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