curvedraw

view 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 source
1 PREFIX = /usr/local
3 src = $(wildcard src/*.cc)
4 obj = $(src:.cc=.o)
5 dep = $(obj:.o=.d)
6 bin = curvedraw
8 CXXFLAGS = -pedantic -Wall -g
9 LDFLAGS = $(libgl) -lvmath -ldrawtext -lm
11 sys := $(shell uname -s | sed 's/MINGW.*/win32/')
13 ifeq ($(sys), Darwin)
14 libgl = -framework OpenGL -framework GLUT
15 else ifeq ($(sys), win32)
16 libgl = -lopengl32 -lglut32
17 else
18 libgl = -lGL -lglut
19 endif
21 $(bin): $(obj)
22 $(CXX) -o $@ $(obj) $(LDFLAGS)
24 -include $(dep)
26 %.d: %.cc
27 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
30 .PHONY: clean
31 clean:
32 rm -f $(obj) $(bin)
34 .PHONY: cleandep
35 cleandep:
36 rm -f $(dep)
38 .PHONY: install
39 install: $(bin)
40 mkdir -p $(DESTDIR)$(PREFIX)/bin
41 cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
43 .PHONY: uninstall
44 uninstall:
45 rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)