]> git.ipfire.org Git - people/ms/network.git/blame - Makefile.am
libnetwork: Add logging infrastructure
[people/ms/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
01f2b2e4 34pkgconfigdir = $(libdir)/pkgconfig
5ca9dc30 35pppdir = $(sysconfdir)/ppp
5e84cd41 36systemconfigdir = $(datadir)/network
5ca9dc30
MT
37sysctldir = $(prefix)/lib/sysctl.d
38tmpfilesdir = $(prefix)/lib/tmpfiles.d
39udevrulesdir = $(udevdir)/rules.d
40
41networkdir = $(libexecdir)/network
42helpersdir = $(networkdir)/helpers
43
44macrosdir = $(libexecdir)/firewall/macros
45
46hooksdir = $(networkdir)/hooks
7d2cb6d3 47hooks_configsdir = $(hooksdir)/configs
5ca9dc30
MT
48hooks_portsdir = $(hooksdir)/ports
49hooks_zonesdir = $(hooksdir)/zones
50
de3cecef
MT
51triggersdir = $(networkdir)/triggers
52
9c9d0585
SS
53logdir = $(localestatedir)/log/network
54
5ca9dc30
MT
55CLEANFILES =
56DISTCLEANFILES =
57EXTRA_DIST =
58INSTALL_DIRS =
59INSTALL_EXEC_HOOKS =
60UNINSTALL_EXEC_HOOKS =
61noinst_DATA =
62
01f2b2e4
MT
63AM_CPPFLAGS = \
64 $(OUR_CPPFLAGS) \
65 -include $(top_builddir)/config.h \
66 -I${top_srcdir}/src/libnetwork
67
68AM_CFLAGS = \
69 $(OUR_CFLAGS) \
70 -fvisibility=hidden \
71 -ffunction-sections \
72 -fdata-sections
73
74AM_LDFLAGS = \
75 $(OUR_LDFLAGS) \
76 -Wl,--gc-sections \
77 -Wl,--as-needed
e708653f 78
5ca9dc30
MT
79DISTCHECK_CONFIGURE_FLAGS = \
80 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \
81 --with-udevdir=$$dc_install_base/$(udevdir)
82
83install-directories-hook:
84 $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
85
86INSTALL_EXEC_HOOKS += \
87 install-directories-hook
88
89# ------------------------------------------------------------------------------
90
91AM_V_XSLT = $(AM_V_XSLT_$(V))
92AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
93AM_V_XSLT_0 = @echo " XSLT " $@;
94
95# ------------------------------------------------------------------------------
96
97dist_doc_DATA = \
1337eee2 98 README \
dd46582c 99 docs/CODING_STYLE \
1337eee2 100 docs/COPYING
5ca9dc30
MT
101
102dist_sbin_SCRIPTS = \
103 src/dhclient-script \
104 src/firewall-config \
105 src/firewall4 \
106 src/firewall6 \
107 src/network
108
109network_SCRIPTS = \
110 src/functions/functions
111
112CLEANFILES += \
113 src/functions/functions
114
115EXTRA_DIST += \
116 src/functions/functions.in
117
118dist_network_SCRIPTS = \
5ca9dc30
MT
119 src/functions/functions.at \
120 src/functions/functions.auth \
5ca9dc30
MT
121 src/functions/functions.bonding \
122 src/functions/functions.bridge \
123 src/functions/functions.cli \
124 src/functions/functions.cli.firewall \
125 src/functions/functions.colors \
126 src/functions/functions.config \
127 src/functions/functions.conntrack \
128 src/functions/functions.constants \
129 src/functions/functions.constants-firewall \
130 src/functions/functions.db \
5ccc7299 131 src/functions/functions.description \
5ca9dc30
MT
132 src/functions/functions.device \
133 src/functions/functions.dhclient \
134 src/functions/functions.dhcpd \
135 src/functions/functions.distro \
136 src/functions/functions.dns \
137 src/functions/functions.dummy \
e524986c 138 src/functions/functions.editor \
5ca9dc30
MT
139 src/functions/functions.firewall \
140 src/functions/functions.firewall-policy \
141 src/functions/functions.firewall-zones \
142 src/functions/functions.he \
143 src/functions/functions.hook \
144 src/functions/functions.hostapd \
b8026986 145 src/functions/functions.hotplug \
5ca9dc30 146 src/functions/functions.http \
de72bd91 147 src/functions/functions.interrupts \
5ca9dc30 148 src/functions/functions.ip \
be844b7b 149 src/functions/functions.ipsec \
4e78b7ad 150 src/functions/functions.ipsec-pool \
5ca9dc30
MT
151 src/functions/functions.iptables \
152 src/functions/functions.ip-tunnel \
153 src/functions/functions.ipv4 \
154 src/functions/functions.ipv6 \
5ca9dc30
MT
155 src/functions/functions.list \
156 src/functions/functions.lock \
157 src/functions/functions.logging \
158 src/functions/functions.macros \
5ca9dc30
MT
159 src/functions/functions.modem \
160 src/functions/functions.phy \
161 src/functions/functions.ports \
162 src/functions/functions.ppp \
163 src/functions/functions.pppoe-server \
164 src/functions/functions.radvd \
5ca9dc30
MT
165 src/functions/functions.route \
166 src/functions/functions.routing \
167 src/functions/functions.serial \
168 src/functions/functions.service \
e9df08ad 169 src/functions/functions.settings \
5ca9dc30 170 src/functions/functions.stp \
5ca9dc30 171 src/functions/functions.sysctl \
de72bd91 172 src/functions/functions.system \
de3cecef 173 src/functions/functions.triggers \
5ca9dc30
MT
174 src/functions/functions.usb \
175 src/functions/functions.util \
176 src/functions/functions.vlan \
2da98f56 177 src/functions/functions.vpn \
3eae7bed 178 src/functions/functions.vpn-security-policies \
5ca9dc30 179 src/functions/functions.wireless \
81bf9898 180 src/functions/functions.wireless-mesh \
49958b8c 181 src/functions/functions.wireless-networks \
5ca9dc30
MT
182 src/functions/functions.wpa_supplicant \
183 src/functions/functions.zone \
184 src/network-radvd-config \
185 src/dhclient-helper \
186 src/header-config \
187 src/header-port \
188 src/header-zone \
189 src/ppp/dialer \
190 src/ppp/pppoe-server
191
192dist_helpers_SCRIPTS = \
5ca9dc30
MT
193 src/helpers/dhcpd-config-helper \
194 src/helpers/firewall-kernel-init \
195 src/helpers/hostapd-config-helper \
67baa452 196 src/helpers/ipsec-updown \
5ca9dc30 197 src/helpers/pppd-angel \
02807ad2 198 src/helpers/wpa_supplicant
5ca9dc30 199
13a6e69f
MT
200bin_PROGRAMS = \
201 src/inetcalc
202
203src_inetcalc_SOURCES = \
204 src/inetcalc.c
205
01f2b2e4
MT
206src_inetcalc_LDADD = \
207 src/libnetwork.la
208
7d2cb6d3 209dist_hooks_configs_SCRIPTS = \
9353a4e4 210 src/hooks/configs/dhcp \
7d2cb6d3 211 src/hooks/configs/ipv4-static \
b73e9d43
MT
212 src/hooks/configs/ipv6-auto \
213 src/hooks/configs/ipv6-static \
7d2cb6d3
MT
214 src/hooks/configs/pppoe-server
215
5ca9dc30 216dist_hooks_ports_SCRIPTS = \
5ca9dc30
MT
217 src/hooks/ports/bonding \
218 src/hooks/ports/dummy \
219 src/hooks/ports/ethernet \
5ca9dc30 220 src/hooks/ports/vlan \
727248f0
MT
221 src/hooks/ports/wireless-ap \
222 src/hooks/ports/wireless-mesh
5ca9dc30
MT
223
224dist_hooks_zones_SCRIPTS = \
5ca9dc30 225 src/hooks/zones/6to4-tunnel \
5ca9dc30 226 src/hooks/zones/bridge \
5ca9dc30
MT
227 src/hooks/zones/modem \
228 src/hooks/zones/pppoe \
5ca9dc30
MT
229 src/hooks/zones/wireless
230
f166708b
MT
231INSTALL_DIRS += \
232 $(configdir) \
233 $(configdir)/ports \
234 $(configdir)/vpn \
235 $(configdir)/vpn/ipsec/connections \
236 $(configdir)/vpn/security-policies \
237 $(configdir)/wireless \
238 $(configdir)/wireless/networks \
239 $(configdir)/zones
240
5ca9dc30
MT
241# ------------------------------------------------------------------------------
242
01f2b2e4
MT
243LIBNETWORK_CURRENT=0
244LIBNETWORK_REVISION=0
245LIBNETWORK_AGE=0
246
247pkginclude_HEADERS = \
6f4814db
MT
248 src/libnetwork/network/libnetwork.h \
249 src/libnetwork/network/logging.h
01f2b2e4
MT
250
251lib_LTLIBRARIES = \
252 src/libnetwork.la
253
254src_libnetwork_la_SOURCES = \
255 src/libnetwork/libnetwork-private.h \
256 src/libnetwork/libnetwork.c
257
6f4814db
MT
258src_libnetwork_la_CPPFLAGS = \
259 $(AM_CPPFLAGS) \
260 -D_GNU_SOURCE \
261 -DNETWORK_PRIVATE
262
01f2b2e4
MT
263src_libnetwork_la_LDFLAGS = \
264 $(AM_LDFLAGS) \
265 -version-info $(LIBNETWORK_CURRENT):$(LIBNETWORK_REVISION):$(LIBNETWORK_AGE) \
266 -Wl,--version-script=$(top_srcdir)/src/libnetwork/libnetwork.sym
267
268src_libnetwork_la_DEPENDENCIES = \
269 src/libnetwork/libnetwork.sym
270
271EXTRA_DIST += \
272 src/libnetwork/libnetwork.sym
273
274# ------------------------------------------------------------------------------
275
5ca9dc30
MT
276ppp_SCRIPTS = \
277 src/ppp/ip-updown
278
279CLEANFILES += \
280 src/ppp/ip-updown
281
282EXTRA_DIST += \
283 src/ppp/ip-updown.in
284
285INSTALL_DIRS += \
9c9d0585
SS
286 $(pppdir) \
287 $(logdir)
5ca9dc30
MT
288
289ppp-install-hook:
290 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up
291 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-up
292 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-down
293 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-up
294 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-down
295
296ppp-uninstall-hook:
297 rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up}
298 rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up}
299
300INSTALL_EXEC_HOOKS += ppp-install-hook
301UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook
302
303# ------------------------------------------------------------------------------
304
305if HAVE_SYSTEMD
306systemdsystemunit_DATA = \
307 src/systemd/firewall4.service \
308 src/systemd/firewall6.service \
309 src/systemd/firewall-init.service \
310 src/systemd/network-init.service \
311 src/systemd/network@.service
312
313CLEANFILES += \
314 $(systemdsystemunit_DATA)
315
316INSTALL_DIRS += \
317 $(systemdsystemunitdir)
318endif
319
320EXTRA_DIST += \
321 src/systemd/firewall4.service.in \
322 src/systemd/firewall6.service.in \
323 src/systemd/firewall-init.service.in \
324 src/systemd/network-init.service.in \
325 src/systemd/network@.service.in
326
327# ------------------------------------------------------------------------------
328
5e84cd41
MT
329systemconfig_vpndir = $(systemconfigdir)/vpn
330
331dist_systemconfig_vpn_security_policies_DATA = \
56d5efa7 332 config/vpn/security-policies/performance \
5e84cd41
MT
333 config/vpn/security-policies/system
334
335systemconfig_vpn_security_policiesdir = $(systemconfig_vpndir)/security-policies
336
337# ------------------------------------------------------------------------------
338
5ca9dc30
MT
339dist_sysctl_DATA = \
340 src/sysctl/network.conf
341
342# ------------------------------------------------------------------------------
343
bae37360
MT
344dist_bashcompletion_SCRIPTS = \
345 src/bash-completion/network
346
347# ------------------------------------------------------------------------------
348
5ca9dc30 349dist_tmpfiles_DATA = \
f9dac5a0 350 src/tmpfiles/network.conf
5ca9dc30
MT
351
352# ------------------------------------------------------------------------------
353
354if HAVE_UDEV
355dist_udev_SCRIPTS = \
356 src/udev/network-hotplug \
357 src/udev/network-hotplug-rename \
358 src/udev/network-hotplug-serial
359
360dist_udevrules_DATA = \
361 src/udev/rules.d/50-serial-whitelist.rules \
362 src/udev/rules.d/60-net.rules
363
364INSTALL_DIRS += \
365 $(udevdir) \
366 $(udevrulesdir)
367endif
368
369# ------------------------------------------------------------------------------
370
01f2b2e4 371pkgconfig_DATA = \
5ca9dc30
MT
372 src/network.pc
373
374CLEANFILES += \
01f2b2e4 375 $(pkgconfig_DATA)
5ca9dc30
MT
376
377EXTRA_DIST += \
378 src/network.pc.in
379
380# ------------------------------------------------------------------------------
381
382dist_macros_DATA = \
383 src/macros/DHCP \
384 src/macros/HTTP \
385 src/macros/HTTPS \
386 src/macros/WWW
387
388# ------------------------------------------------------------------------------
389
ec3fe5b7 390INSTALL_DIRS += \
de3cecef
MT
391 $(triggersdir)
392
393# ------------------------------------------------------------------------------
394
5ca9dc30 395MANPAGES = \
2b0ff832 396 man/firewall-settings.8 \
5ca9dc30 397 man/network.8 \
89c81bcf 398 man/network-color.8 \
6135a5b3 399 man/network-description.8 \
5ca9dc30 400 man/network-device.8 \
427f5ae2 401 man/network-dhcp.8 \
5ca9dc30 402 man/network-dns-server.8 \
de72bd91 403 man/network-performance-tuning.8 \
7a302fa7 404 man/network-port.8 \
94eab754 405 man/network-quick-start.8 \
5ca9dc30 406 man/network-route.8 \
e023191b 407 man/network-route-static.8 \
2b0ff832 408 man/network-settings.8 \
bec94f95
MT
409 man/network-vpn.8 \
410 man/network-vpn-security-policies.8 \
5ca9dc30 411 man/network-zone.8 \
5ca9dc30 412 man/network-zone-6to4-tunnel.8 \
5ca9dc30
MT
413 man/network-zone-bridge.8 \
414 man/network-zone-config-pppoe-server.8 \
7a302fa7 415 man/network-zone-modem.8 \
2fb7ae4d
MT
416 man/network-zone-pppoe.8 \
417 man/network-zone-wireless.8
5ca9dc30
MT
418
419MANPAGES_XML = $(patsubst %.8,%.xml,$(MANPAGES))
420MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
421
422.PHONY: man
423man: $(MANPAGES) $(MANPAGES_HTML)
424
425man_MANS = \
426 $(MANPAGES)
427
428noinst_DATA += \
429 $(MANPAGES_HTML)
430
431CLEANFILES += \
432 $(man_MANS) \
433 $(MANPAGES_HTML)
434
435EXTRA_DIST += \
436 $(MANPAGES_XML) \
437 man/custom-html.xsl
438
439XSLTPROC_FLAGS = \
440 --nonet \
441 --stringparam man.output.quietly 1 \
442 --stringparam funcsynopsis.style ansi \
443 --stringparam man.th.extra1.suppress 1 \
444 --stringparam man.authors.section.enabled 1 \
445 --stringparam man.copyright.section.enabled 1
446
447XSLTPROC_COMMAND_MAN = \
448 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
449 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
450
451XSLTPROC_COMMAND_HTML = \
452 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
453
454man/%.8: man/%.xml
455 $(XSLTPROC_COMMAND_MAN)
456
457man/%.html: man/%.xml man/custom-html.xsl
458 $(XSLTPROC_COMMAND_HTML)
459
460# ------------------------------------------------------------------------------
461
462substitutions = \
463 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
464 '|PACKAGE_URL=$(PACKAGE_URL)|' \
465 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
466 '|prefix=$(prefix)|' \
467 '|exec_prefix=$(exec_prefix)|' \
468 '|sbindir=$(sbindir)|' \
c6525a63
MT
469 '|networkdir=$(networkdir)|' \
470 '|helpersdir=$(helpersdir)|'
5ca9dc30
MT
471
472SED_PROCESS = \
473 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
474 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
475 < $< > $@
476
477src/functions/functions: src/functions/functions.in Makefile
478 $(SED_PROCESS)
479
480src/ppp/ip-updown: src/ppp/ip-updown.in Makefile
481 $(SED_PROCESS)
482
483src/systemd/%: src/systemd/%.in Makefile
484 $(SED_PROCESS)
485
486src/%.pc: src/%.pc.in Makefile
487 $(SED_PROCESS)
488
489INSTALL_DIRS += \
490 $(sbindir)
491
492install-exec-hook: $(INSTALL_EXEC_HOOKS)
493
494uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
495
496# - testsuite ------------------------------------------------------------------
497
498TESTS_ENVIRONMENT = \
071d3416 499 LD_LIBRARY_PATH=$(top_builddir)/src/.libs:$(LD_LIBRARY_PATH) \
8744a476
MT
500 PATH=$(top_builddir)/src:$(PATH) \
501 functions=$(abs_builddir)/src/functions/functions \
502 networkdir=$(abs_srcdir)/src/functions \
503 testdir=$(top_srcdir)/test
504
505dist_check_DATA = \
ee86c73f
MT
506 test/constants.sh \
507 test/test-functions
5ca9dc30
MT
508
509dist_check_SCRIPTS = \
8744a476 510 $(TESTS)
5ca9dc30
MT
511
512TESTS = \
bb8304ec 513 test/load-library \
bb8304ec 514 test/functions/ip/ip_detect_protocol \
bb8304ec 515 test/functions/ip/ip_get_prefix \
8b0958b2 516 test/functions/ip/ip_net_is_valid \
b7fd8067 517 test/functions/ip/ip_is_valid \
b862734c 518 test/functions/ip/ip_network_is_subnet_of \
b7fd8067
MT
519 test/functions/ip/ip_prefix_is_valid \
520 test/functions/ip/ip_protocol_is_supported \
521 test/functions/ip/ip_split_prefix