stratgame
view Makefile @ 2:369b51c9e4a8
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 23 May 2012 07:25:43 +0300 |
parents | 55a43e27339a |
children | 8d95187cb3ee |
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 = strat
7 incdir = -Isrc -Ilevel/src -Icommon/src
9 liblevel = level/liblevel.a
10 libcommon = common/libcommon.a
11 slibs = $(liblevel) $(libcommon)
13 CFLAGS = -pedantic -Wall -g $(incdir)
14 CXXFLAGS = -std=c++0x $(CFLAGS)
15 LDFLAGS = $(libdir) $(slibs) $(libgl) -limtk -limago -lvmath
17 ifeq ($(shell uname -s), Darwin)
18 CC = clang
19 CXX = clang++
20 incdir += -I/opt/local/include
21 libdir += -L/opt/local/lib
22 libgl = -framework OpenGL -framework GLUT -lGLEW
23 else
24 libgl = -lGL -lGLU -lglut -lGLEW
25 endif
27 $(bin): $(obj) $(slibs)
28 $(CXX) -o $@ $(obj) $(LDFLAGS)
30 -include $(dep)
32 %.d: %.c
33 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
35 %.d: %.cc
36 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
39 .PHONY: clean
40 clean:
41 rm -f $(obj) $(bin) $(dep)