]> git.ipfire.org Git - people/ms/network.git/blame_incremental - Makefile.am
libnetwork: Initialise netlink connection when initialising context
[people/ms/network.git] / Makefile.am
... / ...
CommitLineData
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
31configdir = $(sysconfdir)/network
32bashcompletiondir= $(datadir)/bash-completion/completions
33libexecdir = $(prefix)/lib
34pkgconfigdir = $(libdir)/pkgconfig
35pppdir = $(sysconfdir)/ppp
36systemconfigdir = $(datadir)/network
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
47hooks_configsdir = $(hooksdir)/configs
48hooks_portsdir = $(hooksdir)/ports
49hooks_zonesdir = $(hooksdir)/zones
50
51triggersdir = $(networkdir)/triggers
52
53logdir = $(localestatedir)/log/network
54
55CLEANFILES =
56DISTCLEANFILES =
57EXTRA_DIST =
58INSTALL_DIRS =
59INSTALL_EXEC_HOOKS =
60UNINSTALL_EXEC_HOOKS =
61noinst_DATA =
62
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
78
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 = \
98 README \
99 docs/CODING_STYLE \
100 docs/COPYING
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 = \
119 src/functions/functions.at \
120 src/functions/functions.auth \
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 \
131 src/functions/functions.description \
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 \
138 src/functions/functions.editor \
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 \
145 src/functions/functions.hotplug \
146 src/functions/functions.http \
147 src/functions/functions.interrupts \
148 src/functions/functions.ip \
149 src/functions/functions.ipsec \
150 src/functions/functions.ipsec-pool \
151 src/functions/functions.iptables \
152 src/functions/functions.ip-tunnel \
153 src/functions/functions.ipv4 \
154 src/functions/functions.ipv6 \
155 src/functions/functions.list \
156 src/functions/functions.lock \
157 src/functions/functions.logging \
158 src/functions/functions.macros \
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 \
165 src/functions/functions.route \
166 src/functions/functions.routing \
167 src/functions/functions.serial \
168 src/functions/functions.service \
169 src/functions/functions.settings \
170 src/functions/functions.stp \
171 src/functions/functions.sysctl \
172 src/functions/functions.system \
173 src/functions/functions.triggers \
174 src/functions/functions.usb \
175 src/functions/functions.util \
176 src/functions/functions.vlan \
177 src/functions/functions.vpn \
178 src/functions/functions.vpn-security-policies \
179 src/functions/functions.wireless \
180 src/functions/functions.wireless-mesh \
181 src/functions/functions.wireless-networks \
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 = \
193 src/helpers/dhcpd-config-helper \
194 src/helpers/firewall-kernel-init \
195 src/helpers/hostapd-config-helper \
196 src/helpers/ipsec-updown \
197 src/helpers/pppd-angel \
198 src/helpers/wpa_supplicant
199
200bin_PROGRAMS = \
201 src/inetcalc
202
203src_inetcalc_SOURCES = \
204 src/inetcalc.c
205
206src_inetcalc_LDADD = \
207 src/libnetwork.la
208
209dist_hooks_configs_SCRIPTS = \
210 src/hooks/configs/dhcp \
211 src/hooks/configs/ipv4-static \
212 src/hooks/configs/ipv6-auto \
213 src/hooks/configs/ipv6-static \
214 src/hooks/configs/pppoe-server
215
216dist_hooks_ports_SCRIPTS = \
217 src/hooks/ports/bonding \
218 src/hooks/ports/dummy \
219 src/hooks/ports/ethernet \
220 src/hooks/ports/vlan \
221 src/hooks/ports/wireless-ap \
222 src/hooks/ports/wireless-mesh
223
224dist_hooks_zones_SCRIPTS = \
225 src/hooks/zones/6to4-tunnel \
226 src/hooks/zones/bridge \
227 src/hooks/zones/modem \
228 src/hooks/zones/pppoe \
229 src/hooks/zones/wireless
230
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
241# ------------------------------------------------------------------------------
242
243LIBNETWORK_CURRENT=0
244LIBNETWORK_REVISION=0
245LIBNETWORK_AGE=0
246
247pkginclude_HEADERS = \
248 src/libnetwork/network/interface.h \
249 src/libnetwork/network/libnetwork.h \
250 src/libnetwork/network/logging.h
251
252lib_LTLIBRARIES = \
253 src/libnetwork.la
254
255src_libnetwork_la_SOURCES = \
256 src/libnetwork/interface.c \
257 src/libnetwork/libnetwork-private.h \
258 src/libnetwork/libnetwork.c
259
260src_libnetwork_la_LIBADD = \
261 $(LIBNL_LIBS)
262
263src_libnetwork_la_CPPFLAGS = \
264 $(AM_CPPFLAGS) \
265 $(LIBNL_CPPFLAGS) \
266 -D_GNU_SOURCE \
267 -DNETWORK_PRIVATE
268
269src_libnetwork_la_CFLAGS = \
270 $(AM_CFLAGS) \
271 $(LIBNL_CFLAGS)
272
273src_libnetwork_la_LDFLAGS = \
274 $(AM_LDFLAGS) \
275 -version-info $(LIBNETWORK_CURRENT):$(LIBNETWORK_REVISION):$(LIBNETWORK_AGE) \
276 -Wl,--version-script=$(top_srcdir)/src/libnetwork/libnetwork.sym
277
278src_libnetwork_la_DEPENDENCIES = \
279 src/libnetwork/libnetwork.sym
280
281EXTRA_DIST += \
282 src/libnetwork/libnetwork.sym
283
284# ------------------------------------------------------------------------------
285
286ppp_SCRIPTS = \
287 src/ppp/ip-updown
288
289CLEANFILES += \
290 src/ppp/ip-updown
291
292EXTRA_DIST += \
293 src/ppp/ip-updown.in
294
295INSTALL_DIRS += \
296 $(pppdir) \
297 $(logdir)
298
299ppp-install-hook:
300 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up
301 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-up
302 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-down
303 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-up
304 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-down
305
306ppp-uninstall-hook:
307 rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up}
308 rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up}
309
310INSTALL_EXEC_HOOKS += ppp-install-hook
311UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook
312
313# ------------------------------------------------------------------------------
314
315if HAVE_SYSTEMD
316systemdsystemunit_DATA = \
317 src/systemd/firewall4.service \
318 src/systemd/firewall6.service \
319 src/systemd/firewall-init.service \
320 src/systemd/network-init.service \
321 src/systemd/network@.service
322
323CLEANFILES += \
324 $(systemdsystemunit_DATA)
325
326INSTALL_DIRS += \
327 $(systemdsystemunitdir)
328endif
329
330EXTRA_DIST += \
331 src/systemd/firewall4.service.in \
332 src/systemd/firewall6.service.in \
333 src/systemd/firewall-init.service.in \
334 src/systemd/network-init.service.in \
335 src/systemd/network@.service.in
336
337# ------------------------------------------------------------------------------
338
339systemconfig_vpndir = $(systemconfigdir)/vpn
340
341dist_systemconfig_vpn_security_policies_DATA = \
342 config/vpn/security-policies/performance \
343 config/vpn/security-policies/system
344
345systemconfig_vpn_security_policiesdir = $(systemconfig_vpndir)/security-policies
346
347# ------------------------------------------------------------------------------
348
349dist_sysctl_DATA = \
350 src/sysctl/network.conf
351
352# ------------------------------------------------------------------------------
353
354dist_bashcompletion_SCRIPTS = \
355 src/bash-completion/network
356
357# ------------------------------------------------------------------------------
358
359dist_tmpfiles_DATA = \
360 src/tmpfiles/network.conf
361
362# ------------------------------------------------------------------------------
363
364if HAVE_UDEV
365dist_udev_SCRIPTS = \
366 src/udev/network-hotplug \
367 src/udev/network-hotplug-rename \
368 src/udev/network-hotplug-serial
369
370dist_udevrules_DATA = \
371 src/udev/rules.d/50-serial-whitelist.rules \
372 src/udev/rules.d/60-net.rules
373
374INSTALL_DIRS += \
375 $(udevdir) \
376 $(udevrulesdir)
377endif
378
379# ------------------------------------------------------------------------------
380
381pkgconfig_DATA = \
382 src/network.pc
383
384CLEANFILES += \
385 $(pkgconfig_DATA)
386
387EXTRA_DIST += \
388 src/network.pc.in
389
390# ------------------------------------------------------------------------------
391
392dist_macros_DATA = \
393 src/macros/DHCP \
394 src/macros/HTTP \
395 src/macros/HTTPS \
396 src/macros/WWW
397
398# ------------------------------------------------------------------------------
399
400INSTALL_DIRS += \
401 $(triggersdir)
402
403# ------------------------------------------------------------------------------
404
405MANPAGES = \
406 man/firewall-settings.8 \
407 man/network.8 \
408 man/network-color.8 \
409 man/network-description.8 \
410 man/network-device.8 \
411 man/network-dhcp.8 \
412 man/network-dns-server.8 \
413 man/network-performance-tuning.8 \
414 man/network-port.8 \
415 man/network-quick-start.8 \
416 man/network-route.8 \
417 man/network-route-static.8 \
418 man/network-settings.8 \
419 man/network-vpn.8 \
420 man/network-vpn-security-policies.8 \
421 man/network-zone.8 \
422 man/network-zone-6to4-tunnel.8 \
423 man/network-zone-bridge.8 \
424 man/network-zone-config-pppoe-server.8 \
425 man/network-zone-modem.8 \
426 man/network-zone-pppoe.8 \
427 man/network-zone-wireless.8
428
429MANPAGES_XML = $(patsubst %.8,%.xml,$(MANPAGES))
430MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
431
432.PHONY: man
433man: $(MANPAGES) $(MANPAGES_HTML)
434
435man_MANS = \
436 $(MANPAGES)
437
438noinst_DATA += \
439 $(MANPAGES_HTML)
440
441CLEANFILES += \
442 $(man_MANS) \
443 $(MANPAGES_HTML)
444
445EXTRA_DIST += \
446 $(MANPAGES_XML) \
447 man/custom-html.xsl
448
449XSLTPROC_FLAGS = \
450 --nonet \
451 --stringparam man.output.quietly 1 \
452 --stringparam funcsynopsis.style ansi \
453 --stringparam man.th.extra1.suppress 1 \
454 --stringparam man.authors.section.enabled 1 \
455 --stringparam man.copyright.section.enabled 1
456
457XSLTPROC_COMMAND_MAN = \
458 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
459 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
460
461XSLTPROC_COMMAND_HTML = \
462 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
463
464man/%.8: man/%.xml
465 $(XSLTPROC_COMMAND_MAN)
466
467man/%.html: man/%.xml man/custom-html.xsl
468 $(XSLTPROC_COMMAND_HTML)
469
470# ------------------------------------------------------------------------------
471
472substitutions = \
473 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
474 '|PACKAGE_URL=$(PACKAGE_URL)|' \
475 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
476 '|prefix=$(prefix)|' \
477 '|exec_prefix=$(exec_prefix)|' \
478 '|sbindir=$(sbindir)|' \
479 '|networkdir=$(networkdir)|' \
480 '|helpersdir=$(helpersdir)|'
481
482SED_PROCESS = \
483 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
484 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
485 < $< > $@
486
487src/functions/functions: src/functions/functions.in Makefile
488 $(SED_PROCESS)
489
490src/ppp/ip-updown: src/ppp/ip-updown.in Makefile
491 $(SED_PROCESS)
492
493src/systemd/%: src/systemd/%.in Makefile
494 $(SED_PROCESS)
495
496src/%.pc: src/%.pc.in Makefile
497 $(SED_PROCESS)
498
499INSTALL_DIRS += \
500 $(sbindir)
501
502install-exec-hook: $(INSTALL_EXEC_HOOKS)
503
504uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
505
506# - testsuite ------------------------------------------------------------------
507
508TESTS_ENVIRONMENT = \
509 LD_LIBRARY_PATH=$(top_builddir)/src/.libs:$(LD_LIBRARY_PATH) \
510 PATH=$(top_builddir)/src:$(PATH) \
511 functions=$(abs_builddir)/src/functions/functions \
512 networkdir=$(abs_srcdir)/src/functions \
513 testdir=$(top_srcdir)/test
514
515dist_check_DATA = \
516 test/constants.sh \
517 test/test-functions
518
519dist_check_SCRIPTS = \
520 $(TESTS)
521
522TESTS = \
523 test/load-library \
524 test/functions/ip/ip_detect_protocol \
525 test/functions/ip/ip_get_prefix \
526 test/functions/ip/ip_net_is_valid \
527 test/functions/ip/ip_is_valid \
528 test/functions/ip/ip_network_is_subnet_of \
529 test/functions/ip/ip_prefix_is_valid \
530 test/functions/ip/ip_protocol_is_supported \
531 test/functions/ip/ip_split_prefix