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-3d.c \
101 tri-tri.c \
102 tri-unfilled-edgeflag.c \
103 tri-unfilled-clip.c \
104 tri-unfilled-smooth.c \
105 tri-unfilled-userclip-stip.c \
106 tri-unfilled-userclip.c \
107 tri-unfilled.c \
108 tri-userclip.c \
109 tri-z-eq.c \
110 tri-z.c \
111 tri.c \
112 trifan-flat.c \
113 trifan-flat-clip.c \
114 trifan-flat-unfilled-clip.c \
115 trifan-unfilled.c \
116 trifan.c \
117 tristrip-clip.c \
118 tristrip-flat.c \
119 tristrip.c \
120 vbo-drawarrays.c \
121 vbo-drawelements.c \
122 vbo-drawrange.c \
123 vp-array.c \
124 vp-array-int.c \
125 vp-clip.c \
126 vp-line-clip.c \
127 vp-tri.c \
128 vp-tri-swap.c \
129 vp-tri-imm.c \
130 vp-tri-cb.c \
131 vp-unfilled.c
132
133 PROGS = $(SOURCES:%.c=%)
134
135 INCLUDES = -I. -I$(TOP)/include -I../samples
136
137 UTIL_FILES = readtex.h readtex.c
138
139
140 ##### RULES #####
141
142 .SUFFIXES:
143 .SUFFIXES: .c
144
145 .c:
146 $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
147
148 .c.o:
149 $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
150
151 .S.o:
152 $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
153
154
155 ##### TARGETS #####
156
157 default: $(UTIL_FILES) $(PROGS)
158
159 clean:
160 -rm -f $(PROGS)
161 -rm -f *.o
162 -rm -f getproclist.h
163
164
165 # auto code generation
166 getprocaddress: getprocaddress.c getproclist.h
167
168 getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.py
169 python getprocaddress.py > getproclist.h
170
171
172 texrect: texrect.o readtex.o
173 $(APP_CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
174
175 texrect.o: texrect.c readtex.h
176 $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
177
178 invert: invert.o readtex.o
179 $(APP_CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
180
181 invert.o: invert.c readtex.h
182 $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
183
184 readtex.o: readtex.c
185 $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
186
187
188 readtex.h: $(TOP)/progs/util/readtex.h
189 ln -s $(TOP)/progs/util/readtex.h .
190
191 readtex.c: $(TOP)/progs/util/readtex.c
192 ln -s $(TOP)/progs/util/readtex.c .
193
194
195 fs-tri: fs-tri.c extfuncs.h
196
197
198 extfuncs.h: $(TOP)/progs/util/extfuncs.h
199 cp $< .
200
201
202 # Emacs tags
203 tags:
204 etags `find . -name \*.[ch]` `find ../include`