diff options
author | Rob Herring <robh@kernel.org> | 2018-12-13 12:20:36 -0500 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2018-12-13 12:20:36 -0500 |
commit | acc2038738bd6f881e7a277ba14fa7c589fd3058 (patch) | |
tree | fd56524867a9b726b3e5d2cb040ff16b2f2a67a0 /scripts/Makefile.lib | |
parent | cd1cc0bef46fc8d8f9ebe82d2064d4f4bd5ecf16 (diff) | |
parent | 2c9b0b00af23cdc70d28d82e077dc1d280bcb84a (diff) |
Merge branch 'yaml-bindings-for-v4.21' into dt/next
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r-- | scripts/Makefile.lib | 24 |
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)) | |||
61 | extra-y += $(dtb-y) | 61 | extra-y += $(dtb-y) |
62 | extra-$(CONFIG_OF_ALL_DTBS) += $(dtb-) | 62 | extra-$(CONFIG_OF_ALL_DTBS) += $(dtb-) |
63 | 63 | ||
64 | ifneq ($(CHECK_DTBS),) | ||
65 | extra-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y)) | ||
66 | extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-)) | ||
67 | endif | ||
68 | |||
64 | # Add subdir path | 69 | # Add subdir path |
65 | 70 | ||
66 | extra-y := $(addprefix $(obj)/,$(extra-y)) | 71 | extra-y := $(addprefix $(obj)/,$(extra-y)) |
@@ -284,13 +289,28 @@ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE | |||
284 | quiet_cmd_dtc = DTC $@ | 289 | quiet_cmd_dtc = DTC $@ |
285 | cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ | 290 | cmd_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 | |||
300 | DT_CHECKER ?= dt-validate | ||
301 | DT_BINDING_DIR := Documentation/devicetree/bindings | ||
302 | DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.yaml | ||
303 | |||
304 | quiet_cmd_dtb_check = CHECK $@ | ||
305 | cmd_dtb_check = $(DT_CHECKER) -p $(DT_TMP_SCHEMA) $@ ; | ||
306 | |||
307 | define rule_dtc_dt_yaml | ||
308 | $(call cmd_and_fixdep,dtc,yaml) \ | ||
309 | $(call echo-cmd,dtb_check) $(cmd_dtb_check) | ||
310 | endef | ||
311 | |||
312 | $(obj)/%.dt.yaml: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE | ||
313 | $(call if_changed_rule,dtc_dt_yaml) | ||
294 | 314 | ||
295 | dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) | 315 | dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) |
296 | 316 | ||