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