summaryrefslogtreecommitdiff
path: root/progs/glsl/Makefile
blob: 80612770332e7a436e70b2488ead871a2fb81d8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# progs/demos/Makefile

TOP = ../..
include $(TOP)/configs/current

INCDIR = $(TOP)/include

LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)

LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)

PROGS = \
	bitmap \
	brick \
	bump \
	convolutions \
	deriv \
	identity \
	fragcoord \
	mandelbrot \
	multinoise \
	multitex \
	noise \
	points \
	pointcoord \
	samplers \
	samplers_array \
	shadow_sampler \
	skinning \
	texdemo1 \
	toyball \
	twoside \
	trirast \
	vert-or-frag-only \
	vert-tex


##### RULES #####

.SUFFIXES:
.SUFFIXES: .c


# make executable from .c file:
.c: $(LIB_DEP)
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@


##### TARGETS #####

default: $(PROGS)



##### Extra dependencies

extfuncs.h:  $(TOP)/progs/util/extfuncs.h
	cp $< .


readtex.c: $(TOP)/progs/util/readtex.c
	cp $< .

readtex.h: $(TOP)/progs/util/readtex.h
	cp $< .

readtex.o: readtex.c readtex.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) readtex.c


shaderutil.c: $(TOP)/progs/util/shaderutil.c
	cp $< .

shaderutil.h: $(TOP)/progs/util/shaderutil.h
	cp $< .

shaderutil.o: shaderutil.c shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) shaderutil.c



bitmap.o: bitmap.c extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) bitmap.c

bitmap: bitmap.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bitmap.o shaderutil.o $(LIBS) -o $@


brick.o: brick.c extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) brick.c

brick: brick.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) brick.o shaderutil.o $(LIBS) -o $@


bump.o: bump.c extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) bump.c

bump: bump.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bump.o shaderutil.o $(LIBS) -o $@


convolutions.o: convolutions.c readtex.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c

convolutions: convolutions.o readtex.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) convolutions.o readtex.o $(LIBS) -o $@


deriv.o: deriv.c extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) deriv.c

deriv: deriv.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) deriv.o shaderutil.o $(LIBS) -o $@


identity.o: identity.c extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) identity.c

identity: identity.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) identity.o shaderutil.o $(LIBS) -o $@


fragcoord.o: fragcoord.c extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) fragcoord.c

fragcoord: fragcoord.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) fragcoord.o shaderutil.o $(LIBS) -o $@


mandelbrot.o: mandelbrot.c extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) mandelbrot.c

mandelbrot: mandelbrot.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) mandelbrot.o shaderutil.o $(LIBS) -o $@

multitex.o: multitex.c extfuncs.h readtex.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) multitex.c

multitex: multitex.o readtex.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) multitex.o readtex.o shaderutil.o $(LIBS) -o $@


noise.o: noise.c extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) noise.c

noise: noise.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) noise.o shaderutil.o $(LIBS) -o $@


points.o: points.c extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) points.c

points: points.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) points.o shaderutil.o $(LIBS) -o $@


pointcoord.o: pointcoord.c readtex.h extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) pointcoord.c

pointcoord: pointcoord.o readtex.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) pointcoord.o readtex.o shaderutil.o $(LIBS) -o $@


samplers.o: samplers.c readtex.h extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) samplers.c

samplers: samplers.o readtex.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) samplers.o readtex.o shaderutil.o $(LIBS) -o $@

samplers_array.o: samplers.c readtex.h extfuncs.h shaderutil.h
	$(APP_CC) -c -DSAMPLERS_ARRAY -I$(INCDIR) $(CFLAGS) samplers.c -o samplers_array.o

samplers_array: samplers_array.o readtex.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) samplers_array.o readtex.o shaderutil.o $(LIBS) -o $@

skinning.o: skinning.c readtex.h extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) skinning.c

skinning: skinning.o readtex.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) skinning.o readtex.o shaderutil.o $(LIBS) -o $@


texdemo1.o: texdemo1.c readtex.h extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c

texdemo1: texdemo1.o readtex.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) texdemo1.o readtex.o shaderutil.o $(LIBS) -o $@


toyball.o: toyball.c extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) toyball.c

toyball: toyball.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) toyball.o shaderutil.o $(LIBS) -o $@


twoside.o: twoside.c extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) twoside.c

twoside: twoside.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) twoside.o shaderutil.o $(LIBS) -o $@


trirast.o: trirast.c extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) trirast.c

trirast: trirast.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) trirast.o shaderutil.o $(LIBS) -o $@


vert-or-frag-only.o: vert-or-frag-only.c extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) vert-or-frag-only.c

vert-or-frag-only: vert-or-frag-only.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-or-frag-only.o shaderutil.o $(LIBS) -o $@


vert-tex.o: vert-tex.c extfuncs.h shaderutil.h
	$(APP_CC) -c -I$(INCDIR) $(CFLAGS) vert-tex.c

vert-tex: vert-tex.o shaderutil.o
	$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-tex.o shaderutil.o $(LIBS) -o $@




clean:
	-rm -f $(PROGS)
	-rm -f *.o *~
	-rm -f extfuncs.h
	-rm -f shaderutil.*