summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/Makefile
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2022-02-28 14:10:05 -0600
committerRob Herring <robh@kernel.org>2022-03-03 14:30:52 -0600
commit309d955985ee9e94697c197b7b489555f1ac7259 (patch)
tree10f6dc8ac3d36861bd2e008ecd27afd529aa9e51 /Documentation/devicetree/bindings/Makefile
parentdca669354e6ff494222dfc461bed1087264f3755 (diff)
dt-bindings: kbuild: Support partial matches with DT_SCHEMA_FILES
DT_SCHEMA_FILES is currently restricted to a list of exact files with the full source tree path (i.e. Documentation/devicetree/bindings/...). Loosen this requirement and let DT_SCHEMA_FILES be a partial match. With this, checking all schema files in a directory is possible: $ make DT_SCHEMA_FILES=/gpio/ dt_binding_check Or all schema files with 'qcom' in the path or filename: $ make DT_SCHEMA_FILES=qcom dt_binding_check Cc: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Link: https://lore.kernel.org/r/20220228201006.1484903-1-robh@kernel.org
Diffstat (limited to 'Documentation/devicetree/bindings/Makefile')
-rw-r--r--Documentation/devicetree/bindings/Makefile15
1 files changed, 5 insertions, 10 deletions
diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
index 41c555181b6f..5138d10e0601 100644
--- a/Documentation/devicetree/bindings/Makefile
+++ b/Documentation/devicetree/bindings/Makefile
@@ -31,11 +31,8 @@ find_all_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \
-name 'processed-schema*' ! \
-name '*.example.dt.yaml' \)
-ifeq ($(DT_SCHEMA_FILES),)
-find_cmd = $(find_all_cmd)
-else
-find_cmd = echo $(addprefix $(srctree)/, $(DT_SCHEMA_FILES))
-endif
+find_cmd = $(find_all_cmd) | grep -F "$(DT_SCHEMA_FILES)"
+CHK_DT_DOCS := $(shell $(find_cmd))
quiet_cmd_yamllint = LINT $(src)
cmd_yamllint = ($(find_cmd) | \
@@ -83,22 +80,20 @@ ifeq ($(DT_SCHEMA_FILES),)
$(obj)/processed-schema.json: $(obj)/processed-schema-examples.json FORCE
$(call if_changed,copy)
-DT_SCHEMA_FILES = $(DT_DOCS)
-
else
# If DT_SCHEMA_FILES is specified, use it for processed-schema.json
$(obj)/processed-schema.json: DT_MK_SCHEMA_FLAGS := -u
-$(obj)/processed-schema.json: $(DT_SCHEMA_FILES) check_dtschema_version FORCE
+$(obj)/processed-schema.json: $(CHK_DT_DOCS) check_dtschema_version FORCE
$(call if_changed,mk_schema)
endif
always-$(CHECK_DT_BINDING) += processed-schema-examples.json
always-$(CHECK_DTBS) += processed-schema.json
-always-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES))
-always-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES))
+always-$(CHECK_DT_BINDING) += $(patsubst $(srctree)/$(src)/%.yaml,%.example.dts, $(CHK_DT_DOCS))
+always-$(CHECK_DT_BINDING) += $(patsubst $(srctree)/$(src)/%.yaml,%.example.dt.yaml, $(CHK_DT_DOCS))
# Hack: avoid 'Argument list too long' error for 'make clean'. Remove most of
# build artifacts here before they are processed by scripts/Makefile.clean