ld33_umonster
annotate Makefile @ 3:93ff21458a16
fixed stuff
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 23 Aug 2015 02:51:39 +0300 |
parents | 4a6683050e29 |
children | 92d662deb66e |
rev | line source |
---|---|
nuclear@0 | 1 ccsrc = $(wildcard src/*.cc) |
nuclear@0 | 2 csrc = $(wildcard src/*.c) |
nuclear@0 | 3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o) |
nuclear@0 | 4 dep = $(obj:.o=.d) |
nuclear@0 | 5 |
nuclear@0 | 6 bin = umonster |
nuclear@0 | 7 |
nuclear@0 | 8 sys = $(shell uname -s) |
nuclear@0 | 9 |
nuclear@3 | 10 warn = -pedantic -Wall -Wno-format-extra-args |
nuclear@3 | 11 dbg = -g |
nuclear@3 | 12 opt = -O0 |
nuclear@3 | 13 |
nuclear@3 | 14 CFLAGS = $(warn) $(dbg) $(opt) |
nuclear@0 | 15 CXXFLAGS = $(CFLAGS) |
nuclear@3 | 16 LDFLAGS = $(libgl) -lvmath -limago -lpsys -lanim -lm |
nuclear@0 | 17 |
nuclear@3 | 18 ifeq ($(sys), Darwin) |
nuclear@3 | 19 libgl = -framework OpenGL -framework GLUT -lGLEW |
nuclear@3 | 20 warn += -Wno-deprecated-declarations |
nuclear@3 | 21 else |
nuclear@3 | 22 libgl = -lGL -lGLU -lglut -lGLEW |
nuclear@3 | 23 endif |
nuclear@0 | 24 |
nuclear@3 | 25 .PHONY: all |
nuclear@3 | 26 all: $(bin) |
nuclear@0 | 27 |
nuclear@0 | 28 $(bin): $(obj) |
nuclear@0 | 29 $(CXX) -o $@ $(obj) $(LDFLAGS) |
nuclear@0 | 30 |
nuclear@0 | 31 -include $(dep) |
nuclear@0 | 32 |
nuclear@0 | 33 %.d: %.c |
nuclear@0 | 34 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@0 | 35 |
nuclear@0 | 36 %.d: %.cc |
nuclear@0 | 37 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@0 | 38 |
nuclear@0 | 39 .PHONY: clean |
nuclear@0 | 40 clean: |
nuclear@0 | 41 rm -f $(obj) $(bin) |
nuclear@0 | 42 |
nuclear@0 | 43 .PHONY: cleandep |
nuclear@0 | 44 cleandep: |
nuclear@0 | 45 rm -f $(dep) |