stratgame

view Makefile @ 4:cd12944a8ea8

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 25 May 2012 05:28:20 +0300
parents 369b51c9e4a8
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 = strat
7 incdir = -Isrc -Igfx/src -Ilevel/src -Icommon/src
9 libgfx = gfx/libgfx.a
10 liblevel = level/liblevel.a
11 libcommon = common/libcommon.a
12 slibs = $(libgfx) $(liblevel) $(libcommon)
14 CFLAGS = -pedantic -Wall -g $(incdir)
15 CXXFLAGS = -std=c++0x $(CFLAGS)
16 LDFLAGS = $(libdir) $(slibs) $(libgl) -limtk -limago -lvmath
18 ifeq ($(shell uname -s), Darwin)
19 CC = clang
20 CXX = clang++
21 incdir += -I/opt/local/include
22 libdir += -L/opt/local/lib
23 libgl = -framework OpenGL -framework GLUT -lGLEW
24 else
25 libgl = -lGL -lGLU -lglut -lGLEW
26 endif
28 $(bin): $(obj) $(slibs)
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) >$@
40 .PHONY: clean
41 clean:
42 rm -f $(obj) $(bin) $(dep)