summaryrefslogtreecommitdiff
path: root/Makefile
blob: c0021ed2a2b03eef02ee0efb3f9c9e98139288fc (plain)
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
PACKAGE = collectd-systemd
VERSION = 20170820

include $(dir $(lastword $(MAKEFILE_LIST)))/config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk

files.src.gen += LICENSE
files.out.all += systemd.conf
#files.out.all += systemd.types.db
#files.out.all += systemd.py

files.sys.all += $(collectd_confdir)/systemd.conf
files.sys.all += $(collectd_typesdir)/systemd.types.db
files.sys.all += $(collectd_pythondir)/systemd.py

$(outdir)/%: $(srcdir)/%.in
	sed $(foreach v,$(patsubst $(var.)%,%,$(filter $(var.)%,$^)), -e 's|@$(v)@|$($(v))|g' ) < $< > $@

$(outdir)/systemd.conf: $(var.)collectd_typesdir
$(outdir)/systemd.conf: $(var.)collectd_pythondir

$(DESTDIR)$(collectd_confdir)/systemd.conf: $(outdir)/systemd.conf
	$(INSTALL_DATA) -DT $< $@
$(DESTDIR)$(collectd_typesdir)/systemd.types.db: $(srcdir)/systemd.types.db
	$(INSTALL_DATA) -DT $< $@
$(DESTDIR)$(collectd_pythondir)/systemd.py: $(srcdir)/systemd.py
	$(INSTALL_PROGRAM) -DT $< $@

$(srcdir)/LICENSE:
	wget -O $@ https://www.gnu.org/licenses/gpl-2.0.txt

.SECONDARY:
.DELETE_ON_ERROR:

include $(topsrcdir)/build-aux/Makefile.tail.mk