diff options
author | Paul Burton | 2017-06-15 19:05:09 -0500 |
---|---|---|
committer | Daniel Schwierzeck | 2017-07-25 13:44:00 -0500 |
commit | 09bebb8397f72340812de577a2d00612c7b7ed75 (patch) | |
tree | cd88592619ba97b16285233706352ebaf6564b19 /Makefile | |
parent | d56b4b19744c314c26dc77585a7c7a9253d1487d (diff) | |
download | u-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-- | Makefile | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 | ||
1235 | ARCH_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 |
1237 | quiet_cmd_u-boot__ ?= LD $@ | 1239 | quiet_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 | ||
1243 | quiet_cmd_smap = GEN common/system_map.o | 1246 | quiet_cmd_smap = GEN common/system_map.o |
1244 | cmd_smap = \ | 1247 | cmd_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 | ||
1250 | u-boot: $(u-boot-init) $(u-boot-main) u-boot.lds FORCE | 1253 | u-boot: $(u-boot-init) $(u-boot-main) u-boot.lds FORCE |
1251 | $(call if_changed,u-boot__) | 1254 | +$(call if_changed,u-boot__) |
1252 | ifeq ($(CONFIG_KALLSYMS),y) | 1255 | ifeq ($(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 |