]> git.ipfire.org Git - people/ms/network.git/blame - Makefile.am
Fix test hello-world
[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
f166708b 31configdir = $(sysconfdir)/network
bae37360 32bashcompletiondir= $(datadir)/bash-completion/completions
5ca9dc30 33libexecdir = $(prefix)/lib
01f2b2e4 34pkgconfigdir = $(libdir)/pkgconfig
5ca9dc30 35pppdir = $(sysconfdir)/ppp
5e84cd41 36systemconfigdir = $(datadir)/network
5ca9dc30
MT
37sysctldir = $(prefix)/lib/sysctl.d
38tmpfilesdir = $(prefix)/lib/tmpfiles.d
39udevrulesdir = $(udevdir)/rules.d
40
41networkdir = $(libexecdir)/network
42helpersdir = $(networkdir)/helpers
43
44macrosdir = $(libexecdir)/firewall/macros
45
46hooksdir = $(networkdir)/hooks
7d2cb6d3 47hooks_configsdir = $(hooksdir)/configs
5ca9dc30
MT
48hooks_portsdir = $(hooksdir)/ports
49hooks_zonesdir = $(hooksdir)/zones
50
de3cecef
MT
51triggersdir = $(networkdir)/triggers
52
9c9d0585 53logdir = $(localestatedir)/log/network
e145b2f3 54utildir = $(networkdir)
9c9d0585 55
5ca9dc30
MT
56CLEANFILES =
57DISTCLEANFILES =
58EXTRA_DIST =
59INSTALL_DIRS =
60INSTALL_EXEC_HOOKS =
61UNINSTALL_EXEC_HOOKS =
62noinst_DATA =
63
01f2b2e4
MT
64AM_CPPFLAGS = \
65 $(OUR_CPPFLAGS) \
66 -include $(top_builddir)/config.h \
67 -I${top_srcdir}/src/libnetwork
68
69AM_CFLAGS = \
70 $(OUR_CFLAGS) \
71 -fvisibility=hidden \
72 -ffunction-sections \
73 -fdata-sections
74
75AM_LDFLAGS = \
76 $(OUR_LDFLAGS) \
77 -Wl,--gc-sections \
78 -Wl,--as-needed
e708653f 79
5ca9dc30
MT
80DISTCHECK_CONFIGURE_FLAGS = \
81 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \
82 --with-udevdir=$$dc_install_base/$(udevdir)
83
84install-directories-hook:
85 $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
86
87INSTALL_EXEC_HOOKS += \
88 install-directories-hook
89
90# ------------------------------------------------------------------------------
91
92AM_V_XSLT = $(AM_V_XSLT_$(V))
93AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
94AM_V_XSLT_0 = @echo " XSLT " $@;
95
96# ------------------------------------------------------------------------------
97
98dist_doc_DATA = \
1337eee2 99 README \
dd46582c 100 docs/CODING_STYLE \
1337eee2 101 docs/COPYING
5ca9dc30
MT
102
103dist_sbin_SCRIPTS = \
104 src/dhclient-script \
105 src/firewall-config \
106 src/firewall4 \
107 src/firewall6 \
108 src/network
109
a62e991a 110network_DATA = \
5ca9dc30
MT
111 src/functions/functions
112
113CLEANFILES += \
114 src/functions/functions
115
116EXTRA_DIST += \
117 src/functions/functions.in
118
a62e991a 119dist_network_DATA = \
5ca9dc30
MT
120 src/functions/functions.at \
121 src/functions/functions.auth \
5ca9dc30
MT
122 src/functions/functions.bonding \
123 src/functions/functions.bridge \
124 src/functions/functions.cli \
125 src/functions/functions.cli.firewall \
126 src/functions/functions.colors \
127 src/functions/functions.config \
128 src/functions/functions.conntrack \
129 src/functions/functions.constants \
130 src/functions/functions.constants-firewall \
131 src/functions/functions.db \
5ccc7299 132 src/functions/functions.description \
5ca9dc30
MT
133 src/functions/functions.device \
134 src/functions/functions.dhclient \
135 src/functions/functions.dhcpd \
136 src/functions/functions.distro \
137 src/functions/functions.dns \
138 src/functions/functions.dummy \
e524986c 139 src/functions/functions.editor \
5ca9dc30
MT
140 src/functions/functions.firewall \
141 src/functions/functions.firewall-policy \
142 src/functions/functions.firewall-zones \
143 src/functions/functions.he \
144 src/functions/functions.hook \
145 src/functions/functions.hostapd \
b8026986 146 src/functions/functions.hotplug \
5ca9dc30 147 src/functions/functions.http \
de72bd91 148 src/functions/functions.interrupts \
5ca9dc30 149 src/functions/functions.ip \
be844b7b 150 src/functions/functions.ipsec \
4e78b7ad 151 src/functions/functions.ipsec-pool \
5ca9dc30
MT
152 src/functions/functions.iptables \
153 src/functions/functions.ip-tunnel \
154 src/functions/functions.ipv4 \
155 src/functions/functions.ipv6 \
5ca9dc30
MT
156 src/functions/functions.list \
157 src/functions/functions.lock \
158 src/functions/functions.logging \
159 src/functions/functions.macros \
5ca9dc30
MT
160 src/functions/functions.modem \
161 src/functions/functions.phy \
162 src/functions/functions.ports \
163 src/functions/functions.ppp \
164 src/functions/functions.pppoe-server \
165 src/functions/functions.radvd \
5ca9dc30
MT
166 src/functions/functions.route \
167 src/functions/functions.routing \
168 src/functions/functions.serial \
169 src/functions/functions.service \
e9df08ad 170 src/functions/functions.settings \
5ca9dc30 171 src/functions/functions.stp \
5ca9dc30 172 src/functions/functions.sysctl \
de72bd91 173 src/functions/functions.system \
de3cecef 174 src/functions/functions.triggers \
5ca9dc30
MT
175 src/functions/functions.usb \
176 src/functions/functions.util \
177 src/functions/functions.vlan \
2da98f56 178 src/functions/functions.vpn \
3eae7bed 179 src/functions/functions.vpn-security-policies \
5ca9dc30 180 src/functions/functions.wireless \
81bf9898 181 src/functions/functions.wireless-mesh \
49958b8c 182 src/functions/functions.wireless-networks \
5ca9dc30
MT
183 src/functions/functions.wpa_supplicant \
184 src/functions/functions.zone \
185 src/network-radvd-config \
186 src/dhclient-helper \
187 src/header-config \
188 src/header-port \
189 src/header-zone \
190 src/ppp/dialer \
191 src/ppp/pppoe-server
192
193dist_helpers_SCRIPTS = \
5ca9dc30
MT
194 src/helpers/dhcpd-config-helper \
195 src/helpers/firewall-kernel-init \
196 src/helpers/hostapd-config-helper \
67baa452 197 src/helpers/ipsec-updown \
5ca9dc30 198 src/helpers/pppd-angel \
02807ad2 199 src/helpers/wpa_supplicant
5ca9dc30 200
13a6e69f
MT
201bin_PROGRAMS = \
202 src/inetcalc
203
204src_inetcalc_SOURCES = \
205 src/inetcalc.c
206
01f2b2e4
MT
207src_inetcalc_LDADD = \
208 src/libnetwork.la
209
7d2cb6d3 210dist_hooks_configs_SCRIPTS = \
9353a4e4 211 src/hooks/configs/dhcp \
b73e9d43 212 src/hooks/configs/ipv6-auto \
46a28dcd
MT
213 src/hooks/configs/pppoe-server \
214 src/hooks/configs/static
7d2cb6d3 215
5ca9dc30 216dist_hooks_ports_SCRIPTS = \
5ca9dc30
MT
217 src/hooks/ports/bonding \
218 src/hooks/ports/dummy \
219 src/hooks/ports/ethernet \
5ca9dc30 220 src/hooks/ports/vlan \
727248f0
MT
221 src/hooks/ports/wireless-ap \
222 src/hooks/ports/wireless-mesh
5ca9dc30
MT
223
224dist_hooks_zones_SCRIPTS = \
5ca9dc30 225 src/hooks/zones/6to4-tunnel \
5ca9dc30 226 src/hooks/zones/bridge \
5ca9dc30
MT
227 src/hooks/zones/modem \
228 src/hooks/zones/pppoe \
5ca9dc30
MT
229 src/hooks/zones/wireless
230
f166708b
MT
231INSTALL_DIRS += \
232 $(configdir) \
233 $(configdir)/ports \
234 $(configdir)/vpn \
235 $(configdir)/vpn/ipsec/connections \
236 $(configdir)/vpn/security-policies \
237 $(configdir)/wireless \
238 $(configdir)/wireless/networks \
239 $(configdir)/zones
240
5ca9dc30
MT
241# ------------------------------------------------------------------------------
242
01f2b2e4
MT
243LIBNETWORK_CURRENT=0
244LIBNETWORK_REVISION=0
245LIBNETWORK_AGE=0
246
247pkginclude_HEADERS = \
248629ae 248 src/libnetwork/network/interface.h \
6f4814db 249 src/libnetwork/network/libnetwork.h \
9cb2f0c0
MT
250 src/libnetwork/network/logging.h \
251 src/libnetwork/network/phy.h
01f2b2e4
MT
252
253lib_LTLIBRARIES = \
254 src/libnetwork.la
255
256src_libnetwork_la_SOURCES = \
248629ae 257 src/libnetwork/interface.c \
01f2b2e4 258 src/libnetwork/libnetwork-private.h \
9cb2f0c0
MT
259 src/libnetwork/libnetwork.c \
260 src/libnetwork/phy.c
01f2b2e4 261
db0a2d76
MT
262src_libnetwork_la_LIBADD = \
263 $(LIBNL_LIBS)
264
6f4814db
MT
265src_libnetwork_la_CPPFLAGS = \
266 $(AM_CPPFLAGS) \
db0a2d76 267 $(LIBNL_CPPFLAGS) \
6f4814db
MT
268 -D_GNU_SOURCE \
269 -DNETWORK_PRIVATE
270
db0a2d76
MT
271src_libnetwork_la_CFLAGS = \
272 $(AM_CFLAGS) \
273 $(LIBNL_CFLAGS)
274
01f2b2e4
MT
275src_libnetwork_la_LDFLAGS = \
276 $(AM_LDFLAGS) \
277 -version-info $(LIBNETWORK_CURRENT):$(LIBNETWORK_REVISION):$(LIBNETWORK_AGE) \
278 -Wl,--version-script=$(top_srcdir)/src/libnetwork/libnetwork.sym
279
280src_libnetwork_la_DEPENDENCIES = \
281 src/libnetwork/libnetwork.sym
282
283EXTRA_DIST += \
284 src/libnetwork/libnetwork.sym
285
286# ------------------------------------------------------------------------------
e145b2f3
MT
287
288util_PROGRAMS = \
289 src/utils/network-phy-list-ht-caps
290
291src_utils_network_phy_list_ht_caps_SOURCES = \
292 src/utils/network-phy-list-ht-caps.c
293
294src_utils_network_phy_list_ht_caps_LDADD = \
295 src/libnetwork.la
296
297# ------------------------------------------------------------------------------
01f2b2e4 298
5ca9dc30
MT
299ppp_SCRIPTS = \
300 src/ppp/ip-updown
301
302CLEANFILES += \
303 src/ppp/ip-updown
304
305EXTRA_DIST += \
306 src/ppp/ip-updown.in
307
308INSTALL_DIRS += \
9c9d0585
SS
309 $(pppdir) \
310 $(logdir)
5ca9dc30
MT
311
312ppp-install-hook:
313 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up
314 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-up
315 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-down
316 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-up
317 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-down
318
319ppp-uninstall-hook:
320 rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up}
321 rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up}
322
323INSTALL_EXEC_HOOKS += ppp-install-hook
324UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook
325
326# ------------------------------------------------------------------------------
327
328if HAVE_SYSTEMD
329systemdsystemunit_DATA = \
330 src/systemd/firewall4.service \
331 src/systemd/firewall6.service \
332 src/systemd/firewall-init.service \
333 src/systemd/network-init.service \
334 src/systemd/network@.service
335
336CLEANFILES += \
337 $(systemdsystemunit_DATA)
338
339INSTALL_DIRS += \
340 $(systemdsystemunitdir)
341endif
342
343EXTRA_DIST += \
344 src/systemd/firewall4.service.in \
345 src/systemd/firewall6.service.in \
346 src/systemd/firewall-init.service.in \
347 src/systemd/network-init.service.in \
348 src/systemd/network@.service.in
349
350# ------------------------------------------------------------------------------
351
5e84cd41
MT
352systemconfig_vpndir = $(systemconfigdir)/vpn
353
354dist_systemconfig_vpn_security_policies_DATA = \
56d5efa7 355 config/vpn/security-policies/performance \
5e84cd41
MT
356 config/vpn/security-policies/system
357
358systemconfig_vpn_security_policiesdir = $(systemconfig_vpndir)/security-policies
359
360# ------------------------------------------------------------------------------
361
5ca9dc30
MT
362dist_sysctl_DATA = \
363 src/sysctl/network.conf
364
365# ------------------------------------------------------------------------------
366
bae37360
MT
367dist_bashcompletion_SCRIPTS = \
368 src/bash-completion/network
369
370# ------------------------------------------------------------------------------
371
5ca9dc30 372dist_tmpfiles_DATA = \
f9dac5a0 373 src/tmpfiles/network.conf
5ca9dc30
MT
374
375# ------------------------------------------------------------------------------
376
377if HAVE_UDEV
378dist_udev_SCRIPTS = \
379 src/udev/network-hotplug \
380 src/udev/network-hotplug-rename \
381 src/udev/network-hotplug-serial
382
383dist_udevrules_DATA = \
384 src/udev/rules.d/50-serial-whitelist.rules \
385 src/udev/rules.d/60-net.rules
386
387INSTALL_DIRS += \
388 $(udevdir) \
389 $(udevrulesdir)
390endif
391
392# ------------------------------------------------------------------------------
393
01f2b2e4 394pkgconfig_DATA = \
5ca9dc30
MT
395 src/network.pc
396
397CLEANFILES += \
01f2b2e4 398 $(pkgconfig_DATA)
5ca9dc30
MT
399
400EXTRA_DIST += \
401 src/network.pc.in
402
403# ------------------------------------------------------------------------------
404
405dist_macros_DATA = \
406 src/macros/DHCP \
407 src/macros/HTTP \
408 src/macros/HTTPS \
409 src/macros/WWW
410
411# ------------------------------------------------------------------------------
412
ec3fe5b7 413INSTALL_DIRS += \
de3cecef
MT
414 $(triggersdir)
415
416# ------------------------------------------------------------------------------
417
5ca9dc30 418MANPAGES = \
2b0ff832 419 man/firewall-settings.8 \
5ca9dc30 420 man/network.8 \
89c81bcf 421 man/network-color.8 \
6135a5b3 422 man/network-description.8 \
5ca9dc30 423 man/network-device.8 \
427f5ae2 424 man/network-dhcp.8 \
5ca9dc30 425 man/network-dns-server.8 \
de72bd91 426 man/network-performance-tuning.8 \
7a302fa7 427 man/network-port.8 \
94eab754 428 man/network-quick-start.8 \
5ca9dc30 429 man/network-route.8 \
e023191b 430 man/network-route-static.8 \
2b0ff832 431 man/network-settings.8 \
bec94f95
MT
432 man/network-vpn.8 \
433 man/network-vpn-security-policies.8 \
5ca9dc30 434 man/network-zone.8 \
5ca9dc30 435 man/network-zone-6to4-tunnel.8 \
5ca9dc30
MT
436 man/network-zone-bridge.8 \
437 man/network-zone-config-pppoe-server.8 \
7a302fa7 438 man/network-zone-modem.8 \
2fb7ae4d
MT
439 man/network-zone-pppoe.8 \
440 man/network-zone-wireless.8
5ca9dc30
MT
441
442MANPAGES_XML = $(patsubst %.8,%.xml,$(MANPAGES))
443MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
444
445.PHONY: man
446man: $(MANPAGES) $(MANPAGES_HTML)
447
448man_MANS = \
449 $(MANPAGES)
450
451noinst_DATA += \
452 $(MANPAGES_HTML)
453
454CLEANFILES += \
455 $(man_MANS) \
456 $(MANPAGES_HTML)
457
458EXTRA_DIST += \
459 $(MANPAGES_XML) \
460 man/custom-html.xsl
461
462XSLTPROC_FLAGS = \
463 --nonet \
464 --stringparam man.output.quietly 1 \
465 --stringparam funcsynopsis.style ansi \
466 --stringparam man.th.extra1.suppress 1 \
467 --stringparam man.authors.section.enabled 1 \
468 --stringparam man.copyright.section.enabled 1
469
470XSLTPROC_COMMAND_MAN = \
471 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
472 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
473
474XSLTPROC_COMMAND_HTML = \
475 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
476
477man/%.8: man/%.xml
478 $(XSLTPROC_COMMAND_MAN)
479
480man/%.html: man/%.xml man/custom-html.xsl
481 $(XSLTPROC_COMMAND_HTML)
482
483# ------------------------------------------------------------------------------
484
485substitutions = \
486 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
487 '|PACKAGE_URL=$(PACKAGE_URL)|' \
488 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
489 '|prefix=$(prefix)|' \
490 '|exec_prefix=$(exec_prefix)|' \
491 '|sbindir=$(sbindir)|' \
c6525a63 492 '|networkdir=$(networkdir)|' \
96275aa1
MT
493 '|helpersdir=$(helpersdir)|' \
494 '|utildir=$(utildir)|'
5ca9dc30
MT
495
496SED_PROCESS = \
497 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
498 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
499 < $< > $@
500
501src/functions/functions: src/functions/functions.in Makefile
502 $(SED_PROCESS)
503
504src/ppp/ip-updown: src/ppp/ip-updown.in Makefile
505 $(SED_PROCESS)
506
507src/systemd/%: src/systemd/%.in Makefile
508 $(SED_PROCESS)
509
510src/%.pc: src/%.pc.in Makefile
511 $(SED_PROCESS)
512
513INSTALL_DIRS += \
514 $(sbindir)
515
516install-exec-hook: $(INSTALL_EXEC_HOOKS)
517
518uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
519
520# - testsuite ------------------------------------------------------------------
521
522TESTS_ENVIRONMENT = \
071d3416 523 LD_LIBRARY_PATH=$(top_builddir)/src/.libs:$(LD_LIBRARY_PATH) \
8744a476
MT
524 PATH=$(top_builddir)/src:$(PATH) \
525 functions=$(abs_builddir)/src/functions/functions \
526 networkdir=$(abs_srcdir)/src/functions \
527 testdir=$(top_srcdir)/test
528
529dist_check_DATA = \
ee86c73f
MT
530 test/constants.sh \
531 test/test-functions
5ca9dc30
MT
532
533dist_check_SCRIPTS = \
8744a476 534 $(TESTS)
5ca9dc30
MT
535
536TESTS = \
bb8304ec 537 test/load-library \
bb8304ec 538 test/functions/ip/ip_detect_protocol \
bb8304ec 539 test/functions/ip/ip_get_prefix \
8b0958b2 540 test/functions/ip/ip_net_is_valid \
b7fd8067 541 test/functions/ip/ip_is_valid \
b862734c 542 test/functions/ip/ip_network_is_subnet_of \
b7fd8067
MT
543 test/functions/ip/ip_prefix_is_valid \
544 test/functions/ip/ip_protocol_is_supported \
545 test/functions/ip/ip_split_prefix