* [PATCH 1/2] kbuild: fix DT binding schema rule again to avoid needless rebuilds
@ 2020-04-21 3:35 Masahiro Yamada
2020-04-21 3:35 ` [PATCH 2/2] kbuild: use separate commands for generating *.dtb and *.dt.yaml Masahiro Yamada
0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2020-04-21 3:35 UTC (permalink / raw)
To: linux-kbuild
Cc: Rob Herring, devicetree, linux-kernel, Masahiro Yamada,
Michal Marek, Rob Herring
Since commit 7a0496056064 ("kbuild: fix DT binding schema rule to detect
command line changes"), this rule is every time re-run even if you change
nothing.
cmd_dtc takes one additional parameter to pass to the -O option of dtc.
We need to pass 'yaml' to if_changed_rule. Otherwise, cmd-check invoked
from if_changed_rule is false positive.
Fixes: 7a0496056064 ("kbuild: fix DT binding schema rule to detect command line changes")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/Makefile.lib | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 97547108ee7f..4b799737722c 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -309,7 +309,7 @@ define rule_dtc
endef
$(obj)/%.dt.yaml: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
- $(call if_changed_rule,dtc)
+ $(call if_changed_rule,dtc,yaml)
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] kbuild: use separate commands for generating *.dtb and *.dt.yaml
2020-04-21 3:35 [PATCH 1/2] kbuild: fix DT binding schema rule again to avoid needless rebuilds Masahiro Yamada
@ 2020-04-21 3:35 ` Masahiro Yamada
0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2020-04-21 3:35 UTC (permalink / raw)
To: linux-kbuild
Cc: Rob Herring, devicetree, linux-kernel, Masahiro Yamada, Michal Marek
Currently, cmd_dtc takes $(2) to select the target format. The
additional parameter complicates things when it is used with
cmd_and_fixdep and if_changed_rule.
To make it easier to understand, use a separate cmd_dtc_yaml.
One visible change is, 'DTC [Y]' is used for the log when compiling
*.dts to *.dt.yaml.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/Makefile.lib | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 4b799737722c..d5ac19e10e1d 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -284,32 +284,37 @@ cmd_dt_S_dtb= \
$(obj)/%.dtb.S: $(obj)/%.dtb FORCE
$(call if_changed,dt_S_dtb)
-quiet_cmd_dtc = DTC $@
-cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
+__cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
$(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
- $(DTC) -O $(2) -o $@ -b 0 \
+ $(DTC) -O $(1) -o $@ -b 0 \
$(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
-d $(depfile).dtc.tmp $(dtc-tmp) ; \
cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
+quiet_cmd_dtc = DTC $@
+ cmd_dtc = $(call __cmd_dtc,dtb)
+
$(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE
- $(call if_changed_dep,dtc,dtb)
+ $(call if_changed_dep,dtc)
DT_CHECKER ?= dt-validate
DT_BINDING_DIR := Documentation/devicetree/bindings
# DT_TMP_SCHEMA may be overridden from Documentation/devicetree/bindings/Makefile
DT_TMP_SCHEMA ?= $(objtree)/$(DT_BINDING_DIR)/processed-schema.yaml
+quiet_cmd_dtc_yaml = DTC [Y] $@
+ cmd_dtc_yaml = $(call __cmd_dtc,yaml)
+
quiet_cmd_dtb_check = CHECK $@
cmd_dtb_check = $(DT_CHECKER) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@
-define rule_dtc
- $(call cmd_and_fixdep,dtc,yaml)
+define rule_dtc_yaml
+ $(call cmd_and_fixdep,dtc_yaml)
$(call cmd,dtb_check)
endef
$(obj)/%.dt.yaml: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
- $(call if_changed_rule,dtc,yaml)
+ $(call if_changed_rule,dtc_yaml)
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-21 3:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21 3:35 [PATCH 1/2] kbuild: fix DT binding schema rule again to avoid needless rebuilds Masahiro Yamada
2020-04-21 3:35 ` [PATCH 2/2] kbuild: use separate commands for generating *.dtb and *.dt.yaml Masahiro Yamada
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).