blob: b714b97f5845d78a6c0f1bb2e8453aec8e897dcd [file] [log] [blame]
Jan Engelhardtf82070f2008-01-20 13:14:00 +00001# -*- Makefile -*-
2
3AUTOMAKE_OPTIONS = foreign subdir-objects
Jan Engelhardtfb6209a2008-01-29 13:32:07 +00004
Jan Engelhardtca7cd662008-02-11 01:23:01 +01005AM_CFLAGS = ${regular_CFLAGS} -I${top_builddir}/include -I${top_srcdir}/include ${kinclude_CFLAGS}
Jan Engelhardtf82070f2008-01-20 13:14:00 +00006SUBDIRS := extensions
Jan Engelhardt77f15382008-02-11 15:01:03 +01007if ENABLE_LIBIPQ
Jan Engelhardtf82070f2008-01-20 13:14:00 +00008SUBDIRS += libipq
9endif
10
11# libiptc
12libiptc_libiptc_a_SOURCES = libiptc/libip4tc.c libiptc/libip6tc.c
13
14# iptables, dynamic
15iptables_SOURCES = iptables-standalone.c iptables.c xtables.c
16iptables_LDFLAGS = -rdynamic
17iptables_LDADD = -ldl -lm libiptc/libiptc.a extensions/libext4.a
18
19iptables_multi_SOURCES = iptables-multi.c iptables-save.c \
20 iptables-restore.c iptables-xml.c \
21 iptables-standalone.c iptables.c xtables.c
22iptables_multi_CFLAGS = ${AM_CFLAGS} -DIPTABLES_MULTI
23iptables_multi_LDFLAGS = ${iptables_LDFLAGS}
24iptables_multi_LDADD = ${iptables_LDADD}
25
26iptables_restore_SOURCES = iptables-restore.c iptables.c xtables.c
27iptables_restore_LDFLAGS = ${iptables_LDFLAGS}
28iptables_restore_LDADD = ${iptables_LDADD}
29
30iptables_save_SOURCES = iptables-save.c iptables.c xtables.c
31iptables_save_LDFLAGS = ${iptables_LDFLAGS}
32iptables_save_LDADD = ${iptables_LDADD}
33
34# iptables-multi, semi-static
35iptables_static_SOURCES = ${iptables_multi_SOURCES}
36iptables_static_CFLAGS = ${iptables_multi_CFLAGS} -DNO_SHARED_LIBS=1
37iptables_static_LDADD = -lm libiptc/libiptc.a extensions/libext4.a
38
39iptables_xml_SOURCES = iptables-xml.c
40
41# ip6tables, dynamic
42ip6tables_SOURCES = ip6tables-standalone.c ip6tables.c xtables.c
43ip6tables_LDFLAGS = -rdynamic
44ip6tables_LDADD = -ldl -lm libiptc/libiptc.a extensions/libext6.a
45
46ip6tables_multi_SOURCES = ip6tables-multi.c ip6tables-save.c \
47 ip6tables-restore.c ip6tables-standalone.c \
48 ip6tables.c xtables.c
49ip6tables_multi_CFLAGS = ${AM_CFLAGS} -DIPTABLES_MULTI
50ip6tables_multi_LDFLAGS = ${ip6tables_LDFLAGS}
51ip6tables_multi_LDADD = ${ip6tables_LDADD}
52
53ip6tables_restore_SOURCES = ip6tables-restore.c ip6tables.c xtables.c
54ip6tables_restore_LDFLAGS = ${ip6tables_LDFLAGS}
55ip6tables_restore_LDADD = ${ip6tables_LDADD}
56
57ip6tables_save_SOURCES = ip6tables-save.c ip6tables.c xtables.c
58ip6tables_save_LDFLAGS = ${ip6tables_LDFLAGS}
59ip6tables_save_LDADD = ${ip6tables_LDADD}
60
61# iptables-multi, semi-static
62ip6tables_static_SOURCES = ${ip6tables_multi_SOURCES}
63ip6tables_static_CFLAGS = ${ip6tables_multi_CFLAGS} -DNO_SHARED_LIBS=1
64ip6tables_static_LDADD = -lm libiptc/libiptc.a extensions/libext6.a
65
66noinst_LIBRARIES := libiptc/libiptc.a
67bin_PROGRAMS := iptables-xml
68sbin_PROGRAMS :=
69noinst_PROGRAMS :=
70man_MANS := iptables.8 iptables-restore.8 iptables-save.8 \
71 iptables-xml.8 ip6tables.8 ip6tables-restore.8 \
72 ip6tables-save.8
73CLEANFILES := iptables.8 ip6tables.8
74if ENABLE_DEVEL
Jan Engelhardt72ed4ff2008-07-29 19:04:11 +020075include_HEADERS := include/xtables.h
Jan Engelhardtf82070f2008-01-20 13:14:00 +000076endif
77
78if ENABLE_STATIC
79sbin_PROGRAMS += iptables-static ip6tables-static
80endif
81if ENABLE_SHARED
82sbin_PROGRAMS += iptables iptables-multi iptables-restore iptables-save \
83 ip6tables ip6tables-multi ip6tables-restore ip6tables-save
84endif
85
86iptables.8: ${srcdir}/iptables.8.in extensions/matches4.man extensions/targets4.man
87 ${AM_VERBOSE_GEN} sed -e '/@MATCH@/ r extensions/matches4.man' -e '/@TARGET@/ r extensions/targets4.man' $< >$@;
88
89ip6tables.8: ${srcdir}/ip6tables.8.in extensions/matches6.man extensions/targets6.man
90 ${AM_VERBOSE_GEN} sed -e '/@MATCH@/ r extensions/matches6.man' -e '/@TARGET@/ r extensions/targets6.man' $< >$@;
91
92extensions/%:
93 ${MAKE} ${AM_MAKEFLAGS} -C $(@D) $(@F)
Jan Engelhardta31cdd82008-03-03 13:04:07 +010094
95.PHONY: tarball
96tarball:
Jan Engelhardte6610c82008-04-17 10:32:13 +020097 rm -Rf /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION};
98 pushd ${top_srcdir} && git-archive --prefix=${PACKAGE_TARNAME}-${PACKAGE_VERSION}/ HEAD | tar -C /tmp -x && popd;
99 pushd /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION} && ./autogen.sh && popd;
100 tar -C /tmp -cjf ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.bz2 --owner=root --group=root ${PACKAGE_TARNAME}-${PACKAGE_VERSION}/;
101 rm -Rf /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION};