nuclear@1: csrc = $(wildcard src/*.c) $(wildcard vmath/*.c) nuclear@1: ccsrc = $(wildcard src/*.cc) $(wildcard vmath/*.cc) nuclear@1: obj = $(csrc:.c=.o) $(ccsrc:.cc=.o) nuclear@1: dep = $(obj:.o=.d) nuclear@1: bin = proto nuclear@1: nuclear@1: CFLAGS = -pedantic -Wall -g -Ivmath nuclear@1: CXXFLAGS = $(CFLAGS) nuclear@1: LDFLAGS = $(libgl) -lm nuclear@1: nuclear@1: ifeq ($(shell uname -s), Darwin) nuclear@1: libgl = -framework OpenGL -framework GLUT -lglew nuclear@1: else nuclear@1: libgl = -lGL -lGLU -lglut -lGLEW nuclear@1: endif nuclear@1: nuclear@1: $(bin): $(obj) nuclear@1: $(CXX) -o $@ $(obj) $(LDFLAGS) nuclear@1: nuclear@1: -include $(dep) nuclear@1: nuclear@1: %.d: %.c nuclear@1: @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@1: nuclear@1: %.d: %.cc nuclear@1: @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@1: nuclear@1: .PHONY: clean nuclear@1: clean: nuclear@1: rm -f $(obj) $(bin) $(dep)