]>
Commit | Line | Data |
---|---|---|
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 | ||
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 | ||
f166708b | 31 | configdir = $(sysconfdir)/network |
bae37360 | 32 | bashcompletiondir= $(datadir)/bash-completion/completions |
5ca9dc30 | 33 | libexecdir = $(prefix)/lib |
01f2b2e4 | 34 | pkgconfigdir = $(libdir)/pkgconfig |
5ca9dc30 | 35 | pppdir = $(sysconfdir)/ppp |
5e84cd41 | 36 | systemconfigdir = $(datadir)/network |
5ca9dc30 MT |
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 | |
7d2cb6d3 | 47 | hooks_configsdir = $(hooksdir)/configs |
5ca9dc30 MT |
48 | hooks_portsdir = $(hooksdir)/ports |
49 | hooks_zonesdir = $(hooksdir)/zones | |
50 | ||
de3cecef MT |
51 | triggersdir = $(networkdir)/triggers |
52 | ||
9c9d0585 | 53 | logdir = $(localestatedir)/log/network |
e145b2f3 | 54 | utildir = $(networkdir) |
9c9d0585 | 55 | |
5ca9dc30 MT |
56 | CLEANFILES = |
57 | DISTCLEANFILES = | |
58 | EXTRA_DIST = | |
59 | INSTALL_DIRS = | |
60 | INSTALL_EXEC_HOOKS = | |
61 | UNINSTALL_EXEC_HOOKS = | |
62 | noinst_DATA = | |
63 | ||
01f2b2e4 MT |
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 | |
e708653f | 79 | |
5ca9dc30 MT |
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 | ||
c4966dd6 MT |
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 " $@; | |
95 | ||
1908d2b3 MT |
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 " $@; | |
99 | ||
5ca9dc30 MT |
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 " $@; | |
103 | ||
104 | # ------------------------------------------------------------------------------ | |
105 | ||
106 | dist_doc_DATA = \ | |
1337eee2 | 107 | README \ |
dd46582c | 108 | docs/CODING_STYLE \ |
1337eee2 | 109 | docs/COPYING |
5ca9dc30 MT |
110 | |
111 | dist_sbin_SCRIPTS = \ | |
112 | src/dhclient-script \ | |
113 | src/firewall-config \ | |
114 | src/firewall4 \ | |
115 | src/firewall6 \ | |
116 | src/network | |
117 | ||
a62e991a | 118 | network_DATA = \ |
5ca9dc30 MT |
119 | src/functions/functions |
120 | ||
121 | CLEANFILES += \ | |
122 | src/functions/functions | |
123 | ||
124 | EXTRA_DIST += \ | |
125 | src/functions/functions.in | |
126 | ||
a62e991a | 127 | dist_network_DATA = \ |
5ca9dc30 MT |
128 | src/functions/functions.at \ |
129 | src/functions/functions.auth \ | |
5ca9dc30 MT |
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 \ | |
5ccc7299 | 140 | src/functions/functions.description \ |
5ca9dc30 MT |
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 \ | |
e524986c | 147 | src/functions/functions.editor \ |
5ca9dc30 MT |
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 \ | |
b8026986 | 154 | src/functions/functions.hotplug \ |
5ca9dc30 | 155 | src/functions/functions.http \ |
de72bd91 | 156 | src/functions/functions.interrupts \ |
5ca9dc30 | 157 | src/functions/functions.ip \ |
be844b7b | 158 | src/functions/functions.ipsec \ |
4e78b7ad | 159 | src/functions/functions.ipsec-pool \ |
5ca9dc30 MT |
160 | src/functions/functions.iptables \ |
161 | src/functions/functions.ip-tunnel \ | |
162 | src/functions/functions.ipv4 \ | |
163 | src/functions/functions.ipv6 \ | |
5ca9dc30 MT |
164 | src/functions/functions.list \ |
165 | src/functions/functions.lock \ | |
166 | src/functions/functions.logging \ | |
167 | src/functions/functions.macros \ | |
5ca9dc30 MT |
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 \ | |
5ca9dc30 MT |
174 | src/functions/functions.route \ |
175 | src/functions/functions.routing \ | |
176 | src/functions/functions.serial \ | |
177 | src/functions/functions.service \ | |
e9df08ad | 178 | src/functions/functions.settings \ |
5ca9dc30 | 179 | src/functions/functions.stp \ |
5ca9dc30 | 180 | src/functions/functions.sysctl \ |
de72bd91 | 181 | src/functions/functions.system \ |
de3cecef | 182 | src/functions/functions.triggers \ |
5ca9dc30 MT |
183 | src/functions/functions.usb \ |
184 | src/functions/functions.util \ | |
185 | src/functions/functions.vlan \ | |
2da98f56 | 186 | src/functions/functions.vpn \ |
3eae7bed | 187 | src/functions/functions.vpn-security-policies \ |
5ca9dc30 | 188 | src/functions/functions.wireless \ |
81bf9898 | 189 | src/functions/functions.wireless-mesh \ |
49958b8c | 190 | src/functions/functions.wireless-networks \ |
5ca9dc30 MT |
191 | src/functions/functions.wpa_supplicant \ |
192 | src/functions/functions.zone \ | |
193 | src/network-radvd-config \ | |
194 | src/dhclient-helper \ | |
195 | src/header-config \ | |
196 | src/header-port \ | |
197 | src/header-zone \ | |
198 | src/ppp/dialer \ | |
199 | src/ppp/pppoe-server | |
200 | ||
201 | dist_helpers_SCRIPTS = \ | |
5ca9dc30 MT |
202 | src/helpers/dhcpd-config-helper \ |
203 | src/helpers/firewall-kernel-init \ | |
204 | src/helpers/hostapd-config-helper \ | |
67baa452 | 205 | src/helpers/ipsec-updown \ |
5ca9dc30 | 206 | src/helpers/pppd-angel \ |
02807ad2 | 207 | src/helpers/wpa_supplicant |
5ca9dc30 | 208 | |
13a6e69f MT |
209 | bin_PROGRAMS = \ |
210 | src/inetcalc | |
211 | ||
212 | src_inetcalc_SOURCES = \ | |
213 | src/inetcalc.c | |
214 | ||
01f2b2e4 MT |
215 | src_inetcalc_LDADD = \ |
216 | src/libnetwork.la | |
217 | ||
7d2cb6d3 | 218 | dist_hooks_configs_SCRIPTS = \ |
9353a4e4 | 219 | src/hooks/configs/dhcp \ |
b73e9d43 | 220 | src/hooks/configs/ipv6-auto \ |
46a28dcd MT |
221 | src/hooks/configs/pppoe-server \ |
222 | src/hooks/configs/static | |
7d2cb6d3 | 223 | |
5ca9dc30 | 224 | dist_hooks_ports_SCRIPTS = \ |
5ca9dc30 MT |
225 | src/hooks/ports/bonding \ |
226 | src/hooks/ports/dummy \ | |
227 | src/hooks/ports/ethernet \ | |
5ca9dc30 | 228 | src/hooks/ports/vlan \ |
727248f0 MT |
229 | src/hooks/ports/wireless-ap \ |
230 | src/hooks/ports/wireless-mesh | |
5ca9dc30 MT |
231 | |
232 | dist_hooks_zones_SCRIPTS = \ | |
5ca9dc30 | 233 | src/hooks/zones/6to4-tunnel \ |
5ca9dc30 | 234 | src/hooks/zones/bridge \ |
5ca9dc30 MT |
235 | src/hooks/zones/modem \ |
236 | src/hooks/zones/pppoe \ | |
5ca9dc30 MT |
237 | src/hooks/zones/wireless |
238 | ||
f166708b MT |
239 | INSTALL_DIRS += \ |
240 | $(configdir) \ | |
241 | $(configdir)/ports \ | |
242 | $(configdir)/vpn \ | |
243 | $(configdir)/vpn/ipsec/connections \ | |
244 | $(configdir)/vpn/security-policies \ | |
245 | $(configdir)/wireless \ | |
246 | $(configdir)/wireless/networks \ | |
247 | $(configdir)/zones | |
248 | ||
5ca9dc30 MT |
249 | # ------------------------------------------------------------------------------ |
250 | ||
01f2b2e4 MT |
251 | LIBNETWORK_CURRENT=0 |
252 | LIBNETWORK_REVISION=0 | |
253 | LIBNETWORK_AGE=0 | |
254 | ||
255 | pkginclude_HEADERS = \ | |
248629ae | 256 | src/libnetwork/network/interface.h \ |
6f4814db | 257 | src/libnetwork/network/libnetwork.h \ |
9cb2f0c0 MT |
258 | src/libnetwork/network/logging.h \ |
259 | src/libnetwork/network/phy.h | |
01f2b2e4 MT |
260 | |
261 | lib_LTLIBRARIES = \ | |
262 | src/libnetwork.la | |
263 | ||
264 | src_libnetwork_la_SOURCES = \ | |
248629ae | 265 | src/libnetwork/interface.c \ |
01f2b2e4 | 266 | src/libnetwork/libnetwork-private.h \ |
9cb2f0c0 MT |
267 | src/libnetwork/libnetwork.c \ |
268 | src/libnetwork/phy.c | |
01f2b2e4 | 269 | |
db0a2d76 MT |
270 | src_libnetwork_la_LIBADD = \ |
271 | $(LIBNL_LIBS) | |
272 | ||
6f4814db MT |
273 | src_libnetwork_la_CPPFLAGS = \ |
274 | $(AM_CPPFLAGS) \ | |
db0a2d76 | 275 | $(LIBNL_CPPFLAGS) \ |
6f4814db MT |
276 | -D_GNU_SOURCE \ |
277 | -DNETWORK_PRIVATE | |
278 | ||
db0a2d76 MT |
279 | src_libnetwork_la_CFLAGS = \ |
280 | $(AM_CFLAGS) \ | |
281 | $(LIBNL_CFLAGS) | |
282 | ||
01f2b2e4 MT |
283 | src_libnetwork_la_LDFLAGS = \ |
284 | $(AM_LDFLAGS) \ | |
285 | -version-info $(LIBNETWORK_CURRENT):$(LIBNETWORK_REVISION):$(LIBNETWORK_AGE) \ | |
286 | -Wl,--version-script=$(top_srcdir)/src/libnetwork/libnetwork.sym | |
287 | ||
288 | src_libnetwork_la_DEPENDENCIES = \ | |
289 | src/libnetwork/libnetwork.sym | |
290 | ||
291 | EXTRA_DIST += \ | |
292 | src/libnetwork/libnetwork.sym | |
293 | ||
294 | # ------------------------------------------------------------------------------ | |
e145b2f3 MT |
295 | |
296 | util_PROGRAMS = \ | |
297 | src/utils/network-phy-list-ht-caps | |
298 | ||
299 | src_utils_network_phy_list_ht_caps_SOURCES = \ | |
300 | src/utils/network-phy-list-ht-caps.c | |
301 | ||
302 | src_utils_network_phy_list_ht_caps_LDADD = \ | |
303 | src/libnetwork.la | |
304 | ||
305 | # ------------------------------------------------------------------------------ | |
01f2b2e4 | 306 | |
5ca9dc30 MT |
307 | ppp_SCRIPTS = \ |
308 | src/ppp/ip-updown | |
309 | ||
310 | CLEANFILES += \ | |
311 | src/ppp/ip-updown | |
312 | ||
313 | EXTRA_DIST += \ | |
314 | src/ppp/ip-updown.in | |
315 | ||
316 | INSTALL_DIRS += \ | |
9c9d0585 SS |
317 | $(pppdir) \ |
318 | $(logdir) | |
5ca9dc30 MT |
319 | |
320 | ppp-install-hook: | |
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 | |
326 | ||
327 | ppp-uninstall-hook: | |
328 | rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up} | |
329 | rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up} | |
330 | ||
331 | INSTALL_EXEC_HOOKS += ppp-install-hook | |
332 | UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook | |
333 | ||
334 | # ------------------------------------------------------------------------------ | |
335 | ||
336 | if HAVE_SYSTEMD | |
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 | |
343 | ||
344 | CLEANFILES += \ | |
345 | $(systemdsystemunit_DATA) | |
346 | ||
347 | INSTALL_DIRS += \ | |
348 | $(systemdsystemunitdir) | |
349 | endif | |
350 | ||
351 | EXTRA_DIST += \ | |
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 | |
357 | ||
358 | # ------------------------------------------------------------------------------ | |
359 | ||
5e84cd41 MT |
360 | systemconfig_vpndir = $(systemconfigdir)/vpn |
361 | ||
362 | dist_systemconfig_vpn_security_policies_DATA = \ | |
56d5efa7 | 363 | config/vpn/security-policies/performance \ |
5e84cd41 MT |
364 | config/vpn/security-policies/system |
365 | ||
366 | systemconfig_vpn_security_policiesdir = $(systemconfig_vpndir)/security-policies | |
367 | ||
368 | # ------------------------------------------------------------------------------ | |
369 | ||
5ca9dc30 MT |
370 | dist_sysctl_DATA = \ |
371 | src/sysctl/network.conf | |
372 | ||
373 | # ------------------------------------------------------------------------------ | |
374 | ||
bae37360 MT |
375 | dist_bashcompletion_SCRIPTS = \ |
376 | src/bash-completion/network | |
377 | ||
378 | # ------------------------------------------------------------------------------ | |
379 | ||
5ca9dc30 | 380 | dist_tmpfiles_DATA = \ |
f9dac5a0 | 381 | src/tmpfiles/network.conf |
5ca9dc30 MT |
382 | |
383 | # ------------------------------------------------------------------------------ | |
384 | ||
385 | if HAVE_UDEV | |
386 | dist_udev_SCRIPTS = \ | |
387 | src/udev/network-hotplug \ | |
388 | src/udev/network-hotplug-rename \ | |
389 | src/udev/network-hotplug-serial | |
390 | ||
391 | dist_udevrules_DATA = \ | |
392 | src/udev/rules.d/50-serial-whitelist.rules \ | |
393 | src/udev/rules.d/60-net.rules | |
394 | ||
395 | INSTALL_DIRS += \ | |
396 | $(udevdir) \ | |
397 | $(udevrulesdir) | |
398 | endif | |
399 | ||
400 | # ------------------------------------------------------------------------------ | |
401 | ||
01f2b2e4 | 402 | pkgconfig_DATA = \ |
5ca9dc30 MT |
403 | src/network.pc |
404 | ||
405 | CLEANFILES += \ | |
01f2b2e4 | 406 | $(pkgconfig_DATA) |
5ca9dc30 MT |
407 | |
408 | EXTRA_DIST += \ | |
409 | src/network.pc.in | |
410 | ||
411 | # ------------------------------------------------------------------------------ | |
412 | ||
413 | dist_macros_DATA = \ | |
414 | src/macros/DHCP \ | |
415 | src/macros/HTTP \ | |
416 | src/macros/HTTPS \ | |
417 | src/macros/WWW | |
418 | ||
419 | # ------------------------------------------------------------------------------ | |
420 | ||
ec3fe5b7 | 421 | INSTALL_DIRS += \ |
de3cecef MT |
422 | $(triggersdir) |
423 | ||
424 | # ------------------------------------------------------------------------------ | |
425 | ||
5ca9dc30 | 426 | MANPAGES = \ |
2b0ff832 | 427 | man/firewall-settings.8 \ |
5ca9dc30 | 428 | man/network.8 \ |
89c81bcf | 429 | man/network-color.8 \ |
6135a5b3 | 430 | man/network-description.8 \ |
5ca9dc30 | 431 | man/network-device.8 \ |
427f5ae2 | 432 | man/network-dhcp.8 \ |
5ca9dc30 | 433 | man/network-dns-server.8 \ |
de72bd91 | 434 | man/network-performance-tuning.8 \ |
7a302fa7 | 435 | man/network-port.8 \ |
94eab754 | 436 | man/network-quick-start.8 \ |
5ca9dc30 | 437 | man/network-route.8 \ |
e023191b | 438 | man/network-route-static.8 \ |
2b0ff832 | 439 | man/network-settings.8 \ |
bec94f95 MT |
440 | man/network-vpn.8 \ |
441 | man/network-vpn-security-policies.8 \ | |
5ca9dc30 | 442 | man/network-zone.8 \ |
5ca9dc30 | 443 | man/network-zone-6to4-tunnel.8 \ |
5ca9dc30 MT |
444 | man/network-zone-bridge.8 \ |
445 | man/network-zone-config-pppoe-server.8 \ | |
7a302fa7 | 446 | man/network-zone-modem.8 \ |
2fb7ae4d MT |
447 | man/network-zone-pppoe.8 \ |
448 | man/network-zone-wireless.8 | |
5ca9dc30 MT |
449 | |
450 | MANPAGES_XML = $(patsubst %.8,%.xml,$(MANPAGES)) | |
451 | MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML)) | |
452 | ||
453 | .PHONY: man | |
454 | man: $(MANPAGES) $(MANPAGES_HTML) | |
455 | ||
456 | man_MANS = \ | |
457 | $(MANPAGES) | |
458 | ||
459 | noinst_DATA += \ | |
460 | $(MANPAGES_HTML) | |
461 | ||
462 | CLEANFILES += \ | |
463 | $(man_MANS) \ | |
464 | $(MANPAGES_HTML) | |
465 | ||
466 | EXTRA_DIST += \ | |
467 | $(MANPAGES_XML) \ | |
468 | man/custom-html.xsl | |
469 | ||
470 | XSLTPROC_FLAGS = \ | |
471 | --nonet \ | |
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 | |
477 | ||
478 | XSLTPROC_COMMAND_MAN = \ | |
479 | $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \ | |
480 | http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< | |
481 | ||
482 | XSLTPROC_COMMAND_HTML = \ | |
483 | $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $< | |
484 | ||
485 | man/%.8: man/%.xml | |
486 | $(XSLTPROC_COMMAND_MAN) | |
487 | ||
488 | man/%.html: man/%.xml man/custom-html.xsl | |
489 | $(XSLTPROC_COMMAND_HTML) | |
490 | ||
491 | # ------------------------------------------------------------------------------ | |
492 | ||
493 | substitutions = \ | |
494 | '|PACKAGE_NAME=$(PACKAGE_NAME)|' \ | |
495 | '|PACKAGE_URL=$(PACKAGE_URL)|' \ | |
496 | '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \ | |
a35f416c | 497 | '|builddir=$(abs_builddir)|' \ |
5ca9dc30 MT |
498 | '|prefix=$(prefix)|' \ |
499 | '|exec_prefix=$(exec_prefix)|' \ | |
500 | '|sbindir=$(sbindir)|' \ | |
c6525a63 | 501 | '|networkdir=$(networkdir)|' \ |
96275aa1 | 502 | '|helpersdir=$(helpersdir)|' \ |
c4966dd6 MT |
503 | '|utildir=$(utildir)|' \ |
504 | '|VIRTUAL_ENVIRONMENT_IMAGES_DIR=$(VIRTUAL_ENVIRONMENT_IMAGES_DIR)|' | |
5ca9dc30 MT |
505 | |
506 | SED_PROCESS = \ | |
507 | $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ | |
508 | $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \ | |
509 | < $< > $@ | |
510 | ||
3431f712 | 511 | %: %.in Makefile |
5ca9dc30 MT |
512 | $(SED_PROCESS) |
513 | ||
514 | INSTALL_DIRS += \ | |
515 | $(sbindir) | |
516 | ||
517 | install-exec-hook: $(INSTALL_EXEC_HOOKS) | |
518 | ||
519 | uninstall-hook: $(UNINSTALL_EXEC_HOOKS) | |
520 | ||
521 | # - testsuite ------------------------------------------------------------------ | |
522 | ||
523 | TESTS_ENVIRONMENT = \ | |
071d3416 | 524 | LD_LIBRARY_PATH=$(top_builddir)/src/.libs:$(LD_LIBRARY_PATH) \ |
8744a476 MT |
525 | PATH=$(top_builddir)/src:$(PATH) \ |
526 | functions=$(abs_builddir)/src/functions/functions \ | |
527 | networkdir=$(abs_srcdir)/src/functions \ | |
528 | testdir=$(top_srcdir)/test | |
529 | ||
530 | dist_check_DATA = \ | |
ee86c73f MT |
531 | test/constants.sh \ |
532 | test/test-functions | |
5ca9dc30 MT |
533 | |
534 | dist_check_SCRIPTS = \ | |
8744a476 | 535 | $(TESTS) |
5ca9dc30 MT |
536 | |
537 | TESTS = \ | |
bb8304ec | 538 | test/load-library \ |
bb8304ec | 539 | test/functions/ip/ip_detect_protocol \ |
bb8304ec | 540 | test/functions/ip/ip_get_prefix \ |
8b0958b2 | 541 | test/functions/ip/ip_net_is_valid \ |
b7fd8067 | 542 | test/functions/ip/ip_is_valid \ |
b862734c | 543 | test/functions/ip/ip_network_is_subnet_of \ |
b7fd8067 MT |
544 | test/functions/ip/ip_prefix_is_valid \ |
545 | test/functions/ip/ip_protocol_is_supported \ | |
546 | test/functions/ip/ip_split_prefix | |
1908d2b3 MT |
547 | |
548 | # - NITSI tests ---------------------------------------------------------------- | |
549 | ||
232d01c8 | 550 | # Files for the virtual environment |
c4966dd6 | 551 | VIRTUAL_ENVIRONMENT_FILES = \ |
232d01c8 MT |
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 \ | |
232d01c8 MT |
560 | test/nitsi/virtual-environment/basic/settings |
561 | ||
c4966dd6 MT |
562 | EXTRA_DIST += \ |
563 | test/nitsi/virtual-environment/basic/machines/alice/machine.xml.in \ | |
564 | test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml.in \ | |
565 | test/nitsi/virtual-environment/basic/machines/bob/machine.xml.in \ | |
43d82e80 JS |
566 | test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml.in \ |
567 | test/nitsi/virtual-environment/basic/settings.in | |
c4966dd6 MT |
568 | |
569 | CLEANFILES += \ | |
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 \ | |
43d82e80 JS |
573 | test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml \ |
574 | test/nitsi/virtual-environment/basic/settings | |
c4966dd6 MT |
575 | |
576 | # Virtual Machine Images | |
577 | VIRTUAL_ENVIRONMENT_IMAGES = \ | |
578 | $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-alice-2.qcow2 \ | |
579 | $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-bob.qcow2 | |
580 | ||
581 | DISTCLEANFILES += \ | |
582 | $(VIRTUAL_ENVIRONMENT_IMAGES) | |
583 | ||
584 | VIRTUAL_ENVIRONMENT_IMAGES_DIR = $(abs_builddir)/test/nitsi/virtual-environment/.images | |
585 | VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL = \ | |
586 | https://people.ipfire.org/~jschlag/nitsi-ipfire/virtual-environment/basic/ | |
587 | ||
60dbefba | 588 | NITSI_INCLUDE_RECIPES = \ |
f062403a | 589 | test/nitsi/include/make-install \ |
cc698df8 JS |
590 | test/nitsi/include/network-reset \ |
591 | test/nitsi/include/network-settings | |
60dbefba JS |
592 | |
593 | EXTRA_DIST += \ | |
594 | test/nitsi/include/make-install.in | |
cc698df8 JS |
595 | test/nitsi/include/network-reset \ |
596 | test/nitsi/include/network-settings | |
60dbefba JS |
597 | |
598 | CLEANFILES += \ | |
599 | test/nitsi/include/make-install | |
600 | ||
1908d2b3 | 601 | NITSI_TESTS = \ |
a35f416c MT |
602 | test/nitsi/test/hello-world \ |
603 | test/nitsi/test/make-check | |
1908d2b3 MT |
604 | |
605 | EXTRA_DIST += \ | |
606 | test/nitsi/test/hello-world/recipe \ | |
a35f416c MT |
607 | test/nitsi/test/hello-world/settings \ |
608 | test/nitsi/test/make-check/recipe.in \ | |
609 | test/nitsi/test/make-check/settings.in | |
610 | ||
611 | CLEANFILES += \ | |
612 | test/nitsi/test/make-check/recipe \ | |
613 | test/nitsi/test/make-check/settings | |
1908d2b3 MT |
614 | |
615 | NITSI_ENVIRONMENT = | |
616 | ||
617 | .PHONY: $(NITSI_TESTS) | |
60dbefba | 618 | $(NITSI_TESTS): % : %/recipe %/settings $(VIRTUAL_ENVIRONMENT_FILES) $(VIRTUAL_ENVIRONMENT_IMAGES) $(NITSI_INCLUDE_RECIPES) |
449ae5ce | 619 | $(AM_V_NITSI) $(NITSI_ENVIRONMENT) $(NITSI) --log-level error run-test -d $@ |
1908d2b3 MT |
620 | |
621 | .PHONY: nitsi | |
a35f416c | 622 | nitsi: dist $(NITSI_TESTS) |
c4966dd6 MT |
623 | |
624 | # Downloads a virtual image file and extracts it | |
625 | $(VIRTUAL_ENVIRONMENT_IMAGES): | |
626 | $(AM_V_DOWNLOAD)$(MKDIR_P) $(dir $@) && \ | |
627 | $(WGET) -qO - $(VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL)/$(notdir $@).xz | xz -qd > $@ |