mandate METRICCD_HOST at installation time
[metriccd.git] / client / Makefile
blobedca31956c6a554008d8921de5dd6b4e4218bb23
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: /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 $< $@