diff options
author | Dmitry Marakasov <amdmi3@amdmi3.ru> | 2016-04-08 00:19:36 +0300 |
---|---|---|
committer | Dmitry Marakasov <amdmi3@amdmi3.ru> | 2016-04-08 00:19:36 +0300 |
commit | c90f70af7d5154116f7c03e03084a38f0ef5df66 (patch) | |
tree | 96540fd05fa7501c19e92fce5e10993afbf01dce /Makefile | |
parent | 7f7b4d7e92f72372919db63544ebc2f5ba45630c (diff) |
Fix Makefile
- Make install directories overridable
- Support DESTDIR
- Simplify installation (install syntax is pretty much standard)
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 34 |
1 files changed, 13 insertions, 21 deletions
@@ -1,30 +1,22 @@ -PREFIX=/usr/local -BINDIR=$(PREFIX)/bin -MANDIR=$(PREFIX)/share/man/man1 -DOCDIR=$(PREFIX)/share/doc/buku -UNAME_S:=$(shell uname -s) +PREFIX?= /usr/local +BINDIR?= $(PREFIX)/bin +MANDIR?= $(PREFIX)/share/man/man1 +DOCDIR?= $(PREFIX)/share/doc/buku .PHONY: install uninstall install: - install -m755 -d $(BINDIR) - install -m755 -d $(MANDIR) - install -m755 -d $(DOCDIR) + install -m755 -d $(DESTDIR)$(BINDIR) + install -m755 -d $(DESTDIR)$(MANDIR) + install -m755 -d $(DESTDIR)$(DOCDIR) gzip -c buku.1 > buku.1.gz - @if [ "$(UNAME_S)" = "Linux" ]; then\ - install -m755 -t $(BINDIR) buku; \ - install -m644 -t $(MANDIR) buku.1.gz; \ - install -m644 -t $(DOCDIR) README.md; \ - fi - @if [ "$(UNAME_S)" = "Darwin" ]; then\ - install -m755 buku $(BINDIR); \ - install -m644 buku.1.gz $(MANDIR); \ - install -m644 README.md $(DOCDIR); \ - fi + install -m755 buku $(DESTDIR)$(BINDIR) + install -m644 buku.1.gz $(DESTDIR)$(MANDIR) + install -m644 README.md $(DESTDIR)$(DOCDIR) rm -f buku.1.gz uninstall: - rm -f $(BINDIR)/buku - rm -f $(MANDIR)/buku.1.gz - rm -rf $(DOCDIR) + rm -f $(DESTDIR)$(BINDIR)/buku + rm -f $(DESTDIR)$(MANDIR)/buku.1.gz + rm -rf $(DESTDIR)$(DOCDIR) |