vrshoot

annotate Makefile @ 3:c179c72369be

rename candy->vr
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 03 Feb 2014 08:52:13 +0200
parents b2f14e535253
children
rev   line source
nuclear@0 1 csrc = $(wildcard src/*.c) \
nuclear@0 2 $(wildcard libs/vmath/*.c) \
nuclear@0 3 $(wildcard libs/anim/*.c) \
nuclear@0 4 $(wildcard libs/imago/*.c) \
nuclear@0 5 $(wildcard libs/drawtext/*.c) \
nuclear@0 6 $(wildcard libs/ogg/*.c) \
nuclear@0 7 $(wildcard libs/vorbis/*.c) \
nuclear@0 8 $(wildcard libs/psys/*.c) \
nuclear@0 9 $(wildcard libs/kissfft/*.c)
nuclear@0 10
nuclear@0 11 ccsrc = $(wildcard src/*.cc) \
nuclear@0 12 $(wildcard src/audio/*.cc) \
nuclear@0 13 $(wildcard libs/vmath/*.cc)
nuclear@0 14
nuclear@0 15 obj = $(ccsrc:.cc=.o) $(csrc:.c=.o)
nuclear@0 16 dep = $(obj:.o=.d)
nuclear@3 17 bin = vrshoot
nuclear@0 18
nuclear@0 19 USE_ASSIMP = true
nuclear@0 20
nuclear@0 21 ifeq ($(USE_ASSIMP), true)
nuclear@0 22 libs_cflags_ai = `pkg-config --cflags assimp` -DUSE_ASSIMP
nuclear@0 23 libs_ldflags_ai = `pkg-config --libs assimp`
nuclear@0 24 endif
nuclear@0 25
nuclear@0 26 libs_cflags = -Isrc -Ilibs -Ilibs/imago -Ilibs/drawtext -Ilibs/vorbis -Ilibs/kissfft \
nuclear@0 27 `pkg-config --cflags freetype2` $(libs_cflags_ai)
nuclear@0 28 libs_ldflags = -lz -lpng -ljpeg `pkg-config --libs freetype2` \
nuclear@0 29 $(libs_ldflags_ai)
nuclear@0 30
nuclear@0 31
nuclear@0 32 CC = clang
nuclear@0 33 CXX = clang++
nuclear@0 34 CFLAGS = -pedantic -Wall -g $(libs_cflags)
nuclear@0 35 CXXFLAGS = $(CFLAGS)
nuclear@0 36 LDFLAGS = $(libgl) $(libal) -lpthread -lm -ldl $(libs_ldflags)
nuclear@0 37
nuclear@0 38 ifeq ($(shell uname -s), Darwin)
nuclear@0 39 libgl = -framework OpenGL -framework GLUT -lGLEW
nuclear@0 40 libal = -framework OpenAL
nuclear@0 41 else
nuclear@0 42 libgl = -lGL -lGLU -lglut -lGLEW
nuclear@0 43 libal = -lopenal
nuclear@0 44 endif
nuclear@0 45
nuclear@0 46
nuclear@0 47 $(bin): $(obj)
nuclear@0 48 $(CXX) -o $@ $(obj) $(LDFLAGS)
nuclear@0 49
nuclear@0 50 -include $(dep)
nuclear@0 51
nuclear@0 52 %.d: %.c
nuclear@0 53 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 54
nuclear@0 55 %.d: %.cc
nuclear@0 56 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 57
nuclear@0 58 .PHONY: clean
nuclear@0 59 clean:
nuclear@0 60 rm -f $(obj) $(bin)