summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 9 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 68db4ff..7c95b7f 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