[U-Boot] [PATCH 2/2] MX27: Update to autogenerated asm-offsets.h

Wolfgang Denk wd at denx.de
Thu Jun 30 12:33:18 CEST 2011


Dear Stefano Babic,

In message <1309426950-20987-2-git-send-email-sbabic at denx.de> you wrote:
> On i.MX27, the asm-offsets.h file is not yet generated as it should be.
> 
> Signed-off-by: Stefano Babic <sbabic at denx.de>
> CC: Matthias Weisser <weisserm at arcor.de>
> ---
>  arch/arm/cpu/arm926ejs/mx27/Makefile         |   13 +++++++
>  arch/arm/cpu/arm926ejs/mx27/asm-offsets.c    |   45 ++++++++++++++++++++++++++
>  arch/arm/include/asm/arch-mx27/asm-offsets.h |   16 ---------
>  3 files changed, 58 insertions(+), 16 deletions(-)
>  create mode 100644 arch/arm/cpu/arm926ejs/mx27/asm-offsets.c
>  delete mode 100644 arch/arm/include/asm/arch-mx27/asm-offsets.h
> 
> diff --git a/arch/arm/cpu/arm926ejs/mx27/Makefile b/arch/arm/cpu/arm926ejs/mx27/Makefile
> index 0e112b3..2d65e70 100644
> --- a/arch/arm/cpu/arm926ejs/mx27/Makefile
> +++ b/arch/arm/cpu/arm926ejs/mx27/Makefile
> @@ -34,6 +34,8 @@ all:	$(obj).depend $(LIB)
>  $(LIB):	$(OBJS)
>  	$(call cmd_link_o_target, $(OBJS))
>  
> +$(OBJS) : $(TOPDIR)/include/asm/arch/asm-offsets.h
> +
>  #########################################################################
>  
>  # defines $(obj).depend target
> @@ -42,3 +44,14 @@ include $(SRCTREE)/rules.mk
>  sinclude $(obj).depend
>  
>  #########################################################################
> +
> +$(TOPDIR)/include/asm/arch/asm-offsets.h:	$(TOPDIR)/include/autoconf.mk.dep \
> +	./asm-offsets.s
> +	@echo Generating $@
> +	$(TOPDIR)/tools/scripts/make-asm-offsets ./asm-offsets.s $@
> +
> +asm-offsets.s:	$(TOPDIR)/include/autoconf.mk.dep \
> +	./asm-offsets.c
> +	$(CC) -DDO_DEPS_ONLY \
> +		$(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
> +		-o $@ ./asm-offsets.c -c -S

I don't think it makes sense to copy the make rules for asm-offsets.h
and asm-offsets.s into each and every Makefile that needs them.

We should rather add these rules only once (either in rules.mk or in
the toplevel Makefile) and then only add the target to be built in the
board / cpu Makefiles that need them.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Remember, there's a big difference between kneeling down and  bending
over.                                                   - Frank Zappa


More information about the U-Boot mailing list