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