demos: add test of vertex-only and fragment-only shader programs
[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 skinning \
27 texdemo1 \
28 toyball \
29 twoside \
30 trirast \
31 vert-or-frag-only \
32 vert-tex
33
34
35 ##### RULES #####
36
37 .SUFFIXES:
38 .SUFFIXES: .c
39
40
41 # make executable from .c file:
42 .c: $(LIB_DEP)
43 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
44
45
46 ##### TARGETS #####
47
48 default: $(PROGS)
49
50
51
52 ##### Extra dependencies
53
54 extfuncs.h: $(TOP)/progs/util/extfuncs.h
55 cp $< .
56
57
58 readtex.c: $(TOP)/progs/util/readtex.c
59 cp $< .
60
61 readtex.h: $(TOP)/progs/util/readtex.h
62 cp $< .
63
64 readtex.o: readtex.c readtex.h
65 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) readtex.c
66
67
68 shaderutil.c: $(TOP)/progs/util/shaderutil.c
69 cp $< .
70
71 shaderutil.h: $(TOP)/progs/util/shaderutil.h
72 cp $< .
73
74 shaderutil.o: shaderutil.c shaderutil.h
75 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) shaderutil.c
76
77
78
79 bitmap.o: bitmap.c extfuncs.h shaderutil.h
80 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) bitmap.c
81
82 bitmap: bitmap.o shaderutil.o
83 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bitmap.o shaderutil.o $(LIBS) -o $@
84
85
86 brick.o: brick.c extfuncs.h shaderutil.h
87 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) brick.c
88
89 brick: brick.o shaderutil.o
90 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) brick.o shaderutil.o $(LIBS) -o $@
91
92
93 bump.o: bump.c extfuncs.h shaderutil.h
94 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) bump.c
95
96 bump: bump.o shaderutil.o
97 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bump.o shaderutil.o $(LIBS) -o $@
98
99
100 convolutions.o: convolutions.c readtex.h
101 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c
102
103 convolutions: convolutions.o readtex.o
104 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) convolutions.o readtex.o $(LIBS) -o $@
105
106
107 deriv.o: deriv.c extfuncs.h shaderutil.h
108 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) deriv.c
109
110 deriv: deriv.o shaderutil.o
111 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) deriv.o shaderutil.o $(LIBS) -o $@
112
113
114 identity.o: identity.c extfuncs.h shaderutil.h
115 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) identity.c
116
117 identity: identity.o shaderutil.o
118 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) identity.o shaderutil.o $(LIBS) -o $@
119
120
121 fragcoord.o: fragcoord.c extfuncs.h shaderutil.h
122 $(CC) -c -I$(INCDIR) $(CFLAGS) fragcoord.c
123
124 fragcoord: fragcoord.o shaderutil.o
125 $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) fragcoord.o shaderutil.o $(LIBS) -o $@
126
127
128 mandelbrot.o: mandelbrot.c extfuncs.h shaderutil.h
129 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) mandelbrot.c
130
131 mandelbrot: mandelbrot.o shaderutil.o
132 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) mandelbrot.o shaderutil.o $(LIBS) -o $@
133
134 multitex.o: multitex.c extfuncs.h readtex.h shaderutil.h
135 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) multitex.c
136
137 multitex: multitex.o readtex.o shaderutil.o
138 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) multitex.o readtex.o shaderutil.o $(LIBS) -o $@
139
140
141 noise.o: noise.c extfuncs.h shaderutil.h
142 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) noise.c
143
144 noise: noise.o shaderutil.o
145 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) noise.o shaderutil.o $(LIBS) -o $@
146
147
148 points.o: points.c extfuncs.h shaderutil.h
149 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) points.c
150
151 points: points.o shaderutil.o
152 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) points.o shaderutil.o $(LIBS) -o $@
153
154
155 pointcoord.o: pointcoord.c readtex.h extfuncs.h shaderutil.h
156 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) pointcoord.c
157
158 pointcoord: pointcoord.o readtex.o shaderutil.o
159 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) pointcoord.o readtex.o shaderutil.o $(LIBS) -o $@
160
161
162 skinning.o: skinning.c readtex.h extfuncs.h shaderutil.h
163 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) skinning.c
164
165 skinning: skinning.o readtex.o shaderutil.o
166 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) skinning.o readtex.o shaderutil.o $(LIBS) -o $@
167
168
169 texdemo1.o: texdemo1.c readtex.h extfuncs.h shaderutil.h
170 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c
171
172 texdemo1: texdemo1.o readtex.o shaderutil.o
173 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) texdemo1.o readtex.o shaderutil.o $(LIBS) -o $@
174
175
176 toyball.o: toyball.c extfuncs.h shaderutil.h
177 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) toyball.c
178
179 toyball: toyball.o shaderutil.o
180 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) toyball.o shaderutil.o $(LIBS) -o $@
181
182
183 twoside.o: twoside.c extfuncs.h shaderutil.h
184 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) twoside.c
185
186 twoside: twoside.o shaderutil.o
187 $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) twoside.o shaderutil.o $(LIBS) -o $@
188
189
190 trirast.o: trirast.c extfuncs.h shaderutil.h
191 $(APP_CC) -c -I$(INCDIR) $(CFLAGS) trirast.c
192
193 trirast: trirast.o shaderutil.o
194 $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) trirast.o shaderutil.o $(LIBS) -o $@
195
196
197 vert-or-frag-only.o: vert-or-frag-only.c extfuncs.h shaderutil.h
198 $(CC) -c -I$(INCDIR) $(CFLAGS) vert-or-frag-only.c
199
200 vert-or-frag-only: vert-or-frag-only.o shaderutil.o
201 $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-or-frag-only.o shaderutil.o $(LIBS) -o $@
202
203
204
205 vert-tex.o: vert-tex.c extfuncs.h shaderutil.h
206 $(CC) -c -I$(INCDIR) $(CFLAGS) vert-tex.c
207
208 vert-tex: vert-tex.o shaderutil.o
209 $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-tex.o shaderutil.o $(LIBS) -o $@
210
211
212
213
214 clean:
215 -rm -f $(PROGS)
216 -rm -f *.o *~
217 -rm -f extfuncs.h
218 -rm -f shaderutil.*