Skip to content

Commit

Permalink
kbuild: refactor Makefile.dtbinst more
Browse files Browse the repository at this point in the history
Refactor Makefile.dtbinst so it looks similar to other Makefiles.

*.dtb should not be a phony target. Copy files based on the timestamps.
Print installed dtb paths instead of in-kernel dtb paths.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  • Loading branch information
Masahiro Yamada committed Mar 25, 2020
1 parent 2431f22 commit aefd803
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions scripts/Makefile.dtbinst
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ include include/config/auto.conf
include scripts/Kbuild.include
include $(src)/Makefile

dtbinst-files := $(sort $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS), $(dtb-)))
dtbinst-dirs := $(subdir-y) $(subdir-m)
dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-)))
subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m))

# Helper targets for Installing DTBs into the boot directory
quiet_cmd_dtb_install = INSTALL $<
cmd_dtb_install = mkdir -p $(2); cp $< $(2)
__dtbs_install: $(dtbs) $(subdirs)
@:

$(dtbinst-files): %.dtb: $(obj)/%.dtb
$(call cmd,dtb_install,$(dst))
quiet_cmd_dtb_install = INSTALL $@
cmd_dtb_install = install -D $< $@

$(dtbinst-dirs):
$(Q)$(MAKE) $(dtbinst)=$(obj)/$@ dst=$(dst)/$@
$(dst)/%.dtb: $(obj)/%.dtb
$(call cmd,dtb_install)

PHONY += $(dtbinst-files) $(dtbinst-dirs)
__dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
PHONY += $(subdirs)
$(subdirs):
$(Q)$(MAKE) $(dtbinst)=$@ dst=$(patsubst $(obj)/%,$(dst)/%,$@)

.PHONY: $(PHONY)

0 comments on commit aefd803

Please sign in to comment.