From 09bebb8397f72340812de577a2d00612c7b7ed75 Mon Sep 17 00:00:00 2001 From: Paul Burton Date: Thu, 15 Jun 2017 17:05:09 -0700 Subject: Makefile: Allow arch post-link hook This commit allows an architecture to provide a Makefile.postlink whose u-boot target gets invoked after the u-boot ELF is linked. This will be of use for MIPS in a following commit. This mirrors Linux commit fbe6e37dab97 ("kbuild: add arch specific post-link Makefile"). Signed-off-by: Paul Burton Cc: Daniel Schwierzeck Cc: Masahiro Yamada Cc: Simon Glass Cc: u-boot@lists.denx.de Reviewed-by: Tom Rini Reviewed-by: Simon Glass Reviewed-by: Daniel Schwierzeck Tested-by: Daniel Schwierzeck diff --git a/Makefile b/Makefile index a1a3aea..3d2b66a 100644 --- a/Makefile +++ b/Makefile @@ -1232,13 +1232,16 @@ u-boot.elf: u-boot.bin $(Q)$(OBJCOPY) -I binary $(PLATFORM_ELFFLAGS) $< u-boot-elf.o $(call if_changed,u-boot-elf) +ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(ARCH)/Makefile.postlink) + # Rule to link u-boot # May be overridden by arch/$(ARCH)/config.mk quiet_cmd_u-boot__ ?= LD $@ cmd_u-boot__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_u-boot) -o $@ \ -T u-boot.lds $(u-boot-init) \ --start-group $(u-boot-main) --end-group \ - $(PLATFORM_LIBS) -Map u-boot.map + $(PLATFORM_LIBS) -Map u-boot.map; \ + $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) quiet_cmd_smap = GEN common/system_map.o cmd_smap = \ @@ -1248,7 +1251,7 @@ cmd_smap = \ -c $(srctree)/common/system_map.c -o common/system_map.o u-boot: $(u-boot-init) $(u-boot-main) u-boot.lds FORCE - $(call if_changed,u-boot__) + +$(call if_changed,u-boot__) ifeq ($(CONFIG_KALLSYMS),y) $(call cmd,smap) $(call cmd,u-boot__) common/system_map.o -- cgit v0.10.2