Makefile.am revision 5c8f5b60aa8e24da0bd25824f0f85bf7a4a39ea7
1# -*- Makefile -*-
2
3ACLOCAL_AMFLAGS  = -I m4
4AUTOMAKE_OPTIONS = foreign subdir-objects
5
6AM_CFLAGS        = ${regular_CFLAGS}
7AM_CPPFLAGS      = ${regular_CPPFLAGS} -I${top_builddir}/include -I${top_srcdir}/include ${kinclude_CPPFLAGS}
8SUBDIRS          = extensions libiptc
9if ENABLE_DEVEL
10SUBDIRS         += include
11endif
12if ENABLE_LIBIPQ
13SUBDIRS         += libipq
14endif
15if HAVE_LIBNFNETLINK
16SUBDIRS         += utils
17endif
18
19lib_LTLIBRARIES       = libxtables.la
20libxtables_la_SOURCES = xtables.c xtoptions.c
21libxtables_la_LDFLAGS = -version-info ${libxtables_vcurrent}:0:${libxtables_vage}
22if ENABLE_SHARED
23libxtables_la_CFLAGS  = ${AM_CFLAGS}
24libxtables_la_LIBADD  = -ldl
25else
26libxtables_la_CFLAGS  = ${AM_CFLAGS} -DNO_SHARED_LIBS=1
27libxtables_la_LIBADD  =
28endif
29
30xtables_multi_SOURCES  = xtables-multi.c iptables-xml.c
31xtables_multi_CFLAGS   = ${AM_CFLAGS} -DIPTABLES_MULTI
32xtables_multi_LDFLAGS  = -rdynamic
33xtables_multi_LDADD    = extensions/libext.a
34if ENABLE_STATIC
35xtables_multi_CFLAGS  += -DALL_INCLUSIVE
36endif
37if ENABLE_IPV4
38xtables_multi_SOURCES += iptables-save.c iptables-restore.c \
39                         iptables-standalone.c iptables.c
40xtables_multi_CFLAGS  += -DENABLE_IPV4
41xtables_multi_LDADD   += libiptc/libip4tc.la extensions/libext4.a
42endif
43if ENABLE_IPV6
44xtables_multi_SOURCES += ip6tables-save.c ip6tables-restore.c \
45                          ip6tables-standalone.c ip6tables.c
46xtables_multi_CFLAGS  += -DENABLE_IPV6
47xtables_multi_LDADD   += libiptc/libip6tc.la extensions/libext6.a
48endif
49xtables_multi_SOURCES += xshared.c
50xtables_multi_LDADD   += libxtables.la -lm
51
52sbin_PROGRAMS    = xtables-multi
53man_MANS         = iptables.8 iptables-restore.8 iptables-save.8 \
54                   iptables-xml.1 ip6tables.8 ip6tables-restore.8 \
55                   ip6tables-save.8
56CLEANFILES       = iptables.8 ip6tables.8
57
58vx_bin_links   = iptables-xml
59if ENABLE_IPV4
60v4_sbin_links  = iptables iptables-restore iptables-save
61endif
62if ENABLE_IPV6
63v6_sbin_links  = ip6tables ip6tables-restore ip6tables-save
64endif
65
66iptables.8: ${srcdir}/iptables.8.in extensions/matches4.man extensions/targets4.man
67	${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' $< >$@;
68
69ip6tables.8: ${srcdir}/ip6tables.8.in extensions/matches6.man extensions/targets6.man
70	${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' $< >$@;
71
72pkgconfig_DATA = xtables.pc
73
74.PHONY: tarball
75tarball:
76	rm -Rf /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION};
77	pushd ${top_srcdir} && git archive --prefix=${PACKAGE_TARNAME}-${PACKAGE_VERSION}/ HEAD | tar -C /tmp -x && popd;
78	pushd /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION} && ./autogen.sh && popd;
79	tar -C /tmp -cjf ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.bz2 --owner=root --group=root ${PACKAGE_TARNAME}-${PACKAGE_VERSION}/;
80	rm -Rf /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION};
81
82config.status: extensions/GNUmakefile.in \
83	include/xtables.h.in include/iptables/internal.h.in
84
85# Using if..fi avoids an ugly "error (ignored)" message :)
86install-exec-hook:
87	-if test -z "${DESTDIR}"; then /sbin/ldconfig; fi;
88	${INSTALL} -dm0755 "${DESTDIR}${bindir}";
89	for i in ${vx_bin_links}; do ${LN_S} -f "${sbindir}/xtables-multi" "${DESTDIR}${bindir}/$$i"; done;
90	for i in ${v4_sbin_links}; do ${LN_S} -f xtables-multi "${DESTDIR}${sbindir}/$$i"; done;
91	for i in ${v6_sbin_links}; do ${LN_S} -f xtables-multi "${DESTDIR}${sbindir}/$$i"; done;
92