conworlds

view Makefile @ 1:cd7755e4663a

added makefile commented out ovr 0.3.1 header file until it actually works
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 25 Apr 2014 05:43:26 +0300
parents
children e6948e131526
line source
1 csrc = $(wildcard src/*.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