summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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