Makefile.am 5.53 KB
Newer Older
1
2
3
# -*- Makefile -*-

AM_CFLAGS        = ${regular_CFLAGS}
4
AM_CPPFLAGS      = ${regular_CPPFLAGS} -I${top_builddir}/include -I${top_srcdir}/include -I${top_srcdir} ${kinclude_CPPFLAGS} ${libmnl_CFLAGS} ${libnftnl_CFLAGS} ${libnetfilter_conntrack_CFLAGS}
5

6
7
BUILT_SOURCES =

8
9
10
xtables_legacy_multi_SOURCES  = xtables-legacy-multi.c iptables-xml.c
xtables_legacy_multi_CFLAGS   = ${AM_CFLAGS}
xtables_legacy_multi_LDADD    = ../extensions/libext.a
11
if ENABLE_STATIC
12
xtables_legacy_multi_CFLAGS  += -DALL_INCLUSIVE
13
14
endif
if ENABLE_IPV4
15
xtables_legacy_multi_SOURCES += iptables-standalone.c iptables.c
16
17
xtables_legacy_multi_CFLAGS  += -DENABLE_IPV4
xtables_legacy_multi_LDADD   += ../libiptc/libip4tc.la ../extensions/libext4.a
18
19
endif
if ENABLE_IPV6
20
xtables_legacy_multi_SOURCES += ip6tables-standalone.c ip6tables.c
21
22
xtables_legacy_multi_CFLAGS  += -DENABLE_IPV6
xtables_legacy_multi_LDADD   += ../libiptc/libip6tc.la ../extensions/libext6.a
23
endif
24
xtables_legacy_multi_SOURCES += xshared.c iptables-restore.c iptables-save.c
25
xtables_legacy_multi_LDADD   += ../libxtables/libxtables.la -lm
26

27
# iptables using nf_tables api
28
if ENABLE_NFTABLES
29
30
31
xtables_nft_multi_SOURCES  = xtables-nft-multi.c iptables-xml.c
xtables_nft_multi_CFLAGS   = ${AM_CFLAGS}
xtables_nft_multi_LDADD    = ../extensions/libext.a ../extensions/libext_ebt.a
32
if ENABLE_STATIC
33
xtables_nft_multi_CFLAGS  += -DALL_INCLUSIVE
34
endif
35
36
xtables_nft_multi_CFLAGS  += -DENABLE_NFTABLES -DENABLE_IPV4 -DENABLE_IPV6
xtables_nft_multi_SOURCES += xtables-save.c xtables-restore.c \
37
38
				xtables-standalone.c xtables.c nft.c \
				nft-shared.c nft-ipv4.c nft-ipv6.c nft-arp.c \
39
				xtables-monitor.c nft-cache.c \
40
				xtables-arp-standalone.c xtables-arp.c \
41
				nft-bridge.c nft-cmd.c \
42
				xtables-eb-standalone.c xtables-eb.c \
43
				xtables-eb-translate.c \
44
				xtables-translate.c
45
46
47
xtables_nft_multi_LDADD   += ${libmnl_LIBS} ${libnftnl_LIBS} ${libnetfilter_conntrack_LIBS} ../extensions/libext4.a ../extensions/libext6.a ../extensions/libext_ebt.a ../extensions/libext_arpt.a
xtables_nft_multi_SOURCES += xshared.c
xtables_nft_multi_LDADD   += ../libxtables/libxtables.la -lm
48
49
endif

50
sbin_PROGRAMS    = xtables-legacy-multi
51
if ENABLE_NFTABLES
52
sbin_PROGRAMS	+= xtables-nft-multi
53
endif
54
55
man_MANS         = iptables.8 iptables-restore.8 iptables-save.8 \
                   iptables-xml.1 ip6tables.8 ip6tables-restore.8 \
56
57
58
                   ip6tables-save.8 iptables-extensions.8 \
                   iptables-apply.8 ip6tables-apply.8

59
sbin_SCRIPTS     = iptables-apply
60

61
if ENABLE_NFTABLES
62
63
64
65
66
67
man_MANS	+= xtables-nft.8 xtables-translate.8 xtables-legacy.8 \
                   iptables-translate.8 ip6tables-translate.8 \
		   iptables-restore-translate.8 ip6tables-restore-translate.8 \
                   xtables-monitor.8 \
                   arptables-nft.8 arptables-nft-restore.8 arptables-nft-save.8 \
                   ebtables-nft.8
68
endif
69
CLEANFILES       = iptables.8 xtables-monitor.8 \
70
71
72
73
		   iptables-xml.1 iptables-apply.8 \
		   iptables-extensions.8 iptables-extensions.8.tmpl \
		   iptables-restore.8 iptables-save.8 \
		   iptables-restore-translate.8 ip6tables-restore-translate.8 \
74
		   iptables-translate.8 ip6tables-translate.8
75
76
77

vx_bin_links   = iptables-xml
if ENABLE_IPV4
78
79
v4_sbin_links  = iptables-legacy iptables-legacy-restore iptables-legacy-save \
		 iptables iptables-restore iptables-save
80
81
endif
if ENABLE_IPV6
82
83
v6_sbin_links  = ip6tables-legacy ip6tables-legacy-restore ip6tables-legacy-save \
		 ip6tables ip6tables-restore ip6tables-save
84
endif
85
if ENABLE_NFTABLES
86
87
x_sbin_links  = iptables-nft iptables-nft-restore iptables-nft-save \
		ip6tables-nft ip6tables-nft-restore ip6tables-nft-save \
88
89
		iptables-translate ip6tables-translate \
		iptables-restore-translate ip6tables-restore-translate \
90
91
92
93
94
95
96
		arptables-nft arptables \
		arptables-nft-restore arptables-restore \
		arptables-nft-save arptables-save \
		ebtables-nft ebtables \
		ebtables-nft-restore ebtables-restore \
		ebtables-nft-save ebtables-save \
		xtables-monitor
97
endif
98
99
100
101
102
103

iptables-extensions.8: iptables-extensions.8.tmpl ../extensions/matches.man ../extensions/targets.man
	${AM_VERBOSE_GEN} sed \
		-e '/@MATCH@/ r ../extensions/matches.man' \
		-e '/@TARGET@/ r ../extensions/targets.man' $< >$@;

104
iptables-translate.8 ip6tables-translate.8 iptables-restore-translate.8 ip6tables-restore-translate.8:
105
106
	${AM_VERBOSE_GEN} echo '.so man8/xtables-translate.8' >$@

107
108
109
110
111
112
pkgconfig_DATA = xtables.pc

# Using if..fi avoids an ugly "error (ignored)" message :)
install-exec-hook:
	-if test -z "${DESTDIR}"; then /sbin/ldconfig; fi;
	${INSTALL} -dm0755 "${DESTDIR}${bindir}";
113
114
115
116
	for i in ${vx_bin_links}; do ${LN_S} -f "${sbindir}/xtables-legacy-multi" "${DESTDIR}${bindir}/$$i"; done;
	for i in ${v4_sbin_links}; do ${LN_S} -f xtables-legacy-multi "${DESTDIR}${sbindir}/$$i"; done;
	for i in ${v6_sbin_links}; do ${LN_S} -f xtables-legacy-multi "${DESTDIR}${sbindir}/$$i"; done;
	for i in ${x_sbin_links}; do ${LN_S} -f xtables-nft-multi "${DESTDIR}${sbindir}/$$i"; done;
117
	${LN_S} -f iptables-apply "${DESTDIR}${sbindir}/ip6tables-apply"
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140

uninstall-hook:
	dir=${DESTDIR}${bindir}; { \
		test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; \
	} || { \
		test -z "${vx_bin_links}" || ( \
			cd "$$dir" && rm -f ${vx_bin_links} \
		) \
	}
	dir=${DESTDIR}${sbindir}; { \
		test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; \
	} || { \
		test -z "${v4_sbin_links}" || ( \
			cd "$$dir" && rm -f ${v4_sbin_links} \
		); \
		test -z "${v6_sbin_links}" || ( \
			cd "$$dir" && rm -f ${v6_sbin_links} \
		); \
		test -z "${x_sbin_links}" || ( \
			cd "$$dir" && rm -f ${x_sbin_links} \
		); \
		( cd "$$dir" && rm -f ip6tables-apply ); \
	}