blob: 0ffb978509c6591d600370f7e8a265137974cf6b [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 Engelhardt77f15382008-02-11 15:01:03 +01008if ENABLE_LIBIPQ
Jan Engelhardtf82070f2008-01-20 13:14:00 +00009SUBDIRS += libipq
10endif
11
12# libiptc
13libiptc_libiptc_a_SOURCES = libiptc/libip4tc.c libiptc/libip6tc.c
14
Jan Engelhardt126c1362008-08-04 18:37:38 +020015lib_LTLIBRARIES = libxtables.la
16libxtables_la_SOURCES = xtables.c
Jan Engelhardtdacafa52009-01-27 20:56:23 +010017libxtables_la_LDFLAGS = -version-info ${libxtables_vcurrent}:0:${libxtables_vage}
Jan Engelhardt126c1362008-08-04 18:37:38 +020018
Jan Engelhardtf82070f2008-01-20 13:14:00 +000019# iptables, dynamic
Jan Engelhardt126c1362008-08-04 18:37:38 +020020iptables_SOURCES = iptables-standalone.c iptables.c
Jan Engelhardtf82070f2008-01-20 13:14:00 +000021iptables_LDFLAGS = -rdynamic
Jan Engelhardt126c1362008-08-04 18:37:38 +020022iptables_LDADD = -ldl -lm libiptc/libiptc.a extensions/libext4.a libxtables.la
Jan Engelhardtf82070f2008-01-20 13:14:00 +000023
24iptables_multi_SOURCES = iptables-multi.c iptables-save.c \
25 iptables-restore.c iptables-xml.c \
Jan Engelhardt126c1362008-08-04 18:37:38 +020026 iptables-standalone.c iptables.c
Jan Engelhardtf82070f2008-01-20 13:14:00 +000027iptables_multi_CFLAGS = ${AM_CFLAGS} -DIPTABLES_MULTI
28iptables_multi_LDFLAGS = ${iptables_LDFLAGS}
29iptables_multi_LDADD = ${iptables_LDADD}
30
Jan Engelhardt126c1362008-08-04 18:37:38 +020031iptables_restore_SOURCES = iptables-restore.c iptables.c
Jan Engelhardtf82070f2008-01-20 13:14:00 +000032iptables_restore_LDFLAGS = ${iptables_LDFLAGS}
33iptables_restore_LDADD = ${iptables_LDADD}
34
Jan Engelhardt126c1362008-08-04 18:37:38 +020035iptables_save_SOURCES = iptables-save.c iptables.c
Jan Engelhardtf82070f2008-01-20 13:14:00 +000036iptables_save_LDFLAGS = ${iptables_LDFLAGS}
37iptables_save_LDADD = ${iptables_LDADD}
38
39# iptables-multi, semi-static
Jan Engelhard74e8f2f2008-08-15 13:51:10 +020040iptables_static_SOURCES = ${iptables_multi_SOURCES} xtables.c
Jan Engelhardtf82070f2008-01-20 13:14:00 +000041iptables_static_CFLAGS = ${iptables_multi_CFLAGS} -DNO_SHARED_LIBS=1
42iptables_static_LDADD = -lm libiptc/libiptc.a extensions/libext4.a
43
44iptables_xml_SOURCES = iptables-xml.c
45
46# ip6tables, dynamic
Jan Engelhardt126c1362008-08-04 18:37:38 +020047ip6tables_SOURCES = ip6tables-standalone.c ip6tables.c
Jan Engelhardtf82070f2008-01-20 13:14:00 +000048ip6tables_LDFLAGS = -rdynamic
Jan Engelhardt126c1362008-08-04 18:37:38 +020049ip6tables_LDADD = -ldl -lm libiptc/libiptc.a extensions/libext6.a libxtables.la
Jan Engelhardtf82070f2008-01-20 13:14:00 +000050
51ip6tables_multi_SOURCES = ip6tables-multi.c ip6tables-save.c \
52 ip6tables-restore.c ip6tables-standalone.c \
Jan Engelhardt126c1362008-08-04 18:37:38 +020053 ip6tables.c
Jan Engelhardtf82070f2008-01-20 13:14:00 +000054ip6tables_multi_CFLAGS = ${AM_CFLAGS} -DIPTABLES_MULTI
55ip6tables_multi_LDFLAGS = ${ip6tables_LDFLAGS}
56ip6tables_multi_LDADD = ${ip6tables_LDADD}
57
Jan Engelhardt126c1362008-08-04 18:37:38 +020058ip6tables_restore_SOURCES = ip6tables-restore.c ip6tables.c
Jan Engelhardtf82070f2008-01-20 13:14:00 +000059ip6tables_restore_LDFLAGS = ${ip6tables_LDFLAGS}
60ip6tables_restore_LDADD = ${ip6tables_LDADD}
61
Jan Engelhardt126c1362008-08-04 18:37:38 +020062ip6tables_save_SOURCES = ip6tables-save.c ip6tables.c
Jan Engelhardtf82070f2008-01-20 13:14:00 +000063ip6tables_save_LDFLAGS = ${ip6tables_LDFLAGS}
64ip6tables_save_LDADD = ${ip6tables_LDADD}
65
66# iptables-multi, semi-static
Jan Engelhard74e8f2f2008-08-15 13:51:10 +020067ip6tables_static_SOURCES = ${ip6tables_multi_SOURCES} xtables.c
Jan Engelhardtf82070f2008-01-20 13:14:00 +000068ip6tables_static_CFLAGS = ${ip6tables_multi_CFLAGS} -DNO_SHARED_LIBS=1
69ip6tables_static_LDADD = -lm libiptc/libiptc.a extensions/libext6.a
70
Jan Engelhardt52edda62009-01-12 07:21:20 +010071noinst_LIBRARIES = libiptc/libiptc.a
72bin_PROGRAMS = iptables-xml
73sbin_PROGRAMS =
74noinst_PROGRAMS =
75man_MANS = iptables.8 iptables-restore.8 iptables-save.8 \
76 iptables-xml.8 ip6tables.8 ip6tables-restore.8 \
77 ip6tables-save.8
78CLEANFILES = iptables.8 ip6tables.8
Jan Engelhardtf82070f2008-01-20 13:14:00 +000079if ENABLE_DEVEL
Jan Engelhardt52edda62009-01-12 07:21:20 +010080include_HEADERS = include/xtables.h
Jan Engelhardtf82070f2008-01-20 13:14:00 +000081endif
82
83if ENABLE_STATIC
84sbin_PROGRAMS += iptables-static ip6tables-static
85endif
86if ENABLE_SHARED
87sbin_PROGRAMS += iptables iptables-multi iptables-restore iptables-save \
88 ip6tables ip6tables-multi ip6tables-restore ip6tables-save
89endif
90
91iptables.8: ${srcdir}/iptables.8.in extensions/matches4.man extensions/targets4.man
Jan Engelhardt8d671902009-01-08 18:03:45 +010092 ${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 +000093
94ip6tables.8: ${srcdir}/ip6tables.8.in extensions/matches6.man extensions/targets6.man
Jan Engelhardt8d671902009-01-08 18:03:45 +010095 ${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 +000096
Jan Engelhardt126c1362008-08-04 18:37:38 +020097pkgconfig_DATA = xtables.pc
98
Jan Engelhardta31cdd82008-03-03 13:04:07 +010099.PHONY: tarball
100tarball:
Jan Engelhardte6610c82008-04-17 10:32:13 +0200101 rm -Rf /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION};
Jan Engelhardt9e812282008-09-01 14:27:19 +0200102 pushd ${top_srcdir} && git archive --prefix=${PACKAGE_TARNAME}-${PACKAGE_VERSION}/ HEAD | tar -C /tmp -x && popd;
Jan Engelhardte6610c82008-04-17 10:32:13 +0200103 pushd /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION} && ./autogen.sh && popd;
104 tar -C /tmp -cjf ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.bz2 --owner=root --group=root ${PACKAGE_TARNAME}-${PACKAGE_VERSION}/;
105 rm -Rf /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION};
Jan Engelhardtee381462008-08-13 14:43:22 +0200106
107config.status: include/xtables.h.in
Jan Engelhardt75e8b132008-09-08 15:42:06 +0200108
109# ldconfig may fail when we are not root (as is the case in build systems)
110# so add appropriate protection that it does not let `make` fail.
111install-exec-hook:
112 -/sbin/ldconfig || :;