blob: 6fa51ce2cfec5019cbb1c2e7e64434b43e1715e2 [file] [log] [blame]
Keith Whitwellb4517522006-06-22 16:32:19 +00001# progs/tests/Makefile
2
3
4# These programs aren't intended to be included with the normal distro.
5# They're not too interesting but they're good for testing.
6
7TOP = ../..
8include $(TOP)/configs/current
9
10
Dan Nicholsonc05aa5e2007-10-29 09:03:01 -060011LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
Keith Whitwellb4517522006-06-22 16:32:19 +000012
13SOURCES = \
14 clear.c \
15 line-clip.c \
16 line-cull.c \
17 line-userclip-clip.c \
18 line-userclip-nop-clip.c \
19 line-userclip-nop.c \
20 line-userclip.c \
21 line.c \
22 lineloop-clip.c \
23 lineloop.c \
24 point.c \
25 point-clip.c \
26 point-param.c \
27 point-wide.c \
28 poly-flat.c \
29 poly-unfilled.c \
30 poly.c \
31 quad-clip.c \
32 quad-clip-all-vertices.c \
33 quad-clip-nearplane.c \
34 quad-degenerate.c \
35 quad-flat.c \
36 quad-offset-factor.c \
37 quad-offset-units.c \
38 quad-offset-unfilled.c \
39 quad-unfilled.c \
40 quad-tex-2d.c \
Alan Hourihane6d104cb2006-11-02 12:02:13 +000041 quad-tex-pbo.c \
Keith Whitwellb4517522006-06-22 16:32:19 +000042 quad-tex-3d.c \
Keith Whitwellb4517522006-06-22 16:32:19 +000043 quad.c \
44 quads.c \
45 quadstrip.c \
46 quadstrip-flat.c \
Keith Whitwellc53df492007-01-16 13:29:01 +000047 dlist-edgeflag.c \
48 dlist-dangling.c \
49 dlist-edgeflag-dangling.c \
Keith Whitwell48c638b2007-01-30 19:19:51 +000050 drawrange.c \
51 drawelements.c \
52 drawarrays.c \
Keith Whitwellb4517522006-06-22 16:32:19 +000053 tri-blend.c \
54 tri-tex-3d.c \
55 tri-clip.c \
56 tri-cull.c \
57 tri-edgeflag.c \
58 tri-flat-clip.c \
59 tri-flat.c \
60 tri-unfilled-clip.c \
61 tri-unfilled-smooth.c \
62 tri-unfilled-userclip.c \
63 tri-unfilled.c \
64 tri-userclip.c \
65 tri-dlist.c \
66 tri.c \
67 tristrip-clip.c \
68 tristrip.c \
Keith Whitwell48c638b2007-01-30 19:19:51 +000069 vbo-drawrange.c \
70 vbo-drawelements.c \
71 vbo-drawarrays.c \
Keith Whitwellb4517522006-06-22 16:32:19 +000072 vp-clip.c \
73 vp-tri.c \
74 vp-line-clip.c \
75 vp-unfilled.c \
76 vp-array.c
77
78PROGS = $(SOURCES:%.c=%)
79
80INCLUDES = -I. -I$(TOP)/include -I../samples
81
82UTIL_FILES = readtex.h readtex.c
83
84
85##### RULES #####
86
87.SUFFIXES:
88.SUFFIXES: .c
89
90.c:
Dan Nicholson2a3e3382007-09-28 18:42:21 -060091 $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
Keith Whitwellb4517522006-06-22 16:32:19 +000092
93.c.o:
94 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
95
96.S.o:
97 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
98
99
100##### TARGETS #####
101
102default: $(UTIL_FILES) $(PROGS)
103
104clean:
Dan Nicholsona6464b32008-05-07 11:35:23 -0700105 -rm -f $(PROGS)
106 -rm -f *.o
107 -rm -f getproclist.h
Keith Whitwellb4517522006-06-22 16:32:19 +0000108
109
110# auto code generation
111getprocaddress: getprocaddress.c getproclist.h
112
113getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.py
114 python getprocaddress.py > getproclist.h
115
116
117texrect: texrect.o readtex.o
Dan Nicholson2a3e3382007-09-28 18:42:21 -0600118 $(CC) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
Keith Whitwellb4517522006-06-22 16:32:19 +0000119
120texrect.o: texrect.c readtex.h
121 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
122
123invert: invert.o readtex.o
Dan Nicholson2a3e3382007-09-28 18:42:21 -0600124 $(CC) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
Keith Whitwellb4517522006-06-22 16:32:19 +0000125
126invert.o: invert.c readtex.h
127 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
128
129readtex.o: readtex.c
130 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
131
132
133readtex.h: $(TOP)/progs/util/readtex.h
134 ln -s $(TOP)/progs/util/readtex.h .
135
136readtex.c: $(TOP)/progs/util/readtex.c
137 ln -s $(TOP)/progs/util/readtex.c .
138
139
140
141
142# Emacs tags
143tags:
144 etags `find . -name \*.[ch]` `find ../include`