bloboland
annotate Makefile @ 5:2f4406cc341e
meh
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 19 Dec 2012 02:37:20 +0200 |
parents | 1757973feaed |
children |
rev | line source |
---|---|
nuclear@3 | 1 csrc = $(wildcard src/*.c) |
nuclear@3 | 2 ccsrc = $(wildcard src/*.cc) |
nuclear@3 | 3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o) |
nuclear@0 | 4 dep = $(obj:.o=.d) |
nuclear@0 | 5 bin = blobo |
nuclear@0 | 6 |
nuclear@2 | 7 opt = -O3 -ffast-math |
nuclear@2 | 8 dbg = -g |
nuclear@2 | 9 |
nuclear@3 | 10 CFLAGS = -pedantic -Wall $(opt) $(dbg) |
nuclear@2 | 11 CXXFLAGS = -ansi -pedantic -Wall $(opt) $(dbg) |
nuclear@1 | 12 LDFLAGS = $(libgl) -lvmath -limago |
nuclear@0 | 13 |
nuclear@0 | 14 ifeq ($(shell uname -s), Darwin) |
nuclear@0 | 15 libgl = -framework OpenGL -framework GLUT -lGLEW |
nuclear@0 | 16 else |
nuclear@0 | 17 libgl = -lGL -lGLU -lglut -lGLEW |
nuclear@0 | 18 endif |
nuclear@0 | 19 |
nuclear@0 | 20 $(bin): $(obj) |
nuclear@0 | 21 $(CXX) -o $@ $(obj) $(LDFLAGS) |
nuclear@0 | 22 |
nuclear@0 | 23 -include $(dep) |
nuclear@0 | 24 |
nuclear@3 | 25 %.d: %.c |
nuclear@3 | 26 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@3 | 27 |
nuclear@0 | 28 %.d: %.cc |
nuclear@3 | 29 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@0 | 30 |
nuclear@0 | 31 .PHONY: clean |
nuclear@0 | 32 clean: |
nuclear@0 | 33 rm -f $(obj) $(bin) |
nuclear@0 | 34 |
nuclear@0 | 35 .PHONY: cleandep |
nuclear@0 | 36 cleandep: |
nuclear@0 | 37 rm -f $(dep) |