dbf-halloween2015
view 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 |
line source
1 src = $(wildcard src/*.cc) \
2 $(wildcard src/audio/*.cc) \
3 $(wildcard libs/vmath/*.cc)
4 csrc = $(wildcard src/*.c) \
5 $(wildcard src/dsys/*.c) \
6 $(wildcard libs/vmath/*.c) \
7 $(wildcard libs/imago/*.c) \
8 $(wildcard libs/libjpeg/*.c) \
9 $(wildcard libs/libpng/*.c) \
10 $(wildcard libs/zlib/*.c) \
11 $(wildcard libs/ogg/*.c) \
12 $(wildcard libs/vorbis/*.c)
14 obj = $(src:.cc=.o) $(csrc:.c=.o)
15 dep = $(obj:.o=.d)
16 bin = halloween
18 opt = -O2
20 inc = -Isrc -Ilibs/libjpeg -Ilibs/zlib -Ilibs/libpng -Ilibs/imago \
21 -Ilibs/ogg -Ilibs/vorbis
23 CFLAGS = -pedantic -Wall -g $(opt) $(inc)
24 CXXFLAGS = -pedantic -Wall -g $(opt) $(inc)
25 LDFLAGS = $(libgl) $(libal) -lm -ldl -lpthread
27 sys = $(shell uname -s)
28 ifeq ($(sys), Darwin)
29 libgl = -lGL -lGLU -lglut -lGLEW
30 libal = -lopenal
31 else
32 libgl = -framework OpenGL -framework GLUT -lGLEW
33 libal = -framework OpenAL
34 endif
36 $(bin): $(obj) Makefile
37 $(CXX) -o $@ $(obj) $(LDFLAGS)
39 -include $(dep)
41 %.d: %.c
42 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
44 %.d: %.cc
45 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
47 .PHONY: clean
48 clean:
49 rm -f $(obj) $(bin)
51 .PHONY: cleandep
52 cleandep:
53 rm -f $(dep)