From a532b42072fb93b2103ee875e77526408af3854e Mon Sep 17 00:00:00 2001 From: Adam Spragg Date: Tue, 15 Mar 2022 15:40:19 +0000 Subject: Support "DESTDIR=" for "make install" and "make uninstall" --- makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'makefile') 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' -- cgit v1.2.1