-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
22 lines (20 loc) · 851 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
.PHONY: install
install:
@mkdir --parents $${HOME}/.local/bin \
&& mkdir --parents $${HOME}/.config/systemd/user \
&& cp pvpc_exporter $${HOME}/.local/bin/ \
&& cp --no-clobber pvpc_exporter.json $${HOME}/.config/pvpc_exporter.json \
&& chmod 400 $${HOME}/.config/pvpc_exporter.json \
&& cp pvpc-exporter.timer $${HOME}/.config/systemd/user/ \
&& cp pvpc-exporter.service $${HOME}/.config/systemd/user/ \
&& systemctl --user enable --now pvpc-exporter.timer
.PHONY: uninstall
uninstall:
@rm -f $${HOME}/.local/bin/pvpc_exporter \
&& rm -f $${HOME}/.config/pvpc_exporter.json \
&& systemctl --user disable --now pvpc-exporter.timer \
&& rm -f $${HOME}/.config/.config/systemd/user/pvpc-exporter.timer \
&& rm -f $${HOME}/.config/systemd/user/pvpc-exporter.service
.PHONY: build
build:
@go build -ldflags="-s -w" -o pvpc_exporter main.go