Skip to content
Permalink
Browse files

make: Use DESTDIR

This is more standard than forcing the user to specify the destination
directory as part of PREFIX.
  • Loading branch information...
keur committed Aug 11, 2019
1 parent e069dea commit a3cd4298503c6839f3f99570e7d53bf9524ffa87
Showing with 9 additions and 6 deletions.
  1. +9 −6 Makefile
@@ -1,4 +1,7 @@
PREFIX ?= /usr/local
_INSTDIR ?= $(DESTDIR)$(PREFIX)
BINDIR ?= $(_INSTDIR)/bin
MANDIR ?= $(_INSTDIR)/share/man
TASK_DONE = echo -e "\n✓ $@ done\n"

.PHONY: test
@@ -15,14 +18,14 @@ help:
@$(TASK_DONE)

install:
install -d -m 0755 $(PREFIX)/bin
install -m 0755 git-quick-stats $(PREFIX)/bin/git-quick-stats
install -d -m 0755 $(BINDIR)
install -m 0755 git-quick-stats $(BINDIR)/git-quick-stats
$(MAKE) man
@$(TASK_DONE)

uninstall:
rm -f $(PREFIX)/bin/git-quick-stats
rm -f $(PREFIX)/share/man/man1/git-quick-stats.1
rm -f $(BINDIR)/git-quick-stats
rm -f $(MANDIR)/man1/git-quick-stats.1
@$(TASK_DONE)

reinstall:
@@ -32,8 +35,8 @@ reinstall:
@$(TASK_DONE)

man:
install -d -m 0755 $(PREFIX)/share/man/man1/
install -m 0644 git-quick-stats.1 $(PREFIX)/share/man/man1/
install -d -m 0755 $(MANDIR)/man1/
install -m 0644 git-quick-stats.1 $(MANDIR)/man1/

test:
tests/commands_test.sh

0 comments on commit a3cd429

Please sign in to comment.
You can’t perform that action at this time.