nuclear@0: src = $(wildcard *.c src/*.c) nuclear@0: obj = $(src:.c=.o) nuclear@14: depfiles = $(obj:.o=.d) nuclear@0: bin = test nuclear@0: nuclear@0: CC = gcc nuclear@0: CFLAGS = -pedantic -Wall -g -Isrc nuclear@0: LDFLAGS = $(libgl) nuclear@0: nuclear@0: ifeq ($(shell uname -s), Darwin) nuclear@0: libgl = -framework OpenGL -framework GLUT nuclear@0: else nuclear@9: libgl = -lGL -lGLU -lglut nuclear@0: endif nuclear@0: nuclear@0: $(bin): $(obj) nuclear@0: $(CC) -o $@ $(obj) $(LDFLAGS) nuclear@0: nuclear@14: -include $(depfiles) nuclear@14: nuclear@14: %.d: %.c nuclear@14: @$(CPP) $(CFLAGS) -MM -MT $(@:.d=.o) $< >$@ nuclear@14: nuclear@0: .PHONY: clean nuclear@0: clean: nuclear@0: rm -f $(obj) $(bin) nuclear@14: nuclear@14: .PHONY: cleandep nuclear@14: cleandep: nuclear@14: rm -f $(depfiles)