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