Commit 982a1199c946897fe6b4572b8a3b2964cb67c6b1
Committed by
Tom Rini
1 parent
ee0acfa283
Exists in
master
and in
50 other branches
kbuild: use shorten logs for combined rules of mkimage, padding and cat
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Showing 1 changed file with 41 additions and 38 deletions Side-by-side Diff
Makefile
... | ... | @@ -753,6 +753,11 @@ |
753 | 753 | quiet_cmd_cat = CAT $@ |
754 | 754 | cmd_cat = cat $(filter-out $(PHONY), $^) > $@ |
755 | 755 | |
756 | +append = cat $(filter-out $< $(PHONY), $^) >> $@ | |
757 | + | |
758 | +quiet_cmd_pad_cat = CAT $@ | |
759 | +cmd_pad_cat = $(cmd_objcopy) && $(append) || rm -f $@ | |
760 | + | |
756 | 761 | all: $(ALL-y) |
757 | 762 | |
758 | 763 | PHONY += dtbs |
759 | 764 | |
760 | 765 | |
... | ... | @@ -818,25 +823,21 @@ |
818 | 823 | u-boot.dis: u-boot |
819 | 824 | $(OBJDUMP) -d $< > $@ |
820 | 825 | |
821 | -# $@ is output, $(1) and $(2) are inputs, $(3) is padded intermediate, | |
822 | -# $(4) is pad-to | |
823 | -SPL_PAD_APPEND = \ | |
824 | - $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(4) -I binary -O binary \ | |
825 | - $(1) $(3); \ | |
826 | - cat $(3) $(2) > $@; \ | |
827 | - rm $(3) | |
828 | - | |
829 | 826 | ifdef CONFIG_TPL |
830 | 827 | SPL_PAYLOAD := tpl/u-boot-with-tpl.bin |
831 | 828 | else |
832 | 829 | SPL_PAYLOAD := u-boot.bin |
833 | 830 | endif |
834 | 831 | |
835 | -u-boot-with-spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD) | |
836 | - $(call SPL_PAD_APPEND,$<,$(SPL_PAYLOAD),spl/u-boot-spl-pad.bin,$(CONFIG_SPL_PAD_TO)) | |
832 | +OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \ | |
833 | + --pad-to=$(CONFIG_SPL_PAD_TO) | |
834 | +u-boot-with-spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD) FORCE | |
835 | + $(call if_changed,pad_cat) | |
837 | 836 | |
838 | -tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin | |
839 | - $(call SPL_PAD_APPEND,$<,u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO)) | |
837 | +OBJCOPYFLAGS_u-boot-with-tpl.bin = -I binary -O binary \ | |
838 | + --pad-to=$(CONFIG_TPL_PAD_TO) | |
839 | +tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin FORCE | |
840 | + $(call if_changed,pad_cat) | |
840 | 841 | |
841 | 842 | u-boot-with-spl.imx u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin |
842 | 843 | $(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@ |
843 | 844 | |
... | ... | @@ -846,17 +847,15 @@ |
846 | 847 | u-boot.ubl: u-boot-with-spl.bin FORCE |
847 | 848 | $(call if_changed,mkimage) |
848 | 849 | |
849 | -u-boot.ais: spl/u-boot-spl.bin u-boot.img | |
850 | - tools/mkimage -s -n $(if $(CONFIG_AIS_CONFIG_FILE),$(srctree)/$(CONFIG_AIS_CONFIG_FILE:"%"=%),"/dev/null") \ | |
851 | - -T aisimage \ | |
852 | - -e $(CONFIG_SPL_TEXT_BASE) \ | |
853 | - -d spl/u-boot-spl.bin \ | |
854 | - spl/u-boot-spl.ais | |
855 | - $(OBJCOPY) $(OBJCOPYFLAGS) -I binary \ | |
856 | - --pad-to=$(CONFIG_SPL_MAX_SIZE) -O binary \ | |
857 | - spl/u-boot-spl.ais spl/u-boot-spl-pad.ais | |
858 | - cat spl/u-boot-spl-pad.ais u-boot.img > u-boot.ais | |
850 | +MKIMAGEFLAGS_u-boot-spl.ais = -s -n $(if $(CONFIG_AIS_CONFIG_FILE), \ | |
851 | + $(srctree)/$(CONFIG_AIS_CONFIG_FILE:"%"=%),"/dev/null") \ | |
852 | + -T aisimage -e $(CONFIG_SPL_TEXT_BASE) | |
853 | +spl/u-boot-spl.ais: spl/u-boot-spl.bin FORCE | |
854 | + $(call if_changed,mkimage) | |
859 | 855 | |
856 | +OBJCOPYFLAGS_u-boot.ais = -I binary -O binary --pad-to=$(CONFIG_SPL_MAX_SIZE) | |
857 | +u-boot.ais: spl/u-boot-spl.ais u-boot.img FORCE | |
858 | + $(call if_changed,pad_cat) | |
860 | 859 | |
861 | 860 | u-boot.sb: u-boot.bin spl/u-boot-spl.bin |
862 | 861 | $(Q)$(MAKE) $(build)=arch/arm/cpu/arm926ejs/mxs $(objtree)/u-boot.sb |
863 | 862 | |
864 | 863 | |
... | ... | @@ -867,19 +866,20 @@ |
867 | 866 | # SPL image (with mkimage header) and not the binary. Otherwise the resulting image |
868 | 867 | # which is loaded/copied by the ROM bootloader to SRAM doesn't fit. |
869 | 868 | # The resulting image containing both U-Boot images is called u-boot.spr |
870 | -u-boot.spr: u-boot.img spl/u-boot-spl.bin | |
871 | - tools/mkimage -A $(ARCH) -T firmware -C none \ | |
872 | - -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER \ | |
873 | - -d spl/u-boot-spl.bin $@ | |
874 | - $(OBJCOPY) -I binary -O binary \ | |
875 | - --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff $@ | |
876 | - cat u-boot.img >> $@ | |
869 | +MKIMAGEFLAGS_u-boot-spl.img = -A $(ARCH) -T firmware -C none \ | |
870 | + -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER | |
871 | +spl/u-boot-spl.img: spl/u-boot-spl.bin FORCE | |
872 | + $(call if_changed,mkimage) | |
877 | 873 | |
874 | +OBJCOPYFLAGS_u-boot.spr = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) \ | |
875 | + --gap-fill=0xff | |
876 | +u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE | |
877 | + $(call if_changed,pad_cat) | |
878 | + | |
878 | 879 | ifneq ($(CONFIG_TEGRA),) |
879 | -u-boot-nodtb-tegra.bin: spl/u-boot-spl.bin u-boot.bin | |
880 | - $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(CONFIG_SYS_TEXT_BASE) -O binary spl/u-boot-spl spl/u-boot-spl-pad.bin | |
881 | - cat spl/u-boot-spl-pad.bin u-boot.bin > $@ | |
882 | - rm spl/u-boot-spl-pad.bin | |
880 | +OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE) | |
881 | +u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE | |
882 | + $(call if_changed,pad_cat) | |
883 | 883 | |
884 | 884 | ifeq ($(CONFIG_OF_SEPARATE),y) |
885 | 885 | u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb FORCE |
886 | 886 | |
... | ... | @@ -895,11 +895,12 @@ |
895 | 895 | # and need to introduce a new build target with the full blown U-Boot |
896 | 896 | # at the start padded up to the start of the SPL image. And then concat |
897 | 897 | # the SPL image to the end. |
898 | -u-boot-img-spl-at-end.bin: spl/u-boot-spl.bin u-boot.img | |
899 | - $(OBJCOPY) -I binary -O binary --pad-to=$(CONFIG_UBOOT_PAD_TO) \ | |
900 | - --gap-fill=0xff u-boot.img $@ | |
901 | - cat spl/u-boot-spl.bin >> $@ | |
902 | 898 | |
899 | +OBJCOPYFLAGS_u-boot-img-spl-at-end.bin := -I binary -O binary \ | |
900 | + --pad-to=$(CONFIG_UBOOT_PAD_TO) --gap-fill=0xff | |
901 | +u-boot-img-spl-at-end.bin: u-boot.img spl/u-boot-spl.bin FORCE | |
902 | + $(call if_changed,pad_cat) | |
903 | + | |
903 | 904 | # Create a new ELF from a raw binary file. This is useful for arm64 |
904 | 905 | # where static relocation needs to be performed on the raw binary, |
905 | 906 | # but certain simulators only accept an ELF file (but don't do the |
... | ... | @@ -1066,7 +1067,9 @@ |
1066 | 1067 | u-boot-nand.bin: nand_spl/u-boot-spl-16k.bin u-boot.bin FORCE |
1067 | 1068 | $(call if_changed,cat) |
1068 | 1069 | |
1069 | -spl/u-boot-spl.bin: tools prepare | |
1070 | +spl/u-boot-spl.bin: spl/u-boot-spl | |
1071 | + @: | |
1072 | +spl/u-boot-spl: tools prepare | |
1070 | 1073 | $(Q)$(MAKE) obj=spl -f $(srctree)/spl/Makefile all |
1071 | 1074 | |
1072 | 1075 | tpl/u-boot-tpl.bin: tools prepare |