curvedraw

annotate Makefile @ 16:7f795f7fecd6

readme and COPYING
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 20 Dec 2015 10:55:57 +0200
parents 5ace6f6f4973
children
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@0 5 dep = $(obj:.o=.d)
nuclear@0 6 bin = curvedraw
nuclear@0 7
nuclear@15 8 CXXFLAGS = -std=c++11 -pedantic -Wall -g
nuclear@0 9 LDFLAGS = $(libgl) -lvmath -ldrawtext -lm
nuclear@0 10
nuclear@0 11 sys := $(shell uname -s | sed 's/MINGW.*/win32/')
nuclear@0 12
nuclear@0 13 ifeq ($(sys), Darwin)
nuclear@7 14 libgl = -framework OpenGL -framework GLUT -lGLEW
nuclear@0 15 else ifeq ($(sys), win32)
nuclear@7 16 libgl = -lopengl32 -lglut32 -lglew32
nuclear@0 17 else
nuclear@7 18 libgl = -lGL -lglut -lGLEW
nuclear@0 19 endif
nuclear@0 20
nuclear@0 21 $(bin): $(obj)
nuclear@0 22 $(CXX) -o $@ $(obj) $(LDFLAGS)
nuclear@0 23
nuclear@0 24 -include $(dep)
nuclear@0 25
nuclear@0 26 %.d: %.cc
nuclear@0 27 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 28
nuclear@0 29
nuclear@0 30 .PHONY: clean
nuclear@0 31 clean:
nuclear@0 32 rm -f $(obj) $(bin)
nuclear@0 33
nuclear@0 34 .PHONY: cleandep
nuclear@0 35 cleandep:
nuclear@0 36 rm -f $(dep)
nuclear@0 37
nuclear@0 38 .PHONY: install
nuclear@0 39 install: $(bin)
nuclear@0 40 mkdir -p $(DESTDIR)$(PREFIX)/bin
nuclear@0 41 cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
nuclear@0 42
nuclear@0 43 .PHONY: uninstall
nuclear@0 44 uninstall:
nuclear@0 45 rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)