-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
44 lines (35 loc) · 954 Bytes
/
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
36
37
38
39
40
41
42
43
44
#change this line if you're targeting some other architecture, e.g. x86_64-unknown-linux-gnu
ARCH=aarch64-unknown-linux-gnu
DEBUG=target/$(ARCH)/debug/wcas
PROD=target/$(ARCH)/release/wcas
# change to $(PROD) for production
EXEC=$(DEBUG)
NOT_ARCHIVED_PATH=target/package/
INST_DIR=$(NOT_ARCHIVED_PATH)wcas
PACKAGE=target/wcas.tar.xz
all: $(PACKAGE)
$(PACKAGE): $(EXEC)
mkdir -p $(INST_DIR)
cp $(EXEC) $(INST_DIR)/wcas
cp makefile $(INST_DIR)
cp install/wcas.service $(INST_DIR)
tar -caf $(PACKAGE) --directory=$(NOT_ARCHIVED_PATH) wcas
$(DEBUG):
cross build --target $(ARCH)
$(PROD):
cross build --release --target $(ARCH)
BINDIR=/usr/bin/
SYSTEMD=/etc/systemd/system/
.PHONY: install
install:
install wcas $(BINDIR)
install wcas.service $(SYSTEMD)
systemctl stop wcas
systemctl start wcas
systemctl enable wcas
.PHONY: uninstall
uninstall:
systemctl stop wcas
systemctl disable wcas
rm $(BINDIR)wcas
rm $(SYSTEMD)wcas.service