abuild:
[coreboot.git] / util / abuild / abuild
1 #!/bin/bash
2 #
3 #  coreboot autobuild
4 #
5 #  This script builds coreboot images for all available targets.
6 #
7 #  (C) 2004 by Stefan Reinauer <stepan@openbios.org>
8 #  (C) 2006-2010 by coresystems GmbH <info@coresystems.de>
9 #
10 #  This file is subject to the terms and conditions of the GNU General
11 #  Public License. See the file COPYING in the main directory of this
12 #  archive for more details.
13 #     
14
15 #set -x # Turn echo on....
16
17 ABUILD_DATE="January 29th, 2010"
18 ABUILD_VERSION="0.9"
19
20 # Where shall we place all the build trees?
21 TARGET=coreboot-builds
22 XMLFILE=$( pwd )/abuild.xml
23
24 # path to payload. Should be more generic
25 PAYLOAD=/dev/null
26
27 # Lines of error context to be printed in FAILURE case
28 CONTEXT=6
29
30 TESTSUBMISSION="http://qa.coreboot.org/deployment/send.php"
31
32 # Number of CPUs to compile on per default
33 cpus=1
34
35 # Configure-only mode
36 configureonly=0
37
38 # One might want to adjust these in case of cross compiling
39 for i in make gmake gnumake nonexistant_make; do
40         $i --version 2>/dev/null |grep "GNU Make" >/dev/null && break
41 done
42 if [ "$i" = "nonexistant_make" ]; then
43         echo No GNU Make found.
44         exit 1
45 fi
46 MAKE=$i
47
48 # this can be changed to xml by -x
49 mode=text
50
51 # silent mode.. no compiler calls, only warnings in the log files.
52 # this is disabled per default but can be enabled with -s
53 silent=
54
55 # clang mode enabled by -sb option.
56 scanbuild=false
57
58 # use ccache
59 ccache=false
60
61 # stackprotect mode enabled by -ns option.
62 stackprotect=false
63
64 # loglevel changed with -l / --loglevel option
65 loglevel=default
66
67 # update existing image
68 update=false
69
70 # CBFS prefix
71 cbfs_prefix=fallback
72
73 ARCH=`uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
74         -e s/i86pc/i386/ \
75         -e s/arm.*/arm/ -e s/sa110/arm/ -e s/x86_64/amd64/ \
76         -e "s/Power Macintosh/ppc/"`
77
78 trap interrupt INT
79
80 function interrupt
81 {
82         printf "\n$0: execution interrupted manually.\n"
83         if [ "$mode" == "xml" ]; then
84                 printf "$0: deleting incomplete xml output file.\n"
85         fi
86         exit 1
87 }
88
89 function debug
90 {
91         test "$verbose" == "true" && printf "$*\n"
92 }
93
94 function xml
95 {
96         test "$mode" == "xml" && printf "$*\n" >> $XMLFILE
97         return 0
98 }
99
100 function xmlfile
101 {
102         test "$mode" == "xml" && { 
103                 printf '<![CDATA[\n'
104                 cat $1
105                 printf ']]>\n' 
106         } >> $XMLFILE
107 }
108
109
110
111 function vendors
112 {
113         # make this a function so we can easily select
114         # without breaking readability
115         ls -1 "$ROOT/src/mainboard" | grep -v Kconfig | grep -v Makefile
116 }
117
118 function mainboards
119 {
120         # make this a function so we can easily select
121         # without breaking readability
122         
123         VENDOR=$1
124         
125         ls -1 $ROOT/src/mainboard/$VENDOR | grep -v Kconfig
126 }
127
128 function architecture
129 {
130         VENDOR=$1
131         MAINBOARD=$2
132         ARCH=`cat $ROOT/src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \
133                 grep "select ARCH_"|cut -f2- -d_`
134         echo $ARCH | sed s/X86/i386/
135 }
136
137 function create_config
138 {
139         VENDOR=$1
140         MAINBOARD=$2
141         CONFIG=$3
142
143         build_dir=$TARGET/${VENDOR}_${MAINBOARD}
144
145         # get a working payload for the board if we have one.
146         # the --payload option expects a directory containing 
147         # a shell script payload.sh
148         #   Usage: payload.sh [VENDOR] [DEVICE]
149         # the script returns an absolute path to the payload binary.
150
151         if [ -f $payloads/payload.sh ]; then
152                 PAYLOAD=`sh $payloads/payload.sh $VENDOR $MAINBOARD`
153                 printf "Using payload $PAYLOAD\n"
154         fi
155
156         [ "$update" = "true" ] && mv ${build_dir}/coreboot.rom coreboot.rom.tmp
157         $MAKE distclean obj=${build_dir}
158         mkdir -p ${build_dir}
159         [ "$update" = "true" ] && mv coreboot.rom.tmp ${build_dir}/coreboot.rom
160
161         if [ "$CONFIG" != "" ]; then
162                 printf "  Using existing configuration $CONFIG ... "
163                 xml "  <config>$CONFIG</config>"
164                 cp $CONFIG .config
165         else
166                 printf "  Creating config file... "
167                 xml "  <config>autogenerated</config>"
168                 grep "depends[\t ]on[\t ]*VENDOR" src/mainboard/$VENDOR/$MAINBOARD/../Kconfig | \
169                         sed "s,^.*\(VENDOR_.*\)[^A-Z0-9_]*,CONFIG_\1=y," > .config
170                 grep "config[\t ]*BOARD" src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \
171                         sed "s,^.*\(BOARD_.*\)[^A-Z0-9_]*,CONFIG_\1=y," >> .config
172                 grep "select[\t ]*ARCH" src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \
173                         sed "s,^.*\(ARCH_.*\)[^A-Z0-9_]*,CONFIG_\1=y," >> .config
174                 echo "CONFIG_MAINBOARD_DIR=\"$VENDOR/$MAINBOARD\"" >> .config
175                 echo "CONFIG_CBFS_PREFIX=\"$cbfs_prefix\"" >> .config
176                 if [ "$PAYLOAD" != "/dev/null" ]; then
177                         echo "# CONFIG_PAYLOAD_NONE is not set" >> .config
178                         echo "CONFIG_PAYLOAD_ELF=y" >> .config
179                         echo "CONFIG_FALLBACK_PAYLOAD_FILE=\"$PAYLOAD\"" >> .config
180                 fi
181
182                 if [ "$loglevel" != "default" ]; then
183                         printf "(loglevel override) "
184                         echo "CONFIG_MAXIMUM_CONSOLE_LOGLEVEL_$loglevel=y" >> .config
185                         echo "CONFIG_MAXIMUM_CONSOLE_LOGLEVEL=$loglevel" >> .config
186                         echo "CONFIG_DEFAULT_CONSOLE_LOGLEVEL_$loglevel=y" >> .config
187                         echo "CONFIG_DEFAULT_CONSOLE_LOGLEVEL=$loglevel" >> .config
188                 fi
189
190                 if [ "$update" != "false" ]; then
191                         printf "(update) "
192                         echo "CONFIG_UPDATE_IMAGE=y" >> .config
193                 fi
194
195                 if [ "$ccache" = "true" ]; then
196                         printf "(ccache enabled) "
197                         echo "CONFIG_CCACHE=y" >> .config
198                 fi
199
200                 if [ "$scanbuild" = "true" ]; then
201                         printf "(scan-build enabled) "
202                         echo "CONFIG_SCANBUILD_ENABLE=y" >> .config
203                         echo "CONFIG_SCANBUILD_REPORT_LOCATION=\"$TARGET/scan-build-results-tmp\"" >> .config
204                 fi
205         fi
206
207         #yes "" | $MAKE oldconfig -j $cpus obj=${build_dir} &> ${build_dir}/config.log
208         yes "" | $MAKE oldconfig obj=${build_dir} &> ${build_dir}/config.log
209         ret=$?
210         mv .config.old $TARGET/${VENDOR}_${MAINBOARD}/config.in
211         if [ $ret -eq 0 ]; then
212                 printf "ok; "
213                 xml "  <builddir>ok</builddir>"
214                 xml "  <log>"
215                 xmlfile $build_dir/config.log
216                 xml "  </log>"
217                 xml ""
218                 return 0
219         else
220                 # Does this ever happen?
221                 printf "FAILED!\nLog excerpt:\n"
222                 xml "  <builddir>failed</builddir>"
223                 xml "  <log>"
224                 xmlfile $build_dir/config.log
225                 xml "  </log>"
226                 xml ""
227                 tail -n $CONTEXT $build_dir/config.log 2> /dev/null || tail -$CONTEXT $build_dir/config.log
228                 return 1
229         fi
230 }
231
232 function create_buildenv
233 {
234         VENDOR=$1
235         MAINBOARD=$2
236         CONFIG=$3
237
238         create_config $VENDOR $MAINBOARD $CONFIG
239         ret=$?
240
241         # Allow simple "make" in the target directory
242         MAKEFILE=$TARGET/${VENDOR}_${MAINBOARD}/Makefile
243         echo "# autogenerated makefile" > $MAKEFILE
244         echo "TOP=$ROOT" >> $MAKEFILE
245         echo "OUT=$TARGET/${VENDOR}_${MAINBOARD}" >> $MAKEFILE
246         echo "all:" >> $MAKEFILE
247         echo "  cp config.build \$(TOP)/.config" >> $MAKEFILE
248         echo "  cd \$(TOP); \$(MAKE) oldconfig obj=\$(OUT)" >> $MAKEFILE
249         echo "  cd \$(TOP); \$(MAKE) obj=\$(OUT)" >> $MAKEFILE
250
251         return $ret
252 }
253
254 function compile_target
255 {       
256         VENDOR=$1
257         MAINBOARD=$2
258
259         printf " Compiling image "
260         test "$cpus" == "" && printf "in parallel .. "
261         test "$cpus" == "1" && printf "on 1 cpu .. "
262         test 0$cpus -gt 1 && printf "on %d cpus in parallel .. " $cpus
263
264         CURR=$( pwd )
265         #stime=`perl -e 'print time();' 2>/dev/null || date +%s`
266         build_dir=$TARGET/${VENDOR}_${MAINBOARD}
267         eval $MAKE $silent -j $cpus obj=${build_dir} \
268                 &> ${build_dir}/make.log
269         ret=$?
270         mv .config ${build_dir}/config.build
271         mv .xcompile ${build_dir}/xcompile.build
272         cd $TARGET/${VENDOR}_${MAINBOARD}
273
274         etime=`perl -e 'print time();' 2>/dev/null || date +%s`
275         duration=$(( $etime - $stime ))
276         xml "  <buildtime>${duration}s</buildtime>"
277
278         xml "  <log>"
279         xmlfile make.log
280         xml "  </log>"
281
282         if [ $ret -eq 0 ]; then
283                 xml "  <compile>ok</compile>"
284                 printf "ok\n" > compile.status
285                 printf "ok. (took ${duration}s)\n"
286                 cd $CURR
287                 return 0
288         else
289                 xml "  <compile>failed</compile>"
290                 printf "FAILED after ${duration}s!\nLog excerpt:\n"
291                 tail -n $CONTEXT make.log 2> /dev/null || tail -$CONTEXT make.log
292                 cd $CURR
293                 return 1
294         fi
295 }
296
297 function built_successfully
298 {
299         CURR=`pwd`
300         status="fail"
301         if [ -d "$TARGET/${VENDOR}_${MAINBOARD}" ]; then
302                 cd $TARGET/${VENDOR}_${MAINBOARD}
303                 if [ -r compile.status ] ; then
304                         status=`cat compile.status`
305                 fi
306                 cd $CURR
307         fi
308         [ "$buildall" != "true" -a "$status" == "ok" ]
309 }
310
311 function build_broken
312 {
313         CURR=`pwd`
314         status="yes"
315         [ -r "$ROOT/src/mainboard/${VENDOR}/${MAINBOARD}/BROKEN" ] && status="no"
316         [ "$buildbroken" == "true" -o "$status" == "yes" ]
317 }
318
319 function build_target
320 {
321         VENDOR=$1
322         MAINBOARD=$2
323         CONFIG=$3
324         TARCH=$( architecture $VENDOR $MAINBOARD )
325
326         # Allow architecture override in an abuild.info file.
327         # This is used for the Motorola Sandpoint, which is not a real target
328         # but a skeleton target for the Sandpoint X3.
329         [ -r "$ROOT/src/mainboard/${VENDOR}/${MAINBOARD}/abuild.info" ] && \
330                 source $ROOT/src/mainboard/${VENDOR}/${MAINBOARD}/abuild.info
331
332         # default setting
333
334         CC="${CROSS_COMPILE}gcc"
335         CROSS_COMPILE=""
336         found_crosscompiler=false
337         if which $TARCH-elf-gcc 2>/dev/null >/dev/null; then
338                 # i386-elf target needs --divide, for i386-linux, that's the default
339                 if [ "$TARCH" = "i386" ]; then
340                         CC="$CC -Wa,--divide"
341                 fi
342                 CROSS_COMPILE="$TARCH-elf-"
343                 CC=gcc
344                 CROSS_TEXT=", using $CROSS_COMPILE$CC"
345                 found_crosscompiler=true
346         fi
347
348         HOSTCC='gcc'
349
350         printf "Building $VENDOR/$MAINBOARD; "
351
352         xml "<mainboard>"
353         xml ""
354         xml "  <vendor>$VENDOR</vendor>"
355         xml "  <device>$MAINBOARD</device>"
356         xml ""
357         xml "  <architecture>$TARCH</architecture>"
358         xml ""
359
360         if [ "$ARCH" = "$TARCH" -o $found_crosscompiler = true ]; then
361                 printf "$TARCH: ok$CROSS_TEXT\n"
362         else
363                 # FIXME this is basically the same as above.
364                 found_crosscompiler=false
365                 if [ "$ARCH" == amd64 -a "$TARCH" == i386 ]; then
366                         CC="gcc -m32"
367                         found_crosscompiler=true
368                 fi
369                 if [ "$ARCH" == ppc64 -a "$TARCH" == ppc ]; then
370                         CC="gcc -m32"
371                         found_crosscompiler=true
372                 fi
373                 if [ "$found_crosscompiler" == "false" -a "$TARCH" == ppc ];then
374                         for prefix in powerpc-eabi- powerpc-linux- ppc_74xx- \
375                             powerpc-7450-linux-gnu- powerpc-elf-; do
376                                 if ${prefix}gcc --version > /dev/null 2> /dev/null ; then
377                                         found_crosscompiler=true
378                                         CROSS_COMPILE=$prefix
379                                 fi
380                         done
381                 fi
382
383         
384                 # TBD: look for suitable cross compiler suite
385                 # cross-$TARCH-gcc and cross-$TARCH-ld
386                 
387                 # Check result:
388                 if [ $found_crosscompiler == "false" ]; then
389                         printf "$TARCH: skipped, we're $ARCH\n\n"
390                         xml "  <status>notbuilt</status>"
391                         xml ""
392                         xml "</mainboard>"
393                 
394                         return 0
395                 else
396                         printf "$TARCH: ok, $ARCH using ${CROSS_COMPILE}gcc\n"
397                         xml "  <compiler>"
398                         xml "    <path>`which ${CROSS_COMPILE}gcc`</path>"
399                         xml "    <version>`${CROSS_COMPILE}gcc --version | head -1`</version>"
400                         xml "  </compiler>"
401                         xml ""
402                 fi
403         fi
404
405         CC=${CROSS_COMPILE}$CC
406
407         if  [ "$stackprotect" = "true" ]; then
408                 CC="$CC -fno-stack-protector"
409         fi
410
411         built_successfully $VENDOR $MAINBOARD && test $update = "false" && \
412         {
413                 printf " ( mainboard/$VENDOR/$MAINBOARD previously ok )\n\n"
414                 xml "  <status>previouslyok</status>"
415                 xml ""
416                 xml "</mainboard>"
417                 return 0
418         }
419
420         build_broken $VENDOR $MAINBOARD || \
421         {
422                 printf " ( broken mainboard/$VENDOR/$MAINBOARD skipped )\n\n"
423                 xml "  <status>knownbroken</status>"
424                 xml ""
425                 xml "</mainboard>"
426                 return 0
427         }
428         
429         stime=`perl -e 'print time();' 2>/dev/null || date +%s`
430         create_buildenv $VENDOR $MAINBOARD $CONFIG
431         if [ $? -eq 0  -a  $configureonly -eq 0 ]; then
432                 compile_target $VENDOR $MAINBOARD && 
433                         xml "  <status>ok</status>" ||
434                         xml "<status>broken</status>"
435                 if [ "$scanbuild" = "true" ]; then
436                         mv `dirname $TARGET/scan-build-results-tmp/*/index.html` $TARGET/${VENDOR}_${MAINBOARD}-scanbuild
437                         MAKE=$origMAKE
438                 fi
439         fi
440         # Not calculated here because we still print it in compile_target
441         #etime=`perl -e 'print time();' 2>/dev/null || date +%s`
442         #duration=$(( $etime - $stime ))
443         #xml "  <buildtime>${duration}s</buildtime>"
444
445         xml ""
446         xml "</mainboard>"
447
448         printf "\n"
449 }
450
451 function test_target
452 {
453         VENDOR=$1
454         MAINBOARD=$2
455
456         if [ "$hwtest" != "true" ]; then
457                 return 0
458         fi
459
460         # image does not exist. we silently skip the patch.
461         if [ ! -r "$TARGET/${VENDOR}_${MAINBOARD}/coreboot.rom" ]; then
462                 return 0
463         fi
464
465         which curl &> /dev/null
466         if [ $? != 0 ]; then
467                 printf "curl is not installed but required for test submission.  skipping test.\n\n"
468                 return 0
469         fi
470
471         CURR=`pwd`
472         if [ -r "$TARGET/${VENDOR}_${MAINBOARD}/tested" ]; then
473                 printf "Testing image for board $VENDOR $MAINBOARD skipped (previously submitted).\n\n"
474                 return 0
475         fi
476         # touch $TARGET/${VENDOR}_${MAINBOARD}/tested
477
478         printf "Submitting image for board $VENDOR $MAINBOARD to test system...\n"
479
480         curl -f -F "romfile=@$TARGET/${VENDOR}_${MAINBOARD}/coreboot.rom" \
481                 -F "mode=abuild" -F "mainboard=${VENDOR}_${MAINBOARD}" -F "submit=Upload" \
482                 "http://qa.coreboot.org/deployment/send.php"
483
484         printf "\n"
485         return 0
486 }
487
488 function remove_target
489 {
490         if [ "$remove" != "true" ]; then
491                 return 0
492         fi
493
494         VENDOR=$1
495         MAINBOARD=$2
496
497         # Save the generated coreboot.rom file of each board.
498         if [ -r "$TARGET/${VENDOR}_${MAINBOARD}/coreboot.rom" ]; then
499                 cp $TARGET/${VENDOR}_${MAINBOARD}/coreboot.rom \
500                    ${VENDOR}_${MAINBOARD}_coreboot.rom
501         fi
502
503         printf "Removing build dir for board $VENDOR $MAINBOARD...\n"
504         rm -rf $TARGET/${VENDOR}_${MAINBOARD}
505
506         return 0
507 }
508
509 function myhelp
510 {
511         printf "Usage: $0 [-v] [-a] [-b] [-r] [-t <vendor/board>] [-p <dir>] [lbroot]\n"
512         printf "       $0 [-V|--version]\n"
513         printf "       $0 [-h|--help]\n\n"
514
515         printf "Options:\n"
516         printf "    [-v|--verbose]                print more messages\n"
517         printf "    [-a|--all]                    build previously succeeded ports as well\n"
518         printf "    [-b|--broken]                 attempt to build ports that are known broken\n"
519         printf "    [-r|--remove]                 remove output dir after build\n"
520         printf "    [-t|--target <vendor/board>]  attempt to build target vendor/board only\n"
521         printf "    [-p|--payloads <dir>]         use payloads in <dir> to build images\n"
522         printf "    [-V|--version]                print version number and exit\n"
523         printf "    [-h|--help]                   print this help and exit\n"
524         printf "    [-x|--xml]                    write xml log file \n"
525         printf "                                  (defaults to $XMLFILE)\n"
526         printf "    [-T|--test]                   submit image(s) to automated test system\n"
527         printf "    [-c|--cpus <numcpus>]         build on <numcpus> at the same time\n"
528         printf "    [-s|--silent]                 omit compiler calls in logs\n"
529         printf "    [-ns|--nostackprotect]        use gcc -fno-stack-protector option\n"
530         printf "    [-sb|--scan-build]            use clang's static analyzer\n"
531         printf "    [-y|--ccache]                 use ccache\n"
532         printf "    [-C|--config]                 configure-only mode\n"
533         printf "    [-l|--loglevel <num>]         set loglevel\n"
534         printf "    [-u|--update]                 update existing image\n"
535         printf "    [-P|--prefix <name>]          file name prefix in CBFS\n"
536         printf "    [lbroot]                      absolute path to coreboot sources\n"
537         printf "                                  (defaults to $ROOT)\n\n"
538 }
539
540 function myversion 
541 {
542         cat << EOF
543
544 coreboot autobuild v$ABUILD_VERSION ($ABUILD_DATE)
545
546 Copyright (C) 2004 by Stefan Reinauer <stepan@openbios.org>
547 Copyright (C) 2006-2010 by coresystems GmbH <info@coresystems.de>
548
549 This program is free software; you may redistribute it under the terms
550 of the GNU General Public License. This program has absolutely no
551 warranty.
552
553 EOF
554 }
555
556 # default options
557 target=""
558 buildall=false
559 verbose=false
560
561 test -f util/sconfig/config.g && ROOT=$( pwd )
562 test -f ../util/sconfig/config.g && ROOT=$( cd ..; pwd )
563 test "$ROOT" = "" && ROOT=$( cd ../..; pwd )
564
565 # parse parameters.. try to find out whether we're running GNU getopt
566 getoptbrand="`getopt -V`"
567 if [ "${getoptbrand:0:6}" == "getopt" ]; then
568         # Detected GNU getopt that supports long options.
569         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 -- "$@"`
570         eval set "$args"
571 else
572         # Detected non-GNU getopt
573         args=`getopt Vvhat:bp:Tc:sxCl:rP:uy $*`
574         set -- $args
575 fi
576
577 if [ $? != 0 ]; then
578         myhelp
579         exit 1
580 fi
581
582 while true ; do
583         case "$1" in
584                 -x|--xml)       shift; mode=xml; rm -f $XMLFILE ;;
585                 -t|--target)    shift; target="$1"; shift;;
586                 -a|--all)       shift; buildall=true;;
587                 -b|--broken)    shift; buildbroken=true;;
588                 -r|--remove)    shift; remove=true; shift;;
589                 -v|--verbose)   shift; verbose=true; silent='V=1';;
590                 -V|--version)   shift; myversion; exit 0;;
591                 -h|--help)      shift; myversion; myhelp; exit 0;;
592                 -p|--payloads)  shift; payloads="$1"; shift;;
593                 -T|--test)      shift; hwtest=true;;
594                 -c|--cpus)      shift; cpus="$1"; test "$cpus" == "max" && cpus=""; shift;;
595                 -s|--silent)    shift; silent="-s";;
596                 -ns|--nostackprotect) shift; stackprotect=true;;
597                 -sb|--scan-build) shift; scanbuild=true;;
598                 -y|--ccache)    shift; ccache=true;;
599                 -C|--config)    shift; configureonly=1;;
600                 -l|--loglevel)  shift; loglevel="$1"; shift;;
601                 -u|--update)    shift; update="true";;
602                 -P|--prefix)    shift; cbfs_prefix="$1"; shift;;
603                 --)             shift; break;;
604                 -*)             printf "Invalid option\n\n"; myhelp; exit 1;;
605                 *)              break;;
606         esac
607 done
608
609 # /path/to/freebios2/
610 test -z "$1" || ROOT=$1
611
612 debug "ROOT=$ROOT"
613
614 xml '<?xml version="1.0" encoding="utf-8"?>'
615 xml '<abuild>'
616
617 if [ "$target" != "" ]; then
618         # build a single board
619         VENDOR=`printf $target|cut -f1 -d/`
620         MAINBOARD=`printf $target|cut -f2 -d/`
621         CONFIG=`printf $target|cut -f3 -d/`
622         if [ ! -r $ROOT/src/mainboard/$target ]; then
623                 printf "No such target: $target\n"
624                 xml '</abuild>'
625                 exit 1
626         fi
627         build_target $VENDOR $MAINBOARD $CONFIG
628         test_target $VENDOR $MAINBOARD
629 else
630         # build all boards per default
631         for VENDOR in $( vendors ); do
632                 for MAINBOARD in $( mainboards $VENDOR ); do
633                         build_target $VENDOR $MAINBOARD
634                         test_target $VENDOR $MAINBOARD
635                         remove_target $VENDOR $MAINBOARD
636                 done
637         done
638 fi
639 xml '</abuild>'
640