nuclear@5: name = $(shell pwd | sed 's/.*\///') nuclear@5: bin = $(name) nuclear@5: src = $(wildcard *.c) nuclear@5: obj = $(src:.c=.o) nuclear@5: nuclear@12: ifeq ($(shell uname -s), Darwin) nuclear@12: libsgl = libsgl.dylib nuclear@12: libgl = -framework OpenGL nuclear@12: else nuclear@12: libsgl = libsgl.so nuclear@12: libgl = -lGL -lGLU nuclear@12: rpath = -Wl,-rpath=. nuclear@12: endif nuclear@12: nuclear@5: sgldir = ../.. nuclear@5: nuclear@5: CC = gcc nuclear@5: CFLAGS = -pedantic -Wall -g -I$(sgldir)/include nuclear@12: LDFLAGS = -L. $(rpath) -lsgl $(libgl) -lm nuclear@5: nuclear@12: $(bin): $(obj) $(libsgl) nuclear@5: $(CC) -o $@ $(obj) $(LDFLAGS) nuclear@5: nuclear@12: libsgl.dylib: $(sgldir)/libsgl.dylib nuclear@12: ln -s $< $@ nuclear@12: nuclear@5: libsgl.so: $(sgldir)/libsgl.so.0.0 nuclear@5: ln -s $< $@.0 nuclear@5: ln -s $< $@ nuclear@5: nuclear@5: .PHONY: clean nuclear@5: clean: nuclear@5: rm -f $(obj) $(bin)