aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorAdam Spragg <adam@spra.gg>2022-03-15 15:40:19 +0000
committerAdam Spragg <adam@spra.gg>2022-03-15 15:40:19 +0000
commita532b42072fb93b2103ee875e77526408af3854e (patch)
tree7aa2e238c5dfb25653b97336dee7b9189bd759be /makefile
parent3b9bb2497e1c809ec3b5f7db40dd32c689e7ac47 (diff)
Support "DESTDIR=" for "make install" and "make uninstall"
Diffstat (limited to 'makefile')
-rw-r--r--makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/makefile b/makefile
index 6e0ca1a..cce32c2 100644
--- a/makefile
+++ b/makefile
@@ -1,7 +1,6 @@
PREFIX=/usr/local
SBINDIR=$(PREFIX)/sbin
-SYSDDIR=$(PREFIX)/lib/systemd/system
SED_SHELL:=
SED_SHELL+=s:^SBINDIR=.*:SBINDIR=$(SBINDIR):;
@@ -20,6 +19,9 @@ all:
.PHONY: install
+install: DESTDIR=$(PREFIX)
+install: SBINDIR=$(DESTDIR)/sbin
+install: SYSDDIR=$(DESTDIR)/lib/systemd/system
install:
install -d '$(SBINDIR)'
install -m 755 -t '$(SBINDIR)' adu-download
@@ -36,6 +38,9 @@ install:
.PHONY: uninstall
+uninstall: DESTDIR=$(PREFIX)
+uninstall: SBINDIR=$(DESTDIR)/sbin
+uninstall: SYSDDIR=$(DESTDIR)/lib/systemd/system
uninstall:
systemctl --now disable adu-download.timer
rm -f '$(SYSDDIR)/system-update.target.wants/adu-upgrade.service'