distray

diff Makefile @ 0:cf494adee646

distance field raytracer
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 25 Dec 2015 05:41:10 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Fri Dec 25 05:41:10 2015 +0200
     1.3 @@ -0,0 +1,33 @@
     1.4 +src = $(wildcard src/*.cc)
     1.5 +obj = $(src:.cc=.o)
     1.6 +dep = $(obj:.o=.d)
     1.7 +bin = distray
     1.8 +
     1.9 +opt = -O3
    1.10 +dbg = -g
    1.11 +
    1.12 +CXXFLAGS = -std=c++11 -pedantic -Wall $(opt) $(dbg)
    1.13 +LDFLAGS = $(libgl) -lm -lvmath
    1.14 +
    1.15 +sys := $(shell uname -s)
    1.16 +ifeq ($(sys), Darwin)
    1.17 +	libgl = -framework OpenGL -framework GLUT -lGLEW
    1.18 +else
    1.19 +	libgl = -lGL -lGLU -lglut -lGLEW
    1.20 +endif
    1.21 +
    1.22 +$(bin): $(obj)
    1.23 +	$(CXX) -o $@ $(obj) $(LDFLAGS)
    1.24 +
    1.25 +-include $(dep)
    1.26 +
    1.27 +%.d: %.cc
    1.28 +	@$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.29 +
    1.30 +.PHONY: clean
    1.31 +clean:
    1.32 +	rm -f $(obj) $(bin)
    1.33 +
    1.34 +.PHONY: cleandep
    1.35 +cleandep:
    1.36 +	rm -f $(dep)