conworlds

view Makefile @ 4:e6948e131526

adding a vr wrapper
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 20 Aug 2014 06:33:43 +0300
parents cd7755e4663a
children 3c36bc28c6c2
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 CFLAGS = -pedantic -Wall -g
8 CXXFLAGS = -std=c++11 $(CFLAGS)
9 LDFLAGS = $(libgl_$(sys)) -lm -lvmath -limago
11 libgl_unix = -lGL -lGLU -lglut -lGLEW
12 libgl_mac = -framework OpenGL -framework GLUT -lGLEW
13 libgl_win = -lopengl32 -lglu32 -lglut32 -lglew32
15 $(bin): $(obj)
16 $(CXX) -o $@ $(obj) $(LDFLAGS)
18 -include $(dep)
20 %.d: %.c
21 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
23 %.d: %.cc
24 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
26 .PHONY: clean
27 clean:
28 rm -f $(obj) $(bin)
30 # os detection
31 uname = $(shell uname -s)
32 ifeq ($(sys), Darwin)
33 sys = mac
34 else ifeq ($(findstring MINGW, $(sys)), MINGW)
35 sys = win
36 else
37 sys = unix
38 endif