diff options
author | Ayman Bagabas <ayman.bagabas@gmail.com> | 2019-07-01 18:14:16 -0400 |
---|---|---|
committer | Ayman Bagabas <ayman.bagabas@gmail.com> | 2019-07-01 18:34:07 -0400 |
commit | cd5fd9bde283454bb64549bb064ecd3d50500d23 (patch) | |
tree | edba53d659bb2f747bac5c0aaeceb79f025cf754 /Makefile | |
parent | 86cd3ad33f6e6453db54e7cd507e85ec0da32055 (diff) |
Make use of PREFIX environment variable
This patch puts the environment variable PREFIX in more use. If
specified, mull-wizard Makefile substitute all instances of prefix with
the provided environment variable.
Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -1,10 +1,8 @@ .POSIX: OS = $(shell uname -s) -ifeq ($(OS), Darwin) +ifndef PREFIX PREFIX = /usr/local -else - PREFIX = /usr endif MANPREFIX = $(PREFIX)/share/man @@ -18,12 +16,16 @@ install: for shared in share/*; do \ cp -f $$shared $(DESTDIR)$(PREFIX)/share/mutt-wizard; \ done + mkdir -p $(DESTDIR)$(MANPREFIX)/man1 + cp -f mw.1 $(DESTDIR)$(MANPREFIX)/man1/mw.1 + if [ "$(PREFIX)" ]; then \ + sed -iba 's:/usr/local:$(PREFIX):' $(DESTDIR)$(PREFIX)/share/mutt-wizard/mutt-wizard.muttrc; \ + sed -iba 's:/usr/local:$(PREFIX):' $(DESTDIR)$(PREFIX)/bin/mw; \ + sed -iba 's:/usr/local:$(PREFIX):' $(DESTDIR)$(MANPREFIX)/man1/mw.1; \ + fi if [ "$(OS)" = "Darwin" ]; then \ - sed -iba 's/\/usr\//\/usr\/local\//' $(DESTDIR)$(PREFIX)/share/mutt-wizard/mutt-wizard.muttrc; \ rm $(DESTDIR)$(PREFIX)/share/mutt-wizard/mutt-wizard.muttrcba; \ fi - mkdir -p $(DESTDIR)$(MANPREFIX)/man1 - cp -f mw.1 $(DESTDIR)$(MANPREFIX)/man1/mw.1 uninstall: for script in bin/*; do \ |