coeng

view Makefile @ 8:8cce82794f90

seems to work nicely
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 15 Feb 2015 05:14:20 +0200
parents 2f872a179914
children 49fdb15f1100
line source
1 csrc = $(wildcard src/*.c)
2 ccsrc = $(wildcard src/*.cc)
3 obj = $(ccsrc:.cc=.o) $(csrc:.c=.o)
4 dep = $(obj:.o=.d)
5 bin = test
7 warn = -pedantic -Wall
8 dbg = -g
10 CXXFLAGS = -std=c++11 $(warn) $(dbg)
11 LDFLAGS = $(libgl) -lm -lvmath -lpthread
13 ifeq ($(shell uname -s), Darwin)
14 libgl = -framework OpenGL -framework GLUT -lGLEW
15 warn += -Wno-deprecated-declarations
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)