History

kbuild: take into account DT_SCHEMA_FILES changes while checking dtbs

It is useful to be able to recheck dtbs files against a limited set of DT schema files. This can be accomplished by using differnt DT_SCHEMA_FILES argument values while rerunning make dtbs_check. However for some reason if_changed_rule doesn't pick up the rule_dtc changes (and doesn't retrigger the build). Fix this by changing if_changed_rule to if_changed_dep and squashing DTC and dt-validate into a single new command. Then if_changed_dep triggers on DT_SCHEMA_FILES changes and reruns the build/check.

Dmitry Baryshkov committed 4 years ago

Commit d7c6ea01 parent 72271421 file · +6 −8Browse files

Unified · Split

scripts/Makefile.lib+6−8
@@ -371,17 +371,15 @@ DT_CHECKER_FLAGS ?= $(if $(DT_SCHEMA_FILES),-l $(DT_SCHEMA_FILES),-m) · 370 unmodified lines
371371 DT_BINDING_DIR := Documentation/devicetree/bindings
372372 DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.json
373373
374−quiet_cmd_dtb_check = CHECK $@
375− cmd_dtb_check = $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@ || true
374+quiet_cmd_dtb = DTC_CHK $@
375+ cmd_dtb = $(cmd_dtc) ; $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@ || true
376+else
377+quiet_cmd_dtb = $(quiet_cmd_dtc)
378+ cmd_dtb = $(cmd_dtc)
376379 endif
377380
378−define rule_dtc
379− $(call cmd_and_fixdep,dtc)
380− $(call cmd,dtb_check)
381−endef
382−
383381 $(obj)/%.dtb: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
384− $(call if_changed_rule,dtc)
382+ $(call if_changed_dep,dtb)
385383
386384 $(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE
387385 $(call if_changed_dep,dtc)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t