[U-Boot] [PATCH 01/10] mkconfig: parse top level makefile target to multiple config targets

Hu Mingkai-B21284 Mingkai.Hu at freescale.com
Fri Aug 21 09:18:29 CEST 2009


> -----Original Message-----
> From: Kumar Gala [mailto:galak at kernel.crashing.org] 
> Sent: Tuesday, August 18, 2009 11:07 PM
> To: Wolfgang Denk
> Cc: Wood Scott-B07421; U-Boot-Users ML; Hu Mingkai-B21284; 
> Mike Frysinger
> Subject: Re: [PATCH 01/10] mkconfig: parse top level makefile 
> target to multiple config targets
> 
> 
> On Aug 18, 2009, at 2:37 AM, Mingkai Hu wrote:
> 
> > To simplify the top level makefile it useful to be able to 
> paree the 
> > top level makefile target to multiple individual target, 
> then put them 
> > to the config.h and config.mk, leave the board config file 
> and board 
> > makefile to handle the different targets.
> > ---
> > mkconfig |   11 +++++++++++
> > 1 files changed, 11 insertions(+), 0 deletions(-)
> 
> I know you are swamped w/ARM.. but if we can make some 
> progress on this one change it would be useful for 'next'.
> 
> thanks
> 
> - k
> 

Hi Wolfgang,

How do you think of this method? Or can we handle the different options
as follows?

MPC8536DS_NAND_config: unconfig
       @echo "" >$(obj)include/config.h;
       @echo "#define CONFIG_$(subst MPC8536DS_,,$(subst
config,U_BOOT,$@))" \
               > $(obj)include/config.h
       @$(MKCONFIG) -a MPC8536DS ppc mpc85xx mpc8536ds freescale
       @echo "CONFIG_$(subst MPC8536DS_,,$(subst config,U_BOOT,$@)) = y"
\
               >> $(obj)include/config.mk

If there's  an orthogonal option, such as 36BIT, we have to handle it
seperately:

MPC8536DS_NAND_config \
MPC8536DS_NAND_36BIT_config: unconfig
       @echo "" >$(obj)include/config.h;
       @if [ "$(findstring _36BIT_,$@" ] ; then \
               echo "#define CONFIG_PHYS_64BIT" >>$(obj)include/config.h
; \
       fi
       @echo "#define CONFIG_$(subst MPC8536DS_,,$(subst
config,U_BOOT,$@))" \
               > $(obj)include/config.h
       @$(MKCONFIG) -a MPC8536DS ppc mpc85xx mpc8536ds freescale
       @echo "CONFIG_$(subst MPC8536DS_,,$(subst config,U_BOOT,$@)) = y"
\
               >> $(obj)include/config.mk

Look forward to your comments.

Thanks,
Mingkai

> >
> > diff --git a/mkconfig b/mkconfig
> > index b0bbbd1..d9e216d 100755
> > --- a/mkconfig
> > +++ b/mkconfig
> > @@ -10,12 +10,14 @@
> >
> > APPEND=no	# Default: Create new config file
> > BOARD_NAME=""	# Name to print in make output
> > +TARGETS=""
> >
> > while [ $# -gt 0 ] ; do
> > 	case "$1" in
> > 	--) shift ; break ;;
> > 	-a) shift ; APPEND=yes ;;
> > 	-n) shift ; BOARD_NAME="${1%%_config}" ; shift ;;
> > +	-t) shift ; TARGETS="`echo $1 | sed 's:_: :g'` ${TARGETS}" ;
> > shift ;;
> > 	*)  break ;;
> > 	esac
> > done
> > @@ -72,6 +74,10 @@ echo "BOARD  = $4" >> config.mk
> >
> > [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC    = $6" >> config.mk
> >
> > +for i in ${TARGETS} ; do
> > +	echo "CONFIG_OPT_${i} = y" >> config.mk ; done
> > +
> > #
> > # Create board specific header file
> > #
> > @@ -82,6 +88,11 @@ else
> > 	> config.h		# Create new config file
> > fi
> > echo "/* Automatically generated - do not edit */" >>config.h
> > +
> > +for i in ${TARGETS} ; do
> > +	echo "#define CONFIG_OPT_${i} 1" >>config.h ; done
> > +
> > echo "#include <configs/$1.h>" >>config.h echo "#include 
> > <asm/config.h>" >>config.h
> >
> > --
> > 1.5.4
> 
> 
> 


More information about the U-Boot mailing list