From: Stephen Warren <swarren@wwwdotorg.org>
To: David Gibson <david@gibson.dropbear.id.au>,
Jon Loeliger <jdl@jdl.com>,
Grant Likely <grant.likely@secretlab.ca>,
Rob Herring <rob.herring@calxeda.com>,
Scott Wood <scottwood@freescale.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: devicetree-discuss@lists.ozlabs.org,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
Stephen Warren <swarren@nvidia.com>
Subject: [RFC PATCH 1/2] kbuild: centralize .dts->.dtb rule
Date: Fri, 28 Sep 2012 13:32:10 -0600 [thread overview]
Message-ID: <1348860731-20868-2-git-send-email-swarren@wwwdotorg.org> (raw)
In-Reply-To: <1348860731-20868-1-git-send-email-swarren@wwwdotorg.org>
From: Stephen Warren <swarren@nvidia.com>
All architectures that use cmd_dtc do so in the same way. Move the build
rule to a central location to avoid duplication.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
Jean-Christophe,
Moving the build rule to Makefile.lib rather than Makefile.build seems
reasonable to me; the dtc-related logic is already in Makefile.lib, and
for features where cmd_* is defined in Makefile.lib, the associated
build rule is also defined there. I see no reason for this patch series
to move all the dtc-related logic into Makefile.build.
arch/arm/boot/Makefile | 4 ----
arch/c6x/boot/Makefile | 3 ---
arch/openrisc/boot/Makefile | 3 ---
arch/powerpc/boot/Makefile | 4 ----
scripts/Makefile.lib | 3 +++
5 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index 3fdab01..da33331 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -61,10 +61,6 @@ endif
targets += $(dtb-y)
-# Rule to build device tree blobs
-$(obj)/%.dtb: $(src)/dts/%.dts FORCE
- $(call if_changed_dep,dtc)
-
$(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))
clean-files := *.dtb
diff --git a/arch/c6x/boot/Makefile b/arch/c6x/boot/Makefile
index 6891257..ad605fb 100644
--- a/arch/c6x/boot/Makefile
+++ b/arch/c6x/boot/Makefile
@@ -12,9 +12,6 @@ ifneq ($(DTB),)
obj-y += linked_dtb.o
endif
-$(obj)/%.dtb: $(src)/dts/%.dts FORCE
- $(call if_changed_dep,dtc)
-
quiet_cmd_cp = CP $< $@$2
cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)
diff --git a/arch/openrisc/boot/Makefile b/arch/openrisc/boot/Makefile
index 0995835..fd329bd 100644
--- a/arch/openrisc/boot/Makefile
+++ b/arch/openrisc/boot/Makefile
@@ -10,6 +10,3 @@ obj-y += $(BUILTIN_DTB)
clean-files := *.dtb.S
#DTC_FLAGS ?= -p 1024
-
-$(obj)/%.dtb: $(src)/dts/%.dts FORCE
- $(call if_changed_dep,dtc)
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 6a15c96..90206f2 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -356,10 +356,6 @@ $(obj)/treeImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits)
$(obj)/treeImage.%: vmlinux $(obj)/%.dtb $(wrapperbits)
$(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb)
-# Rule to build device tree blobs
-$(obj)/%.dtb: $(src)/dts/%.dts FORCE
- $(call if_changed_dep,dtc)
-
# If there isn't a platform selected then just strip the vmlinux.
ifeq (,$(image-y))
image-y := vmlinux.strip
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 0be6f11..425578e 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -266,6 +266,9 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
quiet_cmd_dtc = DTC $@
cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $<
+$(obj)/%.dtb: $(src)/dts/%.dts FORCE
+ $(call if_changed_dep,dtc)
+
# Bzip2
# ---------------------------------------------------------------------------
--
1.7.0.4
next prev parent reply other threads:[~2012-09-28 19:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-28 19:32 [RFC PATCH 0/2] dtc: enable use of pre-processor Stephen Warren
2012-09-28 19:32 ` Stephen Warren [this message]
2012-09-29 20:08 ` [RFC PATCH 1/2] kbuild: centralize .dts->.dtb rule Jean-Christophe PLAGNIOL-VILLARD
2012-10-01 15:36 ` Stephen Warren
2012-09-28 19:32 ` [RFC PATCH 2/2] kbuild: introduce cmd_dtc_cpp Stephen Warren
2012-09-29 20:02 ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-28 20:39 ` [RFC PATCH 0/2] dtc: enable use of pre-processor Jon Loeliger
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=1348860731-20868-2-git-send-email-swarren@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=david@gibson.dropbear.id.au \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=jdl@jdl.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=plagnioj@jcrosoft.com \
--cc=rob.herring@calxeda.com \
--cc=scottwood@freescale.com \
--cc=swarren@nvidia.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
all inboxes | Powered by JetHome®