textures
[nexus3d] / Makefile
1 src = $(wildcard src/*.c) $(wildcard src/gl/*.c) $(wildcard src/wsys/*.c) \
2           $(wildcard src/unix/*.c)
3 obj = $(src:.c=.o)
4 dep = $(src:.c=.d)
5
6 sdr = test.v.glsl test.p.glsl
7 spirv = $(sdr:.glsl=.spv)
8
9 name = nexus3d
10 liba = lib$(name).a
11
12 warn = -pedantic -Wall
13 dbg = -g
14 #opt = -O3 -ffast-math
15 inc = -Isrc
16
17 CFLAGS = $(warn) $(dbg) $(opt) $(inc) $(def) -MMD
18 LDFLAGS = -lGL -lglut -lGLEW -lm
19
20 GLSLANG = glslangValidator
21
22
23 test: test.o $(liba) $(spirv)
24         $(CC) -o $@ test.o $(obj) $(liba) $(LDFLAGS)
25
26 $(liba): $(obj)
27         $(AR) rcs $@ $(obj)
28
29 -include $(dep)
30
31 %.v.spv: %.v.glsl
32         $(GLSLANG) -G -S vert -o $@ $<
33
34 %.p.spv: %.p.glsl
35         $(GLSLANG) -G -S frag -o $@ $<
36
37 .PHONY: clean
38 clean:
39         rm -f $(obj) $(liba) test test.o
40
41 .PHONY: cleandep
42 cleandep:
43         rm -f $(dep)