Makefile.am 4.63 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
AM_YFLAGS = -d
6

7
8
BUILT_SOURCES =

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

30
# iptables using nf_tables api
31
if ENABLE_NFTABLES
32
BUILT_SOURCES += xtables-config-parser.h
33
34
35
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
36
if ENABLE_STATIC
37
xtables_nft_multi_CFLAGS  += -DALL_INCLUSIVE
38
endif
39
40
41
xtables_nft_multi_CFLAGS  += -DENABLE_NFTABLES -DENABLE_IPV4 -DENABLE_IPV6
xtables_nft_multi_SOURCES += xtables-config-parser.y xtables-config-syntax.l
xtables_nft_multi_SOURCES += xtables-save.c xtables-restore.c \
42
43
				xtables-standalone.c xtables.c nft.c \
				nft-shared.c nft-ipv4.c nft-ipv6.c nft-arp.c \
44
				xtables-monitor.c \
45
				xtables-arp-standalone.c xtables-arp.c \
46
				nft-bridge.c \
47
				xtables-eb-standalone.c xtables-eb.c \
48
				xtables-eb-translate.c \
49
				xtables-translate.c
50
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
51
# yacc and lex generate dirty code
52
53
54
xtables_nft_multi-xtables-config-parser.o xtables_nft_multi-xtables-config-syntax.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-declarations -Wno-implicit-function-declaration -Wno-nested-externs -Wno-undef -Wno-redundant-decls
xtables_nft_multi_SOURCES += xshared.c
xtables_nft_multi_LDADD   += ../libxtables/libxtables.la -lm
55
56
endif

57
sbin_PROGRAMS    = xtables-legacy-multi
58
if ENABLE_NFTABLES
59
sbin_PROGRAMS	+= xtables-nft-multi
60
endif
61
62
man_MANS         = iptables.8 iptables-restore.8 iptables-save.8 \
                   iptables-xml.1 ip6tables.8 ip6tables-restore.8 \
63
64
65
66
                   ip6tables-save.8 iptables-extensions.8 \
                   xtables-nft.8 xtables-translate.8 xtables-legacy.8 \
                   xtables-monitor.8
CLEANFILES       = iptables.8 xtables-monitor.8 \
67
		   xtables-config-parser.c xtables-config-syntax.c
68
69
70

vx_bin_links   = iptables-xml
if ENABLE_IPV4
71
72
v4_sbin_links  = iptables-legacy iptables-legacy-restore iptables-legacy-save \
		 iptables iptables-restore iptables-save
73
74
endif
if ENABLE_IPV6
75
76
v6_sbin_links  = ip6tables-legacy ip6tables-legacy-restore ip6tables-legacy-save \
		 ip6tables ip6tables-restore ip6tables-save
77
endif
78
if ENABLE_NFTABLES
79
80
x_sbin_links  = iptables-nft iptables-nft-restore iptables-nft-save \
		ip6tables-nft ip6tables-nft-restore ip6tables-nft-save \
81
82
		iptables-translate ip6tables-translate \
		iptables-restore-translate ip6tables-restore-translate \
83
84
85
86
87
88
89
		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
90
endif
91
92
93
94
95
96
97
98
99
100
101
102

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' $< >$@;

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}";
103
104
105
106
	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;