gpuray_glsl

diff Makefile @ 0:f234630e38ff

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 09 Nov 2014 13:03:36 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Sun Nov 09 13:03:36 2014 +0200
     1.3 @@ -0,0 +1,50 @@
     1.4 +src = $(wildcard src/*.cc) $(wildcard vmath/*.cc)
     1.5 +csrc = $(wildcard src/*.c) $(wildcard vmath/*.c) $(wildcard anim/*.c)
     1.6 +obj = $(src:.cc=.o) $(csrc:.c=.o)
     1.7 +dep = $(obj:.o=.d)
     1.8 +bin = ray1
     1.9 +
    1.10 +opt = -O3 -march=native
    1.11 +dbg = -g
    1.12 +#prof = -pg
    1.13 +CFLAGS = -pedantic -Wall $(dbg) $(opt) $(prof) -I.
    1.14 +CXXFLAGS = -std=c++11 $(CFLAGS)
    1.15 +LDFLAGS = $(prof) $(libgl) -limago
    1.16 +
    1.17 +ifeq ($(shell uname -s), Darwin)
    1.18 +	# the gcc shipping with Darwin is ancient and doesn't support C++11
    1.19 +	# use clang instead.
    1.20 +	CXX = clang++
    1.21 +	CPP = clang -E
    1.22 +	CXXFLAGS += -stdlib=libc++
    1.23 +	LDFLAGS += -stdlib=libc++
    1.24 +
    1.25 +	libgl = -framework OpenGL -framework GLUT -lGLEW
    1.26 +else
    1.27 +	libgl = -lGL -lGLU -lglut -lGLEW
    1.28 +endif
    1.29 +
    1.30 +ifeq ($(CC), icc)
    1.31 +	libomp = -liomp5
    1.32 +else
    1.33 +	libomp = -lgomp
    1.34 +endif
    1.35 +
    1.36 +$(bin): $(obj)
    1.37 +	$(CXX) -o $@ $(obj) $(LDFLAGS)
    1.38 +
    1.39 +-include $(dep)
    1.40 +
    1.41 +%.d: %.c
    1.42 +	@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.43 +
    1.44 +%.d: %.cc
    1.45 +	@$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.46 +
    1.47 +.PHONY: clean
    1.48 +clean:
    1.49 +	rm -f $(obj) $(bin)
    1.50 +
    1.51 +.PHONY: cleandep
    1.52 +cleandep: clean
    1.53 +	rm -f $(dep)