tavli

annotate Makefile @ 10:fc5c68da7906

added readme and license
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 26 Jun 2015 05:41:18 +0300
parents 3fcd7b4d631f
children b1a195c3ee16
rev   line source
nuclear@0 1 PREFIX ?= /usr/local
nuclear@0 2
nuclear@0 3 src = $(wildcard src/*.cc)
nuclear@0 4 obj = $(src:.cc=.o)
nuclear@6 5 dep = $(obj:.o=.d)
nuclear@0 6
nuclear@0 7 bin = tavli
nuclear@0 8
nuclear@0 9 CXXFLAGS = -pedantic -Wall -g
nuclear@1 10 LDFLAGS = $(libgl) -lvmath -limago -lm -lpthread
nuclear@0 11
nuclear@0 12 ifeq ($(shell uname -s), Darwin)
nuclear@0 13 libgl = -framework OpenGL -framework GLUT -lGLEW
nuclear@0 14 else
nuclear@0 15 libgl = -lGL -lGLU -lglut -lGLEW
nuclear@0 16 endif
nuclear@0 17
nuclear@0 18 $(bin): $(obj)
nuclear@0 19 $(CXX) -o $@ $(obj) $(LDFLAGS)
nuclear@0 20
nuclear@6 21 -include $(dep)
nuclear@6 22
nuclear@6 23 %.d: %.cc
nuclear@6 24 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@6 25
nuclear@0 26 .PHONY: clean
nuclear@0 27 clean:
nuclear@0 28 rm -f $(obj) $(bin)
nuclear@0 29
nuclear@6 30 .PHONY: cleandep
nuclear@6 31 cleandep:
nuclear@6 32 rm -f $(dep)
nuclear@6 33
nuclear@0 34 .PHONY: install
nuclear@0 35 install: $(bin)
nuclear@0 36 mkdir -p $(PREFIX)/bin
nuclear@0 37 cp $(bin) $(PREFIX)/bin/$(bin)
nuclear@0 38
nuclear@0 39 .PHONY: uninstall
nuclear@0 40 uninstall:
nuclear@0 41 rm -f $(PREFIX)/bin/$(bin)