2019-04-21 21:47:27 -04:00
|
|
|
.POSIX:
|
|
|
|
|
2019-05-04 22:47:01 +02:00
|
|
|
OS = $(shell uname -s)
|
2019-07-01 18:14:16 -04:00
|
|
|
ifndef PREFIX
|
2019-05-04 22:47:01 +02:00
|
|
|
PREFIX = /usr/local
|
|
|
|
endif
|
2019-04-22 12:13:45 -04:00
|
|
|
MANPREFIX = $(PREFIX)/share/man
|
2019-04-21 21:47:27 -04:00
|
|
|
|
|
|
|
install:
|
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
2019-05-01 21:21:02 -04:00
|
|
|
for script in bin/*; do \
|
|
|
|
cp -f $$script $(DESTDIR)$(PREFIX)/bin/; \
|
|
|
|
chmod 755 $(DESTDIR)$(PREFIX)/$$script; \
|
|
|
|
done
|
2019-04-23 15:08:25 +02:00
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/share/mutt-wizard
|
2019-11-25 16:50:08 -05:00
|
|
|
chmod 755 $(DESTDIR)$(PREFIX)/share/mutt-wizard
|
2019-05-01 21:24:41 -04:00
|
|
|
for shared in share/*; do \
|
|
|
|
cp -f $$shared $(DESTDIR)$(PREFIX)/share/mutt-wizard; \
|
2019-11-25 18:30:24 -05:00
|
|
|
chmod 644 $(DESTDIR)$(PREFIX)/share/mutt-wizard/$$(basename $(notdir $$shared)); \
|
2019-05-01 21:24:41 -04:00
|
|
|
done
|
2019-07-01 18:14:16 -04:00
|
|
|
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
|
|
|
|
cp -f mw.1 $(DESTDIR)$(MANPREFIX)/man1/mw.1
|
2019-11-25 16:50:08 -05:00
|
|
|
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/mw.1
|
2019-07-01 18:14:16 -04:00
|
|
|
if [ "$(PREFIX)" ]; then \
|
|
|
|
sed -iba 's:/usr/local:$(PREFIX):' $(DESTDIR)$(PREFIX)/share/mutt-wizard/mutt-wizard.muttrc; \
|
2019-11-25 12:40:18 -05:00
|
|
|
rm -f $(DESTDIR)$(PREFIX)/share/mutt-wizard/mutt-wizard.muttrcba; \
|
2019-07-01 18:14:16 -04:00
|
|
|
sed -iba 's:/usr/local:$(PREFIX):' $(DESTDIR)$(PREFIX)/bin/mw; \
|
2019-11-25 12:40:18 -05:00
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/mwba; \
|
2019-07-01 18:14:16 -04:00
|
|
|
sed -iba 's:/usr/local:$(PREFIX):' $(DESTDIR)$(MANPREFIX)/man1/mw.1; \
|
2019-11-25 12:40:18 -05:00
|
|
|
rm -f $(DESTDIR)$(MANPREFIX)/man1/mw.1ba; \
|
2019-05-05 09:20:57 +02:00
|
|
|
fi
|
2019-04-21 21:47:27 -04:00
|
|
|
|
|
|
|
uninstall:
|
2019-11-24 08:26:16 -05:00
|
|
|
for script in bin/*; do \
|
2019-07-01 19:18:36 -04:00
|
|
|
rm -f $(DESTDIR)$(PREFIX)/$$script; \
|
2019-05-01 21:21:02 -04:00
|
|
|
done
|
2019-04-23 15:08:25 +02:00
|
|
|
rm -rf $(DESTDIR)$(PREFIX)/share/mutt-wizard
|
2019-10-26 19:44:26 +03:00
|
|
|
rm -f $(DESTDIR)$(MANPREFIX)/man1/mw.1
|
2019-04-21 21:47:27 -04:00
|
|
|
|
|
|
|
.PHONY: install uninstall
|