]> git.ipfire.org Git - people/ms/network.git/blame - Makefile.am
network fix parameter passing when using ""
[people/ms/network.git] / Makefile.am
CommitLineData
5ca9dc30
MT
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
21ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
22AM_MAKEFLAGS = --no-print-directory
23AUTOMAKE_OPTIONS = color-tests
24
25# remove target it the command fails
26.DELETE_ON_ERROR:
27
28# keep itermediate files
29.SECONDARY:
30
bae37360 31bashcompletiondir= $(datadir)/bash-completion/completions
5ca9dc30
MT
32libexecdir = $(prefix)/lib
33pkgconfigdatadir = $(datadir)/pkgconfig
34pppdir = $(sysconfdir)/ppp
5e84cd41 35systemconfigdir = $(datadir)/network
5ca9dc30
MT
36sysctldir = $(prefix)/lib/sysctl.d
37tmpfilesdir = $(prefix)/lib/tmpfiles.d
38udevrulesdir = $(udevdir)/rules.d
39
40networkdir = $(libexecdir)/network
41helpersdir = $(networkdir)/helpers
42
43macrosdir = $(libexecdir)/firewall/macros
44
45hooksdir = $(networkdir)/hooks
7d2cb6d3 46hooks_configsdir = $(hooksdir)/configs
5ca9dc30
MT
47hooks_portsdir = $(hooksdir)/ports
48hooks_zonesdir = $(hooksdir)/zones
49
de3cecef
MT
50triggersdir = $(networkdir)/triggers
51
9c9d0585
SS
52logdir = $(localestatedir)/log/network
53
5ca9dc30
MT
54CLEANFILES =
55DISTCLEANFILES =
56EXTRA_DIST =
57INSTALL_DIRS =
58INSTALL_EXEC_HOOKS =
59UNINSTALL_EXEC_HOOKS =
60noinst_DATA =
61
e708653f
SS
62AM_CFLAGS = $(OUR_CFLAGS)
63AM_CPPFLAGS = $(OUR_CPPFLAGS)
64AM_LDFLAGS = $(OUR_LDFLAGS)
65
5ca9dc30
MT
66DISTCHECK_CONFIGURE_FLAGS = \
67 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \
68 --with-udevdir=$$dc_install_base/$(udevdir)
69
70install-directories-hook:
71 $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
72
73INSTALL_EXEC_HOOKS += \
74 install-directories-hook
75
76# ------------------------------------------------------------------------------
77
78AM_V_XSLT = $(AM_V_XSLT_$(V))
79AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
80AM_V_XSLT_0 = @echo " XSLT " $@;
81
82# ------------------------------------------------------------------------------
83
84dist_doc_DATA = \
1337eee2 85 README \
dd46582c 86 docs/CODING_STYLE \
1337eee2 87 docs/COPYING
5ca9dc30
MT
88
89dist_sbin_SCRIPTS = \
90 src/dhclient-script \
91 src/firewall-config \
92 src/firewall4 \
93 src/firewall6 \
94 src/network
95
96network_SCRIPTS = \
97 src/functions/functions
98
99CLEANFILES += \
100 src/functions/functions
101
102EXTRA_DIST += \
103 src/functions/functions.in
104
105dist_network_SCRIPTS = \
5ca9dc30
MT
106 src/functions/functions.at \
107 src/functions/functions.auth \
108 src/functions/functions.batman-adv \
109 src/functions/functions.bonding \
110 src/functions/functions.bridge \
111 src/functions/functions.cli \
112 src/functions/functions.cli.firewall \
113 src/functions/functions.colors \
114 src/functions/functions.config \
115 src/functions/functions.conntrack \
116 src/functions/functions.constants \
117 src/functions/functions.constants-firewall \
118 src/functions/functions.db \
5ccc7299 119 src/functions/functions.description \
5ca9dc30
MT
120 src/functions/functions.device \
121 src/functions/functions.dhclient \
122 src/functions/functions.dhcpd \
123 src/functions/functions.distro \
124 src/functions/functions.dns \
125 src/functions/functions.dummy \
e524986c 126 src/functions/functions.editor \
5ca9dc30
MT
127 src/functions/functions.firewall \
128 src/functions/functions.firewall-policy \
129 src/functions/functions.firewall-zones \
130 src/functions/functions.he \
131 src/functions/functions.hook \
132 src/functions/functions.hostapd \
b8026986 133 src/functions/functions.hotplug \
5ca9dc30 134 src/functions/functions.http \
de72bd91 135 src/functions/functions.interrupts \
5ca9dc30 136 src/functions/functions.ip \
be844b7b 137 src/functions/functions.ipsec \
5ca9dc30
MT
138 src/functions/functions.iptables \
139 src/functions/functions.ip-tunnel \
140 src/functions/functions.ipv4 \
141 src/functions/functions.ipv6 \
5ca9dc30
MT
142 src/functions/functions.list \
143 src/functions/functions.lock \
144 src/functions/functions.logging \
145 src/functions/functions.macros \
5ca9dc30
MT
146 src/functions/functions.modem \
147 src/functions/functions.phy \
148 src/functions/functions.ports \
149 src/functions/functions.ppp \
150 src/functions/functions.pppoe-server \
151 src/functions/functions.radvd \
5ca9dc30
MT
152 src/functions/functions.route \
153 src/functions/functions.routing \
154 src/functions/functions.serial \
155 src/functions/functions.service \
e9df08ad 156 src/functions/functions.settings \
5ca9dc30 157 src/functions/functions.stp \
5ca9dc30 158 src/functions/functions.sysctl \
de72bd91 159 src/functions/functions.system \
de3cecef 160 src/functions/functions.triggers \
5ca9dc30
MT
161 src/functions/functions.usb \
162 src/functions/functions.util \
163 src/functions/functions.vlan \
2da98f56 164 src/functions/functions.vpn \
3eae7bed 165 src/functions/functions.vpn-security-policies \
5ca9dc30
MT
166 src/functions/functions.wireless \
167 src/functions/functions.wpa_supplicant \
168 src/functions/functions.zone \
169 src/network-radvd-config \
170 src/dhclient-helper \
171 src/header-config \
172 src/header-port \
173 src/header-zone \
174 src/ppp/dialer \
175 src/ppp/pppoe-server
176
177dist_helpers_SCRIPTS = \
5ca9dc30
MT
178 src/helpers/bridge-stp \
179 src/helpers/dhcpd-config-helper \
180 src/helpers/firewall-kernel-init \
181 src/helpers/hostapd-config-helper \
67baa452 182 src/helpers/ipsec-updown \
5ca9dc30
MT
183 src/helpers/pppd-angel \
184 src/helpers/wpa_supplicant \
185 src/helpers/wpa_supplicant-config-helper
186
13a6e69f
MT
187bin_PROGRAMS = \
188 src/inetcalc
189
190src_inetcalc_SOURCES = \
191 src/inetcalc.c
192
d837cc79 193bridge-stp-install-hook: bridge-stp-uninstall-hook
5ca9dc30
MT
194 ln -svf --relative $(DESTDIR)$(helpersdir)/bridge-stp $(DESTDIR)$(sbindir)/
195
196bridge-stp-uninstall-hook:
197 rm -f $(DESTDIR)$(sbindir)/bridge-stp
198
199INSTALL_EXEC_HOOKS += bridge-stp-install-hook
200UNINSTALL_EXEC_HOOKS += bridge-stp-uninstall-hook
201
7d2cb6d3 202dist_hooks_configs_SCRIPTS = \
9353a4e4 203 src/hooks/configs/dhcp \
7d2cb6d3 204 src/hooks/configs/ipv4-static \
b73e9d43
MT
205 src/hooks/configs/ipv6-auto \
206 src/hooks/configs/ipv6-static \
7d2cb6d3
MT
207 src/hooks/configs/pppoe-server
208
5ca9dc30
MT
209dist_hooks_ports_SCRIPTS = \
210 src/hooks/ports/batman-adv \
5ca9dc30
MT
211 src/hooks/ports/bonding \
212 src/hooks/ports/dummy \
213 src/hooks/ports/ethernet \
5ca9dc30 214 src/hooks/ports/vlan \
b8026986 215 src/hooks/ports/wireless-adhoc \
727248f0
MT
216 src/hooks/ports/wireless-ap \
217 src/hooks/ports/wireless-mesh
5ca9dc30
MT
218
219dist_hooks_zones_SCRIPTS = \
5ca9dc30 220 src/hooks/zones/6to4-tunnel \
5ca9dc30 221 src/hooks/zones/bridge \
5ca9dc30
MT
222 src/hooks/zones/modem \
223 src/hooks/zones/pppoe \
5ca9dc30
MT
224 src/hooks/zones/wireless
225
226# ------------------------------------------------------------------------------
227
228ppp_SCRIPTS = \
229 src/ppp/ip-updown
230
231CLEANFILES += \
232 src/ppp/ip-updown
233
234EXTRA_DIST += \
235 src/ppp/ip-updown.in
236
237INSTALL_DIRS += \
9c9d0585
SS
238 $(pppdir) \
239 $(logdir)
5ca9dc30
MT
240
241ppp-install-hook:
242 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up
243 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-up
244 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-down
245 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-up
246 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-down
247
248ppp-uninstall-hook:
249 rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up}
250 rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up}
251
252INSTALL_EXEC_HOOKS += ppp-install-hook
253UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook
254
255# ------------------------------------------------------------------------------
256
257if HAVE_SYSTEMD
258systemdsystemunit_DATA = \
259 src/systemd/firewall4.service \
260 src/systemd/firewall6.service \
261 src/systemd/firewall-init.service \
262 src/systemd/network-init.service \
263 src/systemd/network@.service
264
265CLEANFILES += \
266 $(systemdsystemunit_DATA)
267
268INSTALL_DIRS += \
269 $(systemdsystemunitdir)
270endif
271
272EXTRA_DIST += \
273 src/systemd/firewall4.service.in \
274 src/systemd/firewall6.service.in \
275 src/systemd/firewall-init.service.in \
276 src/systemd/network-init.service.in \
277 src/systemd/network@.service.in
278
279# ------------------------------------------------------------------------------
280
5e84cd41
MT
281systemconfig_vpndir = $(systemconfigdir)/vpn
282
283dist_systemconfig_vpn_security_policies_DATA = \
56d5efa7 284 config/vpn/security-policies/performance \
5e84cd41
MT
285 config/vpn/security-policies/system
286
287systemconfig_vpn_security_policiesdir = $(systemconfig_vpndir)/security-policies
288
289# ------------------------------------------------------------------------------
290
5ca9dc30
MT
291dist_sysctl_DATA = \
292 src/sysctl/network.conf
293
294# ------------------------------------------------------------------------------
295
bae37360
MT
296dist_bashcompletion_SCRIPTS = \
297 src/bash-completion/network
298
299# ------------------------------------------------------------------------------
300
5ca9dc30 301dist_tmpfiles_DATA = \
f9dac5a0 302 src/tmpfiles/network.conf
5ca9dc30
MT
303
304# ------------------------------------------------------------------------------
305
306if HAVE_UDEV
307dist_udev_SCRIPTS = \
308 src/udev/network-hotplug \
309 src/udev/network-hotplug-rename \
310 src/udev/network-hotplug-serial
311
312dist_udevrules_DATA = \
313 src/udev/rules.d/50-serial-whitelist.rules \
314 src/udev/rules.d/60-net.rules
315
316INSTALL_DIRS += \
317 $(udevdir) \
318 $(udevrulesdir)
319endif
320
321# ------------------------------------------------------------------------------
322
323pkgconfigdata_DATA = \
324 src/network.pc
325
326CLEANFILES += \
327 $(pkgconfigdata_DATA)
328
329EXTRA_DIST += \
330 src/network.pc.in
331
332# ------------------------------------------------------------------------------
333
334dist_macros_DATA = \
335 src/macros/DHCP \
336 src/macros/HTTP \
337 src/macros/HTTPS \
338 src/macros/WWW
339
340# ------------------------------------------------------------------------------
341
ec3fe5b7 342INSTALL_DIRS += \
de3cecef
MT
343 $(triggersdir)
344
345# ------------------------------------------------------------------------------
346
5ca9dc30 347MANPAGES = \
2b0ff832 348 man/firewall-settings.8 \
5ca9dc30 349 man/network.8 \
89c81bcf 350 man/network-color.8 \
6135a5b3 351 man/network-description.8 \
5ca9dc30 352 man/network-device.8 \
427f5ae2 353 man/network-dhcp.8 \
5ca9dc30 354 man/network-dns-server.8 \
de72bd91 355 man/network-performance-tuning.8 \
7a302fa7 356 man/network-port.8 \
5ca9dc30
MT
357 man/network-port-batman-adv.8 \
358 man/network-port-batman-adv-port.8 \
94eab754 359 man/network-quick-start.8 \
5ca9dc30 360 man/network-route.8 \
e023191b 361 man/network-route-static.8 \
2b0ff832 362 man/network-settings.8 \
5ca9dc30 363 man/network-zone.8 \
5ca9dc30 364 man/network-zone-6to4-tunnel.8 \
5ca9dc30
MT
365 man/network-zone-bridge.8 \
366 man/network-zone-config-pppoe-server.8 \
7a302fa7 367 man/network-zone-modem.8 \
2fb7ae4d
MT
368 man/network-zone-pppoe.8 \
369 man/network-zone-wireless.8
5ca9dc30
MT
370
371MANPAGES_XML = $(patsubst %.8,%.xml,$(MANPAGES))
372MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
373
374.PHONY: man
375man: $(MANPAGES) $(MANPAGES_HTML)
376
377man_MANS = \
378 $(MANPAGES)
379
380noinst_DATA += \
381 $(MANPAGES_HTML)
382
383CLEANFILES += \
384 $(man_MANS) \
385 $(MANPAGES_HTML)
386
387EXTRA_DIST += \
388 $(MANPAGES_XML) \
389 man/custom-html.xsl
390
391XSLTPROC_FLAGS = \
392 --nonet \
393 --stringparam man.output.quietly 1 \
394 --stringparam funcsynopsis.style ansi \
395 --stringparam man.th.extra1.suppress 1 \
396 --stringparam man.authors.section.enabled 1 \
397 --stringparam man.copyright.section.enabled 1
398
399XSLTPROC_COMMAND_MAN = \
400 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
401 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
402
403XSLTPROC_COMMAND_HTML = \
404 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
405
406man/%.8: man/%.xml
407 $(XSLTPROC_COMMAND_MAN)
408
409man/%.html: man/%.xml man/custom-html.xsl
410 $(XSLTPROC_COMMAND_HTML)
411
412# ------------------------------------------------------------------------------
413
414substitutions = \
415 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
416 '|PACKAGE_URL=$(PACKAGE_URL)|' \
417 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
418 '|prefix=$(prefix)|' \
419 '|exec_prefix=$(exec_prefix)|' \
420 '|sbindir=$(sbindir)|' \
c6525a63
MT
421 '|networkdir=$(networkdir)|' \
422 '|helpersdir=$(helpersdir)|'
5ca9dc30
MT
423
424SED_PROCESS = \
425 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
426 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
427 < $< > $@
428
429src/functions/functions: src/functions/functions.in Makefile
430 $(SED_PROCESS)
431
432src/ppp/ip-updown: src/ppp/ip-updown.in Makefile
433 $(SED_PROCESS)
434
435src/systemd/%: src/systemd/%.in Makefile
436 $(SED_PROCESS)
437
438src/%.pc: src/%.pc.in Makefile
439 $(SED_PROCESS)
440
441INSTALL_DIRS += \
442 $(sbindir)
443
444install-exec-hook: $(INSTALL_EXEC_HOOKS)
445
446uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
447
448# - testsuite ------------------------------------------------------------------
449
450TESTS_ENVIRONMENT = \
8744a476
MT
451 PATH=$(top_builddir)/src:$(PATH) \
452 functions=$(abs_builddir)/src/functions/functions \
453 networkdir=$(abs_srcdir)/src/functions \
454 testdir=$(top_srcdir)/test
455
456dist_check_DATA = \
ee86c73f
MT
457 test/constants.sh \
458 test/test-functions
5ca9dc30
MT
459
460dist_check_SCRIPTS = \
8744a476 461 $(TESTS)
5ca9dc30
MT
462
463TESTS = \
bb8304ec 464 test/load-library \
bb8304ec 465 test/functions/ip/ip_detect_protocol \
bb8304ec 466 test/functions/ip/ip_get_prefix \
8b0958b2 467 test/functions/ip/ip_net_is_valid \
b7fd8067 468 test/functions/ip/ip_is_valid \
b862734c 469 test/functions/ip/ip_network_is_subnet_of \
b7fd8067
MT
470 test/functions/ip/ip_prefix_is_valid \
471 test/functions/ip/ip_protocol_is_supported \
472 test/functions/ip/ip_split_prefix