]> git.ipfire.org Git - thirdparty/u-boot.git/blobdiff - Makefile
rockchip: make_fit_atf.py: allow inclusion of a tee binary
[thirdparty/u-boot.git] / Makefile
index 58a5721b3d6a9096f55cdc1bb91831f304e03209..a94b538e4a028b51f771ce2977bcf80dec69776d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -346,7 +346,7 @@ define size_check
        limit=$$( printf "%d" $2 ); \
        if test $$actual -gt $$limit; then \
                echo "$1 exceeds file size limit:" >&2; \
-               echo "  limit:  $$(printf %#x bytes $$limit) bytes" >&2; \
+               echo "  limit:  $$(printf %#x $$limit) bytes" >&2; \
                echo "  actual: $$(printf %#x $$actual) bytes" >&2; \
                echo "  excess: $$(printf %#x $$((actual - limit))) bytes" >&2;\
                exit 1; \
@@ -806,6 +806,12 @@ else
 SPL_SIZE_CHECK =
 endif
 
+ifneq ($(CONFIG_TPL_SIZE_LIMIT),0)
+TPL_SIZE_CHECK = @$(call size_check,$@,$(CONFIG_TPL_SIZE_LIMIT))
+else
+TPL_SIZE_CHECK =
+endif
+
 # Statically apply RELA-style relocations (currently arm64 only)
 # This is useful for arm64 where static relocation needs to be performed on
 # the raw binary, but certain simulators only accept an ELF file (but don't
@@ -1119,7 +1125,15 @@ u-boot.bin: u-boot-nodtb.bin FORCE
        $(call if_changed,copy)
 endif
 
-%.imx: %.bin
+# we call Makefile in arch/arm/mach-imx which
+# has targets which are dependent on targets defined
+# here. make could not resolve them and we must ensure
+# that they are finished before calling imx targets
+ifeq ($(CONFIG_MULTI_DTB_FIT),y)
+IMX_DEPS = u-boot-fit-dtb.bin
+endif
+
+%.imx: $(IMX_DEPS) %.bin
        $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
        $(BOARD_SIZE_CHECK)
 
@@ -1806,6 +1820,7 @@ spl/boot.bin: spl/u-boot-spl
 tpl/u-boot-tpl.bin: tools prepare \
                $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb)
        $(Q)$(MAKE) obj=tpl -f $(srctree)/scripts/Makefile.spl all
+       $(TPL_SIZE_CHECK)
 
 TAG_SUBDIRS := $(patsubst %,$(srctree)/%,$(u-boot-dirs) include)