conworlds

view Makefile @ 10:e3f0ca1d008a

added preliminary OpenHMD module
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 22 Aug 2014 20:11:15 +0300
parents 3c36bc28c6c2
children 283cdfa7dda2
line source
1 csrc = $(wildcard src/*.c) $(wildcard src/vr/*.c)
2 ccsrc = $(wildcard src/*.cc)
3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
4 dep = $(obj:.o=.d)
5 bin = vrchess
7 # comment out to disable LibOVR (oculus sdk)
8 #ovr_cflags = -DUSE_LIBOVR
9 #ovr_libs = -lovr
10 # comment out to disable OpenHMD
11 ohmd_cflags = -DUSE_OPENHMD
12 ohmd_libs = -lopenhmd
14 CFLAGS = -pedantic -Wall -g $(ovr_cflags)
15 CXXFLAGS = -std=c++11 $(CFLAGS)
16 LDFLAGS = $(libgl_$(sys)) -lm -lvmath -limago $(ovr_libs)
18 libgl_unix = -lGL -lGLU -lglut -lGLEW
19 libgl_mac = -framework OpenGL -framework GLUT -lGLEW
20 libgl_win = -lopengl32 -lglu32 -lglut32 -lglew32
22 $(bin): $(obj)
23 $(CXX) -o $@ $(obj) $(LDFLAGS)
25 -include $(dep)
27 %.d: %.c
28 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
30 %.d: %.cc
31 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
33 .PHONY: clean
34 clean:
35 rm -f $(obj) $(bin)
37 # os detection
38 uname = $(shell uname -s)
39 ifeq ($(sys), Darwin)
40 sys = mac
41 else ifeq ($(findstring MINGW, $(sys)), MINGW)
42 sys = win
43 else
44 sys = unix
45 endif