Makefile.am revision 8816e91cddef785c78b3598c7c41a1f88be08f5a
1# -*- Makefile -*-
2
3AM_CFLAGS        = ${regular_CFLAGS}
4AM_CPPFLAGS      = ${regular_CPPFLAGS} -I${top_builddir}/include -I${top_srcdir}/include ${kinclude_CPPFLAGS}
5
6xtables_multi_SOURCES  = xtables-multi.c iptables-xml.c
7xtables_multi_CFLAGS   = ${AM_CFLAGS}
8xtables_multi_LDADD    = ../extensions/libext.a
9if ENABLE_STATIC
10xtables_multi_CFLAGS  += -DALL_INCLUSIVE
11endif
12if ENABLE_IPV4
13xtables_multi_SOURCES += iptables-save.c iptables-restore.c \
14                         iptables-standalone.c iptables.c
15xtables_multi_CFLAGS  += -DENABLE_IPV4
16xtables_multi_LDADD   += ../libiptc/libip4tc.la ../extensions/libext4.a
17endif
18if ENABLE_IPV6
19xtables_multi_SOURCES += ip6tables-save.c ip6tables-restore.c \
20                          ip6tables-standalone.c ip6tables.c
21xtables_multi_CFLAGS  += -DENABLE_IPV6
22xtables_multi_LDADD   += ../libiptc/libip6tc.la ../extensions/libext6.a
23endif
24xtables_multi_SOURCES += xshared.c
25xtables_multi_LDADD   += ../libxtables/libxtables.la -lm
26
27sbin_PROGRAMS    = xtables-multi
28man_MANS         = iptables.8 iptables-restore.8 iptables-save.8 \
29                   iptables-xml.1 ip6tables.8 ip6tables-restore.8 \
30                   ip6tables-save.8
31CLEANFILES       = iptables.8 ip6tables.8
32
33vx_bin_links   = iptables-xml
34if ENABLE_IPV4
35v4_sbin_links  = iptables iptables-restore iptables-save
36endif
37if ENABLE_IPV6
38v6_sbin_links  = ip6tables ip6tables-restore ip6tables-save
39endif
40
41iptables.8: ${srcdir}/iptables.8.in ../extensions/matches4.man ../extensions/targets4.man
42	${AM_VERBOSE_GEN} sed -e 's/@PACKAGE_AND_VERSION@/${PACKAGE} ${PACKAGE_VERSION}/g' -e '/@MATCH@/ r ../extensions/matches4.man' -e '/@TARGET@/ r ../extensions/targets4.man' $< >$@;
43
44ip6tables.8: ${srcdir}/ip6tables.8.in ../extensions/matches6.man ../extensions/targets6.man
45	${AM_VERBOSE_GEN} sed -e 's/@PACKAGE_AND_VERSION@/${PACKAGE} ${PACKAGE_VERSION}/g' -e '/@MATCH@/ r ../extensions/matches6.man' -e '/@TARGET@/ r ../extensions/targets6.man' $< >$@;
46
47pkgconfig_DATA = xtables.pc
48
49# Using if..fi avoids an ugly "error (ignored)" message :)
50install-exec-hook:
51	-if test -z "${DESTDIR}"; then /sbin/ldconfig; fi;
52	${INSTALL} -dm0755 "${DESTDIR}${bindir}";
53	for i in ${vx_bin_links}; do ${LN_S} -f "${sbindir}/xtables-multi" "${DESTDIR}${bindir}/$$i"; done;
54	for i in ${v4_sbin_links}; do ${LN_S} -f xtables-multi "${DESTDIR}${sbindir}/$$i"; done;
55	for i in ${v6_sbin_links}; do ${LN_S} -f xtables-multi "${DESTDIR}${sbindir}/$$i"; done;
56