#
# Makefile for XVideo.a library
#

CFLAGS = -I/usr/include/X10 -L/usr/lib/X10

INCLUDES = XVideo.h XlibInternal.h
SRCS = Xvid.c XCreateVideo.c XCreateVideoWindow.c XAbsCoords.c
OBJS = Xvid.o XCreateVideo.o XCreateVideoWindow.o XAbsCoords.o
DOCS = videorules videobugs XVideo.doc README
DEMOS = video.c tplx.c tvid.c
MAKEFILE = makefile
TARFILE = XVideo.tar
VERSION = XVideo.version
LOGFILE = XVideo.tarlog
FTP = /site/mit/ftp/pub

.c.o:	
	cc $(CFLAGS) -c $*.c

all: 	
	@make XVideo.a 
	@make video
	@make tvid 
	@make tplx

clean: 	
	@rm -f $(OBJS)

tar:	$(SRCS) $(INCLUDES) $(DOCS) $(DEMOS) $(MAKEFILE)
	@date >$(VERSION)
	@cat $(VERSION) >>$(LOGFILE)

	@tar cf $(TARFILE) $(SRCS) $(INCLUDES) $(DOCS) \
		$(DEMOS) $(MAKEFILE) $(VERSION)
	@cp $(TARFILE) $(FTP)
	@chmod a+r $(FTP)/$(TARFILE)
	@ls -l $(FTP)/$(TARFILE)

#
# video.c and tplx.c and tvid.c: test programs for the library
#

video:	video.o XVideo.a
	cc $(CFLAGS) -o video video.o XVideo.a -lX

tplx:	tplx.o XVideo.a
	cc $(CFLAGS) -o tplx tplx.o XVideo.a -lX

tvid:	tvid.o XVideo.a
	cc $(CFLAGS) -o tvid tvid.o XVideo.a -lX

# XVideo.h contains common definitions, macros, and variables for video
# XAbsCoords.c gets absolute coordinates for 16-pixel parallax requirement
# Xvid.c is the guts of the library
# XCreateVideo.c is the video counterpart to XCreate()
# XCreateVideoWindow.c is the video counterpart to XCreateWindow()

XVideo.a: 	$(OBJS) $(SRCS) $(INCLUDES)
		@ar cr XVideo.a $(OBJS)
		@ranlib XVideo.a
