3 # Print statistics when we exit
7 # Determine number of CPU cores if no default was set
8 : ${BUILD_NCPUS:="`getconf _NPROCESSORS_ONLN`"}
10 if [ "$BUILD_NCPUS" -gt 1 ]
12 JOBS="-j $((BUILD_NCPUS + 1))"
18 if [ "${CROSS_COMPILE}" ] ; then
19 MAKE="make CROSS_COMPILE=${CROSS_COMPILE}"
24 if [ "${MAKEALL_LOGDIR}" ] ; then
25 LOG_DIR=${MAKEALL_LOGDIR}
30 if [ ! "${BUILD_DIR}" ] ; then
34 [ -d ${LOG_DIR} ] || mkdir ${LOG_DIR} || exit 1
38 # Keep track of the number of builds and errors
44 # Helper funcs for parsing boards.cfg
50 '($1 !~ /^#/ && $field == select) { print $1 }' \
53 boards_by_arch() { boards_by_field 2 "$@" ; }
54 boards_by_cpu() { boards_by_field 3 "$@" ; }
56 #########################################################################
58 #########################################################################
60 LIST_5xx="$(boards_by_cpu mpc5xx)"
62 #########################################################################
64 #########################################################################
66 LIST_5xxx="$(boards_by_cpu mpc5xxx)"
68 #########################################################################
70 #########################################################################
72 LIST_512x="$(boards_by_cpu mpc512x)"
74 #########################################################################
76 #########################################################################
78 LIST_8xx="$(boards_by_cpu mpc8xx)"
80 #########################################################################
82 #########################################################################
84 LIST_4xx="$(boards_by_cpu ppc4xx)"
86 #########################################################################
88 #########################################################################
90 LIST_8220="$(boards_by_cpu mpc8220)"
92 #########################################################################
94 #########################################################################
96 LIST_824x="$(boards_by_cpu mpc824x)"
98 #########################################################################
99 ## MPC8260 Systems (includes 8250, 8255 etc.)
100 #########################################################################
102 LIST_8260="$(boards_by_cpu mpc8260)"
104 #########################################################################
105 ## MPC83xx Systems (includes 8349, etc.)
106 #########################################################################
108 LIST_83xx="$(boards_by_cpu mpc83xx)"
110 #########################################################################
111 ## MPC85xx Systems (includes 8540, 8560 etc.)
112 #########################################################################
114 LIST_85xx="$(boards_by_cpu mpc85xx)"
116 #########################################################################
118 #########################################################################
120 LIST_86xx="$(boards_by_cpu mpc86xx)"
122 #########################################################################
124 #########################################################################
126 LIST_74xx_7xx="$(boards_by_cpu 74xx_7xx)"
128 #########################################################################
130 #########################################################################
153 # Alias "ppc" -> "powerpc" to not break compatibility with older scripts
154 # still using "ppc" instead of "powerpc"
159 #########################################################################
161 #########################################################################
163 LIST_SA="$(boards_by_cpu sa1100)"
165 #########################################################################
167 #########################################################################
183 #########################################################################
185 #########################################################################
249 davinci_dm355leopard \
254 #########################################################################
256 #########################################################################
262 #########################################################################
264 #########################################################################
280 #########################################################################
282 #########################################################################
303 #########################################################################
305 #########################################################################
338 #########################################################################
340 #########################################################################
342 LIST_pxa="$(boards_by_cpu pxa)
349 LIST_ixp="$(boards_by_cpu ixp)
354 #########################################################################
356 #########################################################################
370 #########################################################################
371 ## MIPS Systems (default = big endian)
372 #########################################################################
379 vct_platinum_onenand \
380 vct_platinum_onenand_small \
382 vct_platinumavc_small \
383 vct_platinumavc_onenand \
384 vct_platinumavc_onenand_small \
387 vct_premium_onenand \
388 vct_premium_onenand_small \
410 #########################################################################
411 ## MIPS Systems (little endian)
412 #########################################################################
429 #########################################################################
431 #########################################################################
433 LIST_x86="$(boards_by_arch i386)
437 #########################################################################
439 #########################################################################
441 LIST_nios2="$(boards_by_arch nios2)
445 #########################################################################
446 ## MicroBlaze Systems
447 #########################################################################
449 LIST_microblaze="$(boards_by_arch microblaze)"
451 #########################################################################
453 #########################################################################
455 LIST_coldfire="$(boards_by_arch m68k)
459 EB+MCF-EV123_internal \
470 #########################################################################
472 #########################################################################
474 LIST_avr32="$(boards_by_arch avr32)"
476 #########################################################################
478 #########################################################################
480 LIST_blackfin="$(boards_by_arch blackfin)
484 #########################################################################
486 #########################################################################
514 #########################################################################
516 #########################################################################
518 LIST_sparc="$(boards_by_arch sparc)"
520 #-----------------------------------------------------------------------
525 ${MAKE} distclean >/dev/null
526 ${MAKE} -s ${target}_config
528 ${MAKE} ${JOBS} all 2>&1 >${LOG_DIR}/$target.MAKELOG \
529 | tee ${LOG_DIR}/$target.ERR
531 # Check for 'make' errors
532 if [ ${PIPESTATUS[0]} -ne 0 ] ; then
536 if [ -s ${LOG_DIR}/$target.ERR ] ; then
537 ERR_CNT=$((ERR_CNT + 1))
538 ERR_LIST="${ERR_LIST} $target"
540 rm ${LOG_DIR}/$target.ERR
543 TOTAL_CNT=$((TOTAL_CNT + 1))
545 ${CROSS_COMPILE}size ${BUILD_DIR}/u-boot \
546 | tee -a ${LOG_DIR}/$target.MAKELOG
550 # If a LIST_xxx var exists, use it. But avoid variable
551 # expansion in the eval when a board name contains certain
552 # characters that the shell interprets.
555 *) list=$(eval echo '${LIST_'$t'}') ;;
557 if [ -n "${list}" ] ; then
558 build_targets ${list}
565 #-----------------------------------------------------------------------
569 echo "--------------------- SUMMARY ----------------------------"
570 echo "Boards compiled: ${TOTAL_CNT}"
571 if [ ${ERR_CNT} -gt 0 ] ; then
572 echo "Boards with warnings or errors: ${ERR_CNT} (${ERR_LIST} )"
574 echo "----------------------------------------------------------"
579 #-----------------------------------------------------------------------
581 #----- for now, just run PowerPC by default -----
582 [ $# = 0 ] && set -- powerpc