aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Burton2017-06-15 19:05:09 -0500
committerDaniel Schwierzeck2017-07-25 13:44:00 -0500
commit09bebb8397f72340812de577a2d00612c7b7ed75 (patch)
treecd88592619ba97b16285233706352ebaf6564b19 /Makefile
parentd56b4b19744c314c26dc77585a7c7a9253d1487d (diff)
downloadu-boot-09bebb8397f72340812de577a2d00612c7b7ed75.tar.gz
u-boot-09bebb8397f72340812de577a2d00612c7b7ed75.tar.xz
u-boot-09bebb8397f72340812de577a2d00612c7b7ed75.zip
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 <paul.burton@imgtec.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Simon Glass <sjg@chromium.org> Cc: u-boot@lists.denx.de Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Tested-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index a1a3aeac52..3d2b66a91f 100644
--- a/Makefile
+++ b/Makefile
@@ -1232,13 +1232,16 @@ u-boot.elf: u-boot.bin
1232 $(Q)$(OBJCOPY) -I binary $(PLATFORM_ELFFLAGS) $< u-boot-elf.o 1232 $(Q)$(OBJCOPY) -I binary $(PLATFORM_ELFFLAGS) $< u-boot-elf.o
1233 $(call if_changed,u-boot-elf) 1233 $(call if_changed,u-boot-elf)
1234 1234
1235ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(ARCH)/Makefile.postlink)
1236
1235# Rule to link u-boot 1237# Rule to link u-boot
1236# May be overridden by arch/$(ARCH)/config.mk 1238# May be overridden by arch/$(ARCH)/config.mk
1237quiet_cmd_u-boot__ ?= LD $@ 1239quiet_cmd_u-boot__ ?= LD $@
1238 cmd_u-boot__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_u-boot) -o $@ \ 1240 cmd_u-boot__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_u-boot) -o $@ \
1239 -T u-boot.lds $(u-boot-init) \ 1241 -T u-boot.lds $(u-boot-init) \
1240 --start-group $(u-boot-main) --end-group \ 1242 --start-group $(u-boot-main) --end-group \
1241 $(PLATFORM_LIBS) -Map u-boot.map 1243 $(PLATFORM_LIBS) -Map u-boot.map; \
1244 $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
1242 1245
1243quiet_cmd_smap = GEN common/system_map.o 1246quiet_cmd_smap = GEN common/system_map.o
1244cmd_smap = \ 1247cmd_smap = \
@@ -1248,7 +1251,7 @@ cmd_smap = \
1248 -c $(srctree)/common/system_map.c -o common/system_map.o 1251 -c $(srctree)/common/system_map.c -o common/system_map.o
1249 1252
1250u-boot: $(u-boot-init) $(u-boot-main) u-boot.lds FORCE 1253u-boot: $(u-boot-init) $(u-boot-main) u-boot.lds FORCE
1251 $(call if_changed,u-boot__) 1254 +$(call if_changed,u-boot__)
1252ifeq ($(CONFIG_KALLSYMS),y) 1255ifeq ($(CONFIG_KALLSYMS),y)
1253 $(call cmd,smap) 1256 $(call cmd,smap)
1254 $(call cmd,u-boot__) common/system_map.o 1257 $(call cmd,u-boot__) common/system_map.o