util: Add abort() which will stop the program immediately
[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 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
40
41 networkdir       = $(libexecdir)/network
42 helpersdir       = $(networkdir)/helpers
43
44 macrosdir        = $(libexecdir)/firewall/macros
45
46 hooksdir         = $(networkdir)/hooks
47 hooks_configsdir = $(hooksdir)/configs
48 hooks_portsdir   = $(hooksdir)/ports
49 hooks_zonesdir   = $(hooksdir)/zones
50
51 triggersdir      = $(networkdir)/triggers
52
53 logdir           = $(localestatedir)/log/network
54 utildir          = $(networkdir)
55
56 CLEANFILES =
57 DISTCLEANFILES =
58 EXTRA_DIST =
59 INSTALL_DIRS =
60 INSTALL_EXEC_HOOKS =
61 UNINSTALL_EXEC_HOOKS =
62 noinst_DATA =
63
64 AM_CPPFLAGS = \
65         $(OUR_CPPFLAGS) \
66         -include $(top_builddir)/config.h \
67         -I${top_srcdir}/src/libnetwork
68
69 AM_CFLAGS = \
70         $(OUR_CFLAGS) \
71         -fvisibility=hidden \
72         -ffunction-sections \
73         -fdata-sections
74
75 AM_LDFLAGS = \
76         $(OUR_LDFLAGS) \
77         -Wl,--gc-sections \
78         -Wl,--as-needed
79
80 DISTCHECK_CONFIGURE_FLAGS = \
81         --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \
82         --with-udevdir=$$dc_install_base/$(udevdir)
83
84 install-directories-hook:
85         $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
86
87 INSTALL_EXEC_HOOKS += \
88         install-directories-hook
89
90 # ------------------------------------------------------------------------------
91
92 AM_V_ASCIIDOC   = $(AM_V_ASCIIDOC_$(V))
93 AM_V_ASCIIDOC_  = $(AM_V_ASCIIDOC_$(AM_DEFAULT_VERBOSITY))
94 AM_V_ASCIIDOC_0 = @echo "  ASCIIDOC" $@;
95
96 AM_V_DOWNLOAD   = $(AM_V_DOWNLOAD_$(V))
97 AM_V_DOWNLOAD_  = $(AM_V_DOWNLOAD_$(AM_DEFAULT_VERBOSITY))
98 AM_V_DOWNLOAD_0 = @echo "  LOAD    " $@;
99
100 AM_V_NITSI   = $(AM_V_NITSI_$(V))
101 AM_V_NITSI_  = $(AM_V_NITSI_$(AM_DEFAULT_VERBOSITY))
102 AM_V_NITSI_0 = @echo "  NITSI   " $@;
103
104 AM_V_XSLT   = $(AM_V_XSLT_$(V))
105 AM_V_XSLT_  = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
106 AM_V_XSLT_0 = @echo "  XSLT    " $@;
107
108 # ------------------------------------------------------------------------------
109
110 dist_doc_DATA = \
111         README \
112         docs/CODING_STYLE \
113         docs/COPYING
114
115 dist_sbin_SCRIPTS = \
116         src/dhclient-script \
117         src/firewall-config \
118         src/firewall4 \
119         src/firewall6 \
120         src/network
121
122 network_DATA = \
123         src/functions/functions
124
125 CLEANFILES += \
126         src/functions/functions
127
128 EXTRA_DIST += \
129         src/functions/functions.in
130
131 dist_network_DATA = \
132         src/functions/functions.at \
133         src/functions/functions.auth \
134         src/functions/functions.bird \
135         src/functions/functions.bonding \
136         src/functions/functions.bridge \
137         src/functions/functions.cli \
138         src/functions/functions.cli.firewall \
139         src/functions/functions.colors \
140         src/functions/functions.config \
141         src/functions/functions.conntrack \
142         src/functions/functions.constants \
143         src/functions/functions.constants-firewall \
144         src/functions/functions.db \
145         src/functions/functions.description \
146         src/functions/functions.device \
147         src/functions/functions.dhclient \
148         src/functions/functions.dhcpd \
149         src/functions/functions.distro \
150         src/functions/functions.dns \
151         src/functions/functions.dummy \
152         src/functions/functions.editor \
153         src/functions/functions.firewall \
154         src/functions/functions.firewall-policy \
155         src/functions/functions.firewall-zones \
156         src/functions/functions.he \
157         src/functions/functions.hook \
158         src/functions/functions.hostapd \
159         src/functions/functions.hotplug \
160         src/functions/functions.http \
161         src/functions/functions.interrupts \
162         src/functions/functions.ip \
163         src/functions/functions.ipsec \
164         src/functions/functions.ipsec-pool \
165         src/functions/functions.iptables \
166         src/functions/functions.ip-tunnel \
167         src/functions/functions.ipv4 \
168         src/functions/functions.ipv6 \
169         src/functions/functions.leds \
170         src/functions/functions.list \
171         src/functions/functions.lock \
172         src/functions/functions.logging \
173         src/functions/functions.macros \
174         src/functions/functions.modem \
175         src/functions/functions.offloading \
176         src/functions/functions.phy \
177         src/functions/functions.ports \
178         src/functions/functions.ppp \
179         src/functions/functions.pppoe-server \
180         src/functions/functions.route \
181         src/functions/functions.routing \
182         src/functions/functions.serial \
183         src/functions/functions.service \
184         src/functions/functions.settings \
185         src/functions/functions.stp \
186         src/functions/functions.sysctl \
187         src/functions/functions.system \
188         src/functions/functions.triggers \
189         src/functions/functions.usb \
190         src/functions/functions.util \
191         src/functions/functions.vlan \
192         src/functions/functions.vpn \
193         src/functions/functions.vpn-security-policies \
194         src/functions/functions.wireless \
195         src/functions/functions.wireless-mesh \
196         src/functions/functions.wireless-networks \
197         src/functions/functions.wpa_supplicant \
198         src/functions/functions.zone \
199         src/header-config \
200         src/header-port \
201         src/header-zone
202
203 dist_network_SCRIPTS = \
204         src/dhclient-helper \
205         src/ppp/dialer \
206         src/ppp/pppoe-server
207
208 dist_helpers_SCRIPTS = \
209         src/helpers/dhcpd-config-helper \
210         src/helpers/firewall-kernel-init \
211         src/helpers/hostapd-config-helper \
212         src/helpers/ipsec-updown \
213         src/helpers/pppd-angel \
214         src/helpers/wpa_supplicant
215
216 bin_PROGRAMS = \
217         src/inetcalc
218
219 src_inetcalc_SOURCES = \
220         src/inetcalc.c
221
222 src_inetcalc_LDADD = \
223         src/libnetwork.la
224
225 dist_hooks_configs_SCRIPTS = \
226         src/hooks/configs/dhcp \
227         src/hooks/configs/ipv6-auto \
228         src/hooks/configs/pppoe-server \
229         src/hooks/configs/static
230
231 dist_hooks_ports_SCRIPTS = \
232         src/hooks/ports/bonding \
233         src/hooks/ports/dummy \
234         src/hooks/ports/ethernet \
235         src/hooks/ports/ip-tunnel \
236         src/hooks/ports/vlan \
237         src/hooks/ports/wireless-ap \
238         src/hooks/ports/wireless-mesh
239
240 dist_hooks_zones_SCRIPTS = \
241         src/hooks/zones/bridge \
242         src/hooks/zones/ip-tunnel \
243         src/hooks/zones/modem \
244         src/hooks/zones/pppoe \
245         src/hooks/zones/wireless
246
247 INSTALL_DIRS += \
248         $(configdir) \
249         $(configdir)/ports \
250         $(configdir)/vpn \
251         $(configdir)/vpn/ipsec/connections \
252         $(configdir)/vpn/security-policies \
253         $(configdir)/wireless \
254         $(configdir)/wireless/networks \
255         $(configdir)/zones
256
257 # ------------------------------------------------------------------------------
258
259 LIBNETWORK_CURRENT=0
260 LIBNETWORK_REVISION=0
261 LIBNETWORK_AGE=0
262
263 pkginclude_HEADERS = \
264         src/libnetwork/network/interface.h \
265         src/libnetwork/network/libnetwork.h \
266         src/libnetwork/network/logging.h \
267         src/libnetwork/network/phy.h
268
269 lib_LTLIBRARIES = \
270         src/libnetwork.la
271
272 src_libnetwork_la_SOURCES = \
273         src/libnetwork/interface.c \
274         src/libnetwork/libnetwork-private.h \
275         src/libnetwork/libnetwork.c \
276         src/libnetwork/phy.c
277
278 src_libnetwork_la_LIBADD = \
279         $(LIBNL_LIBS)
280
281 src_libnetwork_la_CPPFLAGS = \
282         $(AM_CPPFLAGS) \
283         $(LIBNL_CPPFLAGS) \
284         -D_GNU_SOURCE \
285         -DNETWORK_PRIVATE
286
287 src_libnetwork_la_CFLAGS = \
288         $(AM_CFLAGS) \
289         $(LIBNL_CFLAGS)
290
291 src_libnetwork_la_LDFLAGS = \
292         $(AM_LDFLAGS) \
293         -version-info $(LIBNETWORK_CURRENT):$(LIBNETWORK_REVISION):$(LIBNETWORK_AGE) \
294         -Wl,--version-script=$(top_srcdir)/src/libnetwork/libnetwork.sym
295
296 src_libnetwork_la_DEPENDENCIES = \
297         src/libnetwork/libnetwork.sym
298
299 EXTRA_DIST += \
300         src/libnetwork/libnetwork.sym
301
302 # ------------------------------------------------------------------------------
303
304 util_PROGRAMS = \
305         src/utils/network-phy-list-channels \
306         src/utils/network-phy-list-ciphers \
307         src/utils/network-phy-list-ht-caps \
308         src/utils/network-phy-list-vht-caps
309
310 src_utils_network_phy_list_channels_SOURCES = \
311         src/utils/network-phy-list-channels.c
312
313 src_utils_network_phy_list_channels_LDADD = \
314         src/libnetwork.la
315
316 src_utils_network_phy_list_ciphers_SOURCES = \
317         src/utils/network-phy-list-ciphers.c
318
319 src_utils_network_phy_list_ciphers_LDADD = \
320         src/libnetwork.la
321
322 src_utils_network_phy_list_ht_caps_SOURCES = \
323         src/utils/network-phy-list-ht-caps.c
324
325 src_utils_network_phy_list_ht_caps_LDADD = \
326         src/libnetwork.la
327
328 src_utils_network_phy_list_vht_caps_SOURCES = \
329         src/utils/network-phy-list-vht-caps.c
330
331 src_utils_network_phy_list_vht_caps_LDADD = \
332         src/libnetwork.la
333
334 # ------------------------------------------------------------------------------
335
336 ppp_SCRIPTS = \
337         src/ppp/ip-updown
338
339 CLEANFILES += \
340         src/ppp/ip-updown
341
342 EXTRA_DIST += \
343         src/ppp/ip-updown.in
344
345 INSTALL_DIRS += \
346         $(pppdir) \
347         $(logdir)
348
349 ppp-install-hook:
350         ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up
351         ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-up
352         ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-down
353         ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-up
354         ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-down
355
356 ppp-uninstall-hook:
357         rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up}
358         rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up}
359
360 INSTALL_EXEC_HOOKS += ppp-install-hook
361 UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook
362
363 # ------------------------------------------------------------------------------
364
365 if HAVE_SYSTEMD
366 systemdsystemunit_DATA = \
367         src/systemd/firewall4.service \
368         src/systemd/firewall6.service \
369         src/systemd/firewall-init.service \
370         src/systemd/network-init.service \
371         src/systemd/network@.service
372
373 CLEANFILES += \
374         $(systemdsystemunit_DATA)
375
376 INSTALL_DIRS += \
377         $(systemdsystemunitdir)
378 endif
379
380 EXTRA_DIST += \
381         src/systemd/firewall4.service.in \
382         src/systemd/firewall6.service.in \
383         src/systemd/firewall-init.service.in \
384         src/systemd/network-init.service.in \
385         src/systemd/network@.service.in
386
387 # ------------------------------------------------------------------------------
388
389 systemconfig_vpndir = $(systemconfigdir)/vpn
390
391 dist_systemconfig_vpn_security_policies_DATA = \
392         config/vpn/security-policies/performance \
393         config/vpn/security-policies/system
394
395 systemconfig_vpn_security_policiesdir = $(systemconfig_vpndir)/security-policies
396
397 # ------------------------------------------------------------------------------
398
399 dist_sysctl_DATA = \
400         src/sysctl/network.conf
401
402 # ------------------------------------------------------------------------------
403
404 dist_bashcompletion_SCRIPTS = \
405         src/bash-completion/network
406
407 # ------------------------------------------------------------------------------
408
409 dist_tmpfiles_DATA = \
410         src/tmpfiles/network.conf
411
412 # ------------------------------------------------------------------------------
413
414 if HAVE_UDEV
415 dist_udev_SCRIPTS = \
416         src/udev/network-hotplug \
417         src/udev/network-hotplug-rename \
418         src/udev/network-hotplug-serial
419
420 dist_udevrules_DATA = \
421         src/udev/rules.d/50-serial-whitelist.rules \
422         src/udev/rules.d/60-net.rules
423
424 INSTALL_DIRS += \
425         $(udevdir) \
426         $(udevrulesdir)
427 endif
428
429 # ------------------------------------------------------------------------------
430
431 pkgconfig_DATA = \
432         src/network.pc
433
434 CLEANFILES += \
435         $(pkgconfig_DATA)
436
437 EXTRA_DIST += \
438         src/network.pc.in
439
440 # ------------------------------------------------------------------------------
441
442 dist_macros_DATA = \
443         src/macros/DHCP \
444         src/macros/HTTP \
445         src/macros/HTTPS \
446         src/macros/WWW
447
448 # ------------------------------------------------------------------------------
449
450 INSTALL_DIRS += \
451         $(triggersdir)
452
453 # ------------------------------------------------------------------------------
454
455 MANPAGES = \
456         man/firewall-settings.8 \
457         man/network.8 \
458         man/network-device.8 \
459         man/network-dhcp.8 \
460         man/network-dns-server.8 \
461         man/network-performance-tuning.8 \
462         man/network-port.8 \
463         man/network-quick-start.8 \
464         man/network-route.8 \
465         man/network-route-static.8 \
466         man/network-settings.8 \
467         man/network-vpn.8 \
468         man/network-vpn-security-policies.8 \
469         man/network-zone.8 \
470         man/network-zone-bridge.8 \
471         man/network-zone-config-pppoe-server.8 \
472         man/network-zone-ip-tunnel.8 \
473         man/network-zone-modem.8 \
474         man/network-zone-pppoe.8 \
475         man/network-zone-wireless.8
476
477 EXTRA_DIST += \
478         man/include-color.txt \
479         man/include-description.txt
480
481 MANPAGES_TXT  = $(patsubst %.8,%.txt,$(MANPAGES))
482 MANPAGES_HTML = $(patsubst %.txt,%.html,$(MANPAGES_TXT))
483 MANPAGES_XML  = $(patsubst %.txt,%.xml,$(MANPAGES_TXT))
484
485 .PHONY: man
486 man: $(MANPAGES) $(MANPAGES_HTML)
487
488 man_MANS = \
489         $(MANPAGES)
490
491 CLEANFILES += \
492         $(man_MANS) \
493         $(MANPAGES_HTML) \
494         $(MANPAGES_XML)
495
496 EXTRA_DIST += \
497         man/asciidoc.conf \
498         $(MANPAGES_TXT)
499
500 XSLTPROC_FLAGS = \
501         --nonet \
502         --stringparam man.output.quietly 1 \
503         --stringparam funcsynopsis.style ansi \
504         --stringparam man.th.extra1.suppress 1 \
505         --stringparam man.authors.section.enabled 1 \
506         --stringparam man.copyright.section.enabled 1
507
508 XSLTPROC_COMMAND_MAN = \
509         $(AM_V_XSLT)$(MKDIR_P) $(dir $@) && \
510         $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
511                 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
512
513 man/%.xml: man/%.txt man/asciidoc.conf
514         $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \
515         $(ASCIIDOC) \
516                 -f $(abs_srcdir)/man/asciidoc.conf \
517                 -d manpage -b docbook -o $@ $<
518
519 man/%.8: man/%.xml
520         $(XSLTPROC_COMMAND_MAN)
521
522 man/%.html: man/%.txt man/asciidoc.conf
523         $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \
524         $(ASCIIDOC) \
525                 -f $(abs_srcdir)/man/asciidoc.conf \
526                 -b html5 -a icons -a theme=flask -o $@ $<
527
528 .PHONY: upload-man
529 upload-man: $(MANPAGES_HTML)
530         rsync -avHz --delete --progress $(MANPAGES_HTML) ms@people.ipfire.org:/pub/man-pages/$(PACKAGE_NAME)/
531
532 # ------------------------------------------------------------------------------
533
534 substitutions = \
535         '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
536         '|PACKAGE_URL=$(PACKAGE_URL)|' \
537         '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
538         '|builddir=$(abs_builddir)|' \
539         '|prefix=$(prefix)|' \
540         '|exec_prefix=$(exec_prefix)|' \
541         '|sbindir=$(sbindir)|' \
542         '|networkdir=$(networkdir)|' \
543         '|helpersdir=$(helpersdir)|' \
544         '|utildir=$(utildir)|' \
545         '|VIRTUAL_ENVIRONMENT_IMAGES_DIR=$(VIRTUAL_ENVIRONMENT_IMAGES_DIR)|'
546
547 SED_PROCESS = \
548         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
549         $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
550                 < $< > $@
551
552 %: %.in Makefile
553         $(SED_PROCESS)
554
555 INSTALL_DIRS += \
556         $(sbindir)
557
558 install-exec-hook: $(INSTALL_EXEC_HOOKS)
559
560 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
561
562 # - testsuite ------------------------------------------------------------------
563
564 TESTS_ENVIRONMENT = \
565         LD_LIBRARY_PATH=$(top_builddir)/src/.libs:$(LD_LIBRARY_PATH) \
566         PATH=$(top_builddir)/src:$(PATH) \
567         functions=$(abs_builddir)/src/functions/functions \
568         networkdir=$(abs_srcdir)/src/functions \
569         testdir=$(top_srcdir)/test
570
571 dist_check_DATA = \
572         test/constants.sh \
573         test/test-functions
574
575 dist_check_SCRIPTS = \
576         $(TESTS)
577
578 TESTS = \
579         test/load-library \
580         test/functions/ip/ip_detect_protocol \
581         test/functions/ip/ip_get_prefix \
582         test/functions/ip/ip_net_is_valid \
583         test/functions/ip/ip_is_valid \
584         test/functions/ip/ip_network_is_subnet_of \
585         test/functions/ip/ip_prefix_is_valid \
586         test/functions/ip/ip_protocol_is_supported \
587         test/functions/ip/ip_split_prefix
588
589 # - NITSI tests ----------------------------------------------------------------
590
591 # Files for the virtual environment
592 VIRTUAL_ENVIRONMENT_FILES = \
593         test/nitsi/virtual-environment/basic/machines/alice/machine.xml \
594         test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml \
595         test/nitsi/virtual-environment/basic/machines/bob/machine.xml \
596         test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml \
597         test/nitsi/virtual-environment/basic/network/network1/network.xml \
598         test/nitsi/virtual-environment/basic/network/network2/network.xml \
599         test/nitsi/virtual-environment/basic/network/network3/network.xml \
600         test/nitsi/virtual-environment/basic/network/network4/network.xml \
601         test/nitsi/virtual-environment/basic/settings
602
603 EXTRA_DIST += \
604         test/nitsi/virtual-environment/basic/machines/alice/machine.xml.in \
605         test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml.in \
606         test/nitsi/virtual-environment/basic/machines/bob/machine.xml.in \
607         test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml.in \
608         test/nitsi/virtual-environment/basic/settings.in
609
610 CLEANFILES += \
611         test/nitsi/virtual-environment/basic/machines/alice/machine.xml \
612         test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml \
613         test/nitsi/virtual-environment/basic/machines/bob/machine.xml \
614         test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml \
615         test/nitsi/virtual-environment/basic/settings
616
617 # Virtual Machine Images
618 VIRTUAL_ENVIRONMENT_IMAGES = \
619         $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-alice-2.qcow2 \
620         $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-bob.qcow2
621
622 DISTCLEANFILES += \
623         $(VIRTUAL_ENVIRONMENT_IMAGES)
624
625 VIRTUAL_ENVIRONMENT_IMAGES_DIR = $(abs_builddir)/test/nitsi/virtual-environment/.images
626 VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL = \
627         https://people.ipfire.org/~jschlag/nitsi-ipfire/virtual-environment/basic/
628
629 NITSI_INCLUDE_RECIPES = \
630         test/nitsi/include/setup
631
632 EXTRA_DIST += \
633         test/nitsi/include/setup.in
634
635 CLEANFILES += \
636         test/nitsi/include/setup
637
638 NITSI_TESTS = \
639         test/nitsi/test/make-check \
640         test/nitsi/test/phase1 \
641         test/nitsi/test/pppoe \
642         test/nitsi/test/raw-device-get-by-mac \
643         test/nitsi/test/zone-new-bridge \
644         test/nitsi/test/zone-port-attach-bridge \
645         test/nitsi/test/zone/ip-tunnel/gre6 \
646         test/nitsi/test/zone/ip-tunnel/gre4 \
647         test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv4 \
648         test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv6 \
649         test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv4 \
650         test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv6 \
651         test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv4 \
652         test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv6 \
653         test/nitsi/test/port-vlan
654
655 EXTRA_DIST += \
656         test/nitsi/test/settings.in \
657         test/nitsi/test/make-check/recipe.in \
658         test/nitsi/test/make-check/settings.in \
659         test/nitsi/test/raw-device-get-by-mac/recipe \
660         test/nitsi/test/raw-device-get-by-mac/settings.in \
661         test/nitsi/test/zone-new-bridge/recipe \
662         test/nitsi/test/zone-new-bridge/settings.in \
663         test/nitsi/test/zone-port-attach-bridge/recipe \
664         test/nitsi/test/zone-port-attach-bridge/settings.in \
665         test/nitsi/test/zone/ip-tunnel/gre6/recipe \
666         test/nitsi/test/zone/ip-tunnel/gre6/settings \
667         test/nitsi/test/zone/ip-tunnel/gre4/recipe \
668         test/nitsi/test/zone/ip-tunnel/gre4/settings \
669         test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv4/recipe \
670         test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv4/settings \
671         test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv6/recipe \
672         test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv6/settings \
673         test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv4/recipe \
674         test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv4/settings \
675         test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv6/recipe \
676         test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv6/settings \
677         test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv4/recipe \
678         test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv4/settings \
679         test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv6/recipe \
680         test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv6/settings \
681         test/nitsi/test/port-vlan/recipe \
682         test/nitsi/test/port-vlan/settings
683
684 CLEANFILES += \
685         test/nitsi/test/settings \
686         test/nitsi/test/make-check/recipe \
687         test/nitsi/test/make-check/settings \
688         test/nitsi/test/raw-device-get-by-mac/settings \
689         test/nitsi/test/zone-new-bridge/settings \
690         test/nitsi/test/zone-port-attach-bridge/settings
691
692 NITSI_ENVIRONMENT =
693
694 .PHONY: $(NITSI_TESTS)
695 $(NITSI_TESTS): % : dist %/recipe %/settings test/nitsi/test/settings $(VIRTUAL_ENVIRONMENT_FILES) $(VIRTUAL_ENVIRONMENT_IMAGES) $(NITSI_INCLUDE_RECIPES)
696         $(AM_V_NITSI) $(NITSI_ENVIRONMENT) $(NITSI) --log-level error run-test -d $@ \
697                 --default-settings $(abs_builddir)/test/nitsi/test/settings --interactive-error-handling
698
699 .PHONY: nitsi
700 nitsi: $(NITSI_TESTS)
701
702 # Downloads a virtual image file and extracts it
703 $(VIRTUAL_ENVIRONMENT_IMAGES):
704         $(AM_V_DOWNLOAD)$(MKDIR_P) $(dir $@) && \
705         $(WGET) -qO - $(VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL)/$(notdir $@).xz | xz -qd > $@