From patchwork Fri Jun 16 00:05:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Burton X-Patchwork-Id: 776513 X-Patchwork-Delegate: daniel.schwierzeck@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3wpgcz4WnFz9s4q for ; Fri, 16 Jun 2017 10:05:54 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 3DF9EC21C66; Fri, 16 Jun 2017 00:05:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id D84C3C21C3E; Fri, 16 Jun 2017 00:05:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B615AC21C3E; Fri, 16 Jun 2017 00:05:44 +0000 (UTC) Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by lists.denx.de (Postfix) with ESMTP id EBDA0C21C2D for ; Fri, 16 Jun 2017 00:05:43 +0000 (UTC) Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id EE46E15501631; Fri, 16 Jun 2017 01:05:37 +0100 (IST) Received: from localhost (10.20.1.33) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Fri, 16 Jun 2017 01:05:41 +0100 From: Paul Burton To: Date: Thu, 15 Jun 2017 17:05:09 -0700 Message-ID: <20170616000510.27262-1-paul.burton@imgtec.com> X-Mailer: git-send-email 2.13.1 MIME-Version: 1.0 X-Originating-IP: [10.20.1.33] Subject: [U-Boot] [PATCH 1/2] Makefile: Allow arch post-link hook X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 62d0482bcf..3c3bbc5109 100644 --- a/Makefile +++ b/Makefile @@ -1215,13 +1215,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 = \ @@ -1231,7 +1234,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