dbf-udg
annotate Makefile @ 2:c45c7a1f7d9d
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 09 Jan 2013 02:37:05 +0200 |
parents | |
children | e09cbb2e9d4f |
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 = udg |
nuclear@0 | 6 |
nuclear@0 | 7 CFLAGS = -pedantic -Wall -g |
nuclear@0 | 8 CXXFLAGS = -std=c++11 $(CFLAGS) |
nuclear@0 | 9 LDFLAGS = $(libgl) -limago |
nuclear@0 | 10 |
nuclear@0 | 11 ifeq ($(shell uname -s), Darwin) |
nuclear@0 | 12 libgl = -framework OpenGL -framework GLUT -lGLEW |
nuclear@0 | 13 else |
nuclear@0 | 14 libgl = -lGL -lGLU -lglut -lGLEW |
nuclear@0 | 15 endif |
nuclear@0 | 16 |
nuclear@0 | 17 $(bin): $(obj) |
nuclear@0 | 18 $(CXX) -o $@ $(obj) $(LDFLAGS) |
nuclear@0 | 19 |
nuclear@0 | 20 -include $(dep) |
nuclear@0 | 21 |
nuclear@0 | 22 %.d: %.c |
nuclear@0 | 23 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@0 | 24 |
nuclear@0 | 25 %.d: %.cc |
nuclear@0 | 26 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@0 | 27 |
nuclear@0 | 28 .PHONY: clean |
nuclear@0 | 29 clean: |
nuclear@0 | 30 rm -f $(obj) $(bin) $(dep) |