From patchwork Tue Aug 30 17:49:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 112374 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 AB3DDB6F82 for ; Wed, 31 Aug 2011 03:50:09 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 91F0128090; Tue, 30 Aug 2011 19:50:06 +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 D1J2XgjFN65p; Tue, 30 Aug 2011 19:50:06 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D210F2809C; Tue, 30 Aug 2011 19:50:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5849F2809C for ; Tue, 30 Aug 2011 19:49:57 +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 4ma86mj5Y54L for ; Tue, 30 Aug 2011 19:49:55 +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 smtpi3.ngi.it (smtpi3.ngi.it [88.149.128.33]) by theia.denx.de (Postfix) with ESMTP id 6688128090 for ; Tue, 30 Aug 2011 19:49:53 +0200 (CEST) Received: from paperina.lan (unknown [88.149.182.160]) by smtpi3.ngi.it (Postfix) with ESMTP id 6293D35D469; Tue, 30 Aug 2011 19:49:52 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by paperina.lan (Postfix) with ESMTP id 07273140A115; Tue, 30 Aug 2011 19:49:52 +0200 (CEST) Received: from paperina.lan ([127.0.0.1]) by localhost (paperina.lan [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tkdRN1deK62A; Tue, 30 Aug 2011 19:49:48 +0200 (CEST) Received: from papero.lan (papero.lan [192.168.2.105]) by paperina.lan (Postfix) with ESMTP id 072BB140A026; Tue, 30 Aug 2011 19:49:48 +0200 (CEST) From: Stefano Babic To: u-boot@lists.denx.de Date: Tue, 30 Aug 2011 19:49:44 +0200 Message-Id: <1314726584-17203-1-git-send-email-sbabic@denx.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1313575934-15552-1-git-send-email-sbabic@denx.de> References: <1313575934-15552-1-git-send-email-sbabic@denx.de> Subject: [U-Boot] [PATCH V3] 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 CC: Matthias Weisser CC: Wolfgang Denk --- Note: V2 breaks *all* not ARM boards Put the generated asm-offsets.h into include/generated, because this directory is common to all architectures. Makefile | 20 +++++++++++++++++++- arch/arm/cpu/arm1136/mx35/Makefile | 2 -- arch/arm/cpu/arm926ejs/mb86r0x/Makefile | 2 -- arch/arm/cpu/arm926ejs/mx25/Makefile | 2 -- arch/arm/cpu/arm926ejs/mx27/Makefile | 2 -- arch/arm/cpu/armv7/mx5/Makefile | 2 -- arch/arm/cpu/armv7/mx5/lowlevel_init.S | 2 +- arch/arm/include/asm/arch-mx25/macro.h | 2 +- board/freescale/mx35pdk/lowlevel_init.S | 2 +- board/logicpd/imx27lite/lowlevel_init.S | 2 +- board/syteco/jadecpu/lowlevel_init.S | 2 +- board/syteco/zmx25/lowlevel_init.S | 2 +- rules.mk | 10 ---------- 13 files changed, 25 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index 6abc319..493a668 100644 --- a/Makefile +++ b/Makefile @@ -464,7 +464,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/generated/asm-offsets.h for dir in $(SUBDIRS) $(CPUDIR) $(dir $(LDSCRIPT)) ; do \ $(MAKE) -C $$dir _depend ; done @@ -527,6 +528,21 @@ $(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/generated/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 + @mkdir -p $(obj)$(CPUDIR)/$(SOC) + if [ -f $(src)$(CPUDIR)/$(SOC)/asm-offsets.c ];then \ + $(CC) -DDO_DEPS_ONLY \ + $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \ + -o $@ $(src)$(CPUDIR)/$(SOC)/asm-offsets.c -c -S; \ + else \ + touch $(src)$(CPUDIR)/$(SOC)/asm-offsets.s; \ + fi + ######################################################################### else # !config.mk all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \ @@ -916,6 +932,8 @@ clean: $(obj)arch/blackfin/cpu/init.{lds,elf} @rm -f $(obj)include/bmp_logo.h @rm -f $(obj)lib/asm-offsets.s + @rm -f $(obj)include/generated/asm-offsets.h + @rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s @rm -f $(obj)nand_spl/{u-boot.lds,u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map,System.map} @rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map} @rm -f $(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin} diff --git a/arch/arm/cpu/arm1136/mx35/Makefile b/arch/arm/cpu/arm1136/mx35/Makefile index 284cdc5..469397c 100644 --- a/arch/arm/cpu/arm1136/mx35/Makefile +++ b/arch/arm/cpu/arm1136/mx35/Makefile @@ -39,8 +39,6 @@ all: $(obj).depend $(LIB) $(LIB): $(OBJS) $(call cmd_link_o_target, $(OBJS)) -$(OBJS) : $(TOPDIR)/include/asm/arch/asm-offsets.h - ######################################################################### diff --git a/arch/arm/cpu/arm926ejs/mb86r0x/Makefile b/arch/arm/cpu/arm926ejs/mb86r0x/Makefile index 974d0be..bab048b 100644 --- a/arch/arm/cpu/arm926ejs/mb86r0x/Makefile +++ b/arch/arm/cpu/arm926ejs/mb86r0x/Makefile @@ -37,8 +37,6 @@ all: $(obj).depend $(LIB) $(LIB): $(OBJS) $(call cmd_link_o_target, $(OBJS)) -$(OBJS) : $(TOPDIR)/include/asm/arch/asm-offsets.h - ######################################################################### # defines $(obj).depend target diff --git a/arch/arm/cpu/arm926ejs/mx25/Makefile b/arch/arm/cpu/arm926ejs/mx25/Makefile index 9219c06..3c2a65e 100644 --- a/arch/arm/cpu/arm926ejs/mx25/Makefile +++ b/arch/arm/cpu/arm926ejs/mx25/Makefile @@ -34,8 +34,6 @@ all: $(obj).depend $(LIB) $(LIB): $(OBJS) $(call cmd_link_o_target, $(OBJS)) -$(OBJS) : $(TOPDIR)/include/asm/arch/asm-offsets.h - ######################################################################### # defines $(obj).depend target diff --git a/arch/arm/cpu/arm926ejs/mx27/Makefile b/arch/arm/cpu/arm926ejs/mx27/Makefile index 7ac1a21..0e112b3 100644 --- a/arch/arm/cpu/arm926ejs/mx27/Makefile +++ b/arch/arm/cpu/arm926ejs/mx27/Makefile @@ -34,8 +34,6 @@ all: $(obj).depend $(LIB) $(LIB): $(OBJS) $(call cmd_link_o_target, $(OBJS)) -$(OBJS) : $(TOPDIR)/include/asm/arch/asm-offsets.h - ######################################################################### # defines $(obj).depend target diff --git a/arch/arm/cpu/armv7/mx5/Makefile b/arch/arm/cpu/armv7/mx5/Makefile index 6e13cc3..e8be9c9 100644 --- a/arch/arm/cpu/armv7/mx5/Makefile +++ b/arch/arm/cpu/armv7/mx5/Makefile @@ -45,6 +45,4 @@ include $(SRCTREE)/rules.mk sinclude $(obj).depend -lowlevel_init.o : $(TOPDIR)/include/asm/arch/asm-offsets.h - ######################################################################### diff --git a/arch/arm/cpu/armv7/mx5/lowlevel_init.S b/arch/arm/cpu/armv7/mx5/lowlevel_init.S index 6c66b42..7e37221 100644 --- a/arch/arm/cpu/armv7/mx5/lowlevel_init.S +++ b/arch/arm/cpu/armv7/mx5/lowlevel_init.S @@ -21,7 +21,7 @@ #include #include -#include +#include /* * L2CC Cache setup/invalidation/disable diff --git a/arch/arm/include/asm/arch-mx25/macro.h b/arch/arm/include/asm/arch-mx25/macro.h index 276c71c..3b694da 100644 --- a/arch/arm/include/asm/arch-mx25/macro.h +++ b/arch/arm/include/asm/arch-mx25/macro.h @@ -31,7 +31,7 @@ #ifdef __ASSEMBLY__ #include -#include +#include .macro init_aips write32 IMX_AIPS1_BASE + AIPS_MPR_0_7, 0x77777777 diff --git a/board/freescale/mx35pdk/lowlevel_init.S b/board/freescale/mx35pdk/lowlevel_init.S index 9fd04cb..698c4cf 100644 --- a/board/freescale/mx35pdk/lowlevel_init.S +++ b/board/freescale/mx35pdk/lowlevel_init.S @@ -21,7 +21,7 @@ #include #include -#include +#include #include "mx35pdk.h" /* diff --git a/board/logicpd/imx27lite/lowlevel_init.S b/board/logicpd/imx27lite/lowlevel_init.S index e2cdecb..873634f 100644 --- a/board/logicpd/imx27lite/lowlevel_init.S +++ b/board/logicpd/imx27lite/lowlevel_init.S @@ -26,7 +26,7 @@ #include #include #include -#include +#include SOC_ESDCTL_BASE_W: .word IMX_ESD_BASE SOC_SI_ID_REG_W: .word IMX_SYSTEM_CTL_BASE diff --git a/board/syteco/jadecpu/lowlevel_init.S b/board/syteco/jadecpu/lowlevel_init.S index 5ad4dce..b01f087 100644 --- a/board/syteco/jadecpu/lowlevel_init.S +++ b/board/syteco/jadecpu/lowlevel_init.S @@ -30,7 +30,7 @@ #include #include #include -#include +#include /* Set up the platform, once the cpu has been initialized */ .globl lowlevel_init diff --git a/board/syteco/zmx25/lowlevel_init.S b/board/syteco/zmx25/lowlevel_init.S index 8e63de0..1002674 100644 --- a/board/syteco/zmx25/lowlevel_init.S +++ b/board/syteco/zmx25/lowlevel_init.S @@ -27,7 +27,7 @@ #include #include #include -#include +#include /* * clocks diff --git a/rules.mk b/rules.mk index a6bae62..d79fcd3 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 #########################################################################