nuclear@0: csrc = $(wildcard src/*.c) \ nuclear@0: $(wildcard libs/vmath/*.c) \ nuclear@0: $(wildcard libs/anim/*.c) \ nuclear@0: $(wildcard libs/imago/*.c) \ nuclear@0: $(wildcard libs/drawtext/*.c) \ nuclear@0: $(wildcard libs/ogg/*.c) \ nuclear@0: $(wildcard libs/vorbis/*.c) \ nuclear@0: $(wildcard libs/psys/*.c) \ nuclear@0: $(wildcard libs/kissfft/*.c) nuclear@0: nuclear@0: ccsrc = $(wildcard src/*.cc) \ nuclear@0: $(wildcard src/audio/*.cc) \ nuclear@0: $(wildcard libs/vmath/*.cc) nuclear@0: nuclear@0: obj = $(ccsrc:.cc=.o) $(csrc:.c=.o) nuclear@0: dep = $(obj:.o=.d) nuclear@0: bin = candyshoot nuclear@0: nuclear@0: USE_ASSIMP = true nuclear@0: nuclear@0: ifeq ($(USE_ASSIMP), true) nuclear@0: libs_cflags_ai = `pkg-config --cflags assimp` -DUSE_ASSIMP nuclear@0: libs_ldflags_ai = `pkg-config --libs assimp` nuclear@0: endif nuclear@0: nuclear@0: libs_cflags = -Isrc -Ilibs -Ilibs/imago -Ilibs/drawtext -Ilibs/vorbis -Ilibs/kissfft \ nuclear@0: `pkg-config --cflags freetype2` $(libs_cflags_ai) nuclear@0: libs_ldflags = -lz -lpng -ljpeg `pkg-config --libs freetype2` \ nuclear@0: $(libs_ldflags_ai) nuclear@0: nuclear@0: nuclear@0: CC = clang nuclear@0: CXX = clang++ nuclear@0: CFLAGS = -pedantic -Wall -g $(libs_cflags) nuclear@0: CXXFLAGS = $(CFLAGS) nuclear@0: LDFLAGS = $(libgl) $(libal) -lpthread -lm -ldl $(libs_ldflags) nuclear@0: nuclear@0: ifeq ($(shell uname -s), Darwin) nuclear@0: libgl = -framework OpenGL -framework GLUT -lGLEW nuclear@0: libal = -framework OpenAL nuclear@0: else nuclear@0: libgl = -lGL -lGLU -lglut -lGLEW nuclear@0: libal = -lopenal nuclear@0: endif nuclear@0: nuclear@0: nuclear@0: $(bin): $(obj) nuclear@0: $(CXX) -o $@ $(obj) $(LDFLAGS) nuclear@0: nuclear@0: -include $(dep) nuclear@0: nuclear@0: %.d: %.c nuclear@0: @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@0: nuclear@0: %.d: %.cc nuclear@0: @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@0: nuclear@0: .PHONY: clean nuclear@0: clean: nuclear@0: rm -f $(obj) $(bin)