]> git.ipfire.org Git - people/ms/network.git/blob - Makefile.am
Makefile: Remove any excess substitution rules
[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_NITSI = $(AM_V_NITSI_$(V))
93 AM_V_NITSI_ = $(AM_V_NITSI_$(AM_DEFAULT_VERBOSITY))
94 AM_V_NITSI_0 = @echo " NITSI " $@;
95
96 AM_V_XSLT = $(AM_V_XSLT_$(V))
97 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
98 AM_V_XSLT_0 = @echo " XSLT " $@;
99
100 # ------------------------------------------------------------------------------
101
102 dist_doc_DATA = \
103 README \
104 docs/CODING_STYLE \
105 docs/COPYING
106
107 dist_sbin_SCRIPTS = \
108 src/dhclient-script \
109 src/firewall-config \
110 src/firewall4 \
111 src/firewall6 \
112 src/network
113
114 network_DATA = \
115 src/functions/functions
116
117 CLEANFILES += \
118 src/functions/functions
119
120 EXTRA_DIST += \
121 src/functions/functions.in
122
123 dist_network_DATA = \
124 src/functions/functions.at \
125 src/functions/functions.auth \
126 src/functions/functions.bonding \
127 src/functions/functions.bridge \
128 src/functions/functions.cli \
129 src/functions/functions.cli.firewall \
130 src/functions/functions.colors \
131 src/functions/functions.config \
132 src/functions/functions.conntrack \
133 src/functions/functions.constants \
134 src/functions/functions.constants-firewall \
135 src/functions/functions.db \
136 src/functions/functions.description \
137 src/functions/functions.device \
138 src/functions/functions.dhclient \
139 src/functions/functions.dhcpd \
140 src/functions/functions.distro \
141 src/functions/functions.dns \
142 src/functions/functions.dummy \
143 src/functions/functions.editor \
144 src/functions/functions.firewall \
145 src/functions/functions.firewall-policy \
146 src/functions/functions.firewall-zones \
147 src/functions/functions.he \
148 src/functions/functions.hook \
149 src/functions/functions.hostapd \
150 src/functions/functions.hotplug \
151 src/functions/functions.http \
152 src/functions/functions.interrupts \
153 src/functions/functions.ip \
154 src/functions/functions.ipsec \
155 src/functions/functions.ipsec-pool \
156 src/functions/functions.iptables \
157 src/functions/functions.ip-tunnel \
158 src/functions/functions.ipv4 \
159 src/functions/functions.ipv6 \
160 src/functions/functions.list \
161 src/functions/functions.lock \
162 src/functions/functions.logging \
163 src/functions/functions.macros \
164 src/functions/functions.modem \
165 src/functions/functions.phy \
166 src/functions/functions.ports \
167 src/functions/functions.ppp \
168 src/functions/functions.pppoe-server \
169 src/functions/functions.radvd \
170 src/functions/functions.route \
171 src/functions/functions.routing \
172 src/functions/functions.serial \
173 src/functions/functions.service \
174 src/functions/functions.settings \
175 src/functions/functions.stp \
176 src/functions/functions.sysctl \
177 src/functions/functions.system \
178 src/functions/functions.triggers \
179 src/functions/functions.usb \
180 src/functions/functions.util \
181 src/functions/functions.vlan \
182 src/functions/functions.vpn \
183 src/functions/functions.vpn-security-policies \
184 src/functions/functions.wireless \
185 src/functions/functions.wireless-mesh \
186 src/functions/functions.wireless-networks \
187 src/functions/functions.wpa_supplicant \
188 src/functions/functions.zone \
189 src/network-radvd-config \
190 src/dhclient-helper \
191 src/header-config \
192 src/header-port \
193 src/header-zone \
194 src/ppp/dialer \
195 src/ppp/pppoe-server
196
197 dist_helpers_SCRIPTS = \
198 src/helpers/dhcpd-config-helper \
199 src/helpers/firewall-kernel-init \
200 src/helpers/hostapd-config-helper \
201 src/helpers/ipsec-updown \
202 src/helpers/pppd-angel \
203 src/helpers/wpa_supplicant
204
205 bin_PROGRAMS = \
206 src/inetcalc
207
208 src_inetcalc_SOURCES = \
209 src/inetcalc.c
210
211 src_inetcalc_LDADD = \
212 src/libnetwork.la
213
214 dist_hooks_configs_SCRIPTS = \
215 src/hooks/configs/dhcp \
216 src/hooks/configs/ipv6-auto \
217 src/hooks/configs/pppoe-server \
218 src/hooks/configs/static
219
220 dist_hooks_ports_SCRIPTS = \
221 src/hooks/ports/bonding \
222 src/hooks/ports/dummy \
223 src/hooks/ports/ethernet \
224 src/hooks/ports/vlan \
225 src/hooks/ports/wireless-ap \
226 src/hooks/ports/wireless-mesh
227
228 dist_hooks_zones_SCRIPTS = \
229 src/hooks/zones/6to4-tunnel \
230 src/hooks/zones/bridge \
231 src/hooks/zones/modem \
232 src/hooks/zones/pppoe \
233 src/hooks/zones/wireless
234
235 INSTALL_DIRS += \
236 $(configdir) \
237 $(configdir)/ports \
238 $(configdir)/vpn \
239 $(configdir)/vpn/ipsec/connections \
240 $(configdir)/vpn/security-policies \
241 $(configdir)/wireless \
242 $(configdir)/wireless/networks \
243 $(configdir)/zones
244
245 # ------------------------------------------------------------------------------
246
247 LIBNETWORK_CURRENT=0
248 LIBNETWORK_REVISION=0
249 LIBNETWORK_AGE=0
250
251 pkginclude_HEADERS = \
252 src/libnetwork/network/interface.h \
253 src/libnetwork/network/libnetwork.h \
254 src/libnetwork/network/logging.h \
255 src/libnetwork/network/phy.h
256
257 lib_LTLIBRARIES = \
258 src/libnetwork.la
259
260 src_libnetwork_la_SOURCES = \
261 src/libnetwork/interface.c \
262 src/libnetwork/libnetwork-private.h \
263 src/libnetwork/libnetwork.c \
264 src/libnetwork/phy.c
265
266 src_libnetwork_la_LIBADD = \
267 $(LIBNL_LIBS)
268
269 src_libnetwork_la_CPPFLAGS = \
270 $(AM_CPPFLAGS) \
271 $(LIBNL_CPPFLAGS) \
272 -D_GNU_SOURCE \
273 -DNETWORK_PRIVATE
274
275 src_libnetwork_la_CFLAGS = \
276 $(AM_CFLAGS) \
277 $(LIBNL_CFLAGS)
278
279 src_libnetwork_la_LDFLAGS = \
280 $(AM_LDFLAGS) \
281 -version-info $(LIBNETWORK_CURRENT):$(LIBNETWORK_REVISION):$(LIBNETWORK_AGE) \
282 -Wl,--version-script=$(top_srcdir)/src/libnetwork/libnetwork.sym
283
284 src_libnetwork_la_DEPENDENCIES = \
285 src/libnetwork/libnetwork.sym
286
287 EXTRA_DIST += \
288 src/libnetwork/libnetwork.sym
289
290 # ------------------------------------------------------------------------------
291
292 util_PROGRAMS = \
293 src/utils/network-phy-list-ht-caps
294
295 src_utils_network_phy_list_ht_caps_SOURCES = \
296 src/utils/network-phy-list-ht-caps.c
297
298 src_utils_network_phy_list_ht_caps_LDADD = \
299 src/libnetwork.la
300
301 # ------------------------------------------------------------------------------
302
303 ppp_SCRIPTS = \
304 src/ppp/ip-updown
305
306 CLEANFILES += \
307 src/ppp/ip-updown
308
309 EXTRA_DIST += \
310 src/ppp/ip-updown.in
311
312 INSTALL_DIRS += \
313 $(pppdir) \
314 $(logdir)
315
316 ppp-install-hook:
317 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up
318 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-up
319 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-down
320 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-up
321 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-down
322
323 ppp-uninstall-hook:
324 rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up}
325 rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up}
326
327 INSTALL_EXEC_HOOKS += ppp-install-hook
328 UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook
329
330 # ------------------------------------------------------------------------------
331
332 if HAVE_SYSTEMD
333 systemdsystemunit_DATA = \
334 src/systemd/firewall4.service \
335 src/systemd/firewall6.service \
336 src/systemd/firewall-init.service \
337 src/systemd/network-init.service \
338 src/systemd/network@.service
339
340 CLEANFILES += \
341 $(systemdsystemunit_DATA)
342
343 INSTALL_DIRS += \
344 $(systemdsystemunitdir)
345 endif
346
347 EXTRA_DIST += \
348 src/systemd/firewall4.service.in \
349 src/systemd/firewall6.service.in \
350 src/systemd/firewall-init.service.in \
351 src/systemd/network-init.service.in \
352 src/systemd/network@.service.in
353
354 # ------------------------------------------------------------------------------
355
356 systemconfig_vpndir = $(systemconfigdir)/vpn
357
358 dist_systemconfig_vpn_security_policies_DATA = \
359 config/vpn/security-policies/performance \
360 config/vpn/security-policies/system
361
362 systemconfig_vpn_security_policiesdir = $(systemconfig_vpndir)/security-policies
363
364 # ------------------------------------------------------------------------------
365
366 dist_sysctl_DATA = \
367 src/sysctl/network.conf
368
369 # ------------------------------------------------------------------------------
370
371 dist_bashcompletion_SCRIPTS = \
372 src/bash-completion/network
373
374 # ------------------------------------------------------------------------------
375
376 dist_tmpfiles_DATA = \
377 src/tmpfiles/network.conf
378
379 # ------------------------------------------------------------------------------
380
381 if HAVE_UDEV
382 dist_udev_SCRIPTS = \
383 src/udev/network-hotplug \
384 src/udev/network-hotplug-rename \
385 src/udev/network-hotplug-serial
386
387 dist_udevrules_DATA = \
388 src/udev/rules.d/50-serial-whitelist.rules \
389 src/udev/rules.d/60-net.rules
390
391 INSTALL_DIRS += \
392 $(udevdir) \
393 $(udevrulesdir)
394 endif
395
396 # ------------------------------------------------------------------------------
397
398 pkgconfig_DATA = \
399 src/network.pc
400
401 CLEANFILES += \
402 $(pkgconfig_DATA)
403
404 EXTRA_DIST += \
405 src/network.pc.in
406
407 # ------------------------------------------------------------------------------
408
409 dist_macros_DATA = \
410 src/macros/DHCP \
411 src/macros/HTTP \
412 src/macros/HTTPS \
413 src/macros/WWW
414
415 # ------------------------------------------------------------------------------
416
417 INSTALL_DIRS += \
418 $(triggersdir)
419
420 # ------------------------------------------------------------------------------
421
422 MANPAGES = \
423 man/firewall-settings.8 \
424 man/network.8 \
425 man/network-color.8 \
426 man/network-description.8 \
427 man/network-device.8 \
428 man/network-dhcp.8 \
429 man/network-dns-server.8 \
430 man/network-performance-tuning.8 \
431 man/network-port.8 \
432 man/network-quick-start.8 \
433 man/network-route.8 \
434 man/network-route-static.8 \
435 man/network-settings.8 \
436 man/network-vpn.8 \
437 man/network-vpn-security-policies.8 \
438 man/network-zone.8 \
439 man/network-zone-6to4-tunnel.8 \
440 man/network-zone-bridge.8 \
441 man/network-zone-config-pppoe-server.8 \
442 man/network-zone-modem.8 \
443 man/network-zone-pppoe.8 \
444 man/network-zone-wireless.8
445
446 MANPAGES_XML = $(patsubst %.8,%.xml,$(MANPAGES))
447 MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
448
449 .PHONY: man
450 man: $(MANPAGES) $(MANPAGES_HTML)
451
452 man_MANS = \
453 $(MANPAGES)
454
455 noinst_DATA += \
456 $(MANPAGES_HTML)
457
458 CLEANFILES += \
459 $(man_MANS) \
460 $(MANPAGES_HTML)
461
462 EXTRA_DIST += \
463 $(MANPAGES_XML) \
464 man/custom-html.xsl
465
466 XSLTPROC_FLAGS = \
467 --nonet \
468 --stringparam man.output.quietly 1 \
469 --stringparam funcsynopsis.style ansi \
470 --stringparam man.th.extra1.suppress 1 \
471 --stringparam man.authors.section.enabled 1 \
472 --stringparam man.copyright.section.enabled 1
473
474 XSLTPROC_COMMAND_MAN = \
475 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
476 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
477
478 XSLTPROC_COMMAND_HTML = \
479 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
480
481 man/%.8: man/%.xml
482 $(XSLTPROC_COMMAND_MAN)
483
484 man/%.html: man/%.xml man/custom-html.xsl
485 $(XSLTPROC_COMMAND_HTML)
486
487 # ------------------------------------------------------------------------------
488
489 substitutions = \
490 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
491 '|PACKAGE_URL=$(PACKAGE_URL)|' \
492 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
493 '|prefix=$(prefix)|' \
494 '|exec_prefix=$(exec_prefix)|' \
495 '|sbindir=$(sbindir)|' \
496 '|networkdir=$(networkdir)|' \
497 '|helpersdir=$(helpersdir)|' \
498 '|utildir=$(utildir)|'
499
500 SED_PROCESS = \
501 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
502 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
503 < $< > $@
504
505 %: %.in Makefile
506 $(SED_PROCESS)
507
508 INSTALL_DIRS += \
509 $(sbindir)
510
511 install-exec-hook: $(INSTALL_EXEC_HOOKS)
512
513 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
514
515 # - testsuite ------------------------------------------------------------------
516
517 TESTS_ENVIRONMENT = \
518 LD_LIBRARY_PATH=$(top_builddir)/src/.libs:$(LD_LIBRARY_PATH) \
519 PATH=$(top_builddir)/src:$(PATH) \
520 functions=$(abs_builddir)/src/functions/functions \
521 networkdir=$(abs_srcdir)/src/functions \
522 testdir=$(top_srcdir)/test
523
524 dist_check_DATA = \
525 test/constants.sh \
526 test/test-functions
527
528 dist_check_SCRIPTS = \
529 $(TESTS)
530
531 TESTS = \
532 test/load-library \
533 test/functions/ip/ip_detect_protocol \
534 test/functions/ip/ip_get_prefix \
535 test/functions/ip/ip_net_is_valid \
536 test/functions/ip/ip_is_valid \
537 test/functions/ip/ip_network_is_subnet_of \
538 test/functions/ip/ip_prefix_is_valid \
539 test/functions/ip/ip_protocol_is_supported \
540 test/functions/ip/ip_split_prefix
541
542 # - NITSI tests ----------------------------------------------------------------
543
544 NITSI_TESTS = \
545 test/nitsi/test/hello-world
546
547 EXTRA_DIST += \
548 test/nitsi/test/hello-world/recipe \
549 test/nitsi/test/hello-world/settings
550
551 NITSI_ENVIRONMENT =
552
553 .PHONY: $(NITSI_TESTS)
554 $(NITSI_TESTS): dist
555 $(AM_V_NITSI) $(NITSI_ENVIRONMENT) $(NITSI) --log-level error -d $@
556
557 .PHONY: nitsi
558 nitsi: $(NITSI_TESTS)