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