-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
35 lines (26 loc) · 1.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
CARGO = cargo
PREFIX = /usr/bin
CONFIG_PREFIX = /etc
BUILT_TARGET = target/release/wzmach
CONFIG_TARGET = config.ron
LOCAL_PREFIX = $(HOME)/.local/bin
LOCAL_USER = $(USER)
target/release/wzmach:
"$(CARGO)" build --release
# You probably have cargo installed locally, and you will run install as root,
# so it won't find cargo. So we don't put the binary as a dependency
install:
mkdir -p "$(PREFIX)"
install "$(BUILT_TARGET)" "$(PREFIX)/wzmach" --group=input --owner=root --mode=2755
mkdir -p "$(CONFIG_PREFIX)/wzmach"
install "$(CONFIG_TARGET)" "$(CONFIG_PREFIX)/wzmach/config.ron" --group=root --owner=root --mode=644
install-local: $(BUILT_TARGET)
mkdir -p "$(LOCAL_PREFIX)"
sudo install $< "$(LOCAL_PREFIX)/wzmach" --group=input "--owner=$(LOCAL_USER)" --mode=2754
autostart: wzmach.desktop
install wzmach.desktop "$(LOCAL_USER)/.config/autostart/wzmach.desktop"
uninstall:
rm "$(PREFIX)/wzmach"
rm "$(CONFIG_PREFIX)/wzmach/config.ron"
rmdir "$(CONFIG_PREFIX)/wzmach"
.PHONY: target/release/wzmach install install-local uninstall