1 src = $(wildcard src/*.cc) $(wildcard src/machine/*.cc)
2 csrc = $(wildcard src/*.c) $(wildcard src/machine/*.c)
3 obj = $(src:.cc=.o) $(csrc:.c=.o)
10 incpath = -Isrc -Isrc/machine -I/usr/local/include
11 libpath = -L/usr/local/lib
13 warn = -pedantic -Wall
15 CFLAGS = $(warn) $(opt) $(dbg) $(incpath)
16 CXXFLAGS = -std=c++11 $(warn) $(opt) $(dbg) $(incpath)
17 LDFLAGS = $(libpath) $(libgl_$(sys)) -lm -lgmath -lvmath -limago -lresman -lpthread -lassimp -ltreestore
19 sys = $(shell uname -s)
20 libgl_Linux = -lGL -lGLU -lglut -lGLEW
21 libgl_Darwin = -framework OpenGL -framework GLUT -lGLEW
23 $(bin): .clang_complete $(obj)
24 $(CXX) -o $@ $(obj) $(LDFLAGS)
26 .clang_complete: Makefile
28 for i in $(CXXFLAGS); do echo $$i >>$@; done
33 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
36 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@