diff mbox

[U-Boot,1/3] Makefile: Add generic build rules for include/asm/arch/asm-offsets.h

Message ID 1314536593-14310-2-git-send-email-graeme.russ@gmail.com
State Superseded
Headers show

Commit Message

Graeme Russ Aug. 28, 2011, 1:03 p.m. UTC
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 <graeme.russ@gmail.com>
---
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

Comments

Wolfgang Denk Oct. 17, 2011, 8:01 p.m. UTC | #1
Dear Albert,

In message <1314536593-14310-2-git-send-email-graeme.russ@gmail.com> Graeme Russ wrote:
> 
> 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 <graeme.russ@gmail.com>
> ---
> 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(-)

Would you please ACK or NAK this patch?

Best regards,

Wolfgang Denk
Albert ARIBAUD Oct. 21, 2011, 9:25 p.m. UTC | #2
Hi Greame,

Le 28/08/2011 15:03, Graeme Russ a écrit :
>
> 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<graeme.russ@gmail.com>
> ---
> 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(-)

This does not apply cleanly any more. Can you rebase?

Amicalement,
diff mbox

Patch

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}