Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: copy process-schema-examples.yaml to process-schema.yaml

There are two processed schema files:

- processed-schema-examples.yaml

Used for 'make dt_binding_check'. This is always a full schema.

- processed-schema.yaml

Used for 'make dtbs_check'. This may be a full schema, or a smaller
subset if DT_SCHEMA_FILES is given by a user.

If DT_SCHEMA_FILES is not specified, they are the same. You can copy
the former to the latter instead of running dt-mk-schema twice. This
saves the cpu time a lot when you do 'make dt_binding_check dtbs_check'
because building the full schema takes a couple of seconds.

If DT_SCHEMA_FILES is specified, processed-schema.yaml is generated
based on the specified yaml files.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20200625170434.635114-4-masahiroy@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Masahiro Yamada and committed by
Rob Herring
dee9c0b5 ce810eeb

+23 -8
+20 -8
Documentation/devicetree/bindings/Makefile
··· 2 2 DT_DOC_CHECKER ?= dt-doc-validate 3 3 DT_EXTRACT_EX ?= dt-extract-example 4 4 DT_MK_SCHEMA ?= dt-mk-schema 5 - DT_MK_SCHEMA_USERONLY_FLAG := $(if $(DT_SCHEMA_FILES), -u) 6 5 7 6 DT_SCHEMA_MIN_VERSION = 2020.5 8 7 ··· 34 35 35 36 DT_DOCS = $(shell $(find_cmd) | sed -e 's|^$(srctree)/||') 36 37 37 - DT_SCHEMA_FILES ?= $(DT_DOCS) 38 - 39 - extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES)) 40 - extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES)) 41 - extra-$(CHECK_DT_BINDING) += processed-schema-examples.yaml 42 - 43 38 override DTC_FLAGS := \ 44 39 -Wno-avoid_unnecessary_addr_size \ 45 40 -Wno-graph_child_address \ ··· 42 49 $(obj)/processed-schema-examples.yaml: $(DT_DOCS) check_dtschema_version FORCE 43 50 $(call if_changed,mk_schema) 44 51 45 - $(obj)/processed-schema.yaml: DT_MK_SCHEMA_FLAGS := $(DT_MK_SCHEMA_USERONLY_FLAG) 52 + ifeq ($(DT_SCHEMA_FILES),) 53 + 54 + # Unless DT_SCHEMA_FILES is specified, use the full schema for dtbs_check too. 55 + # Just copy processed-schema-examples.yaml 56 + 57 + $(obj)/processed-schema.yaml: $(obj)/processed-schema-examples.yaml FORCE 58 + $(call if_changed,copy) 59 + 60 + DT_SCHEMA_FILES = $(DT_DOCS) 61 + 62 + else 63 + 64 + # If DT_SCHEMA_FILES is specified, use it for processed-schema.yaml 65 + 66 + $(obj)/processed-schema.yaml: DT_MK_SCHEMA_FLAGS := -u 46 67 $(obj)/processed-schema.yaml: $(DT_SCHEMA_FILES) check_dtschema_version FORCE 47 68 $(call if_changed,mk_schema) 48 69 70 + endif 71 + 72 + extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES)) 73 + extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES)) 74 + extra-$(CHECK_DT_BINDING) += processed-schema-examples.yaml 49 75 extra-$(CHECK_DTBS) += processed-schema.yaml 50 76 51 77 # Hack: avoid 'Argument list too long' error for 'make clean'. Remove most of
+3
scripts/Makefile.lib
··· 212 212 $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s))))))) 213 213 endef 214 214 215 + quiet_cmd_copy = COPY $@ 216 + cmd_copy = cp $< $@ 217 + 215 218 # Shipped files 216 219 # =========================================================================== 217 220