Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 1 | # -*- Makefile -*- |
| 2 | |
Jan Engelhardt | 0086b8b | 2009-01-07 15:11:59 +0100 | [diff] [blame] | 3 | ACLOCAL_AMFLAGS = -I m4 |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 4 | AUTOMAKE_OPTIONS = foreign subdir-objects |
Jan Engelhardt | fb6209a | 2008-01-29 13:32:07 +0000 | [diff] [blame] | 5 | |
Jan Engelhardt | ca7cd66 | 2008-02-11 01:23:01 +0100 | [diff] [blame] | 6 | AM_CFLAGS = ${regular_CFLAGS} -I${top_builddir}/include -I${top_srcdir}/include ${kinclude_CFLAGS} |
Jan Engelhardt | 52edda6 | 2009-01-12 07:21:20 +0100 | [diff] [blame] | 7 | SUBDIRS = extensions |
Jan Engelhardt | 77f1538 | 2008-02-11 15:01:03 +0100 | [diff] [blame] | 8 | if ENABLE_LIBIPQ |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 9 | SUBDIRS += libipq |
| 10 | endif |
| 11 | |
| 12 | # libiptc |
| 13 | libiptc_libiptc_a_SOURCES = libiptc/libip4tc.c libiptc/libip6tc.c |
| 14 | |
Jan Engelhardt | 126c136 | 2008-08-04 18:37:38 +0200 | [diff] [blame] | 15 | lib_LTLIBRARIES = libxtables.la |
| 16 | libxtables_la_SOURCES = xtables.c |
Jan Engelhardt | dacafa5 | 2009-01-27 20:56:23 +0100 | [diff] [blame] | 17 | libxtables_la_LDFLAGS = -version-info ${libxtables_vcurrent}:0:${libxtables_vage} |
Jan Engelhardt | 126c136 | 2008-08-04 18:37:38 +0200 | [diff] [blame] | 18 | |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 19 | # iptables, dynamic |
Jan Engelhardt | 126c136 | 2008-08-04 18:37:38 +0200 | [diff] [blame] | 20 | iptables_SOURCES = iptables-standalone.c iptables.c |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 21 | iptables_LDFLAGS = -rdynamic |
Jan Engelhardt | 126c136 | 2008-08-04 18:37:38 +0200 | [diff] [blame] | 22 | iptables_LDADD = -ldl -lm libiptc/libiptc.a extensions/libext4.a libxtables.la |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 23 | |
| 24 | iptables_multi_SOURCES = iptables-multi.c iptables-save.c \ |
| 25 | iptables-restore.c iptables-xml.c \ |
Jan Engelhardt | 126c136 | 2008-08-04 18:37:38 +0200 | [diff] [blame] | 26 | iptables-standalone.c iptables.c |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 27 | iptables_multi_CFLAGS = ${AM_CFLAGS} -DIPTABLES_MULTI |
| 28 | iptables_multi_LDFLAGS = ${iptables_LDFLAGS} |
| 29 | iptables_multi_LDADD = ${iptables_LDADD} |
| 30 | |
Jan Engelhardt | 126c136 | 2008-08-04 18:37:38 +0200 | [diff] [blame] | 31 | iptables_restore_SOURCES = iptables-restore.c iptables.c |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 32 | iptables_restore_LDFLAGS = ${iptables_LDFLAGS} |
| 33 | iptables_restore_LDADD = ${iptables_LDADD} |
| 34 | |
Jan Engelhardt | 126c136 | 2008-08-04 18:37:38 +0200 | [diff] [blame] | 35 | iptables_save_SOURCES = iptables-save.c iptables.c |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 36 | iptables_save_LDFLAGS = ${iptables_LDFLAGS} |
| 37 | iptables_save_LDADD = ${iptables_LDADD} |
| 38 | |
| 39 | # iptables-multi, semi-static |
Jan Engelhard | 74e8f2f | 2008-08-15 13:51:10 +0200 | [diff] [blame] | 40 | iptables_static_SOURCES = ${iptables_multi_SOURCES} xtables.c |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 41 | iptables_static_CFLAGS = ${iptables_multi_CFLAGS} -DNO_SHARED_LIBS=1 |
| 42 | iptables_static_LDADD = -lm libiptc/libiptc.a extensions/libext4.a |
| 43 | |
| 44 | iptables_xml_SOURCES = iptables-xml.c |
| 45 | |
| 46 | # ip6tables, dynamic |
Jan Engelhardt | 126c136 | 2008-08-04 18:37:38 +0200 | [diff] [blame] | 47 | ip6tables_SOURCES = ip6tables-standalone.c ip6tables.c |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 48 | ip6tables_LDFLAGS = -rdynamic |
Jan Engelhardt | 126c136 | 2008-08-04 18:37:38 +0200 | [diff] [blame] | 49 | ip6tables_LDADD = -ldl -lm libiptc/libiptc.a extensions/libext6.a libxtables.la |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 50 | |
| 51 | ip6tables_multi_SOURCES = ip6tables-multi.c ip6tables-save.c \ |
| 52 | ip6tables-restore.c ip6tables-standalone.c \ |
Jan Engelhardt | 126c136 | 2008-08-04 18:37:38 +0200 | [diff] [blame] | 53 | ip6tables.c |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 54 | ip6tables_multi_CFLAGS = ${AM_CFLAGS} -DIPTABLES_MULTI |
| 55 | ip6tables_multi_LDFLAGS = ${ip6tables_LDFLAGS} |
| 56 | ip6tables_multi_LDADD = ${ip6tables_LDADD} |
| 57 | |
Jan Engelhardt | 126c136 | 2008-08-04 18:37:38 +0200 | [diff] [blame] | 58 | ip6tables_restore_SOURCES = ip6tables-restore.c ip6tables.c |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 59 | ip6tables_restore_LDFLAGS = ${ip6tables_LDFLAGS} |
| 60 | ip6tables_restore_LDADD = ${ip6tables_LDADD} |
| 61 | |
Jan Engelhardt | 126c136 | 2008-08-04 18:37:38 +0200 | [diff] [blame] | 62 | ip6tables_save_SOURCES = ip6tables-save.c ip6tables.c |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 63 | ip6tables_save_LDFLAGS = ${ip6tables_LDFLAGS} |
| 64 | ip6tables_save_LDADD = ${ip6tables_LDADD} |
| 65 | |
| 66 | # iptables-multi, semi-static |
Jan Engelhard | 74e8f2f | 2008-08-15 13:51:10 +0200 | [diff] [blame] | 67 | ip6tables_static_SOURCES = ${ip6tables_multi_SOURCES} xtables.c |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 68 | ip6tables_static_CFLAGS = ${ip6tables_multi_CFLAGS} -DNO_SHARED_LIBS=1 |
| 69 | ip6tables_static_LDADD = -lm libiptc/libiptc.a extensions/libext6.a |
| 70 | |
Jan Engelhardt | 52edda6 | 2009-01-12 07:21:20 +0100 | [diff] [blame] | 71 | noinst_LIBRARIES = libiptc/libiptc.a |
| 72 | bin_PROGRAMS = iptables-xml |
| 73 | sbin_PROGRAMS = |
| 74 | noinst_PROGRAMS = |
| 75 | man_MANS = iptables.8 iptables-restore.8 iptables-save.8 \ |
| 76 | iptables-xml.8 ip6tables.8 ip6tables-restore.8 \ |
| 77 | ip6tables-save.8 |
| 78 | CLEANFILES = iptables.8 ip6tables.8 |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 79 | if ENABLE_DEVEL |
Jan Engelhardt | 52edda6 | 2009-01-12 07:21:20 +0100 | [diff] [blame] | 80 | include_HEADERS = include/xtables.h |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 81 | endif |
| 82 | |
| 83 | if ENABLE_STATIC |
| 84 | sbin_PROGRAMS += iptables-static ip6tables-static |
| 85 | endif |
| 86 | if ENABLE_SHARED |
| 87 | sbin_PROGRAMS += iptables iptables-multi iptables-restore iptables-save \ |
| 88 | ip6tables ip6tables-multi ip6tables-restore ip6tables-save |
| 89 | endif |
| 90 | |
| 91 | iptables.8: ${srcdir}/iptables.8.in extensions/matches4.man extensions/targets4.man |
Jan Engelhardt | 8d67190 | 2009-01-08 18:03:45 +0100 | [diff] [blame] | 92 | ${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 Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 93 | |
| 94 | ip6tables.8: ${srcdir}/ip6tables.8.in extensions/matches6.man extensions/targets6.man |
Jan Engelhardt | 8d67190 | 2009-01-08 18:03:45 +0100 | [diff] [blame] | 95 | ${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 Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 96 | |
Jan Engelhardt | 126c136 | 2008-08-04 18:37:38 +0200 | [diff] [blame] | 97 | pkgconfig_DATA = xtables.pc |
| 98 | |
Jan Engelhardt | a31cdd8 | 2008-03-03 13:04:07 +0100 | [diff] [blame] | 99 | .PHONY: tarball |
| 100 | tarball: |
Jan Engelhardt | e6610c8 | 2008-04-17 10:32:13 +0200 | [diff] [blame] | 101 | rm -Rf /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION}; |
Jan Engelhardt | 9e81228 | 2008-09-01 14:27:19 +0200 | [diff] [blame] | 102 | pushd ${top_srcdir} && git archive --prefix=${PACKAGE_TARNAME}-${PACKAGE_VERSION}/ HEAD | tar -C /tmp -x && popd; |
Jan Engelhardt | e6610c8 | 2008-04-17 10:32:13 +0200 | [diff] [blame] | 103 | 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 Engelhardt | ee38146 | 2008-08-13 14:43:22 +0200 | [diff] [blame] | 106 | |
| 107 | config.status: include/xtables.h.in |
Jan Engelhardt | 75e8b13 | 2008-09-08 15:42:06 +0200 | [diff] [blame] | 108 | |
| 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. |
| 111 | install-exec-hook: |
| 112 | -/sbin/ldconfig || :; |