nuclear@0: src = $(wildcard src/*.cc) $(wildcard vmath/*.cc) nuclear@0: csrc = $(wildcard src/*.c) $(wildcard vmath/*.c) $(wildcard anim/*.c) nuclear@0: obj = $(src:.cc=.o) $(csrc:.c=.o) nuclear@0: dep = $(obj:.o=.d) nuclear@0: bin = ray1 nuclear@0: nuclear@0: opt = -O3 -march=native nuclear@0: dbg = -g nuclear@0: #prof = -pg nuclear@0: CFLAGS = -pedantic -Wall $(dbg) $(opt) $(prof) -I. nuclear@0: CXXFLAGS = -std=c++11 $(CFLAGS) nuclear@0: LDFLAGS = $(prof) $(libgl) -limago nuclear@0: nuclear@0: ifeq ($(shell uname -s), Darwin) nuclear@0: # the gcc shipping with Darwin is ancient and doesn't support C++11 nuclear@0: # use clang instead. nuclear@0: CXX = clang++ nuclear@0: CPP = clang -E nuclear@0: CXXFLAGS += -stdlib=libc++ nuclear@0: LDFLAGS += -stdlib=libc++ nuclear@0: nuclear@0: libgl = -framework OpenGL -framework GLUT -lGLEW nuclear@0: else nuclear@0: libgl = -lGL -lGLU -lglut -lGLEW nuclear@0: endif nuclear@0: nuclear@0: ifeq ($(CC), icc) nuclear@0: libomp = -liomp5 nuclear@0: else nuclear@0: libomp = -lgomp nuclear@0: endif nuclear@0: nuclear@0: $(bin): $(obj) nuclear@0: $(CXX) -o $@ $(obj) $(LDFLAGS) nuclear@0: nuclear@0: -include $(dep) nuclear@0: nuclear@0: %.d: %.c nuclear@0: @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@0: nuclear@0: %.d: %.cc nuclear@0: @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@0: nuclear@0: .PHONY: clean nuclear@0: clean: nuclear@0: rm -f $(obj) $(bin) nuclear@0: nuclear@0: .PHONY: cleandep nuclear@0: cleandep: clean nuclear@0: rm -f $(dep)