managing dependencies
[metriccd.git] / client / Makefile
blob6ff3a71f8afa72f967cd2f0323f6de36a19fcbbc
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
33 .PHONY: try-satisfy-deps
34 try-satisfy-deps:
35 apt install moreutils conntrack netcat-openbsd