Merge commit 'origin/gallium-master-merge'
[mesa.git] / progs / glsl / Makefile
1 # progs/demos/Makefile
2
3 TOP = ../..
4 include $(TOP)/configs/current
5
6 INCDIR = $(TOP)/include
7
8 LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
9
10 LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
11
12 PROGS = \
13 bitmap \
14 brick \
15 bump \
16 convolutions \
17 deriv \
18 identity \
19 fragcoord \
20 mandelbrot \
21 multinoise \
22 multitex \
23 noise \
24 points \
25 pointcoord \
26 samplers \
27 samplers_array \
28 skinning \
29 texdemo1 \
30 toyball \
31 twoside \
32 trirast \
33 vert-or-frag-only \
34 vert-tex
35
36
37 ##### RULES #####
38
39 .SUFFIXES:
40 .SUFFIXES: .c
41
42
43 # make executable from .c file:
44 .c: $(LIB_DEP)
45 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
46
47
48 ##### TARGETS #####
49
50 default: $(PROGS)
51
52
53
54 ##### Extra dependencies
55
56 extfuncs.h: $(TOP)/progs/util/extfuncs.h
57 cp $< .
58
59
60 readtex.c: $(TOP)/progs/util/readtex.c
61 cp $< .
62
63 readtex.h: $(TOP)/progs/util/readtex.h
64 cp $< .
65
66 readtex.o: readtex.c readtex.h
67 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) readtex.c
68
69
70 shaderutil.c: $(TOP)/progs/util/shaderutil.c
71 cp $< .
72
73 shaderutil.h: $(TOP)/progs/util/shaderutil.h
74 cp $< .
75
76 shaderutil.o: shaderutil.c shaderutil.h
77 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) shaderutil.c
78
79
80
81 bitmap.o: bitmap.c extfuncs.h shaderutil.h
82 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) bitmap.c
83
84 bitmap: bitmap.o shaderutil.o
85 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bitmap.o shaderutil.o $(LIBS) -o $@
86
87
88 brick.o: brick.c extfuncs.h shaderutil.h
89 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) brick.c
90
91 brick: brick.o shaderutil.o
92 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) brick.o shaderutil.o $(LIBS) -o $@
93
94
95 bump.o: bump.c extfuncs.h shaderutil.h
96 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) bump.c
97
98 bump: bump.o shaderutil.o
99 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bump.o shaderutil.o $(LIBS) -o $@
100
101
102 convolutions.o: convolutions.c readtex.h
103 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c
104
105 convolutions: convolutions.o readtex.o
106 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) convolutions.o readtex.o $(LIBS) -o $@
107
108
109 deriv.o: deriv.c extfuncs.h shaderutil.h
110 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) deriv.c
111
112 deriv: deriv.o shaderutil.o
113 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) deriv.o shaderutil.o $(LIBS) -o $@
114
115
116 identity.o: identity.c extfuncs.h shaderutil.h
117 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) identity.c
118
119 identity: identity.o shaderutil.o
120 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) identity.o shaderutil.o $(LIBS) -o $@
121
122
123 fragcoord.o: fragcoord.c extfuncs.h shaderutil.h
124 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) fragcoord.c
125
126 fragcoord: fragcoord.o shaderutil.o
127 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) fragcoord.o shaderutil.o $(LIBS) -o $@
128
129
130 mandelbrot.o: mandelbrot.c extfuncs.h shaderutil.h
131 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) mandelbrot.c
132
133 mandelbrot: mandelbrot.o shaderutil.o
134 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) mandelbrot.o shaderutil.o $(LIBS) -o $@
135
136 multitex.o: multitex.c extfuncs.h readtex.h shaderutil.h
137 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) multitex.c
138
139 multitex: multitex.o readtex.o shaderutil.o
140 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) multitex.o readtex.o shaderutil.o $(LIBS) -o $@
141
142
143 noise.o: noise.c extfuncs.h shaderutil.h
144 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) noise.c
145
146 noise: noise.o shaderutil.o
147 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) noise.o shaderutil.o $(LIBS) -o $@
148
149
150 points.o: points.c extfuncs.h shaderutil.h
151 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) points.c
152
153 points: points.o shaderutil.o
154 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) points.o shaderutil.o $(LIBS) -o $@
155
156
157 pointcoord.o: pointcoord.c readtex.h extfuncs.h shaderutil.h
158 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) pointcoord.c
159
160 pointcoord: pointcoord.o readtex.o shaderutil.o
161 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) pointcoord.o readtex.o shaderutil.o $(LIBS) -o $@
162
163
164 samplers.o: samplers.c readtex.h extfuncs.h shaderutil.h
165 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) samplers.c
166
167 samplers: samplers.o readtex.o shaderutil.o
168 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) samplers.o readtex.o shaderutil.o $(LIBS) -o $@
169
170 samplers_array.o: samplers.c readtex.h extfuncs.h shaderutil.h
171 $(APP_CC) -c -DSAMPLERS_ARRAY -I$(INCDIR) $(CFLAGS) samplers.c -o samplers_array.o
172
173 samplers_array: samplers_array.o readtex.o shaderutil.o
174 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) samplers_array.o readtex.o shaderutil.o $(LIBS) -o $@
175
176 skinning.o: skinning.c readtex.h extfuncs.h shaderutil.h
177 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) skinning.c
178
179 skinning: skinning.o readtex.o shaderutil.o
180 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) skinning.o readtex.o shaderutil.o $(LIBS) -o $@
181
182
183 texdemo1.o: texdemo1.c readtex.h extfuncs.h shaderutil.h
184 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c
185
186 texdemo1: texdemo1.o readtex.o shaderutil.o
187 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) texdemo1.o readtex.o shaderutil.o $(LIBS) -o $@
188
189
190 toyball.o: toyball.c extfuncs.h shaderutil.h
191 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) toyball.c
192
193 toyball: toyball.o shaderutil.o
194 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) toyball.o shaderutil.o $(LIBS) -o $@
195
196
197 twoside.o: twoside.c extfuncs.h shaderutil.h
198 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) twoside.c
199
200 twoside: twoside.o shaderutil.o
201 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) twoside.o shaderutil.o $(LIBS) -o $@
202
203
204 trirast.o: trirast.c extfuncs.h shaderutil.h
205 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) trirast.c
206
207 trirast: trirast.o shaderutil.o
208 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) trirast.o shaderutil.o $(LIBS) -o $@
209
210
211 vert-or-frag-only.o: vert-or-frag-only.c extfuncs.h shaderutil.h
212 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) vert-or-frag-only.c
213
214 vert-or-frag-only: vert-or-frag-only.o shaderutil.o
215 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-or-frag-only.o shaderutil.o $(LIBS) -o $@
216
217
218 vert-tex.o: vert-tex.c extfuncs.h shaderutil.h
219 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) vert-tex.c
220
221 vert-tex: vert-tex.o shaderutil.o
222 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-tex.o shaderutil.o $(LIBS) -o $@
223
224
225
226
227 clean:
228 -rm -f $(PROGS)
229 -rm -f *.o *~
230 -rm -f extfuncs.h
231 -rm -f shaderutil.*