structure thermal devices
[metriccd.git] / client / Makefile
blob6aca5d3f704354862af66ca1116ef3b0b08d81f4
2 .PHONY: default
3 default:
4 false
6 INSTALL_PREFIX = /usr/share/metriccd
8 METER_FILES = $(wildcard meter/*)
9 INSTALL_FILES = $(foreach f,$(METER_FILES) collect submit common.pl,$(INSTALL_PREFIX)/$(f))
11 .PHONY: install
12 install: check-deps /etc/cron.d/metriccd $(INSTALL_FILES)
14 /etc/cron.d/metriccd: cronjob
15 ifndef METRICCD_HOST
16 $(error METRICCD_HOST is not set)
17 endif
18 cat $< | sed -e 's/{{METRICCD_HOST}}/$(METRICCD_HOST)/g' > $@~
19 mv $@~ $@
21 $(INSTALL_PREFIX) $(INSTALL_PREFIX)/meter:
22 mkdir -p $@
24 $(INSTALL_FILES): $(INSTALL_PREFIX)/%: % | $(INSTALL_PREFIX) $(INSTALL_PREFIX)/meter
25 install $< $@
27 .PHONY: check-deps
28 check-deps:
29 type ifne
30 type conntrack
31 type nc.openbsd
32 type prefixlines
34 .PHONY: try-satisfy-deps
35 try-satisfy-deps:
36 apt install moreutils conntrack netcat-openbsd