stratgame

view Makefile @ 0:86b53f76899f

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 21 May 2012 19:07:40 +0300
parents
children 55a43e27339a
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 libgl = -framework OpenGL -framework GLUT -lGLEW
18 else
19 libgl = -lGL -lGLU -lglut -lGLEW
20 endif
22 $(bin): $(obj) $(slibs)
23 $(CC) -o $@ $(obj) $(LDFLAGS)
25 -include $(dep)
27 %.d: %.c
28 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
30 %.d: %.cc
31 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
34 .PHONY: clean
35 clean:
36 rm -f $(obj) $(bin) $(dep)