vrchess

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Fri Apr 25 05:43:26 2014 +0300
     1.3 @@ -0,0 +1,38 @@
     1.4 +csrc = $(wildcard src/*.c)
     1.5 +ccsrc = $(wildcard src/*.cc)
     1.6 +obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
     1.7 +dep = $(obj:.o=.d)
     1.8 +bin = vrchess
     1.9 +
    1.10 +CFLAGS = -pedantic -Wall -g
    1.11 +CXXFLAGS = -std=c++11 $(CFLAGS)
    1.12 +LDFLAGS = $(libgl_$(sys)) -lm -lvmath -limago
    1.13 +
    1.14 +libgl_unix = -lGL -lGLU -lglut -lGLEW
    1.15 +libgl_mac = -framework OpenGL -framework GLUT -lGLEW
    1.16 +libgl_win = -lopengl32 -lglu32 -lglut32 -lglew32
    1.17 +
    1.18 +$(bin): $(obj)
    1.19 +	$(CXX) -o $@ $(obj) $(LDFLAGS)
    1.20 +
    1.21 +-include $(dep)
    1.22 +
    1.23 +%.d: %.c
    1.24 +	@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.25 +
    1.26 +%.d: %.cc
    1.27 +	@$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.28 +
    1.29 +.PHONY: clean
    1.30 +clean:
    1.31 +	rm -f $(obj) $(bin)
    1.32 +
    1.33 +# os detection
    1.34 +uname = $(shell uname -s)
    1.35 +ifeq ($(sys), Darwin)
    1.36 +	sys = mac
    1.37 +else ifeq ($(findstring MINGW, $(sys)), MINGW)
    1.38 +	sys = win
    1.39 +else
    1.40 +	sys = unix
    1.41 +endif