git.lucas.co / fontpreview
git clone https://git.lucas.co/fontpreview.git

commitc47cd9af1b7917f93d53620e77f75487522a73e3
parent71098bc987
authorMateusz Piotrowski <0mp@FreeBSD.org>
date2020-02-11 10:38
Adjust makefile to ease packaging

- PREFIX is a much more standard variable than DEST.
- Add BINDIR to actually let people choose where to install fontpreview
  precisely if they need.
- Support DESTDIR, which is useful for staged package building.

While here, use tabs to indent values of variables. Spaces are sometimes
significant in makefiles (they are parts of the values), which might
lead to confusing bugs.

 Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index c33f354..3a4171f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,14 @@
-DEST ?= /usr/bin
+PREFIX?=	/usr
+BINDIR=		${PREFIX}/bin
 
 all:
 	@echo Run \'make install\' to install fontpreview on your device
 
 install:
-	@cp fontpreview $(DEST)/fontpreview
-	@chmod 755 $(DEST)/fontpreview
+	@cp fontpreview $(DESTDIR)$(BINDIR)/fontpreview
+	@chmod 755 $(DESTDIR)$(BINDIR)/fontpreview
 	@echo fontpreview has been installed on your device
 
 uninstall:
-	@rm -rf $(DEST)/fontpreview
+	@rm -rf $(DESTDIR)$(BINDIR)/fontpreview
 	@echo fontpreview has been removed from your device