# This file is subject to the terms and conditions of the GNU General
# Public License. See the file COPYING in the main directory of this
# archive for more details.
-#
+#
#set -x # Turn echo on....
function xmlfile
{
- test "$mode" == "xml" && {
+ test "$mode" == "xml" && {
printf '<![CDATA[\n'
cat $1
- printf ']]>\n'
+ printf ']]>\n'
} >> $XMLFILE
}
{
# make this a function so we can easily select
# without breaking readability
-
+
VENDOR=$1
-
+
ls -1 $ROOT/src/mainboard/$VENDOR | grep -v Kconfig
}
build_dir=$TARGET/${VENDOR}_${MAINBOARD}
# get a working payload for the board if we have one.
- # the --payload option expects a directory containing
+ # the --payload option expects a directory containing
# a shell script payload.sh
# Usage: payload.sh [VENDOR] [DEVICE]
# the script returns an absolute path to the payload binary.
[ "$update" = "true" ] && mv ${build_dir}/coreboot.rom coreboot.rom.tmp
$MAKE distclean obj=${build_dir}
mkdir -p ${build_dir}
+ mkdir -p $TARGET/sharedutils
[ "$update" = "true" ] && mv coreboot.rom.tmp ${build_dir}/coreboot.rom
if [ "$CONFIG" != "" ]; then
else
printf " Creating config file... "
xml " <config>autogenerated</config>"
- grep "depends[\t ]on[\t ]*VENDOR" src/mainboard/$VENDOR/$MAINBOARD/../Kconfig | \
+ grep "if[\t ]*VENDOR" src/mainboard/$VENDOR/$MAINBOARD/../Kconfig | \
sed "s,^.*\(VENDOR_.*\)[^A-Z0-9_]*,CONFIG_\1=y," > .config
- grep "config[\t ]*BOARD" src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \
+ grep "if[\t ]*BOARD" src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \
sed "s,^.*\(BOARD_.*\)[^A-Z0-9_]*,CONFIG_\1=y," >> .config
grep "select[\t ]*ARCH" src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \
sed "s,^.*\(ARCH_.*\)[^A-Z0-9_]*,CONFIG_\1=y," >> .config
echo "CONFIG_SCANBUILD_ENABLE=y" >> .config
echo "CONFIG_SCANBUILD_REPORT_LOCATION=\"$TARGET/scan-build-results-tmp\"" >> .config
fi
+ echo "CONFIG_USBDEBUG=y" >> .config
fi
- #yes "" | $MAKE oldconfig -j $cpus obj=${build_dir} &> ${build_dir}/config.log
- yes "" | $MAKE oldconfig obj=${build_dir} &> ${build_dir}/config.log
+ #yes "" | $MAKE oldconfig -j $cpus obj=${build_dir} objutil=$TARGET/sharedutils &> ${build_dir}/config.log
+ yes "" | $MAKE oldconfig obj=${build_dir} objutil=$TARGET/sharedutils &> ${build_dir}/config.log
ret=$?
mv .config.old $TARGET/${VENDOR}_${MAINBOARD}/config.in
if [ $ret -eq 0 ]; then
}
function compile_target
-{
+{
VENDOR=$1
MAINBOARD=$2
CURR=$( pwd )
#stime=`perl -e 'print time();' 2>/dev/null || date +%s`
build_dir=$TARGET/${VENDOR}_${MAINBOARD}
- eval $MAKE $silent -j $cpus obj=${build_dir} \
+ eval $MAKE $silent -j $cpus obj=${build_dir} objutil=$TARGET/sharedutils \
&> ${build_dir}/make.log
ret=$?
mv .config ${build_dir}/config.build
done
fi
-
+
# TBD: look for suitable cross compiler suite
# cross-$TARCH-gcc and cross-$TARCH-ld
-
+
# Check result:
if [ $found_crosscompiler == "false" ]; then
printf "$TARCH: skipped, we're $ARCH\n\n"
xml " <status>notbuilt</status>"
xml ""
xml "</mainboard>"
-
+
return 0
else
printf "$TARCH: ok, $ARCH using ${CROSS_COMPILE}gcc\n"
xml "</mainboard>"
return 0
}
-
+
stime=`perl -e 'print time();' 2>/dev/null || date +%s`
create_buildenv $VENDOR $MAINBOARD $CONFIG
if [ $? -eq 0 -a $configureonly -eq 0 ]; then
- compile_target $VENDOR $MAINBOARD &&
+ if [ "$scanbuild" = "true" ]; then
+ rm -rf $TARGET/scan-build-results-tmp
+ fi
+ compile_target $VENDOR $MAINBOARD &&
xml " <status>ok</status>" ||
xml "<status>broken</status>"
if [ "$scanbuild" = "true" ]; then
+ rm -rf $TARGET/${VENDOR}_${MAINBOARD}-scanbuild
mv `dirname $TARGET/scan-build-results-tmp/*/index.html` $TARGET/${VENDOR}_${MAINBOARD}-scanbuild
- MAKE=$origMAKE
fi
fi
# Not calculated here because we still print it in compile_target
printf " (defaults to $ROOT)\n\n"
}
-function myversion
+function myversion
{
cat << EOF
buildall=false
verbose=false
-test -f util/sconfig/config.g && ROOT=$( pwd )
-test -f ../util/sconfig/config.g && ROOT=$( cd ..; pwd )
+test -f util/sconfig/sconfig.l && ROOT=$( pwd )
+test -f ../util/sconfig/sconfig.l && ROOT=$( cd ..; pwd )
test "$ROOT" = "" && ROOT=$( cd ../..; pwd )
# parse parameters.. try to find out whether we're running GNU getopt
getoptbrand="`getopt -V`"
if [ "${getoptbrand:0:6}" == "getopt" ]; then
# Detected GNU getopt that supports long options.
- args=`getopt -l version,verbose,help,all,target:,broken,payloads:,test,cpus:,silent,xml,config,loglevel:,remove,prefix:,update,nostackprotect,scan-build,ccache Vvhat:bp:Tc:sxCl:rP:uy -- "$@"`
- eval set "$args"
+ args=`getopt -l version,verbose,help,all,target:,broken,payloads:,test,cpus:,silent,xml,config,loglevel:,remove,prefix:,update,nostackprotect,scan-build,ccache -o Vvhat:bp:Tc:sxCl:rP:uy -- "$@"`
+ eval set -- $args
else
# Detected non-GNU getopt
args=`getopt Vvhat:bp:Tc:sxCl:rP:uy $*`
-t|--target) shift; target="$1"; shift;;
-a|--all) shift; buildall=true;;
-b|--broken) shift; buildbroken=true;;
- -r|--remove) shift; remove=true; shift;;
+ -r|--remove) shift; remove=true;;
-v|--verbose) shift; verbose=true; silent='V=1';;
-V|--version) shift; myversion; exit 0;;
-h|--help) shift; myversion; myhelp; exit 0;;