conworlds

view Makefile @ 21:2da585428507

added both glut and sdl2 versions just for fun...
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 27 Aug 2014 04:16:22 +0300
parents c814f77d177e
children
line source
1 csrc = $(wildcard src/*.c) $(wildcard src/vr/*.c)
2 ccsrc = $(wildcard src/*.cc) $(wildcard src/sdl/*.cc)
3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
4 dep = $(obj:.o=.d)
5 bin = conworlds
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) `pkg-config --cflags sdl2`
15 CXXFLAGS = -std=c++11 $(CFLAGS)
16 LDFLAGS = $(libgl_$(sys)) -lm -lvmath -limago -lanim $(ovr_libs) `pkg-config --libs sdl2`
18 libgl_unix = -lGL -lGLU -lGLEW
19 libgl_mac = -framework OpenGL -lGLEW
20 libgl_win = -lopengl32 -lglu32 -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