nuclear@0: csrc = $(wildcard src/*.c) nuclear@0: ccsrc = $(wildcard src/*.cc) nuclear@0: obj = $(csrc:.c=.o) $(ccsrc:.cc=.o) nuclear@0: dep = $(obj:.o=.d) nuclear@0: bin = strat nuclear@0: nuclear@3: incdir = -Isrc -Igfx/src -Ilevel/src -Icommon/src nuclear@0: nuclear@3: libgfx = gfx/libgfx.a nuclear@0: liblevel = level/liblevel.a nuclear@2: libcommon = common/libcommon.a nuclear@3: slibs = $(libgfx) $(liblevel) $(libcommon) nuclear@0: nuclear@0: CFLAGS = -pedantic -Wall -g $(incdir) nuclear@0: CXXFLAGS = -std=c++0x $(CFLAGS) nuclear@2: LDFLAGS = $(libdir) $(slibs) $(libgl) -limtk -limago -lvmath nuclear@0: nuclear@0: ifeq ($(shell uname -s), Darwin) nuclear@1: CC = clang nuclear@1: CXX = clang++ nuclear@1: incdir += -I/opt/local/include nuclear@1: libdir += -L/opt/local/lib 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: $(bin): $(obj) $(slibs) nuclear@1: $(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: nuclear@0: .PHONY: clean nuclear@0: clean: nuclear@0: rm -f $(obj) $(bin) $(dep)