diff --git a/Makefile b/Makefile index d5203f5..66572fc 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,12 @@ # notice are preserved. This file is offered as-is, without any warranty. .POSIX: + +# if using BSD make(1), remove these pragmas because they break it .PRAGMA: posix_202x # future POSIX standard support à la pdpmake(1) .PRAGMA: command_comment # breaks without this? +DESTDIR=./dist PREFIX=/usr/local CC?=cc @@ -32,14 +35,13 @@ clean: rm -rf build/ dist/ dist: all - mkdir -p dist/bin dist/share/man/man1 - cp build/bin/* dist/bin/ - cp docs/*.1 dist/share/man/man1/ + mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/share/man/man1 + cp build/bin/* $(DESTDIR)$(PREFIX)/bin/ + cp docs/*.1 $(DESTDIR)$(PREFIX)/share/man/man1/ .PHONY: install install: dist - mkdir -p $(PREFIX) - cp -r dist/* $(PREFIX)/ + cp -r $(DESTDIR)/* / .PHONY: test test: build