dbf-halloween2015

view Makefile @ 3:c37fe5d8a4ed

windows port
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 01 Nov 2015 06:04:28 +0200
parents c3f5c32cb210
children
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
22 warn = -pedantic -Wall
24 CFLAGS = $(warn) -g $(opt) $(inc)
25 CXXFLAGS = $(warn) -g $(opt) $(inc)
26 LDFLAGS = $(libgl) $(libal) -lm -ldl -lpthread
28 sys = $(shell uname -s)
29 ifeq ($(sys), Darwin)
30 libgl = -framework OpenGL -framework GLUT -lGLEW
31 libal = -framework OpenAL
32 warn += -Wno-deprecated-declarations
33 else
34 libgl = -lGL -lGLU -lglut -lGLEW
35 libal = -lopenal
36 endif
38 $(bin): $(obj) Makefile
39 $(CXX) -o $@ $(obj) $(LDFLAGS)
41 -include $(dep)
43 %.d: %.c
44 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
46 %.d: %.cc
47 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
49 .PHONY: clean
50 clean:
51 rm -f $(obj) $(bin)
53 .PHONY: cleandep
54 cleandep:
55 rm -f $(dep)