summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authoru <u@billy>2023-05-01 10:55:01 -0400
committeru <u@billy>2023-05-01 10:55:01 -0400
commit8bd7314490e12d5501818e597144ffd5acc75564 (patch)
treece8462c3b5b8a704d6e33055cbffdd241f40d21a /Makefile
parenta1d4d87f480e932960d037e6401db87b92fdf4f6 (diff)
separate service, executable, and installer
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..c876ade
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,22 @@
1UNIT = suspend-below-battery-capacity
2BINDIR = /usr/local/bin
3BINARIES = $(UNIT)
4.PHONY: all install-bin install
5
6all:
7 @echo "run 'make install' to install"
8
9ifeq ($(shell id -u),0)
10
11install: $(UNIT).service install-bin
12 systemctl enable --now $(shell realpath -e $<)
13
14install-bin:
15 install -t $(BINDIR) -- $(BINARIES)
16
17else
18
19install install-bin:
20 sudo $(MAKE) -$(MAKEFLAGS) $@
21
22endif