conworlds

annotate Makefile @ 22:5f53272ff612

removed the vr wrapper and added an external dependency to libgoatvr
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 29 Aug 2014 07:44:26 +0300
parents c814f77d177e
children
rev   line source
nuclear@4 1 csrc = $(wildcard src/*.c) $(wildcard src/vr/*.c)
nuclear@21 2 ccsrc = $(wildcard src/*.cc) $(wildcard src/sdl/*.cc)
nuclear@1 3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
nuclear@1 4 dep = $(obj:.o=.d)
nuclear@13 5 bin = conworlds
nuclear@1 6
nuclear@6 7 # comment out to disable LibOVR (oculus sdk)
nuclear@6 8 #ovr_cflags = -DUSE_LIBOVR
nuclear@6 9 #ovr_libs = -lovr
nuclear@10 10 # comment out to disable OpenHMD
nuclear@10 11 ohmd_cflags = -DUSE_OPENHMD
nuclear@10 12 ohmd_libs = -lopenhmd
nuclear@6 13
nuclear@17 14 CFLAGS = -pedantic -Wall -g $(ovr_cflags) `pkg-config --cflags sdl2`
nuclear@1 15 CXXFLAGS = -std=c++11 $(CFLAGS)
nuclear@17 16 LDFLAGS = $(libgl_$(sys)) -lm -lvmath -limago -lanim $(ovr_libs) `pkg-config --libs sdl2`
nuclear@1 17
nuclear@17 18 libgl_unix = -lGL -lGLU -lGLEW
nuclear@17 19 libgl_mac = -framework OpenGL -lGLEW
nuclear@17 20 libgl_win = -lopengl32 -lglu32 -lglew32
nuclear@1 21
nuclear@1 22 $(bin): $(obj)
nuclear@1 23 $(CXX) -o $@ $(obj) $(LDFLAGS)
nuclear@1 24
nuclear@1 25 -include $(dep)
nuclear@1 26
nuclear@1 27 %.d: %.c
nuclear@1 28 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@1 29
nuclear@1 30 %.d: %.cc
nuclear@1 31 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@1 32
nuclear@1 33 .PHONY: clean
nuclear@1 34 clean:
nuclear@1 35 rm -f $(obj) $(bin)
nuclear@1 36
nuclear@1 37 # os detection
nuclear@1 38 uname = $(shell uname -s)
nuclear@1 39 ifeq ($(sys), Darwin)
nuclear@1 40 sys = mac
nuclear@1 41 else ifeq ($(findstring MINGW, $(sys)), MINGW)
nuclear@1 42 sys = win
nuclear@1 43 else
nuclear@1 44 sys = unix
nuclear@1 45 endif