nuclear@19: src = $(wildcard src/*.c) nuclear@19: obj = $(src:.c=.o) nuclear@19: dep = $(obj:.o=.d) nuclear@19: bin = goatview nuclear@19: nuclear@19: goat_root = .. nuclear@19: nuclear@19: CC = clang nuclear@19: CPP = clang -E nuclear@19: CFLAGS = -pedantic -Wall -g -I$(goat_root)/src nuclear@23: LDFLAGS = $(libgoat) $(libgl) nuclear@19: nuclear@19: ifeq ($(shell uname -s), Darwin) nuclear@19: libgl = -framework OpenGL -framework GLUT -lGLEW nuclear@23: libgoat = $(goat_root)/libgoat3d.dylib nuclear@19: else nuclear@19: libgl = -lGL -lGLU -lglut -lGLEW nuclear@23: libgoat = $(goat_root)/libgoat3d.so.0.1 -Wl,-rpath=$(goat_root) nuclear@19: endif nuclear@19: nuclear@19: $(bin): $(obj) $(libgoat) nuclear@19: $(CC) -o $@ $(obj) $(LDFLAGS) nuclear@19: nuclear@19: -include $(dep) nuclear@19: nuclear@19: %.d: %.c nuclear@19: @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@19: nuclear@19: .PHONY: clean nuclear@19: clean: nuclear@19: rm -f $(obj) $(bin) nuclear@19: nuclear@19: .PHONY: cleandep nuclear@19: cleandep: nuclear@19: rm -f $(dep)