vrchess

annotate 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
rev   line source
nuclear@4 1 csrc = $(wildcard src/*.c) $(wildcard src/vr/*.c)
nuclear@1 2 ccsrc = $(wildcard src/*.cc)
nuclear@1 3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
nuclear@1 4 dep = $(obj:.o=.d)
nuclear@1 5 bin = vrchess
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@6 10
nuclear@6 11 CFLAGS = -pedantic -Wall -g $(ovr_cflags)
nuclear@1 12 CXXFLAGS = -std=c++11 $(CFLAGS)
nuclear@6 13 LDFLAGS = $(libgl_$(sys)) -lm -lvmath -limago $(ovr_libs)
nuclear@1 14
nuclear@1 15 libgl_unix = -lGL -lGLU -lglut -lGLEW
nuclear@1 16 libgl_mac = -framework OpenGL -framework GLUT -lGLEW
nuclear@1 17 libgl_win = -lopengl32 -lglu32 -lglut32 -lglew32
nuclear@1 18
nuclear@1 19 $(bin): $(obj)
nuclear@1 20 $(CXX) -o $@ $(obj) $(LDFLAGS)
nuclear@1 21
nuclear@1 22 -include $(dep)
nuclear@1 23
nuclear@1 24 %.d: %.c
nuclear@1 25 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@1 26
nuclear@1 27 %.d: %.cc
nuclear@1 28 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@1 29
nuclear@1 30 .PHONY: clean
nuclear@1 31 clean:
nuclear@1 32 rm -f $(obj) $(bin)
nuclear@1 33
nuclear@1 34 # os detection
nuclear@1 35 uname = $(shell uname -s)
nuclear@1 36 ifeq ($(sys), Darwin)
nuclear@1 37 sys = mac
nuclear@1 38 else ifeq ($(findstring MINGW, $(sys)), MINGW)
nuclear@1 39 sys = win
nuclear@1 40 else
nuclear@1 41 sys = unix
nuclear@1 42 endif