stratgame

annotate Makefile @ 1:55a43e27339a

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