From patchwork Sun Aug 28 13:03:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Graeme Russ X-Patchwork-Id: 111902 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 B2AB4B6F70 for ; Sun, 28 Aug 2011 23:03:47 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9823A2809A; Sun, 28 Aug 2011 15:03:40 +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 ekZfn6iV3RQQ; Sun, 28 Aug 2011 15:03:40 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5708D280A7; Sun, 28 Aug 2011 15:03:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3B33A28097 for ; Sun, 28 Aug 2011 15:03:31 +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 FZYsPgHAkIGo for ; Sun, 28 Aug 2011 15:03:28 +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 mail-pz0-f41.google.com (mail-pz0-f41.google.com [209.85.210.41]) by theia.denx.de (Postfix) with ESMTPS id 2DFC12808D for ; Sun, 28 Aug 2011 15:03:26 +0200 (CEST) Received: by mail-pz0-f41.google.com with SMTP id 4so10427653pzk.28 for ; Sun, 28 Aug 2011 06:03:26 -0700 (PDT) Received: by 10.142.49.15 with SMTP id w15mr2039853wfw.266.1314536605629; Sun, 28 Aug 2011 06:03:25 -0700 (PDT) Received: from localhost.localdomain (d122-104-32-184.sbr6.nsw.optusnet.com.au. [122.104.32.184]) by mx.google.com with ESMTPS id z1sm13047981pbz.6.2011.08.28.06.03.23 (version=SSLv3 cipher=OTHER); Sun, 28 Aug 2011 06:03:25 -0700 (PDT) From: Graeme Russ To: u-boot@lists.denx.de Date: Sun, 28 Aug 2011 23:03:11 +1000 Message-Id: <1314536593-14310-2-git-send-email-graeme.russ@gmail.com> X-Mailer: git-send-email 1.7.5.2.317.g391b14 In-Reply-To: <1314536593-14310-1-git-send-email-graeme.russ@gmail.com> References: <1314536593-14310-1-git-send-email-graeme.russ@gmail.com> Subject: [U-Boot] [PATCH 1/3] Makefile: Add generic build rules for include/asm/arch/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 Add three features to the top-level makefile: - Add include/asm/arch/asm-offsets.h as a dependency of the 'depend' target to eliminate 'file does not exist' errors during dependency building - Skip generation of include/asm/arch/asm-offsets.h if the source file ($(CPUDIR)/$(SOC)/asm-offsets.c) does not exist - Add removal of arch specific asm-offsets.s and asm-offsets.h files to the 'clean' target Signed-off-by: Graeme Russ --- Big Fat Note: I have not tested this on ARM which needs to be looked at closely as the SoC files are one level deeper than where sc520 sits under x86 Makefile | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 deletions(-) -- 1.7.5.2.317.g391b14 diff --git a/Makefile b/Makefile index 03d80b7..049b169 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/asm/arch/asm-offsets.h for dir in $(SUBDIRS) $(CPUDIR) $(dir $(LDSCRIPT)) ; do \ $(MAKE) -C $$dir _depend ; done @@ -527,6 +528,23 @@ $(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: $(TOPDIR)/include/autoconf.mk.dep \ + $(if $(wildcard $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.c), \ + $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.s,) + @echo Generating $@ + $(if $(wildcard $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.c), \ + tools/scripts/make-asm-offsets $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.s $@ \ + ,@echo $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.c does not exist - skipping) + +$(TOPDIR)$(CPUDIR)/$(SOC)/asm-offsets.s: $(TOPDIR)/include/autoconf.mk.dep \ + $(if $(wildcard $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.c), \ + $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.c,) + $(if $(wildcard $(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 \ + ,@echo $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.c does not exist - skipping) + ######################################################################### else # !config.mk all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \ @@ -1019,7 +1037,9 @@ clean: $(obj)board/armltd/{integratorap,integratorcp}/u-boot.lds \ $(obj)u-boot.lds \ $(obj)arch/blackfin/cpu/bootrom-asm-offsets.[chs] \ - $(obj)arch/blackfin/cpu/init.{lds,elf} + $(obj)arch/blackfin/cpu/init.{lds,elf} \ + $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.s \ + $(TOPDIR)/include/asm/arch/asm-offsets.h @rm -f $(obj)include/bmp_logo.h @rm -f $(obj)lib/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}