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