curvedraw
diff Makefile @ 0:8e524989c904
getting there
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 15 Dec 2015 07:15:53 +0200 |
parents | |
children | 5ace6f6f4973 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/Makefile Tue Dec 15 07:15:53 2015 +0200 1.3 @@ -0,0 +1,45 @@ 1.4 +PREFIX = /usr/local 1.5 + 1.6 +src = $(wildcard src/*.cc) 1.7 +obj = $(src:.cc=.o) 1.8 +dep = $(obj:.o=.d) 1.9 +bin = curvedraw 1.10 + 1.11 +CXXFLAGS = -pedantic -Wall -g 1.12 +LDFLAGS = $(libgl) -lvmath -ldrawtext -lm 1.13 + 1.14 +sys := $(shell uname -s | sed 's/MINGW.*/win32/') 1.15 + 1.16 +ifeq ($(sys), Darwin) 1.17 + libgl = -framework OpenGL -framework GLUT 1.18 +else ifeq ($(sys), win32) 1.19 + libgl = -lopengl32 -lglut32 1.20 +else 1.21 + libgl = -lGL -lglut 1.22 +endif 1.23 + 1.24 +$(bin): $(obj) 1.25 + $(CXX) -o $@ $(obj) $(LDFLAGS) 1.26 + 1.27 +-include $(dep) 1.28 + 1.29 +%.d: %.cc 1.30 + @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ 1.31 + 1.32 + 1.33 +.PHONY: clean 1.34 +clean: 1.35 + rm -f $(obj) $(bin) 1.36 + 1.37 +.PHONY: cleandep 1.38 +cleandep: 1.39 + rm -f $(dep) 1.40 + 1.41 +.PHONY: install 1.42 +install: $(bin) 1.43 + mkdir -p $(DESTDIR)$(PREFIX)/bin 1.44 + cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin) 1.45 + 1.46 +.PHONY: uninstall 1.47 +uninstall: 1.48 + rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)