nuclear@1: csrc = $(wildcard src/*.c) nuclear@1: ccsrc = $(wildcard src/*.cc) nuclear@1: obj = $(csrc:.c=.o) $(ccsrc:.cc=.o) nuclear@1: dep = $(obj:.o=.d) nuclear@1: bin = vrchess nuclear@1: nuclear@1: CFLAGS = -pedantic -Wall -g nuclear@1: CXXFLAGS = -std=c++11 $(CFLAGS) nuclear@1: LDFLAGS = $(libgl_$(sys)) -lm -lvmath -limago nuclear@1: nuclear@1: libgl_unix = -lGL -lGLU -lglut -lGLEW nuclear@1: libgl_mac = -framework OpenGL -framework GLUT -lGLEW nuclear@1: libgl_win = -lopengl32 -lglu32 -lglut32 -lglew32 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) nuclear@1: nuclear@1: # os detection nuclear@1: uname = $(shell uname -s) nuclear@1: ifeq ($(sys), Darwin) nuclear@1: sys = mac nuclear@1: else ifeq ($(findstring MINGW, $(sys)), MINGW) nuclear@1: sys = win nuclear@1: else nuclear@1: sys = unix nuclear@1: endif