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.list \
165 src/functions/functions.lock \
166 src/functions/functions.logging \
167 src/functions/functions.macros \
168 src/functions/functions.modem \
169 src/functions/functions.phy \
170 src/functions/functions.ports \
171 src/functions/functions.ppp \
172 src/functions/functions.pppoe-server \
173 src/functions/functions.radvd \
174 src/functions/functions.route \
175 src/functions/functions.routing \
176 src/functions/functions.serial \
177 src/functions/functions.service \
178 src/functions/functions.settings \
179 src/functions/functions.stp \
180 src/functions/functions.sysctl \
181 src/functions/functions.system \
182 src/functions/functions.triggers \
183 src/functions/functions.usb \
184 src/functions/functions.util \
185 src/functions/functions.vlan \
186 src/functions/functions.vpn \
187 src/functions/functions.vpn-security-policies \
188 src/functions/functions.wireless \
189 src/functions/functions.wireless-mesh \
190 src/functions/functions.wireless-networks \
191 src/functions/functions.wpa_supplicant \
192 src/functions/functions.zone \
193 src/network-radvd-config \
194 src/dhclient-helper \
201 dist_helpers_SCRIPTS = \
202 src/helpers/dhcpd-config-helper \
203 src/helpers/firewall-kernel-init \
204 src/helpers/hostapd-config-helper \
205 src/helpers/ipsec-updown \
206 src/helpers/pppd-angel \
207 src/helpers/wpa_supplicant
212 src_inetcalc_SOURCES = \
215 src_inetcalc_LDADD = \
218 dist_hooks_configs_SCRIPTS = \
219 src/hooks/configs/dhcp \
220 src/hooks/configs/ipv6-auto \
221 src/hooks/configs/pppoe-server \
222 src/hooks/configs/static
224 dist_hooks_ports_SCRIPTS = \
225 src/hooks/ports/bonding \
226 src/hooks/ports/dummy \
227 src/hooks/ports/ethernet \
228 src/hooks/ports/vlan \
229 src/hooks/ports/wireless-ap \
230 src/hooks/ports/wireless-mesh
232 dist_hooks_zones_SCRIPTS = \
233 src/hooks/zones/6to4-tunnel \
234 src/hooks/zones/bridge \
235 src/hooks/zones/modem \
236 src/hooks/zones/pppoe \
237 src/hooks/zones/wireless
243 $(configdir)/vpn/ipsec/connections \
244 $(configdir)/vpn/security-policies \
245 $(configdir)/wireless \
246 $(configdir)/wireless/networks \
249 # ------------------------------------------------------------------------------
252 LIBNETWORK_REVISION=0
255 pkginclude_HEADERS = \
256 src/libnetwork/network/interface.h \
257 src/libnetwork/network/libnetwork.h \
258 src/libnetwork/network/logging.h \
259 src/libnetwork/network/phy.h
264 src_libnetwork_la_SOURCES = \
265 src/libnetwork/interface.c \
266 src/libnetwork/libnetwork-private.h \
267 src/libnetwork/libnetwork.c \
270 src_libnetwork_la_LIBADD = \
273 src_libnetwork_la_CPPFLAGS = \
279 src_libnetwork_la_CFLAGS = \
283 src_libnetwork_la_LDFLAGS = \
285 -version-info $(LIBNETWORK_CURRENT):$(LIBNETWORK_REVISION):$(LIBNETWORK_AGE) \
286 -Wl,--version-script=$(top_srcdir)/src/libnetwork/libnetwork.sym
288 src_libnetwork_la_DEPENDENCIES = \
289 src/libnetwork/libnetwork.sym
292 src/libnetwork/libnetwork.sym
294 # ------------------------------------------------------------------------------
297 src/utils/network-phy-list-ht-caps
299 src_utils_network_phy_list_ht_caps_SOURCES = \
300 src/utils/network-phy-list-ht-caps.c
302 src_utils_network_phy_list_ht_caps_LDADD = \
305 # ------------------------------------------------------------------------------
321 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up
322 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-up
323 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-down
324 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-up
325 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-down
328 rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up}
329 rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up}
331 INSTALL_EXEC_HOOKS += ppp-install-hook
332 UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook
334 # ------------------------------------------------------------------------------
337 systemdsystemunit_DATA = \
338 src/systemd/firewall4.service \
339 src/systemd/firewall6.service \
340 src/systemd/firewall-init.service \
341 src/systemd/network-init.service \
342 src/systemd/network@.service
345 $(systemdsystemunit_DATA)
348 $(systemdsystemunitdir)
352 src/systemd/firewall4.service.in \
353 src/systemd/firewall6.service.in \
354 src/systemd/firewall-init.service.in \
355 src/systemd/network-init.service.in \
356 src/systemd/network@.service.in
358 # ------------------------------------------------------------------------------
360 systemconfig_vpndir = $(systemconfigdir)/vpn
362 dist_systemconfig_vpn_security_policies_DATA = \
363 config/vpn/security-policies/performance \
364 config/vpn/security-policies/system
366 systemconfig_vpn_security_policiesdir = $(systemconfig_vpndir)/security-policies
368 # ------------------------------------------------------------------------------
371 src/sysctl/network.conf
373 # ------------------------------------------------------------------------------
375 dist_bashcompletion_SCRIPTS = \
376 src/bash-completion/network
378 # ------------------------------------------------------------------------------
380 dist_tmpfiles_DATA = \
381 src/tmpfiles/network.conf
383 # ------------------------------------------------------------------------------
386 dist_udev_SCRIPTS = \
387 src/udev/network-hotplug \
388 src/udev/network-hotplug-rename \
389 src/udev/network-hotplug-serial
391 dist_udevrules_DATA = \
392 src/udev/rules.d/50-serial-whitelist.rules \
393 src/udev/rules.d/60-net.rules
400 # ------------------------------------------------------------------------------
411 # ------------------------------------------------------------------------------
419 # ------------------------------------------------------------------------------
424 # ------------------------------------------------------------------------------
427 man/firewall-settings.8 \
429 man/network-color.8 \
430 man/network-description.8 \
431 man/network-device.8 \
433 man/network-dns-server.8 \
434 man/network-performance-tuning.8 \
436 man/network-quick-start.8 \
437 man/network-route.8 \
438 man/network-route-static.8 \
439 man/network-settings.8 \
441 man/network-vpn-security-policies.8 \
443 man/network-zone-6to4-tunnel.8 \
444 man/network-zone-bridge.8 \
445 man/network-zone-config-pppoe-server.8 \
446 man/network-zone-modem.8 \
447 man/network-zone-pppoe.8 \
448 man/network-zone-wireless.8
450 MANPAGES_XML = $(patsubst %.8,%.xml,$(MANPAGES))
451 MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
454 man: $(MANPAGES) $(MANPAGES_HTML)
472 --stringparam man.output.quietly 1 \
473 --stringparam funcsynopsis.style ansi \
474 --stringparam man.th.extra1.suppress 1 \
475 --stringparam man.authors.section.enabled 1 \
476 --stringparam man.copyright.section.enabled 1
478 XSLTPROC_COMMAND_MAN = \
479 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
480 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
482 XSLTPROC_COMMAND_HTML = \
483 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
486 $(XSLTPROC_COMMAND_MAN)
488 man/%.html: man/%.xml man/custom-html.xsl
489 $(XSLTPROC_COMMAND_HTML)
491 # ------------------------------------------------------------------------------
494 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
495 '|PACKAGE_URL=$(PACKAGE_URL)|' \
496 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
497 '|builddir=$(abs_builddir)|' \
498 '|prefix=$(prefix)|' \
499 '|exec_prefix=$(exec_prefix)|' \
500 '|sbindir=$(sbindir)|' \
501 '|networkdir=$(networkdir)|' \
502 '|helpersdir=$(helpersdir)|' \
503 '|utildir=$(utildir)|' \
504 '|VIRTUAL_ENVIRONMENT_IMAGES_DIR=$(VIRTUAL_ENVIRONMENT_IMAGES_DIR)|'
507 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
508 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
517 install-exec-hook: $(INSTALL_EXEC_HOOKS)
519 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
521 # - testsuite ------------------------------------------------------------------
523 TESTS_ENVIRONMENT = \
524 LD_LIBRARY_PATH=$(top_builddir)/src/.libs:$(LD_LIBRARY_PATH) \
525 PATH=$(top_builddir)/src:$(PATH) \
526 functions=$(abs_builddir)/src/functions/functions \
527 networkdir=$(abs_srcdir)/src/functions \
528 testdir=$(top_srcdir)/test
534 dist_check_SCRIPTS = \
539 test/functions/ip/ip_detect_protocol \
540 test/functions/ip/ip_get_prefix \
541 test/functions/ip/ip_net_is_valid \
542 test/functions/ip/ip_is_valid \
543 test/functions/ip/ip_network_is_subnet_of \
544 test/functions/ip/ip_prefix_is_valid \
545 test/functions/ip/ip_protocol_is_supported \
546 test/functions/ip/ip_split_prefix
548 # - NITSI tests ----------------------------------------------------------------
550 # Files for the virtual environment
551 VIRTUAL_ENVIRONMENT_FILES = \
552 test/nitsi/virtual-environment/basic/machines/alice/machine.xml \
553 test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml \
554 test/nitsi/virtual-environment/basic/machines/bob/machine.xml \
555 test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml \
556 test/nitsi/virtual-environment/basic/network/network1/network.xml \
557 test/nitsi/virtual-environment/basic/network/network2/network.xml \
558 test/nitsi/virtual-environment/basic/network/network3/network.xml \
559 test/nitsi/virtual-environment/basic/network/network4/network.xml \
560 test/nitsi/virtual-environment/basic/README \
561 test/nitsi/virtual-environment/basic/settings
564 test/nitsi/virtual-environment/basic/machines/alice/machine.xml.in \
565 test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml.in \
566 test/nitsi/virtual-environment/basic/machines/bob/machine.xml.in \
567 test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml.in
570 test/nitsi/virtual-environment/basic/machines/alice/machine.xml \
571 test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml \
572 test/nitsi/virtual-environment/basic/machines/bob/machine.xml \
573 test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml
575 # Virtual Machine Images
576 VIRTUAL_ENVIRONMENT_IMAGES = \
577 $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-alice-2.qcow2 \
578 $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-bob.qcow2
581 $(VIRTUAL_ENVIRONMENT_IMAGES)
583 VIRTUAL_ENVIRONMENT_IMAGES_DIR = $(abs_builddir)/test/nitsi/virtual-environment/.images
584 VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL = \
585 https://people.ipfire.org/~jschlag/nitsi-ipfire/virtual-environment/basic/
588 test/nitsi/test/hello-world \
589 test/nitsi/test/make-check
592 test/nitsi/test/hello-world/recipe \
593 test/nitsi/test/hello-world/settings \
594 test/nitsi/test/make-check/recipe.in \
595 test/nitsi/test/make-check/settings.in
598 test/nitsi/test/make-check/recipe \
599 test/nitsi/test/make-check/settings
603 .PHONY: $(NITSI_TESTS)
604 $(NITSI_TESTS): % : %/recipe %/settings $(VIRTUAL_ENVIRONMENT_FILES) $(VIRTUAL_ENVIRONMENT_IMAGES)
605 $(AM_V_NITSI) $(NITSI_ENVIRONMENT) $(NITSI) --log-level error -d $@
608 nitsi: dist $(NITSI_TESTS)
610 # Downloads a virtual image file and extracts it
611 $(VIRTUAL_ENVIRONMENT_IMAGES):
612 $(AM_V_DOWNLOAD)$(MKDIR_P) $(dir $@) && \
613 $(WGET) -qO - $(VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL)/$(notdir $@).xz | xz -qd > $@