dbf-halloween2015
annotate Makefile @ 1:c3f5c32cb210
barfed all the libraries in the source tree to make porting easier
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 01 Nov 2015 00:36:56 +0200 |
parents | 50683c78264e |
children | 5ae5fd3626fa |
rev | line source |
---|---|
nuclear@1 | 1 src = $(wildcard src/*.cc) \ |
nuclear@1 | 2 $(wildcard src/audio/*.cc) \ |
nuclear@1 | 3 $(wildcard libs/vmath/*.cc) |
nuclear@1 | 4 csrc = $(wildcard src/*.c) \ |
nuclear@1 | 5 $(wildcard src/dsys/*.c) \ |
nuclear@1 | 6 $(wildcard libs/vmath/*.c) \ |
nuclear@1 | 7 $(wildcard libs/imago/*.c) \ |
nuclear@1 | 8 $(wildcard libs/libjpeg/*.c) \ |
nuclear@1 | 9 $(wildcard libs/libpng/*.c) \ |
nuclear@1 | 10 $(wildcard libs/zlib/*.c) \ |
nuclear@1 | 11 $(wildcard libs/ogg/*.c) \ |
nuclear@1 | 12 $(wildcard libs/vorbis/*.c) |
nuclear@1 | 13 |
nuclear@0 | 14 obj = $(src:.cc=.o) $(csrc:.c=.o) |
nuclear@0 | 15 dep = $(obj:.o=.d) |
nuclear@0 | 16 bin = halloween |
nuclear@0 | 17 |
nuclear@0 | 18 opt = -O2 |
nuclear@0 | 19 |
nuclear@1 | 20 inc = -Isrc -Ilibs/libjpeg -Ilibs/zlib -Ilibs/libpng -Ilibs/imago \ |
nuclear@1 | 21 -Ilibs/ogg -Ilibs/vorbis |
nuclear@0 | 22 |
nuclear@1 | 23 CFLAGS = -pedantic -Wall -g $(opt) $(inc) |
nuclear@1 | 24 CXXFLAGS = -pedantic -Wall -g $(opt) $(inc) |
nuclear@1 | 25 LDFLAGS = $(libgl) $(libal) -lm -ldl -lpthread |
nuclear@1 | 26 |
nuclear@1 | 27 sys = $(shell uname -s) |
nuclear@1 | 28 ifeq ($(sys), Darwin) |
nuclear@1 | 29 libgl = -lGL -lGLU -lglut -lGLEW |
nuclear@1 | 30 libal = -lopenal |
nuclear@1 | 31 else |
nuclear@1 | 32 libgl = -framework OpenGL -framework GLUT -lGLEW |
nuclear@1 | 33 libal = -framework OpenAL |
nuclear@1 | 34 endif |
nuclear@1 | 35 |
nuclear@1 | 36 $(bin): $(obj) Makefile |
nuclear@0 | 37 $(CXX) -o $@ $(obj) $(LDFLAGS) |
nuclear@0 | 38 |
nuclear@0 | 39 -include $(dep) |
nuclear@0 | 40 |
nuclear@0 | 41 %.d: %.c |
nuclear@0 | 42 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@0 | 43 |
nuclear@0 | 44 %.d: %.cc |
nuclear@0 | 45 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@0 | 46 |
nuclear@0 | 47 .PHONY: clean |
nuclear@0 | 48 clean: |
nuclear@0 | 49 rm -f $(obj) $(bin) |
nuclear@0 | 50 |
nuclear@0 | 51 .PHONY: cleandep |
nuclear@0 | 52 cleandep: |
nuclear@0 | 53 rm -f $(dep) |