stratgame
annotate Makefile @ 3:8d95187cb3ee
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 23 May 2012 17:10:46 +0300 |
parents | 369b51c9e4a8 |
children |
rev | line source |
---|---|
nuclear@0 | 1 csrc = $(wildcard src/*.c) |
nuclear@0 | 2 ccsrc = $(wildcard src/*.cc) |
nuclear@0 | 3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o) |
nuclear@0 | 4 dep = $(obj:.o=.d) |
nuclear@0 | 5 bin = strat |
nuclear@0 | 6 |
nuclear@3 | 7 incdir = -Isrc -Igfx/src -Ilevel/src -Icommon/src |
nuclear@0 | 8 |
nuclear@3 | 9 libgfx = gfx/libgfx.a |
nuclear@0 | 10 liblevel = level/liblevel.a |
nuclear@2 | 11 libcommon = common/libcommon.a |
nuclear@3 | 12 slibs = $(libgfx) $(liblevel) $(libcommon) |
nuclear@0 | 13 |
nuclear@0 | 14 CFLAGS = -pedantic -Wall -g $(incdir) |
nuclear@0 | 15 CXXFLAGS = -std=c++0x $(CFLAGS) |
nuclear@2 | 16 LDFLAGS = $(libdir) $(slibs) $(libgl) -limtk -limago -lvmath |
nuclear@0 | 17 |
nuclear@0 | 18 ifeq ($(shell uname -s), Darwin) |
nuclear@1 | 19 CC = clang |
nuclear@1 | 20 CXX = clang++ |
nuclear@1 | 21 incdir += -I/opt/local/include |
nuclear@1 | 22 libdir += -L/opt/local/lib |
nuclear@0 | 23 libgl = -framework OpenGL -framework GLUT -lGLEW |
nuclear@0 | 24 else |
nuclear@0 | 25 libgl = -lGL -lGLU -lglut -lGLEW |
nuclear@0 | 26 endif |
nuclear@0 | 27 |
nuclear@0 | 28 $(bin): $(obj) $(slibs) |
nuclear@1 | 29 $(CXX) -o $@ $(obj) $(LDFLAGS) |
nuclear@0 | 30 |
nuclear@0 | 31 -include $(dep) |
nuclear@0 | 32 |
nuclear@0 | 33 %.d: %.c |
nuclear@0 | 34 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@0 | 35 |
nuclear@0 | 36 %.d: %.cc |
nuclear@0 | 37 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@0 | 38 |
nuclear@0 | 39 |
nuclear@0 | 40 .PHONY: clean |
nuclear@0 | 41 clean: |
nuclear@0 | 42 rm -f $(obj) $(bin) $(dep) |