1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2012-2013 IPFire Network Development Team #
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. #
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. #
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/>. #
19 ###############################################################################
21 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
22 AM_MAKEFLAGS = --no-print-directory
23 AUTOMAKE_OPTIONS = color-tests
25 # remove target it the command fails
28 # keep itermediate files
31 configdir = $(sysconfdir)/network
32 bashcompletiondir= $(datadir)/bash-completion/completions
33 libexecdir = $(prefix)/lib
34 pkgconfigdir = $(libdir)/pkgconfig
35 pppdir = $(sysconfdir)/ppp
36 systemconfigdir = $(datadir)/network
37 sysctldir = $(prefix)/lib/sysctl.d
38 tmpfilesdir = $(prefix)/lib/tmpfiles.d
39 udevrulesdir = $(udevdir)/rules.d
41 networkdir = $(libexecdir)/network
42 helpersdir = $(networkdir)/helpers
44 macrosdir = $(libexecdir)/firewall/macros
46 hooksdir = $(networkdir)/hooks
47 hooks_configsdir = $(hooksdir)/configs
48 hooks_portsdir = $(hooksdir)/ports
49 hooks_zonesdir = $(hooksdir)/zones
51 triggersdir = $(networkdir)/triggers
53 logdir = $(localestatedir)/log/network
54 utildir = $(networkdir)
61 UNINSTALL_EXEC_HOOKS =
66 -include $(top_builddir)/config.h \
67 -I${top_srcdir}/src/libnetwork
80 DISTCHECK_CONFIGURE_FLAGS = \
81 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \
82 --with-udevdir=$$dc_install_base/$(udevdir)
84 install-directories-hook:
85 $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
87 INSTALL_EXEC_HOOKS += \
88 install-directories-hook
90 # ------------------------------------------------------------------------------
92 AM_V_DOWNLOAD = $(AM_V_DOWNLOAD_$(V))
93 AM_V_DOWNLOAD_ = $(AM_V_DOWNLOAD_$(AM_DEFAULT_VERBOSITY))
94 AM_V_DOWNLOAD_0 = @echo " LOAD " $@;
96 AM_V_NITSI = $(AM_V_NITSI_$(V))
97 AM_V_NITSI_ = $(AM_V_NITSI_$(AM_DEFAULT_VERBOSITY))
98 AM_V_NITSI_0 = @echo " NITSI " $@;
100 AM_V_XSLT = $(AM_V_XSLT_$(V))
101 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
102 AM_V_XSLT_0 = @echo " XSLT " $@;
104 # ------------------------------------------------------------------------------
111 dist_sbin_SCRIPTS = \
112 src/dhclient-script \
113 src/firewall-config \
119 src/functions/functions
122 src/functions/functions
125 src/functions/functions.in
127 dist_network_DATA = \
128 src/functions/functions.at \
129 src/functions/functions.auth \
130 src/functions/functions.bonding \
131 src/functions/functions.bridge \
132 src/functions/functions.cli \
133 src/functions/functions.cli.firewall \
134 src/functions/functions.colors \
135 src/functions/functions.config \
136 src/functions/functions.conntrack \
137 src/functions/functions.constants \
138 src/functions/functions.constants-firewall \
139 src/functions/functions.db \
140 src/functions/functions.description \
141 src/functions/functions.device \
142 src/functions/functions.dhclient \
143 src/functions/functions.dhcpd \
144 src/functions/functions.distro \
145 src/functions/functions.dns \
146 src/functions/functions.dummy \
147 src/functions/functions.editor \
148 src/functions/functions.firewall \
149 src/functions/functions.firewall-policy \
150 src/functions/functions.firewall-zones \
151 src/functions/functions.he \
152 src/functions/functions.hook \
153 src/functions/functions.hostapd \
154 src/functions/functions.hotplug \
155 src/functions/functions.http \
156 src/functions/functions.interrupts \
157 src/functions/functions.ip \
158 src/functions/functions.ipsec \
159 src/functions/functions.ipsec-pool \
160 src/functions/functions.iptables \
161 src/functions/functions.ip-tunnel \
162 src/functions/functions.ipv4 \
163 src/functions/functions.ipv6 \
164 src/functions/functions.leds \
165 src/functions/functions.list \
166 src/functions/functions.lock \
167 src/functions/functions.logging \
168 src/functions/functions.macros \
169 src/functions/functions.modem \
170 src/functions/functions.offloading \
171 src/functions/functions.phy \
172 src/functions/functions.ports \
173 src/functions/functions.ppp \
174 src/functions/functions.pppoe-server \
175 src/functions/functions.radvd \
176 src/functions/functions.route \
177 src/functions/functions.routing \
178 src/functions/functions.serial \
179 src/functions/functions.service \
180 src/functions/functions.settings \
181 src/functions/functions.stp \
182 src/functions/functions.sysctl \
183 src/functions/functions.system \
184 src/functions/functions.triggers \
185 src/functions/functions.usb \
186 src/functions/functions.util \
187 src/functions/functions.vlan \
188 src/functions/functions.vpn \
189 src/functions/functions.vpn-security-policies \
190 src/functions/functions.wireless \
191 src/functions/functions.wireless-mesh \
192 src/functions/functions.wireless-networks \
193 src/functions/functions.wpa_supplicant \
194 src/functions/functions.zone \
195 src/network-radvd-config \
200 dist_network_SCRIPTS = \
201 src/dhclient-helper \
205 dist_helpers_SCRIPTS = \
206 src/helpers/dhcpd-config-helper \
207 src/helpers/firewall-kernel-init \
208 src/helpers/hostapd-config-helper \
209 src/helpers/ipsec-updown \
210 src/helpers/pppd-angel \
211 src/helpers/wpa_supplicant
216 src_inetcalc_SOURCES = \
219 src_inetcalc_LDADD = \
222 dist_hooks_configs_SCRIPTS = \
223 src/hooks/configs/dhcp \
224 src/hooks/configs/ipv6-auto \
225 src/hooks/configs/pppoe-server \
226 src/hooks/configs/static
228 dist_hooks_ports_SCRIPTS = \
229 src/hooks/ports/bonding \
230 src/hooks/ports/dummy \
231 src/hooks/ports/ethernet \
232 src/hooks/ports/ip-tunnel \
233 src/hooks/ports/vlan \
234 src/hooks/ports/wireless-ap \
235 src/hooks/ports/wireless-mesh
237 dist_hooks_zones_SCRIPTS = \
238 src/hooks/zones/bridge \
239 src/hooks/zones/ip-tunnel \
240 src/hooks/zones/modem \
241 src/hooks/zones/pppoe \
242 src/hooks/zones/wireless
248 $(configdir)/vpn/ipsec/connections \
249 $(configdir)/vpn/security-policies \
250 $(configdir)/wireless \
251 $(configdir)/wireless/networks \
254 # ------------------------------------------------------------------------------
257 LIBNETWORK_REVISION=0
260 pkginclude_HEADERS = \
261 src/libnetwork/network/interface.h \
262 src/libnetwork/network/libnetwork.h \
263 src/libnetwork/network/logging.h \
264 src/libnetwork/network/phy.h
269 src_libnetwork_la_SOURCES = \
270 src/libnetwork/interface.c \
271 src/libnetwork/libnetwork-private.h \
272 src/libnetwork/libnetwork.c \
275 src_libnetwork_la_LIBADD = \
278 src_libnetwork_la_CPPFLAGS = \
284 src_libnetwork_la_CFLAGS = \
288 src_libnetwork_la_LDFLAGS = \
290 -version-info $(LIBNETWORK_CURRENT):$(LIBNETWORK_REVISION):$(LIBNETWORK_AGE) \
291 -Wl,--version-script=$(top_srcdir)/src/libnetwork/libnetwork.sym
293 src_libnetwork_la_DEPENDENCIES = \
294 src/libnetwork/libnetwork.sym
297 src/libnetwork/libnetwork.sym
299 # ------------------------------------------------------------------------------
302 src/utils/network-phy-list-channels \
303 src/utils/network-phy-list-ht-caps \
304 src/utils/network-phy-list-vht-caps
306 src_utils_network_phy_list_channels_SOURCES = \
307 src/utils/network-phy-list-channels.c
309 src_utils_network_phy_list_channels_LDADD = \
312 src_utils_network_phy_list_ht_caps_SOURCES = \
313 src/utils/network-phy-list-ht-caps.c
315 src_utils_network_phy_list_ht_caps_LDADD = \
318 src_utils_network_phy_list_vht_caps_SOURCES = \
319 src/utils/network-phy-list-vht-caps.c
321 src_utils_network_phy_list_vht_caps_LDADD = \
324 # ------------------------------------------------------------------------------
340 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up
341 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-up
342 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-down
343 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-up
344 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-down
347 rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up}
348 rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up}
350 INSTALL_EXEC_HOOKS += ppp-install-hook
351 UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook
353 # ------------------------------------------------------------------------------
356 systemdsystemunit_DATA = \
357 src/systemd/firewall4.service \
358 src/systemd/firewall6.service \
359 src/systemd/firewall-init.service \
360 src/systemd/network-init.service \
361 src/systemd/network@.service
364 $(systemdsystemunit_DATA)
367 $(systemdsystemunitdir)
371 src/systemd/firewall4.service.in \
372 src/systemd/firewall6.service.in \
373 src/systemd/firewall-init.service.in \
374 src/systemd/network-init.service.in \
375 src/systemd/network@.service.in
377 # ------------------------------------------------------------------------------
379 systemconfig_vpndir = $(systemconfigdir)/vpn
381 dist_systemconfig_vpn_security_policies_DATA = \
382 config/vpn/security-policies/performance \
383 config/vpn/security-policies/system
385 systemconfig_vpn_security_policiesdir = $(systemconfig_vpndir)/security-policies
387 # ------------------------------------------------------------------------------
390 src/sysctl/network.conf
392 # ------------------------------------------------------------------------------
394 dist_bashcompletion_SCRIPTS = \
395 src/bash-completion/network
397 # ------------------------------------------------------------------------------
399 dist_tmpfiles_DATA = \
400 src/tmpfiles/network.conf
402 # ------------------------------------------------------------------------------
405 dist_udev_SCRIPTS = \
406 src/udev/network-hotplug \
407 src/udev/network-hotplug-rename \
408 src/udev/network-hotplug-serial
410 dist_udevrules_DATA = \
411 src/udev/rules.d/50-serial-whitelist.rules \
412 src/udev/rules.d/60-net.rules
419 # ------------------------------------------------------------------------------
430 # ------------------------------------------------------------------------------
438 # ------------------------------------------------------------------------------
443 # ------------------------------------------------------------------------------
446 man/firewall-settings.8 \
448 man/network-color.8 \
449 man/network-description.8 \
450 man/network-device.8 \
452 man/network-dns-server.8 \
453 man/network-performance-tuning.8 \
455 man/network-quick-start.8 \
456 man/network-route.8 \
457 man/network-route-static.8 \
458 man/network-settings.8 \
460 man/network-vpn-security-policies.8 \
462 man/network-zone-bridge.8 \
463 man/network-zone-config-pppoe-server.8 \
464 man/network-zone-ip-tunnel.8 \
465 man/network-zone-modem.8 \
466 man/network-zone-pppoe.8 \
467 man/network-zone-wireless.8
469 MANPAGES_XML = $(patsubst %.8,%.xml,$(MANPAGES))
470 MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
473 man: $(MANPAGES) $(MANPAGES_HTML)
491 --stringparam man.output.quietly 1 \
492 --stringparam funcsynopsis.style ansi \
493 --stringparam man.th.extra1.suppress 1 \
494 --stringparam man.authors.section.enabled 1 \
495 --stringparam man.copyright.section.enabled 1
497 XSLTPROC_COMMAND_MAN = \
498 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
499 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
501 XSLTPROC_COMMAND_HTML = \
502 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
505 $(XSLTPROC_COMMAND_MAN)
507 man/%.html: man/%.xml man/custom-html.xsl
508 $(XSLTPROC_COMMAND_HTML)
510 # ------------------------------------------------------------------------------
513 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
514 '|PACKAGE_URL=$(PACKAGE_URL)|' \
515 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
516 '|builddir=$(abs_builddir)|' \
517 '|prefix=$(prefix)|' \
518 '|exec_prefix=$(exec_prefix)|' \
519 '|sbindir=$(sbindir)|' \
520 '|networkdir=$(networkdir)|' \
521 '|helpersdir=$(helpersdir)|' \
522 '|utildir=$(utildir)|' \
523 '|VIRTUAL_ENVIRONMENT_IMAGES_DIR=$(VIRTUAL_ENVIRONMENT_IMAGES_DIR)|'
526 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
527 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
536 install-exec-hook: $(INSTALL_EXEC_HOOKS)
538 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
540 # - testsuite ------------------------------------------------------------------
542 TESTS_ENVIRONMENT = \
543 LD_LIBRARY_PATH=$(top_builddir)/src/.libs:$(LD_LIBRARY_PATH) \
544 PATH=$(top_builddir)/src:$(PATH) \
545 functions=$(abs_builddir)/src/functions/functions \
546 networkdir=$(abs_srcdir)/src/functions \
547 testdir=$(top_srcdir)/test
553 dist_check_SCRIPTS = \
558 test/functions/ip/ip_detect_protocol \
559 test/functions/ip/ip_get_prefix \
560 test/functions/ip/ip_net_is_valid \
561 test/functions/ip/ip_is_valid \
562 test/functions/ip/ip_network_is_subnet_of \
563 test/functions/ip/ip_prefix_is_valid \
564 test/functions/ip/ip_protocol_is_supported \
565 test/functions/ip/ip_split_prefix
567 # - NITSI tests ----------------------------------------------------------------
569 # Files for the virtual environment
570 VIRTUAL_ENVIRONMENT_FILES = \
571 test/nitsi/virtual-environment/basic/machines/alice/machine.xml \
572 test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml \
573 test/nitsi/virtual-environment/basic/machines/bob/machine.xml \
574 test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml \
575 test/nitsi/virtual-environment/basic/network/network1/network.xml \
576 test/nitsi/virtual-environment/basic/network/network2/network.xml \
577 test/nitsi/virtual-environment/basic/network/network3/network.xml \
578 test/nitsi/virtual-environment/basic/network/network4/network.xml \
579 test/nitsi/virtual-environment/basic/settings
582 test/nitsi/virtual-environment/basic/machines/alice/machine.xml.in \
583 test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml.in \
584 test/nitsi/virtual-environment/basic/machines/bob/machine.xml.in \
585 test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml.in \
586 test/nitsi/virtual-environment/basic/settings.in
589 test/nitsi/virtual-environment/basic/machines/alice/machine.xml \
590 test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml \
591 test/nitsi/virtual-environment/basic/machines/bob/machine.xml \
592 test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml \
593 test/nitsi/virtual-environment/basic/settings
595 # Virtual Machine Images
596 VIRTUAL_ENVIRONMENT_IMAGES = \
597 $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-alice-2.qcow2 \
598 $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-bob.qcow2
601 $(VIRTUAL_ENVIRONMENT_IMAGES)
603 VIRTUAL_ENVIRONMENT_IMAGES_DIR = $(abs_builddir)/test/nitsi/virtual-environment/.images
604 VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL = \
605 https://people.ipfire.org/~jschlag/nitsi-ipfire/virtual-environment/basic/
607 NITSI_INCLUDE_RECIPES = \
608 test/nitsi/include/setup
611 test/nitsi/include/setup.in
614 test/nitsi/include/setup
617 test/nitsi/test/make-check \
618 test/nitsi/test/phase1 \
619 test/nitsi/test/pppoe \
620 test/nitsi/test/raw-device-get-by-mac \
621 test/nitsi/test/zone-new-bridge \
622 test/nitsi/test/zone-port-attach-bridge \
623 test/nitsi/test/zone/ip-tunnel/gre6 \
624 test/nitsi/test/zone/ip-tunnel/gre4 \
625 test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv4 \
626 test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv6 \
627 test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv4 \
628 test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv6 \
629 test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv4 \
630 test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv6 \
631 test/nitsi/test/port-vlan
634 test/nitsi/test/settings.in \
635 test/nitsi/test/make-check/recipe.in \
636 test/nitsi/test/make-check/settings.in \
637 test/nitsi/test/raw-device-get-by-mac/recipe \
638 test/nitsi/test/raw-device-get-by-mac/settings.in \
639 test/nitsi/test/zone-new-bridge/recipe \
640 test/nitsi/test/zone-new-bridge/settings.in \
641 test/nitsi/test/zone-port-attach-bridge/recipe \
642 test/nitsi/test/zone-port-attach-bridge/settings.in \
643 test/nitsi/test/zone/ip-tunnel/gre6/recipe \
644 test/nitsi/test/zone/ip-tunnel/gre6/settings \
645 test/nitsi/test/zone/ip-tunnel/gre4/recipe \
646 test/nitsi/test/zone/ip-tunnel/gre4/settings \
647 test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv4/recipe \
648 test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv4/settings \
649 test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv6/recipe \
650 test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv6/settings \
651 test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv4/recipe \
652 test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv4/settings \
653 test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv6/recipe \
654 test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv6/settings \
655 test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv4/recipe \
656 test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv4/settings \
657 test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv6/recipe \
658 test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv6/settings \
659 test/nitsi/test/port-vlan/recipe \
660 test/nitsi/test/port-vlan/settings
663 test/nitsi/test/settings \
664 test/nitsi/test/make-check/recipe \
665 test/nitsi/test/make-check/settings \
666 test/nitsi/test/raw-device-get-by-mac/settings \
667 test/nitsi/test/zone-new-bridge/settings \
668 test/nitsi/test/zone-port-attach-bridge/settings
672 .PHONY: $(NITSI_TESTS)
673 $(NITSI_TESTS): % : dist %/recipe %/settings test/nitsi/test/settings $(VIRTUAL_ENVIRONMENT_FILES) $(VIRTUAL_ENVIRONMENT_IMAGES) $(NITSI_INCLUDE_RECIPES)
674 $(AM_V_NITSI) $(NITSI_ENVIRONMENT) $(NITSI) --log-level error run-test -d $@ \
675 --default-settings $(abs_builddir)/test/nitsi/test/settings --interactive-error-handling
678 nitsi: $(NITSI_TESTS)
680 # Downloads a virtual image file and extracts it
681 $(VIRTUAL_ENVIRONMENT_IMAGES):
682 $(AM_V_DOWNLOAD)$(MKDIR_P) $(dir $@) && \
683 $(WGET) -qO - $(VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL)/$(notdir $@).xz | xz -qd > $@