[nft PATCH] src/Makefile: Restore per object CFLAGS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 src/Makefile.am | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

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}
-- 
2.13.1

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux