netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: [nft PATCH] src/Makefile: Restore per object CFLAGS
Date: Wed, 10 Jan 2018 13:43:21 +0100	[thread overview]
Message-ID: <20180110124321.19312-1-phil@nwl.cc> (raw)
In-Reply-To: <20180109132632.xfkio5fsama4so5j@salvia>

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(-)

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


  reply	other threads:[~2018-01-10 12:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 13:26 compilation warning --with-mini-gmp Pablo Neira Ayuso
2018-01-10 12:43 ` Phil Sutter [this message]
2018-01-10 14:23   ` [nft PATCH] src/Makefile: Restore per object CFLAGS Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180110124321.19312-1-phil@nwl.cc \
    --to=phil@nwl.cc \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).