]> git.ipfire.org Git - people/ms/network.git/blob - Makefile.am
libnetwork: Add interface objects
[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
55 CLEANFILES =
56 DISTCLEANFILES =
57 EXTRA_DIST =
58 INSTALL_DIRS =
59 INSTALL_EXEC_HOOKS =
60 UNINSTALL_EXEC_HOOKS =
61 noinst_DATA =
62
63 AM_CPPFLAGS = \
64 $(OUR_CPPFLAGS) \
65 -include $(top_builddir)/config.h \
66 -I${top_srcdir}/src/libnetwork
67
68 AM_CFLAGS = \
69 $(OUR_CFLAGS) \
70 -fvisibility=hidden \
71 -ffunction-sections \
72 -fdata-sections
73
74 AM_LDFLAGS = \
75 $(OUR_LDFLAGS) \
76 -Wl,--gc-sections \
77 -Wl,--as-needed
78
79 DISTCHECK_CONFIGURE_FLAGS = \
80 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \
81 --with-udevdir=$$dc_install_base/$(udevdir)
82
83 install-directories-hook:
84 $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
85
86 INSTALL_EXEC_HOOKS += \
87 install-directories-hook
88
89 # ------------------------------------------------------------------------------
90
91 AM_V_XSLT = $(AM_V_XSLT_$(V))
92 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
93 AM_V_XSLT_0 = @echo " XSLT " $@;
94
95 # ------------------------------------------------------------------------------
96
97 dist_doc_DATA = \
98 README \
99 docs/CODING_STYLE \
100 docs/COPYING
101
102 dist_sbin_SCRIPTS = \
103 src/dhclient-script \
104 src/firewall-config \
105 src/firewall4 \
106 src/firewall6 \
107 src/network
108
109 network_SCRIPTS = \
110 src/functions/functions
111
112 CLEANFILES += \
113 src/functions/functions
114
115 EXTRA_DIST += \
116 src/functions/functions.in
117
118 dist_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
192 dist_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
200 bin_PROGRAMS = \
201 src/inetcalc
202
203 src_inetcalc_SOURCES = \
204 src/inetcalc.c
205
206 src_inetcalc_LDADD = \
207 src/libnetwork.la
208
209 dist_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
216 dist_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
224 dist_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
231 INSTALL_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
243 LIBNETWORK_CURRENT=0
244 LIBNETWORK_REVISION=0
245 LIBNETWORK_AGE=0
246
247 pkginclude_HEADERS = \
248 src/libnetwork/network/interface.h \
249 src/libnetwork/network/libnetwork.h \
250 src/libnetwork/network/logging.h
251
252 lib_LTLIBRARIES = \
253 src/libnetwork.la
254
255 src_libnetwork_la_SOURCES = \
256 src/libnetwork/interface.c \
257 src/libnetwork/libnetwork-private.h \
258 src/libnetwork/libnetwork.c
259
260 src_libnetwork_la_CPPFLAGS = \
261 $(AM_CPPFLAGS) \
262 -D_GNU_SOURCE \
263 -DNETWORK_PRIVATE
264
265 src_libnetwork_la_LDFLAGS = \
266 $(AM_LDFLAGS) \
267 -version-info $(LIBNETWORK_CURRENT):$(LIBNETWORK_REVISION):$(LIBNETWORK_AGE) \
268 -Wl,--version-script=$(top_srcdir)/src/libnetwork/libnetwork.sym
269
270 src_libnetwork_la_DEPENDENCIES = \
271 src/libnetwork/libnetwork.sym
272
273 EXTRA_DIST += \
274 src/libnetwork/libnetwork.sym
275
276 # ------------------------------------------------------------------------------
277
278 ppp_SCRIPTS = \
279 src/ppp/ip-updown
280
281 CLEANFILES += \
282 src/ppp/ip-updown
283
284 EXTRA_DIST += \
285 src/ppp/ip-updown.in
286
287 INSTALL_DIRS += \
288 $(pppdir) \
289 $(logdir)
290
291 ppp-install-hook:
292 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up
293 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-up
294 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-down
295 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-up
296 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-down
297
298 ppp-uninstall-hook:
299 rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up}
300 rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up}
301
302 INSTALL_EXEC_HOOKS += ppp-install-hook
303 UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook
304
305 # ------------------------------------------------------------------------------
306
307 if HAVE_SYSTEMD
308 systemdsystemunit_DATA = \
309 src/systemd/firewall4.service \
310 src/systemd/firewall6.service \
311 src/systemd/firewall-init.service \
312 src/systemd/network-init.service \
313 src/systemd/network@.service
314
315 CLEANFILES += \
316 $(systemdsystemunit_DATA)
317
318 INSTALL_DIRS += \
319 $(systemdsystemunitdir)
320 endif
321
322 EXTRA_DIST += \
323 src/systemd/firewall4.service.in \
324 src/systemd/firewall6.service.in \
325 src/systemd/firewall-init.service.in \
326 src/systemd/network-init.service.in \
327 src/systemd/network@.service.in
328
329 # ------------------------------------------------------------------------------
330
331 systemconfig_vpndir = $(systemconfigdir)/vpn
332
333 dist_systemconfig_vpn_security_policies_DATA = \
334 config/vpn/security-policies/performance \
335 config/vpn/security-policies/system
336
337 systemconfig_vpn_security_policiesdir = $(systemconfig_vpndir)/security-policies
338
339 # ------------------------------------------------------------------------------
340
341 dist_sysctl_DATA = \
342 src/sysctl/network.conf
343
344 # ------------------------------------------------------------------------------
345
346 dist_bashcompletion_SCRIPTS = \
347 src/bash-completion/network
348
349 # ------------------------------------------------------------------------------
350
351 dist_tmpfiles_DATA = \
352 src/tmpfiles/network.conf
353
354 # ------------------------------------------------------------------------------
355
356 if HAVE_UDEV
357 dist_udev_SCRIPTS = \
358 src/udev/network-hotplug \
359 src/udev/network-hotplug-rename \
360 src/udev/network-hotplug-serial
361
362 dist_udevrules_DATA = \
363 src/udev/rules.d/50-serial-whitelist.rules \
364 src/udev/rules.d/60-net.rules
365
366 INSTALL_DIRS += \
367 $(udevdir) \
368 $(udevrulesdir)
369 endif
370
371 # ------------------------------------------------------------------------------
372
373 pkgconfig_DATA = \
374 src/network.pc
375
376 CLEANFILES += \
377 $(pkgconfig_DATA)
378
379 EXTRA_DIST += \
380 src/network.pc.in
381
382 # ------------------------------------------------------------------------------
383
384 dist_macros_DATA = \
385 src/macros/DHCP \
386 src/macros/HTTP \
387 src/macros/HTTPS \
388 src/macros/WWW
389
390 # ------------------------------------------------------------------------------
391
392 INSTALL_DIRS += \
393 $(triggersdir)
394
395 # ------------------------------------------------------------------------------
396
397 MANPAGES = \
398 man/firewall-settings.8 \
399 man/network.8 \
400 man/network-color.8 \
401 man/network-description.8 \
402 man/network-device.8 \
403 man/network-dhcp.8 \
404 man/network-dns-server.8 \
405 man/network-performance-tuning.8 \
406 man/network-port.8 \
407 man/network-quick-start.8 \
408 man/network-route.8 \
409 man/network-route-static.8 \
410 man/network-settings.8 \
411 man/network-vpn.8 \
412 man/network-vpn-security-policies.8 \
413 man/network-zone.8 \
414 man/network-zone-6to4-tunnel.8 \
415 man/network-zone-bridge.8 \
416 man/network-zone-config-pppoe-server.8 \
417 man/network-zone-modem.8 \
418 man/network-zone-pppoe.8 \
419 man/network-zone-wireless.8
420
421 MANPAGES_XML = $(patsubst %.8,%.xml,$(MANPAGES))
422 MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
423
424 .PHONY: man
425 man: $(MANPAGES) $(MANPAGES_HTML)
426
427 man_MANS = \
428 $(MANPAGES)
429
430 noinst_DATA += \
431 $(MANPAGES_HTML)
432
433 CLEANFILES += \
434 $(man_MANS) \
435 $(MANPAGES_HTML)
436
437 EXTRA_DIST += \
438 $(MANPAGES_XML) \
439 man/custom-html.xsl
440
441 XSLTPROC_FLAGS = \
442 --nonet \
443 --stringparam man.output.quietly 1 \
444 --stringparam funcsynopsis.style ansi \
445 --stringparam man.th.extra1.suppress 1 \
446 --stringparam man.authors.section.enabled 1 \
447 --stringparam man.copyright.section.enabled 1
448
449 XSLTPROC_COMMAND_MAN = \
450 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
451 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
452
453 XSLTPROC_COMMAND_HTML = \
454 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
455
456 man/%.8: man/%.xml
457 $(XSLTPROC_COMMAND_MAN)
458
459 man/%.html: man/%.xml man/custom-html.xsl
460 $(XSLTPROC_COMMAND_HTML)
461
462 # ------------------------------------------------------------------------------
463
464 substitutions = \
465 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
466 '|PACKAGE_URL=$(PACKAGE_URL)|' \
467 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
468 '|prefix=$(prefix)|' \
469 '|exec_prefix=$(exec_prefix)|' \
470 '|sbindir=$(sbindir)|' \
471 '|networkdir=$(networkdir)|' \
472 '|helpersdir=$(helpersdir)|'
473
474 SED_PROCESS = \
475 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
476 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
477 < $< > $@
478
479 src/functions/functions: src/functions/functions.in Makefile
480 $(SED_PROCESS)
481
482 src/ppp/ip-updown: src/ppp/ip-updown.in Makefile
483 $(SED_PROCESS)
484
485 src/systemd/%: src/systemd/%.in Makefile
486 $(SED_PROCESS)
487
488 src/%.pc: src/%.pc.in Makefile
489 $(SED_PROCESS)
490
491 INSTALL_DIRS += \
492 $(sbindir)
493
494 install-exec-hook: $(INSTALL_EXEC_HOOKS)
495
496 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
497
498 # - testsuite ------------------------------------------------------------------
499
500 TESTS_ENVIRONMENT = \
501 LD_LIBRARY_PATH=$(top_builddir)/src/.libs:$(LD_LIBRARY_PATH) \
502 PATH=$(top_builddir)/src:$(PATH) \
503 functions=$(abs_builddir)/src/functions/functions \
504 networkdir=$(abs_srcdir)/src/functions \
505 testdir=$(top_srcdir)/test
506
507 dist_check_DATA = \
508 test/constants.sh \
509 test/test-functions
510
511 dist_check_SCRIPTS = \
512 $(TESTS)
513
514 TESTS = \
515 test/load-library \
516 test/functions/ip/ip_detect_protocol \
517 test/functions/ip/ip_get_prefix \
518 test/functions/ip/ip_net_is_valid \
519 test/functions/ip/ip_is_valid \
520 test/functions/ip/ip_network_is_subnet_of \
521 test/functions/ip/ip_prefix_is_valid \
522 test/functions/ip/ip_protocol_is_supported \
523 test/functions/ip/ip_split_prefix