forked from ke6jjj/miner_exporter
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
36 lines (25 loc) · 791 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
PYTHON_SRCS= \
miner_exporter.py \
miner_jsonrpc.py
PYTHON?= python3
DESTROOT?= /home/helium/validator_exporter
BUILT_SERVICE= build/validator_exporter.service
STARTUP= build/run
all: $(BUILT_SERVICE) $(STARTUP)
install: $(DESTROOT)/pyenv $(STARTUP)
for pysrc in $(PYTHON_SRCS); do \
install -D $$pysrc $(DESTROOT); \
done
install $(STARTUP) $(DESTROOT)
install-service: $(BUILT_SERVICE)
install $(BUILT_SERVICE) /etc/systemd/system
$(DESTROOT)/pyenv:
$(PYTHON) -m venv $@ && . $(DESTROOT)/pyenv/bin/activate && pip install -r requirements.txt
$(BUILT_SERVICE): validator_exporter.service.in
mkdir -p build
sed -e s,@@DESTROOT@@,$(DESTROOT),g < $< > $@
$(STARTUP): run.sh.in
mkdir -p build
sed -e s,@@DESTROOT@@,$(DESTROOT),g < $< > $@
clean:
rm -f $(BUILT_SERVICE)