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