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

Showing the changes to scripts (1 of 1 file). Show all

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
371DT_BINDING_DIR := Documentation/devicetree/bindings371DT_BINDING_DIR := Documentation/devicetree/bindings
372DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.json372DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.json
373 373
374quiet_cmd_dtb_check = CHECK $@374quiet_cmd_dtb = DTC_CHK $@
375 cmd_dtb_check = $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@ || true375 cmd_dtb = $(cmd_dtc) ; $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@ || true
376else
377quiet_cmd_dtb = $(quiet_cmd_dtc)
378 cmd_dtb = $(cmd_dtc)
376endif379endif
377 380
378define rule_dtc
379 $(call cmd_and_fixdep,dtc)
380 $(call cmd,dtb_check)
381endef
382
383$(obj)/%.dtb: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE381$(obj)/%.dtb: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
384 $(call if_changed_rule,dtc)382 $(call if_changed_dep,dtb)
385 383
386$(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE384$(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE
387 $(call if_changed_dep,dtc)385 $(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