dbf-halloween2015

annotate Makefile @ 2:5ae5fd3626fa

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