nuclear@0: PREFIX ?= /usr/local nuclear@0: nuclear@0: src = $(wildcard src/*.cc) nuclear@15: csrc = $(wildcard src/*.c) nuclear@15: obj = $(src:.cc=.o) $(csrc:.c=.o) nuclear@6: dep = $(obj:.o=.d) nuclear@0: nuclear@0: bin = tavli nuclear@0: nuclear@15: CFLAGS = -pedantic -Wall -g nuclear@0: CXXFLAGS = -pedantic -Wall -g nuclear@1: LDFLAGS = $(libgl) -lvmath -limago -lm -lpthread nuclear@0: nuclear@0: ifeq ($(shell uname -s), Darwin) 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) nuclear@0: $(CXX) -o $@ $(obj) $(LDFLAGS) nuclear@0: nuclear@6: -include $(dep) nuclear@6: nuclear@15: %.d: %.c nuclear@15: @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@15: nuclear@6: %.d: %.cc nuclear@6: @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@6: nuclear@0: .PHONY: clean nuclear@0: clean: nuclear@0: rm -f $(obj) $(bin) nuclear@0: nuclear@6: .PHONY: cleandep nuclear@6: cleandep: nuclear@6: rm -f $(dep) nuclear@6: nuclear@0: .PHONY: install nuclear@0: install: $(bin) nuclear@0: mkdir -p $(PREFIX)/bin nuclear@0: cp $(bin) $(PREFIX)/bin/$(bin) nuclear@0: nuclear@0: .PHONY: uninstall nuclear@0: uninstall: nuclear@0: rm -f $(PREFIX)/bin/$(bin)