coeng
annotate Makefile @ 8:8cce82794f90
seems to work nicely
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 15 Feb 2015 05:14:20 +0200 |
parents | 2f872a179914 |
children | 49fdb15f1100 |
rev | line source |
---|---|
nuclear@8 | 1 csrc = $(wildcard src/*.c) |
nuclear@2 | 2 ccsrc = $(wildcard src/*.cc) |
nuclear@8 | 3 obj = $(ccsrc:.cc=.o) $(csrc:.c=.o) |
nuclear@6 | 4 dep = $(obj:.o=.d) |
nuclear@2 | 5 bin = test |
nuclear@2 | 6 |
nuclear@3 | 7 warn = -pedantic -Wall |
nuclear@3 | 8 dbg = -g |
nuclear@3 | 9 |
nuclear@4 | 10 CXXFLAGS = -std=c++11 $(warn) $(dbg) |
nuclear@4 | 11 LDFLAGS = $(libgl) -lm -lvmath -lpthread |
nuclear@2 | 12 |
nuclear@2 | 13 ifeq ($(shell uname -s), Darwin) |
nuclear@2 | 14 libgl = -framework OpenGL -framework GLUT -lGLEW |
nuclear@3 | 15 warn += -Wno-deprecated-declarations |
nuclear@2 | 16 else |
nuclear@2 | 17 libgl = -lGL -lGLU -lglut -lGLEW |
nuclear@2 | 18 endif |
nuclear@2 | 19 |
nuclear@2 | 20 $(bin): $(obj) |
nuclear@2 | 21 $(CXX) -o $@ $(obj) $(LDFLAGS) |
nuclear@2 | 22 |
nuclear@6 | 23 -include $(dep) |
nuclear@6 | 24 |
nuclear@8 | 25 %.d: %.c |
nuclear@8 | 26 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@8 | 27 |
nuclear@6 | 28 %.d: %.cc |
nuclear@6 | 29 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@6 | 30 |
nuclear@2 | 31 .PHONY: clean |
nuclear@2 | 32 clean: |
nuclear@2 | 33 rm -f $(obj) $(bin) |
nuclear@6 | 34 |
nuclear@6 | 35 .PHONY: cleandep |
nuclear@6 | 36 cleandep: |
nuclear@6 | 37 rm -f $(dep) |