3 # coreboot autobuilder for kconfig
5 # This script builds coreboot images for all available targets.
7 # (C) 2009 coresystems GmbH
8 # written by Patrick Georgi <patrick.georgi@coresystems.de>
10 # This file is subject to the terms and conditions of the GNU General
11 # Public License, version 2. See the file COPYING in the main directory
12 # of this archive for more details.
14 TARGETDIR=kbuildall.results
17 if [ ! -f util/kbuildall/kbuildall ]; then
18 echo "This application must be run from the"
19 echo "toplevel directory of a coreboot checkout."
23 for make in make gmake gnumake; do
24 if [ "`$make --version 2>/dev/null | grep -c GNU`" -gt 0 ]; then
33 grep "depends[\t ]on[\t ]*VENDOR" src/mainboard/$1/../Kconfig | sed "s,^.*\(VENDOR_.*\)[^A-Z0-9_]*,CONFIG_\1=y," > .config
34 grep "config[\t ]*BOARD" src/mainboard/$1/Kconfig | sed "s,^.*\(BOARD_.*\)[^A-Z0-9_]*,CONFIG_\1=y," >> .config
35 grep "select[\t ]*ARCH" src/mainboard/$1/Kconfig | sed "s,^.*\(ARCH_.*\)[^A-Z0-9_]*,CONFIG_\1=y," >> .config
36 echo "CONFIG_MAINBOARD_DIR=$1" >> .config
37 yes "" | $MAKE oldconfig
40 ALLTARGETS=`(cd src/mainboard; ls */*/Config.lb | sed s,/Config.lb,,)`
41 TARGETCOUNT=`echo $ALLTARGETS | wc -w`
43 if [ -n "$BOARD" ]; then
51 for dir in $ALLTARGETS; do
53 if [ ! -f src/mainboard/$dir/Kconfig ]; then
54 echo "[$i/$TARGETCOUNT] ($dir) no Kconfig"
55 echo "$dir nokconfig" >> $TARGETDIR/_overview.txt
58 name=`echo $dir | sed s,/,_,g`
59 printf "[$i/$TARGETCOUNT] $dir "
60 builddefconfig $dir > $TARGETDIR/$name.buildconfig.log 2>&1
61 result=`$MAKE > $TARGETDIR/$name.buildcoreboot.log 2>&1 && echo ok || echo fail`
63 if [ "$result" = "ok" ]; then
64 util/abuild/abuild -o -C -t $dir
65 sh util/compareboard/compareboard $dir | tee $TARGETDIR/$name.variables.txt
67 echo "$dir $result" >> $TARGETDIR/_overview.txt