aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorAdam Spragg <adam@spra.gg>2022-03-14 15:21:50 +0000
committerAdam Spragg <adam@spra.gg>2022-03-14 15:21:50 +0000
commit3b9bb2497e1c809ec3b5f7db40dd32c689e7ac47 (patch)
tree5d89a750a9f5507670a8573ac87cfde4a20aadfd /makefile
parentab3461e792a3b9a525a895bb0b3a70e55955efb6 (diff)
Support setting PREFIX with `make PREFIX=...` "build" step
Diffstat (limited to 'makefile')
-rw-r--r--makefile15
1 files changed, 13 insertions, 2 deletions
diff --git a/makefile b/makefile
index 90ed9c0..6e0ca1a 100644
--- a/makefile
+++ b/makefile
@@ -3,13 +3,24 @@ PREFIX=/usr/local
SBINDIR=$(PREFIX)/sbin
SYSDDIR=$(PREFIX)/lib/systemd/system
+SED_SHELL:=
+SED_SHELL+=s:^SBINDIR=.*:SBINDIR=$(SBINDIR):;
+
+SED_SYSD:=
+SED_SYSD+=s:^ExecStart=.*/\([^/]\+\)$$:ExecStart=$(SBINDIR)/\1:;
+
+
.PHONY: all
all:
- @echo Build complete
+ sed -i -e '$(SED_SHELL)' adu-download
+ sed -i -e '$(SED_SHELL)' adu-upgrade
+ sed -i -e '$(SED_SYSD)' adu-download.service
+ sed -i -e '$(SED_SYSD)' adu-download.timer
+ sed -i -e '$(SED_SYSD)' adu-upgrade.service
.PHONY: install
-install: all
+install:
install -d '$(SBINDIR)'
install -m 755 -t '$(SBINDIR)' adu-download
install -m 755 -t '$(SBINDIR)' adu-upgrade