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