]>
git.ipfire.org Git - people/ms/u-boot.git/blob - MAKEALL
3 # Tool mainly for U-Boot Quality Assurance: build one or more board
4 # configurations with minimal verbosity, showing only warnings and
7 # There are several ways to select which boards to build.
9 # Traditionally, architecture names (like "powerpc"), CPU family names
10 # (like "mpc83xx") or board names can be specified on the command
11 # line; without any arguments, MAKEALL defaults to building all Power
12 # Architecture systems (i. e. same as for "MAKEALL powerpc").
14 # With the introduction of the board.cfg file, it has become possible
15 # to provide additional selections. We use standard command line
18 # -a or --arch : Select architecture
19 # -c or --cpu : Select CPU family
20 # -s or --soc : Select SoC type
21 # -v or --vendor: Select board vendor
23 # Selections by these options are logically ANDed; if the same option
24 # is used repeatedly, such selections are ORed. So "-v FOO -v BAR"
25 # will select all configurations where the vendor is either FOO or
26 # BAR. Any additional arguments specified on the command line are
27 # always build additionally.
31 # - build all Power Architecture boards:
35 # MAKEALL --arch powerpc
39 # - build all PowerPC boards manufactured by vendor "esd":
41 # MAKEALL -a powerpc -v esd
43 # - build all PowerPC boards manufactured either by "keymile" or
46 # MAKEALL -a powerpc -v keymile -v siemens
48 # - build all Freescale boards with MPC83xx CPUs, plus all 4xx boards:
50 # MAKEALL -c mpc83xx -v freescale 4xx
52 #########################################################################
55 LONG_OPTS
="arch:,cpu:,vendor:,soc:"
57 # Option processing based on util-linux-2.13/getopt-parse.bash
59 # Note that we use `"$@"' to let each command-line parameter expand to a
60 # separate word. The quotes around `$@' are essential!
61 # We need TEMP as the `eval set --' would nuke the return value of
63 TEMP
=`getopt -o ${SHORT_OPTS} --long ${LONG_OPTS} \
66 if [ $?
!= 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
68 # Note the quotes around `$TEMP': they are essential!
76 # echo "Option ARCH: argument \`$2'"
77 if [ "$opt_a" ] ; then
78 opt_a
="${opt_a%)} || \$2 == \"$2\")"
80 opt_a
="(\$2 == \"$2\")"
85 # echo "Option CPU: argument \`$2'"
86 if [ "$opt_c" ] ; then
87 opt_c
="${opt_c%)} || \$3 == \"$2\")"
89 opt_c
="(\$3 == \"$2\")"
94 # echo "Option SoC: argument \`$2'"
95 if [ "$opt_s" ] ; then
96 opt_s
="${opt_s%)} || \$6 == \"$2\")"
98 opt_s
="(\$6 == \"$2\")"
103 # echo "Option VENDOR: argument \`$2'"
104 if [ "$opt_v" ] ; then
105 opt_v
="${opt_v%)} || \$5 == \"$2\")"
107 opt_v
="(\$5 == \"$2\")"
114 echo "Internal error!" >&2 ; exit 1 ;;
117 # echo "Remaining arguments:"
118 # for arg do echo '--> '"\`$arg'" ; done
121 [ "$opt_a" ] && FILTER
="${FILTER} && $opt_a"
122 [ "$opt_c" ] && FILTER
="${FILTER} && $opt_c"
123 [ "$opt_s" ] && FILTER
="${FILTER} && $opt_s"
124 [ "$opt_v" ] && FILTER
="${FILTER} && $opt_v"
126 if [ "$SELECTED" ] ; then
127 SELECTED
=$
(awk '('"$FILTER"') { print $1 }' boards.cfg
)
129 # Make sure some boards from boards.cfg are actually found
130 if [ -z "$SELECTED" ] ; then
131 echo "Error: No boards selected, invalid arguments"
136 #########################################################################
138 # Print statistics when we exit
142 # Determine number of CPU cores if no default was set
143 : ${BUILD_NCPUS:="`getconf _NPROCESSORS_ONLN`"}
145 if [ "$BUILD_NCPUS" -gt 1 ]
147 JOBS
="-j $((BUILD_NCPUS + 1))"
153 if [ "${CROSS_COMPILE}" ] ; then
154 MAKE
="make CROSS_COMPILE=${CROSS_COMPILE}"
159 if [ "${MAKEALL_LOGDIR}" ] ; then
160 LOG_DIR
=${MAKEALL_LOGDIR}
165 if [ ! "${BUILD_DIR}" ] ; then
169 [ -d ${LOG_DIR} ] || mkdir
${LOG_DIR} ||
exit 1
173 # Keep track of the number of builds and errors
179 # Helper funcs for parsing boards.cfg
185 '($1 !~ /^#/ && $field == select) { print $1 }' \
188 boards_by_arch
() { boards_by_field
2 "$@" ; }
189 boards_by_cpu
() { boards_by_field
3 "$@" ; }
190 boards_by_soc
() { boards_by_field
6 "$@" ; }
192 #########################################################################
194 #########################################################################
196 LIST_5xx
="$(boards_by_cpu mpc5xx)"
198 #########################################################################
200 #########################################################################
202 LIST_5xxx
="$(boards_by_cpu mpc5xxx)"
204 #########################################################################
206 #########################################################################
208 LIST_512x
="$(boards_by_cpu mpc512x)"
210 #########################################################################
212 #########################################################################
214 LIST_8xx
="$(boards_by_cpu mpc8xx)"
216 #########################################################################
218 #########################################################################
220 LIST_4xx
="$(boards_by_cpu ppc4xx)"
222 #########################################################################
224 #########################################################################
226 LIST_8220
="$(boards_by_cpu mpc8220)"
228 #########################################################################
230 #########################################################################
232 LIST_824x
="$(boards_by_cpu mpc824x)"
234 #########################################################################
235 ## MPC8260 Systems (includes 8250, 8255 etc.)
236 #########################################################################
238 LIST_8260
="$(boards_by_cpu mpc8260)"
240 #########################################################################
241 ## MPC83xx Systems (includes 8349, etc.)
242 #########################################################################
244 LIST_83xx
="$(boards_by_cpu mpc83xx)"
246 #########################################################################
247 ## MPC85xx Systems (includes 8540, 8560 etc.)
248 #########################################################################
250 LIST_85xx
="$(boards_by_cpu mpc85xx)"
252 #########################################################################
254 #########################################################################
256 LIST_86xx
="$(boards_by_cpu mpc86xx)"
258 #########################################################################
260 #########################################################################
262 LIST_74xx_7xx
="$(boards_by_cpu 74xx_7xx)"
264 #########################################################################
266 #########################################################################
289 # Alias "ppc" -> "powerpc" to not break compatibility with older scripts
290 # still using "ppc" instead of "powerpc"
295 #########################################################################
297 #########################################################################
299 LIST_SA
="$(boards_by_cpu sa1100)"
301 #########################################################################
303 #########################################################################
319 #########################################################################
321 #########################################################################
386 davinci_dm355leopard \
391 #########################################################################
393 #########################################################################
399 #########################################################################
401 #########################################################################
417 #########################################################################
419 #########################################################################
440 #########################################################################
442 #########################################################################
444 LIST_at91
="$(boards_by_soc at91)\
445 $(boards_by_soc at91rm9200)\
462 #########################################################################
464 #########################################################################
466 LIST_pxa
="$(boards_by_cpu pxa)"
468 LIST_ixp
="$(boards_by_cpu ixp)
473 #########################################################################
475 #########################################################################
489 #########################################################################
490 ## MIPS Systems (default = big endian)
491 #########################################################################
498 vct_platinum_onenand \
499 vct_platinum_onenand_small \
501 vct_platinumavc_small \
502 vct_platinumavc_onenand \
503 vct_platinumavc_onenand_small \
506 vct_premium_onenand \
507 vct_premium_onenand_small \
529 #########################################################################
530 ## MIPS Systems (little endian)
531 #########################################################################
548 #########################################################################
550 #########################################################################
552 LIST_x86
="$(boards_by_arch i386)"
554 #########################################################################
556 #########################################################################
558 LIST_nios2
="$(boards_by_arch nios2)
562 #########################################################################
563 ## MicroBlaze Systems
564 #########################################################################
566 LIST_microblaze
="$(boards_by_arch microblaze)"
568 #########################################################################
570 #########################################################################
572 LIST_coldfire
="$(boards_by_arch m68k)
576 EB+MCF-EV123_internal \
587 #########################################################################
589 #########################################################################
591 LIST_avr32
="$(boards_by_arch avr32)"
593 #########################################################################
595 #########################################################################
597 LIST_blackfin
="$(boards_by_arch blackfin)"
599 #########################################################################
601 #########################################################################
603 LIST_sh2
="$(boards_by_cpu sh2)"
604 LIST_sh3
="$(boards_by_cpu sh3)"
605 LIST_sh4
="$(boards_by_cpu sh4)"
607 LIST_sh
="$(boards_by_arch sh)"
609 #########################################################################
611 #########################################################################
613 LIST_sparc
="$(boards_by_arch sparc)"
615 #-----------------------------------------------------------------------
620 ${MAKE} distclean
>/dev
/null
621 ${MAKE} -s ${target}_config
623 ${MAKE} ${JOBS} all 2>&1 >${LOG_DIR}/$target.MAKELOG \
624 |
tee ${LOG_DIR}/$target.ERR
626 # Check for 'make' errors
627 if [ ${PIPESTATUS[0]} -ne 0 ] ; then
631 if [ -s ${LOG_DIR}/$target.ERR
] ; then
632 ERR_CNT
=$
((ERR_CNT
+ 1))
633 ERR_LIST
="${ERR_LIST} $target"
635 rm ${LOG_DIR}/$target.ERR
638 TOTAL_CNT
=$
((TOTAL_CNT
+ 1))
640 ${CROSS_COMPILE}size
${BUILD_DIR}/u-boot \
641 |
tee -a ${LOG_DIR}/$target.MAKELOG
645 # If a LIST_xxx var exists, use it. But avoid variable
646 # expansion in the eval when a board name contains certain
647 # characters that the shell interprets.
650 *) list
=$
(eval echo '${LIST_'$t'}') ;;
652 if [ -n "${list}" ] ; then
653 build_targets
${list}
660 #-----------------------------------------------------------------------
664 echo "--------------------- SUMMARY ----------------------------"
665 echo "Boards compiled: ${TOTAL_CNT}"
666 if [ ${ERR_CNT} -gt 0 ] ; then
667 echo "Boards with warnings or errors: ${ERR_CNT} (${ERR_LIST} )"
669 echo "----------------------------------------------------------"
674 #-----------------------------------------------------------------------
676 # Build target groups selected by options, plus any command line args
677 set -- ${SELECTED} "$@"
678 # run PowerPC by default
679 [ $# = 0 ] && set -- powerpc