[U-Boot] [PATCH 2/3] Makefile: simplify handling of build target names

Mike Frysinger vapier at gentoo.org
Thu May 20 01:40:42 CEST 2010


On Saturday 15 May 2010 20:35:32 Wolfgang Denk wrote:
> --- a/mkconfig
> +++ b/mkconfig
> @@ -22,7 +22,7 @@ while [ $# -gt 0 ] ; do
>  	esac
>  done
> 
> -[ "${BOARD_NAME}" ] || BOARD_NAME="$1"
> +[ "${BOARD_NAME}" ] || BOARD_NAME="${1%%_config}"
> 
>  [ $# -lt 4 ] && exit 1
>  [ $# -gt 6 ] && exit 1
> @@ -102,7 +102,7 @@ done
>  cat << EOF >> config.h
>  #define CONFIG_BOARDDIR board/$BOARDDIR
>  #include <config_defaults.h>
> -#include <configs/$1.h>
> +#include <configs/${1%%_config}.h>
>  #include <asm/config.h>
>  EOF

it isnt harmful, but using %% when there are no glob patterns doesnt make 
sense.  so typically the code would be ${1%_config}.  or even better, create a 
new variable up front set to ${1%_config} and use that later on instead of 
duplicating the same replacement construct multiple times.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100519/66cf19f3/attachment.pgp 


More information about the U-Boot mailing list