1#
2# GRX test programs makefile for SDL. Uses GNU make.
3#
4.PHONY : clean
5
6GRXVSDL=y
7
8include ../makedefs.grx
9
10INCDIR= -I. -I../include
11
12GRX20ST    = ../lib/$(GRX_LIB_SUBDIR)/libgrx20S.a
13
14ifeq ($(EP),x)
15  INCDIR += $(X11INCS)
16  SDLDEFS = -D__XWIN__
17  SDLLIBS = -lSDL -lpthread $(X11LIBS)
18else
19  EX = .exe
20  SDLDEFS =
21  SDLLIBS = -lSDL
22endif
23
24ifeq ($(HAVE_LIBTIFF),y)
25  ADDON_LIBS += -ltiff
26endif
27
28ifeq ($(HAVE_LIBJPEG),y)
29  ADDON_LIBS += -ljpeg
30endif
31
32ifeq ($(HAVE_LIBPNG),y)
33  ADDON_LIBS += -lpng
34endif
35
36ifeq ($(NEED_ZLIB),y)
37  ADDON_LIBS += -lz
38endif
39
40LIBS= $(GRX20ST) $(ADDON_LIBS) $(SDLLIBS) -lm
41
42CCOPT += $(SDLDEFS)
43
44PROGS=  $(EP)arctest$(EX)	\
45	$(EP)bb1test$(EX)	\
46	$(EP)blittest$(EX)	\
47	$(EP)circtest$(EX)	\
48	$(EP)cliptest$(EX)	\
49	$(EP)colorops$(EX)	\
50	$(EP)curstest$(EX)	\
51	$(EP)fontdemo$(EX)	\
52	$(EP)fonttest$(EX)	\
53	$(EP)imgtest$(EX)	\
54	$(EP)jpgtest$(EX)	\
55	$(EP)keys$(EX)		\
56	$(EP)linetest$(EX)	\
57	$(EP)mousetst$(EX)	\
58	$(EP)pcirctst$(EX)	\
59	$(EP)pnmtest$(EX)	\
60	$(EP)pngtest$(EX)	\
61	$(EP)polytest$(EX)	\
62	$(EP)rgbtest$(EX)	\
63	$(EP)sbctest$(EX)	\
64	$(EP)scroltst$(EX)	\
65	$(EP)textpatt$(EX)	\
66	$(EP)winclip$(EX)	\
67	$(EP)wintest$(EX)	\
68	$(EP)fswwtest$(EX)
69
70all: $(PROGS) $(EP)demogrx$(EX) $(EP)speedtst$(EX) $(EP)memtest$(EX)
71
72$(EP)demogrx$(EX): demogrx.o gfaz.o $(GRX20ST)
73	$(CC) $(LDOPT) -o $(EP)demogrx$(EX) demogrx.o gfaz.o $(LIBS)
74
75$(EP)speedtst$(EX): speedtst.o $(GRX20ST)
76	$(CC) $(LDOPT) -o $(EP)speedtst$(EX) speedtst.o $(LIBS)
77
78$(EP)memtest$(EX): memtest.o $(GRX20ST)
79	$(CC) $(LDOPT) -o $(EP)memtest$(EX) memtest.o $(LIBS)
80
81$(PROGS): $(EP)%$(EX) : %.o $(GRX20ST)
82	$(CC) $(LDOPT) -o $@ $*.o $(LIBS)
83
84.c.o:
85	$(CC) -c $(CCOPT) $(INCDIR) $*.c -o $*.o
86
87.c.s:
88	$(CC) -S $(CCOPT) $(INCDIR) $*.c
89
90clean:
91	rm -f *.o $(PROGS) $(EP)demogrx$(EX) $(EP)speedtst$(EX) $(EP)memtest$(EX)
92
93depend.new:
94	$(CC) -MM $(CCOPT) $(INCDIR) $(PROGS:$(EP)%$(EX)=%.c) >depend.new
95
96include depend.gnu
97