Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 1 | # -*- Makefile -*- |
| 2 | |
| 3 | AUTOMAKE_OPTIONS = foreign subdir-objects |
Jan Engelhardt | fb6209a | 2008-01-29 13:32:07 +0000 | [diff] [blame] | 4 | |
Jan Engelhardt | ca7cd66 | 2008-02-11 01:23:01 +0100 | [diff] [blame] | 5 | AM_CFLAGS = ${regular_CFLAGS} -I${top_builddir}/include -I${top_srcdir}/include ${kinclude_CFLAGS} |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 6 | SUBDIRS := extensions |
Jan Engelhardt | 77f1538 | 2008-02-11 15:01:03 +0100 | [diff] [blame] | 7 | if ENABLE_LIBIPQ |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 8 | SUBDIRS += libipq |
| 9 | endif |
| 10 | |
| 11 | # libiptc |
| 12 | libiptc_libiptc_a_SOURCES = libiptc/libip4tc.c libiptc/libip6tc.c |
| 13 | |
| 14 | # iptables, dynamic |
| 15 | iptables_SOURCES = iptables-standalone.c iptables.c xtables.c |
| 16 | iptables_LDFLAGS = -rdynamic |
| 17 | iptables_LDADD = -ldl -lm libiptc/libiptc.a extensions/libext4.a |
| 18 | |
| 19 | iptables_multi_SOURCES = iptables-multi.c iptables-save.c \ |
| 20 | iptables-restore.c iptables-xml.c \ |
| 21 | iptables-standalone.c iptables.c xtables.c |
| 22 | iptables_multi_CFLAGS = ${AM_CFLAGS} -DIPTABLES_MULTI |
| 23 | iptables_multi_LDFLAGS = ${iptables_LDFLAGS} |
| 24 | iptables_multi_LDADD = ${iptables_LDADD} |
| 25 | |
| 26 | iptables_restore_SOURCES = iptables-restore.c iptables.c xtables.c |
| 27 | iptables_restore_LDFLAGS = ${iptables_LDFLAGS} |
| 28 | iptables_restore_LDADD = ${iptables_LDADD} |
| 29 | |
| 30 | iptables_save_SOURCES = iptables-save.c iptables.c xtables.c |
| 31 | iptables_save_LDFLAGS = ${iptables_LDFLAGS} |
| 32 | iptables_save_LDADD = ${iptables_LDADD} |
| 33 | |
| 34 | # iptables-multi, semi-static |
| 35 | iptables_static_SOURCES = ${iptables_multi_SOURCES} |
| 36 | iptables_static_CFLAGS = ${iptables_multi_CFLAGS} -DNO_SHARED_LIBS=1 |
| 37 | iptables_static_LDADD = -lm libiptc/libiptc.a extensions/libext4.a |
| 38 | |
| 39 | iptables_xml_SOURCES = iptables-xml.c |
| 40 | |
| 41 | # ip6tables, dynamic |
| 42 | ip6tables_SOURCES = ip6tables-standalone.c ip6tables.c xtables.c |
| 43 | ip6tables_LDFLAGS = -rdynamic |
| 44 | ip6tables_LDADD = -ldl -lm libiptc/libiptc.a extensions/libext6.a |
| 45 | |
| 46 | ip6tables_multi_SOURCES = ip6tables-multi.c ip6tables-save.c \ |
| 47 | ip6tables-restore.c ip6tables-standalone.c \ |
| 48 | ip6tables.c xtables.c |
| 49 | ip6tables_multi_CFLAGS = ${AM_CFLAGS} -DIPTABLES_MULTI |
| 50 | ip6tables_multi_LDFLAGS = ${ip6tables_LDFLAGS} |
| 51 | ip6tables_multi_LDADD = ${ip6tables_LDADD} |
| 52 | |
| 53 | ip6tables_restore_SOURCES = ip6tables-restore.c ip6tables.c xtables.c |
| 54 | ip6tables_restore_LDFLAGS = ${ip6tables_LDFLAGS} |
| 55 | ip6tables_restore_LDADD = ${ip6tables_LDADD} |
| 56 | |
| 57 | ip6tables_save_SOURCES = ip6tables-save.c ip6tables.c xtables.c |
| 58 | ip6tables_save_LDFLAGS = ${ip6tables_LDFLAGS} |
| 59 | ip6tables_save_LDADD = ${ip6tables_LDADD} |
| 60 | |
| 61 | # iptables-multi, semi-static |
| 62 | ip6tables_static_SOURCES = ${ip6tables_multi_SOURCES} |
| 63 | ip6tables_static_CFLAGS = ${ip6tables_multi_CFLAGS} -DNO_SHARED_LIBS=1 |
| 64 | ip6tables_static_LDADD = -lm libiptc/libiptc.a extensions/libext6.a |
| 65 | |
| 66 | noinst_LIBRARIES := libiptc/libiptc.a |
| 67 | bin_PROGRAMS := iptables-xml |
| 68 | sbin_PROGRAMS := |
| 69 | noinst_PROGRAMS := |
| 70 | man_MANS := iptables.8 iptables-restore.8 iptables-save.8 \ |
| 71 | iptables-xml.8 ip6tables.8 ip6tables-restore.8 \ |
| 72 | ip6tables-save.8 |
| 73 | CLEANFILES := iptables.8 ip6tables.8 |
| 74 | if ENABLE_DEVEL |
Jan Engelhardt | 72ed4ff | 2008-07-29 19:04:11 +0200 | [diff] [blame] | 75 | include_HEADERS := include/xtables.h |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 76 | endif |
| 77 | |
| 78 | if ENABLE_STATIC |
| 79 | sbin_PROGRAMS += iptables-static ip6tables-static |
| 80 | endif |
| 81 | if ENABLE_SHARED |
| 82 | sbin_PROGRAMS += iptables iptables-multi iptables-restore iptables-save \ |
| 83 | ip6tables ip6tables-multi ip6tables-restore ip6tables-save |
| 84 | endif |
| 85 | |
| 86 | iptables.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 | |
| 89 | ip6tables.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 | |
| 92 | extensions/%: |
| 93 | ${MAKE} ${AM_MAKEFLAGS} -C $(@D) $(@F) |
Jan Engelhardt | a31cdd8 | 2008-03-03 13:04:07 +0100 | [diff] [blame] | 94 | |
| 95 | .PHONY: tarball |
| 96 | tarball: |
Jan Engelhardt | e6610c8 | 2008-04-17 10:32:13 +0200 | [diff] [blame] | 97 | 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}; |