conworlds

view Makefile @ 6:3c36bc28c6c2

more stuff in the vr test
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 21 Aug 2014 01:08:03 +0300
parents e6948e131526
children e3f0ca1d008a
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
11 CFLAGS = -pedantic -Wall -g $(ovr_cflags)
12 CXXFLAGS = -std=c++11 $(CFLAGS)
13 LDFLAGS = $(libgl_$(sys)) -lm -lvmath -limago $(ovr_libs)
15 libgl_unix = -lGL -lGLU -lglut -lGLEW
16 libgl_mac = -framework OpenGL -framework GLUT -lGLEW
17 libgl_win = -lopengl32 -lglu32 -lglut32 -lglew32
19 $(bin): $(obj)
20 $(CXX) -o $@ $(obj) $(LDFLAGS)
22 -include $(dep)
24 %.d: %.c
25 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
27 %.d: %.cc
28 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
30 .PHONY: clean
31 clean:
32 rm -f $(obj) $(bin)
34 # os detection
35 uname = $(shell uname -s)
36 ifeq ($(sys), Darwin)
37 sys = mac
38 else ifeq ($(findstring MINGW, $(sys)), MINGW)
39 sys = win
40 else
41 sys = unix
42 endif