diff options
author | Anup Patel <anup.patel@wdc.com> | 2018-12-24 12:15:32 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2018-12-27 09:29:29 +0530 |
commit | a4ce7931212dd71af0b1e30379eddfa4adac21f7 (patch) | |
tree | 4284939a69c4841d57c3fcddc1403fc9e265fd42 /Makefile | |
parent | 2d90226e04a6b886e9f09e6e1328600134f1a754 (diff) |
top: Improve inst_file_list() in Makefile for payloads installation
We now have payloads sub-directory under firmware directory which
means payload BINs and ELFs should be installed under firmware/payloads.
This patch improves inst_file_list() to handle payloads sub-directory
under firmware installation directory.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -152,11 +152,15 @@ copy_file = $(V)mkdir -p `dirname $(1)`; \ inst_file = $(V)mkdir -p `dirname $(1)`; \ echo " INSTALL $(subst $(install_dir)/,,$(1))"; \ cp -f $(2) $(1) -inst_file_list = $(V)if [ ! -z "$(3)" ]; then \ - mkdir -p $(1); \ - for f in $(3) ; do \ - echo " INSTALL "$(2)"/"`basename $$f`; \ - cp -f $$f $(1); \ +inst_file_list = $(V)if [ ! -z "$(4)" ]; then \ + mkdir -p $(1)/$(3); \ + for file in $(4) ; do \ + rel_file=`echo $$file | sed -e 's@$(2)/$(3)/@@'`; \ + dest_file=$(1)"/"$(3)"/"`echo $$rel_file`; \ + dest_dir=`dirname $$dest_file`; \ + echo " INSTALL "$(3)"/"`echo $$rel_file`; \ + mkdir -p $$dest_dir; \ + cp -f $$file $$dest_file; \ done \ fi inst_header_dir = $(V)mkdir -p $(1); \ @@ -274,8 +278,8 @@ install_libplatsbi: $(build_dir)/$(platform_subdir)/lib/libplatsbi.a $(build_dir .PHONY: install_firmwares install_firmwares: $(build_dir)/$(platform_subdir)/lib/libplatsbi.a $(build_dir)/lib/libsbi.a $(firmware-bins-path-y) - $(call inst_file_list,$(install_dir)/$(platform_subdir)/firmware,$(platform_subdir)/firmware,$(firmware-elfs-path-y)) - $(call inst_file_list,$(install_dir)/$(platform_subdir)/firmware,$(platform_subdir)/firmware,$(firmware-bins-path-y)) + $(call inst_file_list,$(install_dir),$(build_dir),$(platform_subdir)/firmware,$(firmware-elfs-path-y)) + $(call inst_file_list,$(install_dir),$(build_dir),$(platform_subdir)/firmware,$(firmware-bins-path-y)) # Rule for "make clean" .PHONY: clean |