diff mbox series

[nft] src/Makefile: Restore per object CFLAGS

Message ID 20180110124321.19312-1-phil@nwl.cc
State Accepted
Delegated to: Pablo Neira
Headers show
Series [nft] src/Makefile: Restore per object CFLAGS | expand

Commit Message

Phil Sutter Jan. 10, 2018, 12:43 p.m. UTC
As per the automake manual, create internal libraries for parser and
mini-gmp sources so per-object flags can be set.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 src/Makefile.am | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

Comments

Pablo Neira Ayuso Jan. 10, 2018, 2:23 p.m. UTC | #1
On Wed, Jan 10, 2018 at 01:43:21PM +0100, Phil Sutter wrote:
> As per the automake manual, create internal libraries for parser and
> mini-gmp sources so per-object flags can be set.

Applied, thanks Phil.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/src/Makefile.am b/src/Makefile.am
index 7581ec2090092..7fa72a8ea5bc2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,9 +22,6 @@  AM_CFLAGS = -Wall								\
 
 AM_YFLAGS = -d
 
-# yacc and lex generate dirty code
-parser_bison.o scanner.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-declarations -Wno-implicit-function-declaration -Wno-nested-externs -Wno-undef -Wno-redundant-decls
-
 BUILT_SOURCES = parser_bison.h
 
 noinst_LTLIBRARIES = libnftables.la
@@ -56,19 +53,29 @@  libnftables_la_SOURCES =			\
 		iface.c				\
 		services.c			\
 		mergesort.c			\
-		scanner.l			\
 		tcpopt.c			\
-		parser_bison.y			\
 		libnftables.c
 
-if BUILD_MINIGMP
-mini-gmp.o: AM_CFLAGS += -Wno-sign-compare
+# yacc and lex generate dirty code
+noinst_LTLIBRARIES += libparser.la
+libparser_la_SOURCES = parser_bison.y scanner.l
+libparser_la_CFLAGS = ${AM_CFLAGS} \
+		      -Wno-missing-prototypes \
+		      -Wno-missing-declarations \
+		      -Wno-implicit-function-declaration \
+		      -Wno-nested-externs \
+		      -Wno-undef \
+		      -Wno-redundant-decls
+
+libnftables_la_LIBADD = ${LIBMNL_LIBS} ${LIBNFTNL_LIBS} libparser.la
 
-libnftables_la_SOURCES += mini-gmp.c
+if BUILD_MINIGMP
+noinst_LTLIBRARIES += libminigmp.la
+libminigmp_la_SOURCES = mini-gmp.c
+libminigmp_la_CFLAGS = ${AM_CFLAGS} -Wno-sign-compare
+libnftables_la_LIBADD += libminigmp.la
 endif
 
-libnftables_la_LIBADD = ${LIBMNL_LIBS} ${LIBNFTNL_LIBS}
-
 if BUILD_XTABLES
 libnftables_la_SOURCES += xt.c
 libnftables_la_LIBADD += ${XTABLES_LIBS}