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