nuclear@24: root = . nuclear@9: src = $(wildcard src/*.c) $(wildcard src/glut/*.c) nuclear@9: ccsrc = $(wildcard src/*.cc) nuclear@9: nuclear@9: obj = $(src:.c=.o) $(ccsrc:.cc=.o) nuclear@9: dep = $(obj:.o=.d) nuclear@9: bin = test nuclear@9: nuclear@9: incdir = -Isrc nuclear@9: def = -DNO_FREETYPE nuclear@9: nuclear@9: CFLAGS = -pedantic -Wall -g $(def) $(incdir) nuclear@9: CXXFLAGS = $(CFLAGS) nuclear@10: LDFLAGS = $(libgl) -lm -ldl nuclear@9: nuclear@9: include libs/Makefile nuclear@9: nuclear@10: sys := $(shell uname -s) nuclear@10: ifeq ($(sys), Darwin) nuclear@10: libgl = -framework OpenGL -framework GLUT -lGLEW nuclear@10: else nuclear@10: libgl = -lGL -lGLU -lglut -lGLEW nuclear@10: endif nuclear@10: nuclear@9: $(bin): $(obj) nuclear@14: @echo "Linking $(bin) ..." nuclear@14: @$(CXX) -o $@ $(obj) $(LDFLAGS) nuclear@9: nuclear@9: -include $(dep) nuclear@9: nuclear@9: %.d: %.c nuclear@9: @$(CPP) $(CFLAGS) -MM -MT $(@:.d=.o) $< >$@ nuclear@9: nuclear@9: %.d: %.cc nuclear@9: @$(CPP) $(CXXFLAGS) -MM -MT $(@:.d=.o) $< >$@ nuclear@9: nuclear@9: .PHONY: clean nuclear@9: clean: nuclear@9: rm -f $(obj) $(bin) nuclear@9: nuclear@9: .PHONY: cleandep nuclear@9: cleandep: nuclear@9: rm -f $(dep)