ld33_umonster

view Makefile @ 4:7b1fa527b51b

added torus mesh gen
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 23 Aug 2015 04:31:29 +0300
parents 4a6683050e29
children 92d662deb66e
line source
1 ccsrc = $(wildcard src/*.cc)
2 csrc = $(wildcard src/*.c)
3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
4 dep = $(obj:.o=.d)
6 bin = umonster
8 sys = $(shell uname -s)
10 warn = -pedantic -Wall -Wno-format-extra-args
11 dbg = -g
12 opt = -O0
14 CFLAGS = $(warn) $(dbg) $(opt)
15 CXXFLAGS = $(CFLAGS)
16 LDFLAGS = $(libgl) -lvmath -limago -lpsys -lanim -lm
18 ifeq ($(sys), Darwin)
19 libgl = -framework OpenGL -framework GLUT -lGLEW
20 warn += -Wno-deprecated-declarations
21 else
22 libgl = -lGL -lGLU -lglut -lGLEW
23 endif
25 .PHONY: all
26 all: $(bin)
28 $(bin): $(obj)
29 $(CXX) -o $@ $(obj) $(LDFLAGS)
31 -include $(dep)
33 %.d: %.c
34 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
36 %.d: %.cc
37 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
39 .PHONY: clean
40 clean:
41 rm -f $(obj) $(bin)
43 .PHONY: cleandep
44 cleandep:
45 rm -f $(dep)