define new APP_CC configuration variable for building apps/demos/tests
[mesa.git] / progs / trivial / Makefile
1 # 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
7 TOP = ../..
8 include $(TOP)/configs/current
9
10
11 LIBS = $(APP_LIB_DEPS)
12
13 SOURCES = \
14 clear-fbo-tex.c \
15 clear-fbo.c \
16 clear-scissor.c \
17 clear-undefined.c \
18 clear.c \
19 dlist-dangling.c \
20 dlist-edgeflag-dangling.c \
21 dlist-edgeflag.c \
22 drawarrays.c \
23 drawelements.c \
24 drawrange.c \
25 flat-clip.c \
26 fs-tri.c \
27 line-clip.c \
28 line-cull.c \
29 line-smooth.c \
30 line-stipple-wide.c \
31 line-userclip-clip.c \
32 line-userclip-nop-clip.c \
33 line-userclip-nop.c \
34 line-userclip.c \
35 line-wide.c \
36 line.c \
37 lineloop-clip.c \
38 lineloop-elts.c \
39 lineloop.c \
40 linestrip-flat-stipple.c \
41 linestrip-stipple-wide.c \
42 linestrip-stipple.c \
43 linestrip.c \
44 long-fixed-func.c \
45 pgon-mode.c \
46 point-clip.c \
47 point-param.c \
48 point-sprite.c \
49 point-wide.c \
50 point-wide-smooth.c \
51 point.c \
52 poly-flat.c \
53 poly-flat-clip.c \
54 poly-flat-unfilled-clip.c \
55 poly-unfilled.c \
56 poly.c \
57 quad-clip-all-vertices.c \
58 quad-clip-nearplane.c \
59 quad-clip.c \
60 quad-degenerate.c \
61 quad-flat.c \
62 quad-offset-factor.c \
63 quad-offset-unfilled.c \
64 quad-offset-units.c \
65 quad-tex-2d.c \
66 quad-tex-3d.c \
67 quad-tex-alpha.c \
68 quad-tex-pbo.c \
69 quad-unfilled-clip.c \
70 quad-unfilled-stipple.c \
71 quad-unfilled.c \
72 quad.c \
73 quads.c \
74 quadstrip-cont.c \
75 quadstrip-flat.c \
76 quadstrip.c \
77 tri-orig.c \
78 tri-alpha.c \
79 tri-blend-color.c \
80 tri-blend-max.c \
81 tri-blend-min.c \
82 tri-blend-revsub.c \
83 tri-blend-sub.c \
84 tri-blend.c \
85 tri-clip.c \
86 tri-cull-both.c \
87 tri-cull.c \
88 tri-dlist.c \
89 tri-edgeflag.c \
90 tri-fbo-tex.c \
91 tri-fbo.c \
92 tri-flat-clip.c \
93 tri-flat.c \
94 tri-fog.c \
95 tri-mask-tri.c \
96 tri-query.c \
97 tri-scissor-tri.c \
98 tri-stencil.c \
99 tri-tex-3d.c \
100 tri-tri.c \
101 tri-unfilled-edgeflag.c \
102 tri-unfilled-clip.c \
103 tri-unfilled-smooth.c \
104 tri-unfilled-userclip-stip.c \
105 tri-unfilled-userclip.c \
106 tri-unfilled.c \
107 tri-userclip.c \
108 tri-z-eq.c \
109 tri-z.c \
110 tri.c \
111 trifan-flat.c \
112 trifan-flat-clip.c \
113 trifan-flat-unfilled-clip.c \
114 trifan-unfilled.c \
115 trifan.c \
116 tristrip-clip.c \
117 tristrip-flat.c \
118 tristrip.c \
119 vbo-drawarrays.c \
120 vbo-drawelements.c \
121 vbo-drawrange.c \
122 vp-array.c \
123 vp-array-int.c \
124 vp-clip.c \
125 vp-line-clip.c \
126 vp-tri.c \
127 vp-unfilled.c
128
129 PROGS = $(SOURCES:%.c=%)
130
131 INCLUDES = -I. -I$(TOP)/include -I../samples
132
133 UTIL_FILES = readtex.h readtex.c
134
135
136 ##### RULES #####
137
138 .SUFFIXES:
139 .SUFFIXES: .c
140
141 .c:
142 $(APP_CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@
143
144 .c.o:
145 $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
146
147 .S.o:
148 $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
149
150
151 ##### TARGETS #####
152
153 default: $(UTIL_FILES) $(PROGS)
154
155 clean:
156 rm -f $(PROGS)
157 rm -f *.o
158 rm -f getproclist.h
159
160
161 # auto code generation
162 getprocaddress: getprocaddress.c getproclist.h
163
164 getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.py
165 python getprocaddress.py > getproclist.h
166
167
168 texrect: texrect.o readtex.o
169 $(APP_CC) texrect.o readtex.o $(LIBS) -o $@
170
171 texrect.o: texrect.c readtex.h
172 $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
173
174 invert: invert.o readtex.o
175 $(APP_CC) invert.o readtex.o $(LIBS) -o $@
176
177 invert.o: invert.c readtex.h
178 $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
179
180 readtex.o: readtex.c
181 $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
182
183
184 readtex.h: $(TOP)/progs/util/readtex.h
185 ln -s $(TOP)/progs/util/readtex.h .
186
187 readtex.c: $(TOP)/progs/util/readtex.c
188 ln -s $(TOP)/progs/util/readtex.c .
189
190
191 fs-tri: fs-tri.c extfuncs.h
192
193
194 extfuncs.h: $(TOP)/progs/util/extfuncs.h
195 cp $< .
196
197
198 # Emacs tags
199 tags:
200 etags `find . -name \*.[ch]` `find ../include`