From patchwork Wed Aug 17 10:12:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 110306 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 89ED1B6F7D for ; Wed, 17 Aug 2011 20:13:18 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 33A4E2808C; Wed, 17 Aug 2011 12:13:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XLKrk2z6jn2m; Wed, 17 Aug 2011 12:13:15 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 27B3628087; Wed, 17 Aug 2011 12:13:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 32A2228087 for ; Wed, 17 Aug 2011 12:13:10 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 80xzmmiIqiRa for ; Wed, 17 Aug 2011 12:13:07 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtpi4.ngi.it (smtpi4.ngi.it [88.149.128.104]) by theia.denx.de (Postfix) with ESMTP id CB38428084 for ; Wed, 17 Aug 2011 12:13:06 +0200 (CEST) Received: from paperina.lan (unknown [88.149.182.160]) by smtpi4.ngi.it (Postfix) with ESMTP id F083F60B7A1; Wed, 17 Aug 2011 12:12:18 +0200 (CEST) Received: from papero.lan (papero.lan [192.168.2.105]) by paperina.lan (Postfix) with ESMTP id 9222F140A0A4; Wed, 17 Aug 2011 12:12:18 +0200 (CEST) From: Stefano Babic To: u-boot@lists.denx.de Date: Wed, 17 Aug 2011 12:12:14 +0200 Message-Id: <1313575934-15552-1-git-send-email-sbabic@denx.de> X-Mailer: git-send-email 1.7.1 Subject: [U-Boot] [PATCH] Makefile : fix generation of cpu related asm-offsets.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de commit 0edf8b5b2fa0d210ebc4d6da0fd1aceeb7e44e47 breaks building on a different directory with the O= parameter. The patch wil fix this issue, generating always asm-offsets.h before the other targets. Signed-off-by: Stefano Babic --- Note: the patch fixes the issue, however I generate an empty asm-offsets.c for boards that do not have one. Is there a better way to reach the goal ? Makefile | 19 ++++++++++++++++++- rules.mk | 10 ---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index f8ae883..10b2498 100644 --- a/Makefile +++ b/Makefile @@ -460,7 +460,8 @@ updater: # parallel sub-makes creating .depend files simultaneously. depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) \ $(obj)include/autoconf.mk \ - $(obj)include/generated/generic-asm-offsets.h + $(obj)include/generated/generic-asm-offsets.h \ + $(obj)include/asm/arch/asm-offsets.h for dir in $(SUBDIRS) $(CPUDIR) $(dir $(LDSCRIPT)) ; do \ $(MAKE) -C $$dir _depend ; done @@ -519,6 +520,22 @@ $(obj)lib/asm-offsets.s: $(obj)include/autoconf.mk.dep \ $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \ -o $@ $(src)lib/asm-offsets.c -c -S +$(obj)include/asm/arch/asm-offsets.h: $(obj)include/autoconf.mk.dep \ + $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s + @echo Generating $@ + tools/scripts/make-asm-offsets $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s $@ + +$(obj)$(CPUDIR)/$(SOC)/asm-offsets.s: $(obj)include/autoconf.mk.dep check_cpu_asm_offsets + @mkdir -p $(obj)$(CPUDIR)/$(SOC) + $(CC) -DDO_DEPS_ONLY \ + $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \ + -o $@ $(src)$(CPUDIR)/$(SOC)/asm-offsets.c -c -S + +# $(src)$(CPUDIR)/$(SOC)/asm-offsets.c +check_cpu_asm_offsets: + if [ ! -f $(src)$(CPUDIR)/$(SOC)/asm-offsets.c ];then \ + touch $(src)$(CPUDIR)/$(SOC)/asm-offsets.c;fi + ######################################################################### else # !config.mk all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \ diff --git a/rules.mk b/rules.mk index 5fd12a0..c2860e5 100644 --- a/rules.mk +++ b/rules.mk @@ -42,14 +42,4 @@ $(HOSTOBJS): $(obj)%.o: %.c $(NOPEDOBJS): $(obj)%.o: %.c $(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTCFLAGS_$(@F)) $(HOSTCFLAGS_$(BCURDIR)) -o $@ $< -c -$(TOPDIR)/include/asm/arch/asm-offsets.h: $(TOPDIR)/include/autoconf.mk.dep \ - $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.s - @echo Generating $@ - $(TOPDIR)/tools/scripts/make-asm-offsets $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.s $@ - -$(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.s: $(TOPDIR)/include/autoconf.mk.dep \ - $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.c - $(CC) -DDO_DEPS_ONLY \ - $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \ - -o $@ $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.c -c -S #########################################################################