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