]>
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 "$@" ; }
191 #########################################################################
193 #########################################################################
195 LIST_5xx
="$(boards_by_cpu mpc5xx)"
197 #########################################################################
199 #########################################################################
201 LIST_5xxx
="$(boards_by_cpu mpc5xxx)"
203 #########################################################################
205 #########################################################################
207 LIST_512x
="$(boards_by_cpu mpc512x)"
209 #########################################################################
211 #########################################################################
213 LIST_8xx
="$(boards_by_cpu mpc8xx)"
215 #########################################################################
217 #########################################################################
219 LIST_4xx
="$(boards_by_cpu ppc4xx)"
221 #########################################################################
223 #########################################################################
225 LIST_8220
="$(boards_by_cpu mpc8220)"
227 #########################################################################
229 #########################################################################
231 LIST_824x
="$(boards_by_cpu mpc824x)"
233 #########################################################################
234 ## MPC8260 Systems (includes 8250, 8255 etc.)
235 #########################################################################
237 LIST_8260
="$(boards_by_cpu mpc8260)"
239 #########################################################################
240 ## MPC83xx Systems (includes 8349, etc.)
241 #########################################################################
243 LIST_83xx
="$(boards_by_cpu mpc83xx)"
245 #########################################################################
246 ## MPC85xx Systems (includes 8540, 8560 etc.)
247 #########################################################################
249 LIST_85xx
="$(boards_by_cpu mpc85xx)"
251 #########################################################################
253 #########################################################################
255 LIST_86xx
="$(boards_by_cpu mpc86xx)"
257 #########################################################################
259 #########################################################################
261 LIST_74xx_7xx
="$(boards_by_cpu 74xx_7xx)"
263 #########################################################################
265 #########################################################################
288 # Alias "ppc" -> "powerpc" to not break compatibility with older scripts
289 # still using "ppc" instead of "powerpc"
294 #########################################################################
296 #########################################################################
298 LIST_SA
="$(boards_by_cpu sa1100)"
300 #########################################################################
302 #########################################################################
318 #########################################################################
320 #########################################################################
384 davinci_dm355leopard \
389 #########################################################################
391 #########################################################################
397 #########################################################################
399 #########################################################################
415 #########################################################################
417 #########################################################################
438 #########################################################################
440 #########################################################################
473 #########################################################################
475 #########################################################################
477 LIST_pxa
="$(boards_by_cpu pxa)"
479 LIST_ixp
="$(boards_by_cpu ixp)
484 #########################################################################
486 #########################################################################
500 #########################################################################
501 ## MIPS Systems (default = big endian)
502 #########################################################################
509 vct_platinum_onenand \
510 vct_platinum_onenand_small \
512 vct_platinumavc_small \
513 vct_platinumavc_onenand \
514 vct_platinumavc_onenand_small \
517 vct_premium_onenand \
518 vct_premium_onenand_small \
540 #########################################################################
541 ## MIPS Systems (little endian)
542 #########################################################################
559 #########################################################################
561 #########################################################################
563 LIST_x86
="$(boards_by_arch i386)"
565 #########################################################################
567 #########################################################################
569 LIST_nios2
="$(boards_by_arch nios2)
573 #########################################################################
574 ## MicroBlaze Systems
575 #########################################################################
577 LIST_microblaze
="$(boards_by_arch microblaze)"
579 #########################################################################
581 #########################################################################
583 LIST_coldfire
="$(boards_by_arch m68k)
587 EB+MCF-EV123_internal \
598 #########################################################################
600 #########################################################################
602 LIST_avr32
="$(boards_by_arch avr32)"
604 #########################################################################
606 #########################################################################
608 LIST_blackfin
="$(boards_by_arch blackfin)"
610 #########################################################################
612 #########################################################################
614 LIST_sh2
="$(boards_by_cpu sh2)"
615 LIST_sh3
="$(boards_by_cpu sh3)"
616 LIST_sh4
="$(boards_by_cpu sh4)"
618 LIST_sh
="$(boards_by_arch sh)"
620 #########################################################################
622 #########################################################################
624 LIST_sparc
="$(boards_by_arch sparc)"
626 #-----------------------------------------------------------------------
631 ${MAKE} distclean
>/dev
/null
632 ${MAKE} -s ${target}_config
634 ${MAKE} ${JOBS} all 2>&1 >${LOG_DIR}/$target.MAKELOG \
635 |
tee ${LOG_DIR}/$target.ERR
637 # Check for 'make' errors
638 if [ ${PIPESTATUS[0]} -ne 0 ] ; then
642 if [ -s ${LOG_DIR}/$target.ERR
] ; then
643 ERR_CNT
=$
((ERR_CNT
+ 1))
644 ERR_LIST
="${ERR_LIST} $target"
646 rm ${LOG_DIR}/$target.ERR
649 TOTAL_CNT
=$
((TOTAL_CNT
+ 1))
651 ${CROSS_COMPILE}size
${BUILD_DIR}/u-boot \
652 |
tee -a ${LOG_DIR}/$target.MAKELOG
656 # If a LIST_xxx var exists, use it. But avoid variable
657 # expansion in the eval when a board name contains certain
658 # characters that the shell interprets.
661 *) list
=$
(eval echo '${LIST_'$t'}') ;;
663 if [ -n "${list}" ] ; then
664 build_targets
${list}
671 #-----------------------------------------------------------------------
675 echo "--------------------- SUMMARY ----------------------------"
676 echo "Boards compiled: ${TOTAL_CNT}"
677 if [ ${ERR_CNT} -gt 0 ] ; then
678 echo "Boards with warnings or errors: ${ERR_CNT} (${ERR_LIST} )"
680 echo "----------------------------------------------------------"
685 #-----------------------------------------------------------------------
687 # Build target groups selected by options, plus any command line args
688 set -- ${SELECTED} "$@"
689 # run PowerPC by default
690 [ $# = 0 ] && set -- powerpc