blob: 13e144e40c0becd6358ad93308a767c7386ab1e5 [file] [log] [blame]
Jan Engelhardtf82070f2008-01-20 13:14:00 +00001# -*- Makefile -*-
2
Jan Engelhardt0086b8b2009-01-07 15:11:59 +01003ACLOCAL_AMFLAGS = -I m4
Jan Engelhardtf82070f2008-01-20 13:14:00 +00004AUTOMAKE_OPTIONS = foreign subdir-objects
Jan Engelhardtfb6209a2008-01-29 13:32:07 +00005
Jan Engelhardtca7cd662008-02-11 01:23:01 +01006AM_CFLAGS = ${regular_CFLAGS} -I${top_builddir}/include -I${top_srcdir}/include ${kinclude_CFLAGS}
Jan Engelhardt52edda62009-01-12 07:21:20 +01007SUBDIRS = extensions
Jan Engelhardtf567ac92009-02-12 15:01:37 +01008if ENABLE_DEVEL
9SUBDIRS += include
10endif
Jan Engelhardt77f15382008-02-11 15:01:03 +010011if ENABLE_LIBIPQ
Jan Engelhardtf82070f2008-01-20 13:14:00 +000012SUBDIRS += libipq
13endif
Jan Engelhardtdb6d0272010-03-27 12:48:55 +010014if HAVE_LIBNFNETLINK
15SUBDIRS += utils
16endif
Jan Engelhardt51bc8362009-02-11 16:40:29 +010017lib_LTLIBRARIES =
Jan Engelhardtf82070f2008-01-20 13:14:00 +000018
19# libiptc
Maciej Żenczykowski26ed9ea2011-04-04 22:30:16 -070020lib_LTLIBRARIES += libiptc/libip4tc.la libiptc/libip6tc.la libiptc/libiptc.la
Jan Engelhardtcc434402009-06-01 13:36:30 +020021libiptc_libiptc_la_SOURCES =
22libiptc_libiptc_la_LIBADD = libiptc/libip4tc.la libiptc/libip6tc.la
Jan Engelhardt655ae6b2010-09-13 16:06:50 +020023libiptc_libiptc_la_LDFLAGS = -version-info 0:0:0 ${libiptc_LDFLAGS2}
Jan Engelhardtcc434402009-06-01 13:36:30 +020024libiptc_libip4tc_la_SOURCES = libiptc/libip4tc.c
25libiptc_libip4tc_la_LDFLAGS = -version-info 0:0:0
26libiptc_libip6tc_la_SOURCES = libiptc/libip6tc.c
Jan Engelhardt655ae6b2010-09-13 16:06:50 +020027libiptc_libip6tc_la_LDFLAGS = -version-info 0:0:0 ${libiptc_LDFLAGS2}
Jan Engelhardtf82070f2008-01-20 13:14:00 +000028
Jan Engelhardt51bc8362009-02-11 16:40:29 +010029lib_LTLIBRARIES += libxtables.la
Jan Engelhardtaa37acc2011-02-07 04:00:50 +010030libxtables_la_SOURCES = xtables.c xtoptions.c
Jan Engelhardtdacafa52009-01-27 20:56:23 +010031libxtables_la_LDFLAGS = -version-info ${libxtables_vcurrent}:0:${libxtables_vage}
Jan Engelhardtb79ec692009-07-23 17:41:21 +020032if ENABLE_SHARED
33libxtables_la_CFLAGS = ${AM_CFLAGS}
Jan Engelhardt5c3e0762009-02-10 10:20:19 +010034libxtables_la_LIBADD = -ldl
Jan Engelhardtb79ec692009-07-23 17:41:21 +020035else
36libxtables_la_CFLAGS = ${AM_CFLAGS} -DNO_SHARED_LIBS=1
37libxtables_la_LIBADD =
38endif
Jan Engelhardt126c1362008-08-04 18:37:38 +020039
Maciej Żenczykowski26ed9ea2011-04-04 22:30:16 -070040xtables_multi_SOURCES = xtables-multi.c
41xtables_multi_CFLAGS = ${AM_CFLAGS} -DIPTABLES_MULTI
42xtables_multi_LDFLAGS = -rdynamic
43xtables_multi_LDADD = extensions/libext.a
Jan Engelhardtb79ec692009-07-23 17:41:21 +020044if ENABLE_STATIC
Maciej Żenczykowski26ed9ea2011-04-04 22:30:16 -070045xtables_multi_CFLAGS += -DALL_INCLUSIVE
Jan Engelhardtb79ec692009-07-23 17:41:21 +020046endif
Maciej Żenczykowski26ed9ea2011-04-04 22:30:16 -070047if ENABLE_IPV4
48xtables_multi_SOURCES += iptables-save.c iptables-restore.c iptables-xml.c \
49 iptables-standalone.c iptables.c
50xtables_multi_CFLAGS += -DENABLE_IPV4
51xtables_multi_LDADD += libiptc/libip4tc.la extensions/libext4.a
Jan Engelhardtb79ec692009-07-23 17:41:21 +020052endif
Maciej Żenczykowski26ed9ea2011-04-04 22:30:16 -070053if ENABLE_IPV6
54xtables_multi_SOURCES += ip6tables-save.c ip6tables-restore.c \
55 ip6tables-standalone.c ip6tables.c
56xtables_multi_CFLAGS += -DENABLE_IPV6
57xtables_multi_LDADD += libiptc/libip6tc.la extensions/libext6.a
58endif
59xtables_multi_SOURCES += xshared.c
60xtables_multi_LDADD += libxtables.la -lm
Jan Engelhardtf82070f2008-01-20 13:14:00 +000061
Maciej Żenczykowski26ed9ea2011-04-04 22:30:16 -070062sbin_PROGRAMS = xtables-multi
Jan Engelhardt52edda62009-01-12 07:21:20 +010063man_MANS = iptables.8 iptables-restore.8 iptables-save.8 \
64 iptables-xml.8 ip6tables.8 ip6tables-restore.8 \
65 ip6tables-save.8
66CLEANFILES = iptables.8 ip6tables.8
Jan Engelhardtf82070f2008-01-20 13:14:00 +000067
Jan Engelhardta094eb02009-04-03 22:37:49 +020068if ENABLE_IPV4
Jan Engelhardt80fcb7b2009-07-25 18:18:36 +020069v4_bin_links = iptables-xml
70v4_sbin_links = iptables iptables-restore iptables-save
Jan Engelhardta094eb02009-04-03 22:37:49 +020071endif
Jan Engelhardt8e586132009-04-03 22:28:34 +020072if ENABLE_IPV6
Jan Engelhardt80fcb7b2009-07-25 18:18:36 +020073v6_sbin_links = ip6tables ip6tables-restore ip6tables-save
Jan Engelhardt8e586132009-04-03 22:28:34 +020074endif
Jan Engelhardtf82070f2008-01-20 13:14:00 +000075
76iptables.8: ${srcdir}/iptables.8.in extensions/matches4.man extensions/targets4.man
Jan Engelhardt8d671902009-01-08 18:03:45 +010077 ${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' $< >$@;
Jan Engelhardtf82070f2008-01-20 13:14:00 +000078
79ip6tables.8: ${srcdir}/ip6tables.8.in extensions/matches6.man extensions/targets6.man
Jan Engelhardt8d671902009-01-08 18:03:45 +010080 ${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' $< >$@;
Jan Engelhardtf82070f2008-01-20 13:14:00 +000081
Jan Engelhardt51bc8362009-02-11 16:40:29 +010082pkgconfig_DATA = libiptc.pc xtables.pc
Jan Engelhardt126c1362008-08-04 18:37:38 +020083
Jan Engelhardta31cdd82008-03-03 13:04:07 +010084.PHONY: tarball
85tarball:
Jan Engelhardte6610c82008-04-17 10:32:13 +020086 rm -Rf /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION};
Jan Engelhardt9e812282008-09-01 14:27:19 +020087 pushd ${top_srcdir} && git archive --prefix=${PACKAGE_TARNAME}-${PACKAGE_VERSION}/ HEAD | tar -C /tmp -x && popd;
Jan Engelhardte6610c82008-04-17 10:32:13 +020088 pushd /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION} && ./autogen.sh && popd;
89 tar -C /tmp -cjf ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.bz2 --owner=root --group=root ${PACKAGE_TARNAME}-${PACKAGE_VERSION}/;
90 rm -Rf /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION};
Jan Engelhardtee381462008-08-13 14:43:22 +020091
Jan Engelhardt2c2466b2009-02-17 15:04:57 +010092config.status: extensions/GNUmakefile.in \
93 include/xtables.h.in include/iptables/internal.h.in
Jan Engelhardt75e8b132008-09-08 15:42:06 +020094
Jan Engelhardtc7f70f12009-03-30 01:28:44 +020095# Using if..fi avoids an ugly "error (ignored)" message :)
Jan Engelhardt75e8b132008-09-08 15:42:06 +020096install-exec-hook:
Jan Engelhardtc7f70f12009-03-30 01:28:44 +020097 -if test -z "${DESTDIR}"; then /sbin/ldconfig; fi;
Jan Engelhardt80fcb7b2009-07-25 18:18:36 +020098 ${INSTALL} -dm0755 "${DESTDIR}${bindir}";
99 for i in ${v4_bin_links}; do ${LN_S} -f "${sbindir}/iptables-multi" "${DESTDIR}${bindir}/$$i"; done;
100 for i in ${v4_sbin_links}; do ${LN_S} -f iptables-multi "${DESTDIR}${sbindir}/$$i"; done;
101 for i in ${v6_sbin_links}; do ${LN_S} -f ip6tables-multi "${DESTDIR}${sbindir}/$$i"; done;