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