All architectures that use cmd_dtc do so in almost the same way. Create a central build rule to avoid duplication. The one difference is that most current uses of dtc build $(obj)/%.dtb from $(src)/dts/%.dts rather than building the .dtb in the same directory as the .dts file. This difference will be eliminated arch-by-arch in future patches. MIPS is the exception here; it already uses the exact same rule as the new common rule, so the duplicate is removed in this patch to avoid any conflict. arch/mips changes courtesy of Ralf Baechle. Update Documentation/kbuild to remove the explicit call to cmd_dtc from the example, now that the rule exists in a centralized location.
Showing the changes to scripts (1 of 5 files). Show all
Unified · Split
| @@ -266,6 +266,9 @@ $(obj)/%.dtb.S: $(obj)/%.dtb · 265 unmodified lines | |||
| 266 | quiet_cmd_dtc = DTC $@ | 266 | quiet_cmd_dtc = DTC $@ |
| 267 | cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $< | 267 | cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $< |
| 268 | 268 | ||
| 269 | $(obj)/%.dtb: $(src)/%.dts FORCE | ||
| 270 | $(call if_changed_dep,dtc) | ||
| 271 | |||
| 269 | # Bzip2 | 272 | # Bzip2 |
| 270 | # --------------------------------------------------------------------------- | 273 | # --------------------------------------------------------------------------- |
| 271 | 274 | ||