summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-12-13 12:20:36 -0500
committerRob Herring <robh@kernel.org>2018-12-13 12:20:36 -0500
commitacc2038738bd6f881e7a277ba14fa7c589fd3058 (patch)
treefd56524867a9b726b3e5d2cb040ff16b2f2a67a0 /scripts/Makefile.lib
parentcd1cc0bef46fc8d8f9ebe82d2064d4f4bd5ecf16 (diff)
parent2c9b0b00af23cdc70d28d82e077dc1d280bcb84a (diff)
Merge branch 'yaml-bindings-for-v4.21' into dt/next
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib24
1 files changed, 22 insertions, 2 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 8e10eb7428ab..0e78249ee77e 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -61,6 +61,11 @@ real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))
61extra-y += $(dtb-y) 61extra-y += $(dtb-y)
62extra-$(CONFIG_OF_ALL_DTBS) += $(dtb-) 62extra-$(CONFIG_OF_ALL_DTBS) += $(dtb-)
63 63
64ifneq ($(CHECK_DTBS),)
65extra-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y))
66extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-))
67endif
68
64# Add subdir path 69# Add subdir path
65 70
66extra-y := $(addprefix $(obj)/,$(extra-y)) 71extra-y := $(addprefix $(obj)/,$(extra-y))
@@ -284,13 +289,28 @@ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE
284quiet_cmd_dtc = DTC $@ 289quiet_cmd_dtc = DTC $@
285cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ 290cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
286 $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ 291 $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
287 $(DTC) -O dtb -o $@ -b 0 \ 292 $(DTC) -O $(2) -o $@ -b 0 \
288 $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \ 293 $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
289 -d $(depfile).dtc.tmp $(dtc-tmp) ; \ 294 -d $(depfile).dtc.tmp $(dtc-tmp) ; \
290 cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) 295 cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
291 296
292$(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE 297$(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE
293 $(call if_changed_dep,dtc) 298 $(call if_changed_dep,dtc,dtb)
299
300DT_CHECKER ?= dt-validate
301DT_BINDING_DIR := Documentation/devicetree/bindings
302DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.yaml
303
304quiet_cmd_dtb_check = CHECK $@
305 cmd_dtb_check = $(DT_CHECKER) -p $(DT_TMP_SCHEMA) $@ ;
306
307define rule_dtc_dt_yaml
308 $(call cmd_and_fixdep,dtc,yaml) \
309 $(call echo-cmd,dtb_check) $(cmd_dtb_check)
310endef
311
312$(obj)/%.dt.yaml: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
313 $(call if_changed_rule,dtc_dt_yaml)
294 314
295dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) 315dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
296 316