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