vrshoot

diff Makefile @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children c179c72369be
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Sat Feb 01 19:58:19 2014 +0200
     1.3 @@ -0,0 +1,60 @@
     1.4 +csrc = $(wildcard src/*.c) \
     1.5 +	   $(wildcard libs/vmath/*.c) \
     1.6 +	   $(wildcard libs/anim/*.c) \
     1.7 +	   $(wildcard libs/imago/*.c) \
     1.8 +	   $(wildcard libs/drawtext/*.c) \
     1.9 +	   $(wildcard libs/ogg/*.c) \
    1.10 +	   $(wildcard libs/vorbis/*.c) \
    1.11 +	   $(wildcard libs/psys/*.c) \
    1.12 +	   $(wildcard libs/kissfft/*.c)
    1.13 +
    1.14 +ccsrc = $(wildcard src/*.cc) \
    1.15 +		$(wildcard src/audio/*.cc) \
    1.16 +		$(wildcard libs/vmath/*.cc)
    1.17 +
    1.18 +obj = $(ccsrc:.cc=.o) $(csrc:.c=.o)
    1.19 +dep = $(obj:.o=.d)
    1.20 +bin = candyshoot
    1.21 +
    1.22 +USE_ASSIMP = true
    1.23 +
    1.24 +ifeq ($(USE_ASSIMP), true)
    1.25 +	libs_cflags_ai = `pkg-config --cflags assimp` -DUSE_ASSIMP
    1.26 +	libs_ldflags_ai = `pkg-config --libs assimp`
    1.27 +endif
    1.28 +
    1.29 +libs_cflags = -Isrc -Ilibs -Ilibs/imago -Ilibs/drawtext -Ilibs/vorbis -Ilibs/kissfft \
    1.30 +			  `pkg-config --cflags freetype2` $(libs_cflags_ai)
    1.31 +libs_ldflags = -lz -lpng -ljpeg `pkg-config --libs freetype2` \
    1.32 +			   $(libs_ldflags_ai)
    1.33 +
    1.34 +
    1.35 +CC = clang
    1.36 +CXX = clang++
    1.37 +CFLAGS = -pedantic -Wall -g $(libs_cflags)
    1.38 +CXXFLAGS = $(CFLAGS)
    1.39 +LDFLAGS = $(libgl) $(libal) -lpthread -lm -ldl $(libs_ldflags)
    1.40 +
    1.41 +ifeq ($(shell uname -s), Darwin)
    1.42 +	libgl = -framework OpenGL -framework GLUT -lGLEW
    1.43 +	libal = -framework OpenAL
    1.44 +else
    1.45 +	libgl = -lGL -lGLU -lglut -lGLEW
    1.46 +	libal = -lopenal
    1.47 +endif
    1.48 +
    1.49 +
    1.50 +$(bin): $(obj)
    1.51 +	$(CXX) -o $@ $(obj) $(LDFLAGS)
    1.52 +
    1.53 +-include $(dep)
    1.54 +
    1.55 +%.d: %.c
    1.56 +	@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.57 +
    1.58 +%.d: %.cc
    1.59 +	@$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.60 +
    1.61 +.PHONY: clean
    1.62 +clean:
    1.63 +	rm -f $(obj) $(bin)