#!smake
#
# Copyright (c) Mark J. Kilgard, 1995, 1996, 1997.
#

TOP = ../..
include $(TOP)/glutdefs
include $(ROOT)/usr/include/make/commondefs

OPTIMIZER = -g

TARGETS = test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 \
	  test11 test12 test13 test14 test15 test16 test17 test18 test19 \
	  test20 test21 test22 test23 test24 \
	  bigtest cursor_test over_test shape_test timer_test

RM = -rm -rf

SRCS = test1.c test2.c test3.c test4.c test5.c test6.c test7.c test8.c \
       test9.c test10.c test11.c test12.c test13.c test14.c test15.c test16.c \
       test17.c test18.c test19.c test20.c test21.c test22.c test23.c test24.c \
       bigtest.c cursor_test.c over_test.c shape_test.c timer_test.c
OBJS = $(SRCS:.c=.o)
LLDLIBS = $(GLUT) -lGLU -lGL -lXmu -lXi -lXext -lX11 -lm

LCOPTS = -I$(TOP)/include -fullwarn
LWOFF = ,813,852,827,826
LDIRT = *~ *.bak *.pure *.pixie *.Counts *.pix32

default : $(TARGETS)

$(TARGETS) : $(GLUT)

# Do not be surprised if some of these tests fail on previous GLUT releases.

test : $(TARGETS)
	@GLUT_TEST_ALT_DISPLAY=$$DISPLAY ./test1
	@./test2
	@./test3
	@./test4
	@./test5
	@./test7
	@./test8
	@./test9
	@./test10
	@./test11
	@./test12
	@./test13
	@./test14
	@./test15
	@./test16
	@./test17
	@./test18
	@./test19
	@./test20
	@./test21
	@./test22
	@./test23
	@./test24

SIFT_OUTPUT = 2>&1 | grep '^[A-Za-z]'

pure_test : $(TARGETS)
	purify -windows=no test1 $(SIFT_OUTPUT) ; test1.pure $(SIFT_OUTPUT) ; /bin/rm ./test1.pure
	purify -windows=no test2 $(SIFT_OUTPUT) ; test2.pure $(SIFT_OUTPUT) ; /bin/rm ./test2.pure
	purify -windows=no test3 $(SIFT_OUTPUT) ; test3.pure $(SIFT_OUTPUT) ; /bin/rm ./test3.pure
	purify -windows=no test4 $(SIFT_OUTPUT) ; test4.pure $(SIFT_OUTPUT) ; /bin/rm ./test4.pure
	purify -windows=no test5 $(SIFT_OUTPUT) ; test5.pure $(SIFT_OUTPUT) ; /bin/rm ./test5.pure
	purify -windows=no test7 $(SIFT_OUTPUT) ; test7.pure $(SIFT_OUTPUT) ; /bin/rm ./test7.pure
	purify -windows=no test8 $(SIFT_OUTPUT) ; test8.pure $(SIFT_OUTPUT) ; /bin/rm ./test8.pure
	purify -windows=no test9 $(SIFT_OUTPUT) ; test9.pure $(SIFT_OUTPUT) ; /bin/rm ./test9.pure
	purify -windows=no test10 $(SIFT_OUTPUT) ; test10.pure $(SIFT_OUTPUT) ; /bin/rm ./test10.pure
	purify -windows=no test11 $(SIFT_OUTPUT) ; test11.pure $(SIFT_OUTPUT) ; /bin/rm ./test11.pure
	purify -windows=no test12 $(SIFT_OUTPUT) ; test12.pure $(SIFT_OUTPUT) ; /bin/rm ./test12.pure
	purify -windows=no test13 $(SIFT_OUTPUT) ; test13.pure $(SIFT_OUTPUT) ; /bin/rm ./test13.pure
	purify -windows=no test14 $(SIFT_OUTPUT) ; test14.pure $(SIFT_OUTPUT) ; /bin/rm ./test14.pure
	purify -windows=no test15 $(SIFT_OUTPUT) ; test15.pure $(SIFT_OUTPUT) ; /bin/rm ./test15.pure
	purify -windows=no test16 $(SIFT_OUTPUT) ; test16.pure $(SIFT_OUTPUT) ; /bin/rm ./test16.pure
	purify -windows=no test17 $(SIFT_OUTPUT) ; test17.pure $(SIFT_OUTPUT) ; /bin/rm ./test17.pure
	purify -windows=no test18 $(SIFT_OUTPUT) ; test18.pure $(SIFT_OUTPUT) ; /bin/rm ./test18.pure
	purify -windows=no test19 $(SIFT_OUTPUT) ; test19.pure $(SIFT_OUTPUT) ; /bin/rm ./test19.pure
	purify -windows=no test20 $(SIFT_OUTPUT) ; test20.pure $(SIFT_OUTPUT) ; /bin/rm ./test20.pure
	purify -windows=no test21 $(SIFT_OUTPUT) ; test21.pure $(SIFT_OUTPUT) ; /bin/rm ./test21.pure
	purify -windows=no test22 $(SIFT_OUTPUT) ; test22.pure $(SIFT_OUTPUT) ; /bin/rm ./test22.pure
	purify -windows=no test23 $(SIFT_OUTPUT) ; test23.pure $(SIFT_OUTPUT) ; /bin/rm ./test23.pure
	purify -windows=no test24 $(SIFT_OUTPUT) ; test24.pure $(SIFT_OUTPUT) ; /bin/rm ./test24.pure

include $(COMMONRULES)
