nuclear@0: ccsrc = $(wildcard src/*.cc) nuclear@0: csrc = $(wildcard src/*.c) nuclear@0: obj = $(csrc:.c=.o) $(ccsrc:.cc=.o) nuclear@0: dep = $(obj:.o=.d) nuclear@0: nuclear@0: bin = umonster nuclear@0: nuclear@0: sys = $(shell uname -s) nuclear@0: nuclear@3: warn = -pedantic -Wall -Wno-format-extra-args nuclear@3: dbg = -g nuclear@7: opt = -O3 nuclear@3: nuclear@3: CFLAGS = $(warn) $(dbg) $(opt) nuclear@0: CXXFLAGS = $(CFLAGS) nuclear@7: LDFLAGS = $(libgl) -lvmath -limago -lpsys -lanim -lm -lmetasurf nuclear@0: nuclear@3: ifeq ($(sys), Darwin) nuclear@3: libgl = -framework OpenGL -framework GLUT -lGLEW nuclear@3: warn += -Wno-deprecated-declarations nuclear@3: else nuclear@3: libgl = -lGL -lGLU -lglut -lGLEW nuclear@3: endif nuclear@0: nuclear@3: .PHONY: all nuclear@3: all: $(bin) 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: nuclear@0: rm -f $(dep)