#
# Makefile for XVideo.a library
#

CFLAGS = 

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

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)
	@chmod 644 $(TARFILE)

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

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

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

tvid:	tvid.c XVideo.a
	cc $(CFLAGS) -o tvid tvid.c 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()

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

Xvid.o: 	Xvid.c $(INCLUDES)
		cc $(CFLAGS) -c Xvid.c

XCreateVideo.o: XCreateVideo.c $(INCLUDES)
		cc $(CFLAGS) -c XCreateVideo.c

XCreateVideoWindow.o: 	XCreateVideoWindow.c $(INCLUDES)
			cc $(CFLAGS) -c XCreateVideoWindow.c

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