]> git.ipfire.org Git - people/stevee/network.git/blame - Makefile.am
Rename make_parent_dir to make_parent_directory
[people/stevee/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 \
4e78b7ad 138 src/functions/functions.ipsec-pool \
5ca9dc30
MT
139 src/functions/functions.iptables \
140 src/functions/functions.ip-tunnel \
141 src/functions/functions.ipv4 \
142 src/functions/functions.ipv6 \
5ca9dc30
MT
143 src/functions/functions.list \
144 src/functions/functions.lock \
145 src/functions/functions.logging \
146 src/functions/functions.macros \
5ca9dc30
MT
147 src/functions/functions.modem \
148 src/functions/functions.phy \
149 src/functions/functions.ports \
150 src/functions/functions.ppp \
151 src/functions/functions.pppoe-server \
152 src/functions/functions.radvd \
5ca9dc30
MT
153 src/functions/functions.route \
154 src/functions/functions.routing \
155 src/functions/functions.serial \
156 src/functions/functions.service \
e9df08ad 157 src/functions/functions.settings \
5ca9dc30 158 src/functions/functions.stp \
5ca9dc30 159 src/functions/functions.sysctl \
de72bd91 160 src/functions/functions.system \
de3cecef 161 src/functions/functions.triggers \
5ca9dc30
MT
162 src/functions/functions.usb \
163 src/functions/functions.util \
164 src/functions/functions.vlan \
2da98f56 165 src/functions/functions.vpn \
3eae7bed 166 src/functions/functions.vpn-security-policies \
5ca9dc30
MT
167 src/functions/functions.wireless \
168 src/functions/functions.wpa_supplicant \
169 src/functions/functions.zone \
170 src/network-radvd-config \
171 src/dhclient-helper \
172 src/header-config \
173 src/header-port \
174 src/header-zone \
175 src/ppp/dialer \
176 src/ppp/pppoe-server
177
178dist_helpers_SCRIPTS = \
5ca9dc30
MT
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 183 src/helpers/pppd-angel \
02807ad2 184 src/helpers/wpa_supplicant
5ca9dc30 185
13a6e69f
MT
186bin_PROGRAMS = \
187 src/inetcalc
188
189src_inetcalc_SOURCES = \
190 src/inetcalc.c
191
7d2cb6d3 192dist_hooks_configs_SCRIPTS = \
9353a4e4 193 src/hooks/configs/dhcp \
7d2cb6d3 194 src/hooks/configs/ipv4-static \
b73e9d43
MT
195 src/hooks/configs/ipv6-auto \
196 src/hooks/configs/ipv6-static \
7d2cb6d3
MT
197 src/hooks/configs/pppoe-server
198
5ca9dc30
MT
199dist_hooks_ports_SCRIPTS = \
200 src/hooks/ports/batman-adv \
5ca9dc30
MT
201 src/hooks/ports/bonding \
202 src/hooks/ports/dummy \
203 src/hooks/ports/ethernet \
5ca9dc30 204 src/hooks/ports/vlan \
b8026986 205 src/hooks/ports/wireless-adhoc \
727248f0
MT
206 src/hooks/ports/wireless-ap \
207 src/hooks/ports/wireless-mesh
5ca9dc30
MT
208
209dist_hooks_zones_SCRIPTS = \
5ca9dc30 210 src/hooks/zones/6to4-tunnel \
5ca9dc30 211 src/hooks/zones/bridge \
5ca9dc30
MT
212 src/hooks/zones/modem \
213 src/hooks/zones/pppoe \
5ca9dc30
MT
214 src/hooks/zones/wireless
215
216# ------------------------------------------------------------------------------
217
218ppp_SCRIPTS = \
219 src/ppp/ip-updown
220
221CLEANFILES += \
222 src/ppp/ip-updown
223
224EXTRA_DIST += \
225 src/ppp/ip-updown.in
226
227INSTALL_DIRS += \
9c9d0585
SS
228 $(pppdir) \
229 $(logdir)
5ca9dc30
MT
230
231ppp-install-hook:
232 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up
233 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-up
234 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-down
235 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-up
236 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-down
237
238ppp-uninstall-hook:
239 rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up}
240 rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up}
241
242INSTALL_EXEC_HOOKS += ppp-install-hook
243UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook
244
245# ------------------------------------------------------------------------------
246
247if HAVE_SYSTEMD
248systemdsystemunit_DATA = \
249 src/systemd/firewall4.service \
250 src/systemd/firewall6.service \
251 src/systemd/firewall-init.service \
252 src/systemd/network-init.service \
253 src/systemd/network@.service
254
255CLEANFILES += \
256 $(systemdsystemunit_DATA)
257
258INSTALL_DIRS += \
259 $(systemdsystemunitdir)
260endif
261
262EXTRA_DIST += \
263 src/systemd/firewall4.service.in \
264 src/systemd/firewall6.service.in \
265 src/systemd/firewall-init.service.in \
266 src/systemd/network-init.service.in \
267 src/systemd/network@.service.in
268
269# ------------------------------------------------------------------------------
270
5e84cd41
MT
271systemconfig_vpndir = $(systemconfigdir)/vpn
272
273dist_systemconfig_vpn_security_policies_DATA = \
56d5efa7 274 config/vpn/security-policies/performance \
5e84cd41
MT
275 config/vpn/security-policies/system
276
277systemconfig_vpn_security_policiesdir = $(systemconfig_vpndir)/security-policies
278
279# ------------------------------------------------------------------------------
280
5ca9dc30
MT
281dist_sysctl_DATA = \
282 src/sysctl/network.conf
283
284# ------------------------------------------------------------------------------
285
bae37360
MT
286dist_bashcompletion_SCRIPTS = \
287 src/bash-completion/network
288
289# ------------------------------------------------------------------------------
290
5ca9dc30 291dist_tmpfiles_DATA = \
f9dac5a0 292 src/tmpfiles/network.conf
5ca9dc30
MT
293
294# ------------------------------------------------------------------------------
295
296if HAVE_UDEV
297dist_udev_SCRIPTS = \
298 src/udev/network-hotplug \
299 src/udev/network-hotplug-rename \
300 src/udev/network-hotplug-serial
301
302dist_udevrules_DATA = \
303 src/udev/rules.d/50-serial-whitelist.rules \
304 src/udev/rules.d/60-net.rules
305
306INSTALL_DIRS += \
307 $(udevdir) \
308 $(udevrulesdir)
309endif
310
311# ------------------------------------------------------------------------------
312
313pkgconfigdata_DATA = \
314 src/network.pc
315
316CLEANFILES += \
317 $(pkgconfigdata_DATA)
318
319EXTRA_DIST += \
320 src/network.pc.in
321
322# ------------------------------------------------------------------------------
323
324dist_macros_DATA = \
325 src/macros/DHCP \
326 src/macros/HTTP \
327 src/macros/HTTPS \
328 src/macros/WWW
329
330# ------------------------------------------------------------------------------
331
ec3fe5b7 332INSTALL_DIRS += \
de3cecef
MT
333 $(triggersdir)
334
335# ------------------------------------------------------------------------------
336
5ca9dc30 337MANPAGES = \
2b0ff832 338 man/firewall-settings.8 \
5ca9dc30 339 man/network.8 \
89c81bcf 340 man/network-color.8 \
6135a5b3 341 man/network-description.8 \
5ca9dc30 342 man/network-device.8 \
427f5ae2 343 man/network-dhcp.8 \
5ca9dc30 344 man/network-dns-server.8 \
de72bd91 345 man/network-performance-tuning.8 \
7a302fa7 346 man/network-port.8 \
5ca9dc30
MT
347 man/network-port-batman-adv.8 \
348 man/network-port-batman-adv-port.8 \
94eab754 349 man/network-quick-start.8 \
5ca9dc30 350 man/network-route.8 \
e023191b 351 man/network-route-static.8 \
2b0ff832 352 man/network-settings.8 \
5ca9dc30 353 man/network-zone.8 \
5ca9dc30 354 man/network-zone-6to4-tunnel.8 \
5ca9dc30
MT
355 man/network-zone-bridge.8 \
356 man/network-zone-config-pppoe-server.8 \
7a302fa7 357 man/network-zone-modem.8 \
2fb7ae4d
MT
358 man/network-zone-pppoe.8 \
359 man/network-zone-wireless.8
5ca9dc30
MT
360
361MANPAGES_XML = $(patsubst %.8,%.xml,$(MANPAGES))
362MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
363
364.PHONY: man
365man: $(MANPAGES) $(MANPAGES_HTML)
366
367man_MANS = \
368 $(MANPAGES)
369
370noinst_DATA += \
371 $(MANPAGES_HTML)
372
373CLEANFILES += \
374 $(man_MANS) \
375 $(MANPAGES_HTML)
376
377EXTRA_DIST += \
378 $(MANPAGES_XML) \
379 man/custom-html.xsl
380
381XSLTPROC_FLAGS = \
382 --nonet \
383 --stringparam man.output.quietly 1 \
384 --stringparam funcsynopsis.style ansi \
385 --stringparam man.th.extra1.suppress 1 \
386 --stringparam man.authors.section.enabled 1 \
387 --stringparam man.copyright.section.enabled 1
388
389XSLTPROC_COMMAND_MAN = \
390 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
391 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
392
393XSLTPROC_COMMAND_HTML = \
394 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
395
396man/%.8: man/%.xml
397 $(XSLTPROC_COMMAND_MAN)
398
399man/%.html: man/%.xml man/custom-html.xsl
400 $(XSLTPROC_COMMAND_HTML)
401
402# ------------------------------------------------------------------------------
403
404substitutions = \
405 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
406 '|PACKAGE_URL=$(PACKAGE_URL)|' \
407 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
408 '|prefix=$(prefix)|' \
409 '|exec_prefix=$(exec_prefix)|' \
410 '|sbindir=$(sbindir)|' \
c6525a63
MT
411 '|networkdir=$(networkdir)|' \
412 '|helpersdir=$(helpersdir)|'
5ca9dc30
MT
413
414SED_PROCESS = \
415 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
416 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
417 < $< > $@
418
419src/functions/functions: src/functions/functions.in Makefile
420 $(SED_PROCESS)
421
422src/ppp/ip-updown: src/ppp/ip-updown.in Makefile
423 $(SED_PROCESS)
424
425src/systemd/%: src/systemd/%.in Makefile
426 $(SED_PROCESS)
427
428src/%.pc: src/%.pc.in Makefile
429 $(SED_PROCESS)
430
431INSTALL_DIRS += \
432 $(sbindir)
433
434install-exec-hook: $(INSTALL_EXEC_HOOKS)
435
436uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
437
438# - testsuite ------------------------------------------------------------------
439
440TESTS_ENVIRONMENT = \
8744a476
MT
441 PATH=$(top_builddir)/src:$(PATH) \
442 functions=$(abs_builddir)/src/functions/functions \
443 networkdir=$(abs_srcdir)/src/functions \
444 testdir=$(top_srcdir)/test
445
446dist_check_DATA = \
ee86c73f
MT
447 test/constants.sh \
448 test/test-functions
5ca9dc30
MT
449
450dist_check_SCRIPTS = \
8744a476 451 $(TESTS)
5ca9dc30
MT
452
453TESTS = \
bb8304ec 454 test/load-library \
bb8304ec 455 test/functions/ip/ip_detect_protocol \
bb8304ec 456 test/functions/ip/ip_get_prefix \
8b0958b2 457 test/functions/ip/ip_net_is_valid \
b7fd8067 458 test/functions/ip/ip_is_valid \
b862734c 459 test/functions/ip/ip_network_is_subnet_of \
b7fd8067
MT
460 test/functions/ip/ip_prefix_is_valid \
461 test/functions/ip/ip_protocol_is_supported \
462 test/functions/ip/ip_split_prefix