starting a new 3d engine
[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 name = nexus3d
7 liba = lib$(name).a
8
9 warn = -pedantic -Wall
10 dbg = -g
11 #opt = -O3 -ffast-math
12 inc = -Isrc
13
14 CFLAGS = $(warn) $(dbg) $(opt) $(inc) $(def) -MMD
15 LDFLAGS = -lGL -lglut -lm
16
17 test: test.o $(liba)
18         $(CC) -o $@ test.o $(obj) $(liba) $(LDFLAGS)
19
20 $(liba): $(obj)
21         $(AR) rcs $@ $(obj)
22
23 -include $(dep)
24
25 .PHONY: clean
26 clean:
27         rm -f $(obj) $(liba) test test.o
28
29 .PHONY: cleandep
30 cleandep:
31         rm -f $(dep)