X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=mkconfig;h=0f7f13e3a4d836d6bb8a1ab18b34e63a4125cc2c;hb=d8775d03f3f0116241cfb45c7ef27fd080904c4a;hp=b0bbbd1e7f41fb0ecdf6918b306680d91b647994;hpb=9eb468da3fd8753de55ab271d6ff5ed7f36d7ea2;p=karo-tx-uboot.git diff --git a/mkconfig b/mkconfig index b0bbbd1e7f..0f7f13e3a4 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 @@ -25,6 +27,11 @@ done [ $# -lt 4 ] && exit 1 [ $# -gt 6 ] && exit 1 +if [ "${ARCH}" -a "${ARCH}" != "$2" ]; then + echo "Failed: \$ARCH=${ARCH}, should be '$2' for ${BOARD_NAME}" 1>&2 + exit 1 +fi + echo "Configuring for ${BOARD_NAME} board..." # @@ -72,6 +79,13 @@ echo "BOARD = $4" >> config.mk [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk +# Assign board directory to BOARDIR variable +if [ -z "$5" -o "$5" = "NULL" ] ; then + BOARDDIR=$4 +else + BOARDDIR=$5/$4 +fi + # # Create board specific header file # @@ -82,7 +96,16 @@ else > config.h # Create new config file fi echo "/* Automatically generated - do not edit */" >>config.h -echo "#include " >>config.h -echo "#include " >>config.h + +for i in ${TARGETS} ; do + echo "#define CONFIG_MK_${i} 1" >>config.h ; +done + +cat << EOF >> config.h +#define CONFIG_BOARDDIR board/$BOARDDIR +#include +#include +#include +EOF exit 0