Skip to content

Commit dee9c0b

Browse files
masahir0yrobherring
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring <[email protected]>
1 parent ce810ee commit dee9c0b

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

Documentation/devicetree/bindings/Makefile

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
DT_DOC_CHECKER ?= dt-doc-validate
33
DT_EXTRACT_EX ?= dt-extract-example
44
DT_MK_SCHEMA ?= dt-mk-schema
5-
DT_MK_SCHEMA_USERONLY_FLAG := $(if $(DT_SCHEMA_FILES), -u)
65

76
DT_SCHEMA_MIN_VERSION = 2020.5
87

@@ -35,12 +34,6 @@ quiet_cmd_mk_schema = SCHEMA $@
3534

3635
DT_DOCS = $(shell $(find_cmd) | sed -e 's|^$(srctree)/||')
3736

38-
DT_SCHEMA_FILES ?= $(DT_DOCS)
39-
40-
extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES))
41-
extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES))
42-
extra-$(CHECK_DT_BINDING) += processed-schema-examples.yaml
43-
4437
override DTC_FLAGS := \
4538
-Wno-avoid_unnecessary_addr_size \
4639
-Wno-graph_child_address \
@@ -49,10 +42,29 @@ override DTC_FLAGS := \
4942
$(obj)/processed-schema-examples.yaml: $(DT_DOCS) check_dtschema_version FORCE
5043
$(call if_changed,mk_schema)
5144

52-
$(obj)/processed-schema.yaml: DT_MK_SCHEMA_FLAGS := $(DT_MK_SCHEMA_USERONLY_FLAG)
45+
ifeq ($(DT_SCHEMA_FILES),)
46+
47+
# Unless DT_SCHEMA_FILES is specified, use the full schema for dtbs_check too.
48+
# Just copy processed-schema-examples.yaml
49+
50+
$(obj)/processed-schema.yaml: $(obj)/processed-schema-examples.yaml FORCE
51+
$(call if_changed,copy)
52+
53+
DT_SCHEMA_FILES = $(DT_DOCS)
54+
55+
else
56+
57+
# If DT_SCHEMA_FILES is specified, use it for processed-schema.yaml
58+
59+
$(obj)/processed-schema.yaml: DT_MK_SCHEMA_FLAGS := -u
5360
$(obj)/processed-schema.yaml: $(DT_SCHEMA_FILES) check_dtschema_version FORCE
5461
$(call if_changed,mk_schema)
5562

63+
endif
64+
65+
extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES))
66+
extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES))
67+
extra-$(CHECK_DT_BINDING) += processed-schema-examples.yaml
5668
extra-$(CHECK_DTBS) += processed-schema.yaml
5769

5870
# Hack: avoid 'Argument list too long' error for 'make clean'. Remove most of

scripts/Makefile.lib

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ $(foreach m, $(notdir $1), \
212212
$(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s)))))))
213213
endef
214214

215+
quiet_cmd_copy = COPY $@
216+
cmd_copy = cp $< $@
217+
215218
# Shipped files
216219
# ===========================================================================
217220

0 commit comments

Comments
 (0)