curvedraw
annotate Makefile @ 5:2b7ae76c173f
windows port
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 18 Dec 2015 03:47:10 +0200 |
parents | |
children | 5ace6f6f4973 |
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@0 | 8 CXXFLAGS = -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@0 | 14 libgl = -framework OpenGL -framework GLUT |
nuclear@0 | 15 else ifeq ($(sys), win32) |
nuclear@0 | 16 libgl = -lopengl32 -lglut32 |
nuclear@0 | 17 else |
nuclear@0 | 18 libgl = -lGL -lglut |
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) |