bloboland
view Makefile @ 5:2f4406cc341e
meh
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 19 Dec 2012 02:37:20 +0200 |
parents | 1757973feaed |
children |
line source
1 csrc = $(wildcard src/*.c)
2 ccsrc = $(wildcard src/*.cc)
3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
4 dep = $(obj:.o=.d)
5 bin = blobo
7 opt = -O3 -ffast-math
8 dbg = -g
10 CFLAGS = -pedantic -Wall $(opt) $(dbg)
11 CXXFLAGS = -ansi -pedantic -Wall $(opt) $(dbg)
12 LDFLAGS = $(libgl) -lvmath -limago
14 ifeq ($(shell uname -s), Darwin)
15 libgl = -framework OpenGL -framework GLUT -lGLEW
16 else
17 libgl = -lGL -lGLU -lglut -lGLEW
18 endif
20 $(bin): $(obj)
21 $(CXX) -o $@ $(obj) $(LDFLAGS)
23 -include $(dep)
25 %.d: %.c
26 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
28 %.d: %.cc
29 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
31 .PHONY: clean
32 clean:
33 rm -f $(obj) $(bin)
35 .PHONY: cleandep
36 cleandep:
37 rm -f $(dep)