]> git.ipfire.org Git - people/ms/network.git/blob - Makefile.am
Use autotools.
[people/ms/network.git] / Makefile.am
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2012-2013 IPFire Network 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 libexecdir = $(prefix)/lib
32 pkgconfigdatadir = $(datadir)/pkgconfig
33 pppdir = $(sysconfdir)/ppp
34 sysctldir = $(prefix)/lib/sysctl.d
35 tmpfilesdir = $(prefix)/lib/tmpfiles.d
36 udevrulesdir = $(udevdir)/rules.d
37
38 networkdir = $(libexecdir)/network
39 helpersdir = $(networkdir)/helpers
40
41 macrosdir = $(libexecdir)/firewall/macros
42
43 hooksdir = $(networkdir)/hooks
44 hooks_portsdir = $(hooksdir)/ports
45 hooks_zonesdir = $(hooksdir)/zones
46
47 CLEANFILES =
48 DISTCLEANFILES =
49 EXTRA_DIST =
50 INSTALL_DIRS =
51 INSTALL_EXEC_HOOKS =
52 UNINSTALL_EXEC_HOOKS =
53 noinst_DATA =
54
55 DISTCHECK_CONFIGURE_FLAGS = \
56 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \
57 --with-udevdir=$$dc_install_base/$(udevdir)
58
59 install-directories-hook:
60 $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
61
62 INSTALL_EXEC_HOOKS += \
63 install-directories-hook
64
65 # ------------------------------------------------------------------------------
66
67 AM_V_XSLT = $(AM_V_XSLT_$(V))
68 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
69 AM_V_XSLT_0 = @echo " XSLT " $@;
70
71 # ------------------------------------------------------------------------------
72
73 dist_doc_DATA = \
74 README
75
76 dist_sbin_SCRIPTS = \
77 src/dhclient-script \
78 src/firewall-config \
79 src/firewall4 \
80 src/firewall6 \
81 src/network
82
83 network_SCRIPTS = \
84 src/functions/functions
85
86 CLEANFILES += \
87 src/functions/functions
88
89 EXTRA_DIST += \
90 src/functions/functions.in
91
92 dist_network_SCRIPTS = \
93 src/functions/functions.aiccu \
94 src/functions/functions.at \
95 src/functions/functions.auth \
96 src/functions/functions.batman-adv \
97 src/functions/functions.bonding \
98 src/functions/functions.bridge \
99 src/functions/functions.cli \
100 src/functions/functions.cli.firewall \
101 src/functions/functions.colors \
102 src/functions/functions.config \
103 src/functions/functions.conntrack \
104 src/functions/functions.constants \
105 src/functions/functions.constants-firewall \
106 src/functions/functions.db \
107 src/functions/functions.device \
108 src/functions/functions.dhclient \
109 src/functions/functions.dhcpd \
110 src/functions/functions.distro \
111 src/functions/functions.dns \
112 src/functions/functions.dummy \
113 src/functions/functions.ethernet \
114 src/functions/functions.firewall \
115 src/functions/functions.firewall-policy \
116 src/functions/functions.firewall-zones \
117 src/functions/functions.he \
118 src/functions/functions.hook \
119 src/functions/functions.hostapd \
120 src/functions/functions.http \
121 src/functions/functions.ip \
122 src/functions/functions.iptables \
123 src/functions/functions.ip-tunnel \
124 src/functions/functions.ipv4 \
125 src/functions/functions.ipv6 \
126 src/functions/functions.isdn \
127 src/functions/functions.list \
128 src/functions/functions.lock \
129 src/functions/functions.logging \
130 src/functions/functions.macros \
131 src/functions/functions.macvlan \
132 src/functions/functions.modem \
133 src/functions/functions.phy \
134 src/functions/functions.ports \
135 src/functions/functions.ppp \
136 src/functions/functions.pppoe-server \
137 src/functions/functions.radvd \
138 src/functions/functions.red \
139 src/functions/functions.route \
140 src/functions/functions.routing \
141 src/functions/functions.serial \
142 src/functions/functions.service \
143 src/functions/functions.stp \
144 src/functions/functions.switch \
145 src/functions/functions.sysctl \
146 src/functions/functions.teredo \
147 src/functions/functions.usb \
148 src/functions/functions.util \
149 src/functions/functions.vlan \
150 src/functions/functions.wireless \
151 src/functions/functions.wpa_supplicant \
152 src/functions/functions.zone \
153 src/network-radvd-config \
154 src/dhclient-helper \
155 src/header-config \
156 src/header-port \
157 src/header-zone \
158 src/ppp/dialer \
159 src/ppp/pppoe-server
160
161 dist_helpers_SCRIPTS = \
162 src/helpers/aiccu-config-helper \
163 src/helpers/bridge-stp \
164 src/helpers/dhcpd-config-helper \
165 src/helpers/firewall-kernel-init \
166 src/helpers/hostapd-config-helper \
167 src/helpers/miredo-config-helper \
168 src/helpers/miredo-helper \
169 src/helpers/pppd-angel \
170 src/helpers/wpa_supplicant \
171 src/helpers/wpa_supplicant-config-helper
172
173 bridge-stp-install-hook:
174 ln -svf --relative $(DESTDIR)$(helpersdir)/bridge-stp $(DESTDIR)$(sbindir)/
175
176 bridge-stp-uninstall-hook:
177 rm -f $(DESTDIR)$(sbindir)/bridge-stp
178
179 INSTALL_EXEC_HOOKS += bridge-stp-install-hook
180 UNINSTALL_EXEC_HOOKS += bridge-stp-uninstall-hook
181
182 dist_hooks_ports_SCRIPTS = \
183 src/hooks/ports/batman-adv \
184 src/hooks/ports/batman-adv-port \
185 src/hooks/ports/bonding \
186 src/hooks/ports/dummy \
187 src/hooks/ports/ethernet \
188 src/hooks/ports/macvlan \
189 src/hooks/ports/vlan \
190 src/hooks/ports/wireless-ap
191
192 dist_hooks_zones_SCRIPTS = \
193 src/hooks/zones/6rd \
194 src/hooks/zones/6to4-tunnel \
195 src/hooks/zones/aiccu \
196 src/hooks/zones/batman-adv \
197 src/hooks/zones/bridge \
198 src/hooks/zones/isdn \
199 src/hooks/zones/isdn-server \
200 src/hooks/zones/modem \
201 src/hooks/zones/pppoe \
202 src/hooks/zones/pptp \
203 src/hooks/zones/switch \
204 src/hooks/zones/teredo \
205 src/hooks/zones/wireless
206
207 # ------------------------------------------------------------------------------
208
209 ppp_SCRIPTS = \
210 src/ppp/ip-updown
211
212 CLEANFILES += \
213 src/ppp/ip-updown
214
215 EXTRA_DIST += \
216 src/ppp/ip-updown.in
217
218 INSTALL_DIRS += \
219 $(pppdir)
220
221 ppp-install-hook:
222 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up
223 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-up
224 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-down
225 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-up
226 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-down
227
228 ppp-uninstall-hook:
229 rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up}
230 rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up}
231
232 INSTALL_EXEC_HOOKS += ppp-install-hook
233 UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook
234
235 # ------------------------------------------------------------------------------
236
237 if HAVE_SYSTEMD
238 systemdsystemunit_DATA = \
239 src/systemd/firewall4.service \
240 src/systemd/firewall6.service \
241 src/systemd/firewall-init.service \
242 src/systemd/network-init.service \
243 src/systemd/network@.service
244
245 CLEANFILES += \
246 $(systemdsystemunit_DATA)
247
248 INSTALL_DIRS += \
249 $(systemdsystemunitdir)
250 endif
251
252 EXTRA_DIST += \
253 src/systemd/firewall4.service.in \
254 src/systemd/firewall6.service.in \
255 src/systemd/firewall-init.service.in \
256 src/systemd/network-init.service.in \
257 src/systemd/network@.service.in
258
259 # ------------------------------------------------------------------------------
260
261 dist_sysctl_DATA = \
262 src/sysctl/network.conf
263
264 # ------------------------------------------------------------------------------
265
266 dist_tmpfiles_DATA = \
267 src/tmpfiles/network
268
269 # ------------------------------------------------------------------------------
270
271 if HAVE_UDEV
272 dist_udev_SCRIPTS = \
273 src/udev/network-hotplug \
274 src/udev/network-hotplug-rename \
275 src/udev/network-hotplug-serial
276
277 dist_udevrules_DATA = \
278 src/udev/rules.d/50-serial-whitelist.rules \
279 src/udev/rules.d/60-net.rules
280
281 INSTALL_DIRS += \
282 $(udevdir) \
283 $(udevrulesdir)
284 endif
285
286 # ------------------------------------------------------------------------------
287
288 pkgconfigdata_DATA = \
289 src/network.pc
290
291 CLEANFILES += \
292 $(pkgconfigdata_DATA)
293
294 EXTRA_DIST += \
295 src/network.pc.in
296
297 # ------------------------------------------------------------------------------
298
299 dist_macros_DATA = \
300 src/macros/DHCP \
301 src/macros/HTTP \
302 src/macros/HTTPS \
303 src/macros/WWW
304
305 # ------------------------------------------------------------------------------
306
307 MANPAGES = \
308 man/firewall-config.8 \
309 man/network.8 \
310 man/network-config.8 \
311 man/network-device.8 \
312 man/network-dns-server.8 \
313 man/network-port-batman-adv.8 \
314 man/network-port-batman-adv-port.8 \
315 man/network-route.8 \
316 man/network-zone.8 \
317 man/network-zone-6rd.8 \
318 man/network-zone-6to4-tunnel.8 \
319 man/network-zone-aiccu.8 \
320 man/network-zone-bridge.8 \
321 man/network-zone-config-pppoe-server.8 \
322 man/network-zone-pppoe.8 \
323 man/network-zone-pptp.8
324
325 MANPAGES_XML = $(patsubst %.8,%.xml,$(MANPAGES))
326 MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
327
328 .PHONY: man
329 man: $(MANPAGES) $(MANPAGES_HTML)
330
331 man_MANS = \
332 $(MANPAGES)
333
334 noinst_DATA += \
335 $(MANPAGES_HTML)
336
337 CLEANFILES += \
338 $(man_MANS) \
339 $(MANPAGES_HTML)
340
341 EXTRA_DIST += \
342 $(MANPAGES_XML) \
343 man/custom-html.xsl
344
345 XSLTPROC_FLAGS = \
346 --nonet \
347 --stringparam man.output.quietly 1 \
348 --stringparam funcsynopsis.style ansi \
349 --stringparam man.th.extra1.suppress 1 \
350 --stringparam man.authors.section.enabled 1 \
351 --stringparam man.copyright.section.enabled 1
352
353 XSLTPROC_COMMAND_MAN = \
354 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
355 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
356
357 XSLTPROC_COMMAND_HTML = \
358 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
359
360 man/%.8: man/%.xml
361 $(XSLTPROC_COMMAND_MAN)
362
363 man/%.html: man/%.xml man/custom-html.xsl
364 $(XSLTPROC_COMMAND_HTML)
365
366 # ------------------------------------------------------------------------------
367
368 substitutions = \
369 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
370 '|PACKAGE_URL=$(PACKAGE_URL)|' \
371 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
372 '|prefix=$(prefix)|' \
373 '|exec_prefix=$(exec_prefix)|' \
374 '|sbindir=$(sbindir)|' \
375 '|networkdir=$(networkdir)|'
376
377 SED_PROCESS = \
378 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
379 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
380 < $< > $@
381
382 src/functions/functions: src/functions/functions.in Makefile
383 $(SED_PROCESS)
384
385 src/ppp/ip-updown: src/ppp/ip-updown.in Makefile
386 $(SED_PROCESS)
387
388 src/systemd/%: src/systemd/%.in Makefile
389 $(SED_PROCESS)
390
391 src/%.pc: src/%.pc.in Makefile
392 $(SED_PROCESS)
393
394 INSTALL_DIRS += \
395 $(sbindir)
396
397 install-exec-hook: $(INSTALL_EXEC_HOOKS)
398
399 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
400
401 # - testsuite ------------------------------------------------------------------
402
403 TESTS_ENVIRONMENT = \
404 topdir="$(shell pwd)" \
405 networkdir="$(top_srcdir)/src/functions"
406
407 dist_check_SCRIPTS = \
408 test/load-library
409
410 TESTS = \
411 test/load-library