aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2022-02-22 23:41:19 +0100
committerGuilhem Moulin <guilhem@fripost.org>2022-02-23 00:01:41 +0100
commit6f6acf57255a7602235792c248d5d4926794395a (patch)
treec77aab389040383ff6c63ff0e460092bdad1c70d /Makefile
parent7ee950907f27dcb50da1821d206aeffe3d25c5c1 (diff)
Makefile: Improve DESTDIR= handling.
Per https://www.gnu.org/prep/standards/html_node/DESTDIR.html .
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 12 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 7db373d..2cff2e4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,4 @@
srcdir ?= .
-DESTDIR ?= /usr/local
BUILD_DOCDIR ?= $(srcdir)/doc
CSS ?= /usr/share/javascript/bootstrap4/css/bootstrap.css
HTML_TEMPLATE ?= $(srcdir)/doc/template.html
@@ -56,7 +55,7 @@ INSTALL ?= install
INSTALL_PROGRAM ?= $(INSTALL)
INSTALL_DATA ?= $(INSTALL) -m0644
-prefix ?= $(DESTDIR)
+prefix ?= /usr/local
exec_prefix ?= $(prefix)
bindir ?= $(exec_prefix)/bin
libdir ?= $(exec_prefix)/lib
@@ -65,19 +64,19 @@ mandir ?= $(datarootdir)/man
man1dir ?= $(mandir)/man1
install: all
- $(INSTALL_PROGRAM) -vDt $(bindir) $(srcdir)/interimap $(srcdir)/pullimap
- $(INSTALL_DATA) -vDT $(srcdir)/lib/Net/IMAP/InterIMAP.pm $(datarootdir)/perl5/Net/IMAP/InterIMAP.pm
- $(INSTALL_DATA) -vDt $(man1dir) $(BUILD_DOCDIR)/interimap.1 $(BUILD_DOCDIR)/pullimap.1
- $(INSTALL_DATA) -vDt $(datarootdir)/doc/pullimap $(srcdir)/pullimap.sample
- $(INSTALL_DATA) -vDt $(datarootdir)/doc/interimap $(srcdir)/interimap.sample $(srcdir)/doc/getting-started.md $(srcdir)/doc/multi-account.md README
- $(INSTALL_DATA) -vDt $(libdir)/systemd/user $(srcdir)/*.service
+ $(INSTALL_PROGRAM) -vDt $(DESTDIR)$(bindir) $(srcdir)/interimap $(srcdir)/pullimap
+ $(INSTALL_DATA) -vDT $(srcdir)/lib/Net/IMAP/InterIMAP.pm $(DESTDIR)$(datarootdir)/perl5/Net/IMAP/InterIMAP.pm
+ $(INSTALL_DATA) -vDt $(DESTDIR)$(man1dir) $(BUILD_DOCDIR)/interimap.1 $(BUILD_DOCDIR)/pullimap.1
+ $(INSTALL_DATA) -vDt $(DESTDIR)$(datarootdir)/doc/pullimap $(srcdir)/pullimap.sample
+ $(INSTALL_DATA) -vDt $(DESTDIR)$(datarootdir)/doc/interimap $(srcdir)/interimap.sample \
+ $(srcdir)/doc/getting-started.md $(srcdir)/doc/multi-account.md $(srcdir)/README
+ $(INSTALL_DATA) -vDt $(DESTDIR)$(libdir)/systemd/user $(srcdir)/*.service
uninstall:
- rm -vf -- $(bindir)/interimap $(man1dir)/interimap.1 $(libdir)/systemd/user/interimap*.service
- rm -vf -- $(bindir)/pullimap $(man1dir)/pullimap.1 $(libdir)/systemd/user/pullimap*.service
- rm -vf -- $(datarootdir)/perl5/Net/IMAP/InterIMAP.pm
- rm -rvf -- $(datarootdir)/doc/interimap $(datarootdir)/doc/pullimap
- rm -vf -- $(BUILD_DOCDIR)/interimap.1 $(BUILD_DOCDIR)/pullimap.1
+ rm -vf -- $(DESTDIR)$(bindir)/interimap $(DESTDIR)$(man1dir)/interimap.1 $(DESTDIR)$(libdir)/systemd/user/interimap*.service
+ rm -vf -- $(DESTDIR)$(bindir)/pullimap $(DESTDIR)$(man1dir)/pullimap.1 $(DESTDIR)$(libdir)/systemd/user/pullimap*.service
+ rm -vf -- $(DESTDIR)$(datarootdir)/perl5/Net/IMAP/InterIMAP.pm
+ rm -rvf -- $(DESTDIR)$(datarootdir)/doc/interimap $(DESTDIR)$(datarootdir)/doc/pullimap
clean:
rm -vf -- $(MANUAL_FILES) $(HTML_FILES)