]> git.ipfire.org Git - oddments/collecty.git/blob - Makefile.am
psi: Add graph template
[oddments/collecty.git] / Makefile.am
1 ###############################################################################
2 # #
3 # collecty - The IPFire statictics collection daemon #
4 # Copyright (C) 2015 collecty development team #
5 # #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
18 # #
19 ###############################################################################
20
21 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
22 AM_MAKEFLAGS = --no-print-directory
23 AUTOMAKE_OPTIONS = color-tests
24
25 # remove target it the command fails
26 .DELETE_ON_ERROR:
27
28 # keep itermediate files
29 .SECONDARY:
30
31 SUBDIRS = . po
32
33 pythondir = $(pyexecdir)
34
35 # Dirs of external packages
36 dbuspolicydir=@dbuspolicydir@
37 dbussystemservicedir=@dbussystemservicedir@
38
39 CLEANFILES =
40 DISTCLEANFILES =
41 EXTRA_DIST =
42 INSTALL_DIRS =
43 noinst_DATA =
44
45 @INTLTOOL_POLICY_RULE@
46
47 .PHONY: update-po
48 update-po:
49 $(MAKE) -C po update-po
50
51 DISTCHECK_CONFIGURE_FLAGS = \
52 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
53 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
54 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
55
56 # ------------------------------------------------------------------------------
57
58 AM_V_XSLT = $(AM_V_XSLT_$(V))
59 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
60 AM_V_XSLT_0 = @echo " XSLT " $@;
61
62 # ------------------------------------------------------------------------------
63
64 dist_doc_DATA = \
65 COPYING
66
67 # ------------------------------------------------------------------------------
68
69 dist_bin_SCRIPTS = \
70 src/collectyd \
71 src/collecty-client
72
73 collecty_PYTHON = \
74 src/collecty/__init__.py \
75 src/collecty/__version__.py \
76 src/collecty/bus.py \
77 src/collecty/client.py \
78 src/collecty/colours.py \
79 src/collecty/constants.py \
80 src/collecty/daemon.py \
81 src/collecty/errors.py \
82 src/collecty/i18n.py \
83 src/collecty/locales.py \
84 src/collecty/logger.py \
85 src/collecty/util.py
86
87 collectydir = $(pythondir)/collecty
88
89 collectyplugins_PYTHON = \
90 src/collecty/plugins/base.py \
91 src/collecty/plugins/contextswitches.py \
92 src/collecty/plugins/conntrack.py \
93 src/collecty/plugins/cpufreq.py \
94 src/collecty/plugins/df.py \
95 src/collecty/plugins/disk.py \
96 src/collecty/plugins/entropy.py \
97 src/collecty/plugins/__init__.py \
98 src/collecty/plugins/interface.py \
99 src/collecty/plugins/interrupts.py \
100 src/collecty/plugins/ipfrag.py \
101 src/collecty/plugins/latency.py \
102 src/collecty/plugins/loadavg.py \
103 src/collecty/plugins/memory.py \
104 src/collecty/plugins/processor.py \
105 src/collecty/plugins/sensors.py
106
107 collectypluginsdir = $(collectydir)/plugins
108
109 pkgpyexec_LTLIBRARIES = \
110 _collecty.la
111
112 _collecty_la_SOURCES = \
113 src/_collecty/_collectymodule.c \
114 src/_collecty/_collectymodule.h \
115 src/_collecty/blockdev.c \
116 src/_collecty/ping.c \
117 src/_collecty/sensors.c \
118 src/_collecty/utils.c
119
120 _collecty_la_CFLAGS = \
121 $(AM_CFLAGS) \
122 $(LIBATASMART_CFLAGS) \
123 $(OPING_CFLAGS) \
124 $(PYTHON_CFLAGS)
125
126 _collecty_la_LDFLAGS = \
127 $(AM_LDFLAGS) \
128 -shared \
129 -module \
130 -avoid-version
131
132 _collecty_la_LIBADD = \
133 $(LIBATASMART_LIBS) \
134 $(OPING_LIBS) \
135 $(PYTHON_LIBS) \
136 $(SENSORS_LIBS)
137
138 dist_dbuspolicy_DATA = \
139 src/dbus/org.ipfire.collecty1.conf
140
141 dist_dbussystemservice_DATA = \
142 src/dbus/org.ipfire.collecty1.service
143
144 systemdsystemunit_DATA = \
145 src/systemd/collecty.service
146
147 dist_systemdsystemunit_DATA = \
148 src/systemd/org.ipfire.collecty1.busname
149
150 EXTRA_DIST += \
151 src/systemd/collecty.service.in
152
153 CLEANFILES += \
154 src/systemd/collecty.service
155
156 # ------------------------------------------------------------------------------
157
158 .PHONY: man
159 man: $(MANPAGES) $(MANPAGES_HTML)
160
161 if ENABLE_MANPAGES
162 MANPAGES = \
163 man/collectyd.1
164
165 MANPAGES_XML = $(patsubst %.1,%.xml,$(patsubst %.5,%.xml,$(MANPAGES)))
166 MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
167
168 man_MANS = \
169 $(MANPAGES)
170
171 noinst_DATA += \
172 $(MANPAGES_HTML)
173
174 CLEANFILES += \
175 $(man_MANS) \
176 $(MANPAGES_HTML)
177
178 EXTRA_DIST += \
179 $(MANPAGES_XML) \
180 man/custom-html.xsl
181
182 XSLTPROC_FLAGS = \
183 --nonet \
184 --stringparam man.output.quietly 1 \
185 --stringparam funcsynopsis.style ansi \
186 --stringparam man.th.extra1.suppress 1 \
187 --stringparam man.authors.section.enabled 1 \
188 --stringparam man.copyright.section.enabled 1
189
190 XSLTPROC_COMMAND_MAN = \
191 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
192 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
193
194 XSLTPROC_COMMAND_HTML = \
195 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
196
197 man/%.1: man/%.xml
198 $(XSLTPROC_COMMAND_MAN)
199
200 man/%.5: man/%.xml
201 $(XSLTPROC_COMMAND_MAN)
202
203 man/%.html: man/%.xml man/custom-html.xsl
204 $(XSLTPROC_COMMAND_HTML)
205
206 endif
207
208 # ------------------------------------------------------------------------------
209
210 substitutions = \
211 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
212 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
213 '|configsdir=$(configsdir)|' \
214 '|bindir=$(bindir)|'
215
216 SED_PROCESS = \
217 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
218 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
219 < $< > $@
220
221 src/systemd/%: src/systemd/%.in Makefile
222 $(SED_PROCESS)