]> git.ipfire.org Git - people/ms/network.git/blob - Makefile.am
security-policies: Add new "performance" policy
[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.iptables \
138 src/functions/functions.ip-tunnel \
139 src/functions/functions.ipv4 \
140 src/functions/functions.ipv6 \
141 src/functions/functions.list \
142 src/functions/functions.lock \
143 src/functions/functions.logging \
144 src/functions/functions.macros \
145 src/functions/functions.modem \
146 src/functions/functions.phy \
147 src/functions/functions.ports \
148 src/functions/functions.ppp \
149 src/functions/functions.pppoe-server \
150 src/functions/functions.radvd \
151 src/functions/functions.route \
152 src/functions/functions.routing \
153 src/functions/functions.serial \
154 src/functions/functions.service \
155 src/functions/functions.settings \
156 src/functions/functions.stp \
157 src/functions/functions.sysctl \
158 src/functions/functions.system \
159 src/functions/functions.triggers \
160 src/functions/functions.usb \
161 src/functions/functions.util \
162 src/functions/functions.vlan \
163 src/functions/functions.vpn-security-policies \
164 src/functions/functions.wireless \
165 src/functions/functions.wpa_supplicant \
166 src/functions/functions.zone \
167 src/network-radvd-config \
168 src/dhclient-helper \
169 src/header-config \
170 src/header-port \
171 src/header-zone \
172 src/ppp/dialer \
173 src/ppp/pppoe-server
174
175 dist_helpers_SCRIPTS = \
176 src/helpers/bridge-stp \
177 src/helpers/dhcpd-config-helper \
178 src/helpers/firewall-kernel-init \
179 src/helpers/hostapd-config-helper \
180 src/helpers/pppd-angel \
181 src/helpers/wpa_supplicant \
182 src/helpers/wpa_supplicant-config-helper
183
184 bin_PROGRAMS = \
185 src/inetcalc
186
187 src_inetcalc_SOURCES = \
188 src/inetcalc.c
189
190 bridge-stp-install-hook: bridge-stp-uninstall-hook
191 ln -svf --relative $(DESTDIR)$(helpersdir)/bridge-stp $(DESTDIR)$(sbindir)/
192
193 bridge-stp-uninstall-hook:
194 rm -f $(DESTDIR)$(sbindir)/bridge-stp
195
196 INSTALL_EXEC_HOOKS += bridge-stp-install-hook
197 UNINSTALL_EXEC_HOOKS += bridge-stp-uninstall-hook
198
199 dist_hooks_configs_SCRIPTS = \
200 src/hooks/configs/dhcp \
201 src/hooks/configs/ipv4-static \
202 src/hooks/configs/ipv6-auto \
203 src/hooks/configs/ipv6-static \
204 src/hooks/configs/pppoe-server
205
206 dist_hooks_ports_SCRIPTS = \
207 src/hooks/ports/batman-adv \
208 src/hooks/ports/bonding \
209 src/hooks/ports/dummy \
210 src/hooks/ports/ethernet \
211 src/hooks/ports/vlan \
212 src/hooks/ports/wireless-adhoc \
213 src/hooks/ports/wireless-ap
214
215 dist_hooks_zones_SCRIPTS = \
216 src/hooks/zones/6to4-tunnel \
217 src/hooks/zones/bridge \
218 src/hooks/zones/modem \
219 src/hooks/zones/pppoe \
220 src/hooks/zones/wireless
221
222 # ------------------------------------------------------------------------------
223
224 ppp_SCRIPTS = \
225 src/ppp/ip-updown
226
227 CLEANFILES += \
228 src/ppp/ip-updown
229
230 EXTRA_DIST += \
231 src/ppp/ip-updown.in
232
233 INSTALL_DIRS += \
234 $(pppdir) \
235 $(logdir)
236
237 ppp-install-hook:
238 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up
239 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-up
240 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-down
241 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-up
242 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-down
243
244 ppp-uninstall-hook:
245 rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up}
246 rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up}
247
248 INSTALL_EXEC_HOOKS += ppp-install-hook
249 UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook
250
251 # ------------------------------------------------------------------------------
252
253 if HAVE_SYSTEMD
254 systemdsystemunit_DATA = \
255 src/systemd/firewall4.service \
256 src/systemd/firewall6.service \
257 src/systemd/firewall-init.service \
258 src/systemd/network-init.service \
259 src/systemd/network@.service
260
261 CLEANFILES += \
262 $(systemdsystemunit_DATA)
263
264 INSTALL_DIRS += \
265 $(systemdsystemunitdir)
266 endif
267
268 EXTRA_DIST += \
269 src/systemd/firewall4.service.in \
270 src/systemd/firewall6.service.in \
271 src/systemd/firewall-init.service.in \
272 src/systemd/network-init.service.in \
273 src/systemd/network@.service.in
274
275 # ------------------------------------------------------------------------------
276
277 systemconfig_vpndir = $(systemconfigdir)/vpn
278
279 dist_systemconfig_vpn_security_policies_DATA = \
280 config/vpn/security-policies/performance \
281 config/vpn/security-policies/system
282
283 systemconfig_vpn_security_policiesdir = $(systemconfig_vpndir)/security-policies
284
285 # ------------------------------------------------------------------------------
286
287 dist_sysctl_DATA = \
288 src/sysctl/network.conf
289
290 # ------------------------------------------------------------------------------
291
292 dist_bashcompletion_SCRIPTS = \
293 src/bash-completion/network
294
295 # ------------------------------------------------------------------------------
296
297 dist_tmpfiles_DATA = \
298 src/tmpfiles/network.conf
299
300 # ------------------------------------------------------------------------------
301
302 if HAVE_UDEV
303 dist_udev_SCRIPTS = \
304 src/udev/network-hotplug \
305 src/udev/network-hotplug-rename \
306 src/udev/network-hotplug-serial
307
308 dist_udevrules_DATA = \
309 src/udev/rules.d/50-serial-whitelist.rules \
310 src/udev/rules.d/60-net.rules
311
312 INSTALL_DIRS += \
313 $(udevdir) \
314 $(udevrulesdir)
315 endif
316
317 # ------------------------------------------------------------------------------
318
319 pkgconfigdata_DATA = \
320 src/network.pc
321
322 CLEANFILES += \
323 $(pkgconfigdata_DATA)
324
325 EXTRA_DIST += \
326 src/network.pc.in
327
328 # ------------------------------------------------------------------------------
329
330 dist_macros_DATA = \
331 src/macros/DHCP \
332 src/macros/HTTP \
333 src/macros/HTTPS \
334 src/macros/WWW
335
336 # ------------------------------------------------------------------------------
337
338 INSTALL_DIRS += \
339 $(triggersdir)
340
341 # ------------------------------------------------------------------------------
342
343 MANPAGES = \
344 man/firewall-settings.8 \
345 man/network.8 \
346 man/network-color.8 \
347 man/network-description.8 \
348 man/network-device.8 \
349 man/network-dhcp.8 \
350 man/network-dns-server.8 \
351 man/network-performance-tuning.8 \
352 man/network-port.8 \
353 man/network-port-batman-adv.8 \
354 man/network-port-batman-adv-port.8 \
355 man/network-quick-start.8 \
356 man/network-route.8 \
357 man/network-route-static.8 \
358 man/network-settings.8 \
359 man/network-zone.8 \
360 man/network-zone-6to4-tunnel.8 \
361 man/network-zone-bridge.8 \
362 man/network-zone-config-pppoe-server.8 \
363 man/network-zone-modem.8 \
364 man/network-zone-pppoe.8 \
365 man/network-zone-wireless.8
366
367 MANPAGES_XML = $(patsubst %.8,%.xml,$(MANPAGES))
368 MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
369
370 .PHONY: man
371 man: $(MANPAGES) $(MANPAGES_HTML)
372
373 man_MANS = \
374 $(MANPAGES)
375
376 noinst_DATA += \
377 $(MANPAGES_HTML)
378
379 CLEANFILES += \
380 $(man_MANS) \
381 $(MANPAGES_HTML)
382
383 EXTRA_DIST += \
384 $(MANPAGES_XML) \
385 man/custom-html.xsl
386
387 XSLTPROC_FLAGS = \
388 --nonet \
389 --stringparam man.output.quietly 1 \
390 --stringparam funcsynopsis.style ansi \
391 --stringparam man.th.extra1.suppress 1 \
392 --stringparam man.authors.section.enabled 1 \
393 --stringparam man.copyright.section.enabled 1
394
395 XSLTPROC_COMMAND_MAN = \
396 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
397 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
398
399 XSLTPROC_COMMAND_HTML = \
400 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
401
402 man/%.8: man/%.xml
403 $(XSLTPROC_COMMAND_MAN)
404
405 man/%.html: man/%.xml man/custom-html.xsl
406 $(XSLTPROC_COMMAND_HTML)
407
408 # ------------------------------------------------------------------------------
409
410 substitutions = \
411 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
412 '|PACKAGE_URL=$(PACKAGE_URL)|' \
413 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
414 '|prefix=$(prefix)|' \
415 '|exec_prefix=$(exec_prefix)|' \
416 '|sbindir=$(sbindir)|' \
417 '|networkdir=$(networkdir)|' \
418 '|helpersdir=$(helpersdir)|'
419
420 SED_PROCESS = \
421 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
422 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
423 < $< > $@
424
425 src/functions/functions: src/functions/functions.in Makefile
426 $(SED_PROCESS)
427
428 src/ppp/ip-updown: src/ppp/ip-updown.in Makefile
429 $(SED_PROCESS)
430
431 src/systemd/%: src/systemd/%.in Makefile
432 $(SED_PROCESS)
433
434 src/%.pc: src/%.pc.in Makefile
435 $(SED_PROCESS)
436
437 INSTALL_DIRS += \
438 $(sbindir)
439
440 install-exec-hook: $(INSTALL_EXEC_HOOKS)
441
442 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
443
444 # - testsuite ------------------------------------------------------------------
445
446 TESTS_ENVIRONMENT = \
447 PATH=$(top_builddir)/src:$(PATH) \
448 functions=$(abs_builddir)/src/functions/functions \
449 networkdir=$(abs_srcdir)/src/functions \
450 testdir=$(top_srcdir)/test
451
452 dist_check_DATA = \
453 test/constants.sh \
454 test/test-functions
455
456 dist_check_SCRIPTS = \
457 $(TESTS)
458
459 TESTS = \
460 test/load-library \
461 test/functions/ip/ip_detect_protocol \
462 test/functions/ip/ip_get_prefix \
463 test/functions/ip/ip_net_is_valid \
464 test/functions/ip/ip_is_valid \
465 test/functions/ip/ip_network_is_subnet_of \
466 test/functions/ip/ip_prefix_is_valid \
467 test/functions/ip/ip_protocol_is_supported \
468 test/functions/ip/ip_split_prefix