qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Makefile: pass include directives to dtc via CPPFLAGS, not CFLAGS
@ 2013-06-21 13:00 Peter Maydell
  2013-06-21 18:07 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2013-06-21 13:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Peter Crosthwaite, David Gibson, patches

The dtc submodule's makefile expects -I include directives to be
in CPPFLAGS, not CFLAGS. Getting this wrong meant that the include
directive would not be applied when generating the dependency .d
files. This in turn meant that we couldn't build libfdt when
doing an out of tree build with clang. (gcc's dependency output
is slightly different from clang in this situation so it happened
to work.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Tracking this down was not made any easier by make bug
http://savannah.gnu.org/bugs/index.php?15110 which meant that
make silently exited without saying anything about what was wrong...

 Makefile |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 3cfa7d0..c06bfab 100644
--- a/Makefile
+++ b/Makefile
@@ -146,10 +146,11 @@ $(SRC_PATH)/pixman/configure:
 	(cd $(SRC_PATH)/pixman; autoreconf -v --install)
 
 DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
-DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS) -I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
+DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
+DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
 
 subdir-dtc:dtc/libfdt dtc/tests
-	$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,)
+	$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,)
 
 dtc/%:
 	mkdir -p $@
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] Makefile: pass include directives to dtc via CPPFLAGS, not CFLAGS
  2013-06-21 13:00 [Qemu-devel] [PATCH] Makefile: pass include directives to dtc via CPPFLAGS, not CFLAGS Peter Maydell
@ 2013-06-21 18:07 ` Michael Tokarev
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Tokarev @ 2013-06-21 18:07 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-trivial, Peter Crosthwaite, patches, qemu-devel,
	David Gibson

21.06.2013 17:00, Peter Maydell wrote:
> The dtc submodule's makefile expects -I include directives to be
> in CPPFLAGS, not CFLAGS. Getting this wrong meant that the include
> directive would not be applied when generating the dependency .d
> files. This in turn meant that we couldn't build libfdt when
> doing an out of tree build with clang. (gcc's dependency output
> is slightly different from clang in this situation so it happened
> to work.)

Thanks, applied to the trivial patches queue, should be in the todays
poll request.

/mjt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-21 18:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-21 13:00 [Qemu-devel] [PATCH] Makefile: pass include directives to dtc via CPPFLAGS, not CFLAGS Peter Maydell
2013-06-21 18:07 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev

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