summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2019-11-24 08:26:53 -0500
committerLuke Smith <luke@lukesmith.xyz>2019-11-24 08:26:53 -0500
commit8b983812ed165ab1300330de6ed9b2db2468afa0 (patch)
treeebf6d0501ae64cf7d8079c37a2404a8dbfc4174f /Makefile
parent15941b43e7cec4b66ad2e9911ca791f365aac362 (diff)
parent9ce96c9a40cc57703fd386b52195bc48c873ba79 (diff)
Merge branch 'master' of git://github.com/aymanbagabas/mutt-wizard into aymanbagabas-master
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 9 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 20c82d1..13214f5 100644
--- a/Makefile
+++ b/Makefile
@@ -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,16 +16,20 @@ 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 \
- rm -f $(DESTDIR)$(PREFIX)/bin/$$script; \
+ rm -f $(DESTDIR)$(PREFIX)/$$script; \
done
rm -rf $(DESTDIR)$(PREFIX)/share/mutt-wizard
rm -f $(DESTDIR)$(MANPREFIX)/man1/mw.1