stratgame
view Makefile @ 1:55a43e27339a
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 22 May 2012 05:02:00 +0300 |
parents | 86b53f76899f |
children | 369b51c9e4a8 |
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
9 liblevel = level/liblevel.a
10 slibs = $(liblevel)
12 CFLAGS = -pedantic -Wall -g $(incdir)
13 CXXFLAGS = -std=c++0x $(CFLAGS)
14 LDFLAGS = $(libdir) $(slibs) $(libgl) -limtk
16 ifeq ($(shell uname -s), Darwin)
17 CC = clang
18 CXX = clang++
19 incdir += -I/opt/local/include
20 libdir += -L/opt/local/lib
21 libgl = -framework OpenGL -framework GLUT -lGLEW
22 else
23 libgl = -lGL -lGLU -lglut -lGLEW
24 endif
26 $(bin): $(obj) $(slibs)
27 $(CXX) -o $@ $(obj) $(LDFLAGS)
29 -include $(dep)
31 %.d: %.c
32 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
34 %.d: %.cc
35 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
38 .PHONY: clean
39 clean:
40 rm -f $(obj) $(bin) $(dep)