From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: linux-rt-users@vger.kernel.org, Clark Williams <williams@redhat.com>
Subject: Makefile: be more friendly with user supplied CFLAGS
Date: Sun, 2 Sep 2012 22:12:55 +0200 [thread overview]
Message-ID: <1346616775-11714-1-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
For compilation to work
-D_GNU_SOURCE -Isrc/include
is needed to be passed to the compiler. For Debian packaging several
things are added but not these two from above. So be a bit more friendly
and add them unconditionally. There is no harm if they are included in
the user supplied CFLAGS and so passed twice.
Moreover be a bit more correct about CFLAGS/CPPFLAGS. Both should be
passed to the compiler with CFLAGS taking options for the compiler and
CPPFLAGS taking options for the preprocessor. This is also needed for
Debian packaging where the helper scripts set CPPFLAGS.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Makefile | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: rt-tests/Makefile
===================================================================
--- rt-tests.orig/Makefile 2012-09-02 22:04:06.547562496 +0200
+++ rt-tests/Makefile 2012-09-02 22:06:56.169496678 +0200
@@ -20,7 +20,8 @@
NUMA := 1
endif
-CFLAGS ?= -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include
+CFLAGS ?= -Wall -Wno-nonnull
+CPPFLAGS += -D_GNU_SOURCE -Isrc/include
LDFLAGS ?=
ifndef DEBUG
@@ -47,7 +48,7 @@
VPATH += src/hackbench
%.o: %.c
- $(CC) -D VERSION_STRING=$(VERSION_STRING) -c $< $(CFLAGS)
+ $(CC) -D VERSION_STRING=$(VERSION_STRING) -c $< $(CFLAGS) $(CPPFLAGS)
# Pattern rule to generate dependency files from .c files
%.d: %.c
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2012-09-02 20:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-02 20:12 Uwe Kleine-König [this message]
2012-10-15 22:56 ` Makefile: be more friendly with user supplied CFLAGS John Kacur
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=1346616775-11714-1-git-send-email-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=linux-rt-users@vger.kernel.org \
--cc=williams@redhat.com \
/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).