mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/8] kbuild: always run gcc -E on *.dts, remove cmd_dtc_cpp
Date: Mon, 20 May 2013 16:14:16 +0200	[thread overview]
Message-ID: <1369059260-28872-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1369059260-28872-1-git-send-email-s.hauer@pengutronix.de>

Based on the same Linux commit from Stephen Warren:

commit b40b25fff8205dd18124d8fc87b2c9c57f269b5f
Author: Stephen Warren <swarren@nvidia.com>
Date:   Wed Mar 6 10:58:37 2013 -0700

    kbuild: always run gcc -E on *.dts, remove cmd_dtc_cpp

    Replace cmd_dtc with cmd_dtc_cpp, and delete the latter.

    Previously, a special file extension (.dtsp) was required to trigger
    the C pre-processor to run on device tree files. This was ugly. Now that
    previous changes have enhanced cmd_dtc_cpp to collect dependency
    information from both gcc -E and dtc, we can transparently run the pre-
    processor on all device tree files, irrespective of whether they
    use /include/ or #include syntax to include *.dtsi.

    Signed-off-by: Stephen Warren <swarren@nvidia.com>
    Acked-by: Rob Herring <rob.herring@calxeda.com>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 scripts/Makefile.lib | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index bbfd4cd..c50bb4e 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -141,10 +141,10 @@ cpp_flags      = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags)
 
 ld_flags       = $(LDFLAGS) $(EXTRA_LDFLAGS)
 
-dtc_cpp_flags  = -Wp,-MD,$(depfile) -nostdinc		\
-      -I$(srctree)/arch/$(SRCARCH)/dts			\
-      -I$(srctree)/arch/$(SRCARCH)/include/dts		\
-      -undef -D__DTS__
+dtc_cpp_flags  = -Wp,-MD,$(depfile).pre -nostdinc                        \
+		 -I$(srctree)/arch/$(SRCARCH)/dts                        \
+		 -I$(srctree)/arch/$(SRCARCH)/dts/include                \
+		 -undef -D__DTS__
 
 # Finds the multi-part object the current object will be linked into
 modname-multi = $(sort $(foreach m,$(multi-used),\
@@ -212,20 +212,17 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
 	$(call cmd,dt_S_dtb)
 
 quiet_cmd_dtc = DTC     $@
-cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $<
+cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
+	$(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \
+		-i $(srctree)/arch/$(SRCARCH)/dts $(DTC_FLAGS) \
+		-d $(depfile).dtc $(dtc-tmp) ; \
+	cat $(depfile).pre $(depfile).dtc > $(depfile)
 
 $(obj)/%.dtb: $(src)/%.dts FORCE
 	$(call if_changed_dep,dtc)
 
 dtc-tmp = $(subst $(comma),_,$(dot-target).dts)
 
-quiet_cmd_dtc_cpp = DTC+CPP $@
-cmd_dtc_cpp = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
-	$(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $(dtc-tmp)
-
-$(obj)/%.dtb: $(src)/%.dtsp FORCE
-	$(call if_changed_dep,dtc_cpp)
-
 # Bzip2
 # ---------------------------------------------------------------------------
 
-- 
1.8.2.rc2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2013-05-20 14:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-20 14:14 [PATCH] devicetree misc updates Sascha Hauer
2013-05-20 14:14 ` [PATCH 1/8] ARM: dtb: Add $(obj)/$(BUILTIN_DTB).dtb.S as secondary target Sascha Hauer
2013-05-20 14:14 ` [PATCH 2/8] ARM: build dtbs during build process using extra-y Sascha Hauer
2013-05-20 14:14 ` [PATCH 3/8] scripts: fixdep: update from v3.10-rc1 Sascha Hauer
2013-05-20 14:14 ` Sascha Hauer [this message]
2013-05-20 14:14 ` [PATCH 5/8] of: When checking for existing devices also check resource end Sascha Hauer
2013-05-20 14:14 ` [PATCH 6/8] of: Call of_add_memory from of_probe Sascha Hauer
2013-05-20 14:14 ` [PATCH 7/8] of: Add of_match_node function Sascha Hauer
2013-05-20 14:14 ` [PATCH 8/8] of: populate devices based on "simple-bus" property Sascha Hauer

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=1369059260-28872-5-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.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