]> git.sur5r.net Git - u-boot/blob - MAKEALL
OMAP3: Add support for the IGEP v2 board.
[u-boot] / MAKEALL
1 #!/bin/bash
2
3 # Print statistics when we exit
4 trap exit 1 2 3 15
5 trap print_stats 0
6
7 # Determine number of CPU cores if no default was set
8 : ${BUILD_NCPUS:="`getconf _NPROCESSORS_ONLN`"}
9
10 if [ "$BUILD_NCPUS" -gt 1 ]
11 then
12         JOBS="-j $((BUILD_NCPUS + 1))"
13 else
14         JOBS=""
15 fi
16
17
18 if [ "${CROSS_COMPILE}" ] ; then
19         MAKE="make CROSS_COMPILE=${CROSS_COMPILE}"
20 else
21         MAKE=make
22 fi
23
24 if [ "${MAKEALL_LOGDIR}" ] ; then
25         LOG_DIR=${MAKEALL_LOGDIR}
26 else
27         LOG_DIR="LOG"
28 fi
29
30 if [ ! "${BUILD_DIR}" ] ; then
31         BUILD_DIR="."
32 fi
33
34 [ -d ${LOG_DIR} ] || mkdir ${LOG_DIR} || exit 1
35
36 LIST=""
37
38 # Keep track of the number of builds and errors
39 ERR_CNT=0
40 ERR_LIST=""
41 TOTAL_CNT=0
42 RC=0
43
44 # Helper funcs for parsing boards.cfg
45 boards_by_field()
46 {
47         awk \
48                 -v field="$1" \
49                 -v select="$2" \
50                 '($1 !~ /^#/ && $field == select) { print $1 }' \
51                 boards.cfg
52 }
53 boards_by_arch() { boards_by_field 2 "$@" ; }
54 boards_by_cpu()  { boards_by_field 3 "$@" ; }
55
56 #########################################################################
57 ## MPC5xx Systems
58 #########################################################################
59
60 LIST_5xx="$(boards_by_cpu mpc5xx)"
61
62 #########################################################################
63 ## MPC5xxx Systems
64 #########################################################################
65
66 LIST_5xxx="$(boards_by_cpu mpc5xxx)
67         digsy_mtc       \
68         EVAL5200        \
69         fo300           \
70         galaxy5200      \
71         icecube_5200    \
72         lite5200b       \
73         mcc200          \
74         MVBC_P          \
75         MVSMR           \
76         pcm030          \
77         PM520           \
78         TB5200          \
79         Total5200       \
80         Total5200_Rev2  \
81         TQM5200         \
82         TQM5200_B       \
83         TQM5200S        \
84 "
85
86 #########################################################################
87 ## MPC512x Systems
88 #########################################################################
89
90 LIST_512x="$(boards_by_cpu mpc512x)
91         mpc5121ads      \
92 "
93
94 #########################################################################
95 ## MPC8xx Systems
96 #########################################################################
97
98 LIST_8xx="$(boards_by_cpu mpc8xx)
99         Adder87x        \
100         AdderII         \
101         ADS860          \
102         FADS823         \
103         FADS850SAR      \
104         FADS860T        \
105         FPS850L         \
106         GEN860T         \
107         GEN860T_SC      \
108         ICU862_100MHz   \
109         IVML24          \
110         IVML24_128      \
111         IVML24_256      \
112         IVMS8           \
113         IVMS8_128       \
114         IVMS8_256       \
115         MBX             \
116         MBX860T         \
117         MPC86xADS       \
118         MPC885ADS       \
119         NETPHONE        \
120         NETTA           \
121         NETTA2          \
122         NETTA_ISDN      \
123         NETVIA          \
124         NETVIA_V2       \
125         RPXlite_DW      \
126         SPD823TS        \
127         SXNI855T        \
128         TK885D          \
129         TQM823L         \
130         TQM823L_LCD     \
131         TQM850L         \
132         TQM855L         \
133         TQM860L         \
134         TQM885D         \
135         v37             \
136 "
137
138 #########################################################################
139 ## PPC4xx Systems
140 #########################################################################
141
142 LIST_4xx="$(boards_by_cpu ppc4xx)
143         acadia_nand     \
144         arches          \
145         bamboo_nand     \
146         canyonlands     \
147         canyonlands_nand \
148         CPCI405         \
149         CPCI4052        \
150         CPCI405AB       \
151         CPCI405DT       \
152         devconcenter    \
153         fx12mm          \
154         glacier         \
155         haleakala       \
156         haleakala_nand  \
157         hcu4            \
158         hcu5            \
159         intip           \
160         kilauea         \
161         kilauea_nand    \
162         mcu25           \
163         MIP405T         \
164         ml507           \
165         ml507_flash     \
166         OCRTC           \
167         ORSG            \
168         PPChameleonEVB  \
169         rainier         \
170         sequoia         \
171         sequoia_nand    \
172         v5fx30teval     \
173         v5fx30teval_flash \
174         W7OLMC          \
175         W7OLMG          \
176         walnut          \
177         xilinx-ppc440-generic \
178         xilinx-ppc440-generic_flash \
179         yellowstone     \
180         yosemite        \
181 "
182
183 #########################################################################
184 ## MPC8220 Systems
185 #########################################################################
186
187 LIST_8220="$(boards_by_cpu mpc8220)"
188
189 #########################################################################
190 ## MPC824x Systems
191 #########################################################################
192
193 LIST_824x="$(boards_by_cpu mpc824x)
194         CPC45           \
195         eXalion         \
196         IDS8247         \
197         linkstation_HGLAN       \
198         Sandpoint8240   \
199         Sandpoint8245   \
200 "
201
202 #########################################################################
203 ## MPC8260 Systems (includes 8250, 8255 etc.)
204 #########################################################################
205
206 LIST_8260="$(boards_by_cpu mpc8260)
207         cogent_mpc8260  \
208         CPU86           \
209         CPU87           \
210         ep8248          \
211         ISPAN           \
212         MPC8260ADS      \
213         MPC8272ADS      \
214         PM826           \
215         PM828           \
216         Rattler8248     \
217         TQM8260_AC      \
218         TQM8260_AD      \
219         TQM8260_AE      \
220 "
221
222 #########################################################################
223 ## MPC83xx Systems (includes 8349, etc.)
224 #########################################################################
225
226 LIST_83xx="$(boards_by_cpu mpc83xx)
227         caddy2          \
228         MPC8313ERDB_33  \
229         MPC8313ERDB_NAND_66     \
230         MPC8315ERDB     \
231         MPC8315ERDB_NAND        \
232         MPC832XEMDS     \
233         MPC832XEMDS_ATM \
234         MPC8349ITX      \
235         MPC8349ITXGP    \
236         MPC8360EMDS     \
237         MPC8360EMDS_ATM \
238         MPC8360ERDK_33  \
239         MPC8360ERDK_66  \
240         MPC837XEMDS     \
241         sbc8349         \
242         SIMPC8313_LP    \
243         vme8349         \
244 "
245
246
247 #########################################################################
248 ## MPC85xx Systems (includes 8540, 8560 etc.)
249 #########################################################################
250
251 LIST_85xx="$(boards_by_cpu mpc85xx)
252         MPC8536DS       \
253         MPC8536DS_NAND  \
254         MPC8536DS_SDCARD        \
255         MPC8536DS_SPIFLASH      \
256         MPC8536DS_36BIT \
257         MPC8540EVAL     \
258         MPC8541CDS      \
259         MPC8548CDS      \
260         MPC8555CDS      \
261         MPC8569MDS      \
262         MPC8569MDS_ATM  \
263         MPC8569MDS_NAND \
264         MPC8572DS       \
265         MPC8572DS_36BIT \
266         P2020DS         \
267         P2020DS_36BIT   \
268         P1011RDB        \
269         P1011RDB_NAND   \
270         P1011RDB_SDCARD \
271         P1011RDB_SPIFLASH       \
272         P1020RDB        \
273         P1020RDB_NAND   \
274         P1020RDB_SDCARD \
275         P1020RDB_SPIFLASH       \
276         P2010RDB        \
277         P2010RDB_NAND   \
278         P2010RDB_SDCARD \
279         P2010RDB_SPIFLASH       \
280         P2020RDB        \
281         P2020RDB_NAND   \
282         P2020RDB_SDCARD \
283         P2020RDB_SPIFLASH       \
284         sbc8540         \
285         sbc8548         \
286         sbc8548_PCI_33  \
287         sbc8548_PCI_66  \
288         sbc8548_PCI_33_PCIE \
289         sbc8548_PCI_66_PCIE \
290         sbc8560         \
291         stxssa          \
292         TQM8540         \
293         TQM8541         \
294         TQM8548         \
295         TQM8548_AG      \
296         TQM8548_BE      \
297         TQM8555         \
298         TQM8560         \
299 "
300
301 #########################################################################
302 ## MPC86xx Systems
303 #########################################################################
304
305 LIST_86xx="$(boards_by_cpu mpc86xx)
306         MPC8641HPCN_36BIT \
307         MPC8641HPCN     \
308 "
309
310 #########################################################################
311 ## 74xx/7xx Systems
312 #########################################################################
313
314 LIST_74xx="             \
315         DB64360         \
316         DB64460         \
317         EVB64260        \
318         mpc7448hpc2     \
319         P3G4            \
320         p3m7448         \
321         PCIPPC2         \
322         PCIPPC6         \
323         ZUMA            \
324 "
325
326 LIST_7xx="              \
327         BAB7xx          \
328         CPCI750         \
329         ELPPC           \
330         p3m750          \
331         ppmc7xx         \
332 "
333
334 #########################################################################
335 ## PowerPC groups
336 #########################################################################
337
338 LIST_TSEC="             \
339         ${LIST_83xx}    \
340         ${LIST_85xx}    \
341         ${LIST_86xx}    \
342 "
343
344 LIST_powerpc="          \
345         ${LIST_5xx}     \
346         ${LIST_512x}    \
347         ${LIST_5xxx}    \
348         ${LIST_8xx}     \
349         ${LIST_8220}    \
350         ${LIST_824x}    \
351         ${LIST_8260}    \
352         ${LIST_83xx}    \
353         ${LIST_85xx}    \
354         ${LIST_86xx}    \
355         ${LIST_4xx}     \
356         ${LIST_74xx}    \
357         ${LIST_7xx}     \
358 "
359
360 # Alias "ppc" -> "powerpc" to not break compatibility with older scripts
361 # still using "ppc" instead of "powerpc"
362 LIST_ppc="              \
363         ${LIST_powerpc} \
364 "
365
366 #########################################################################
367 ## StrongARM Systems
368 #########################################################################
369
370 LIST_SA="$(boards_by_cpu sa1100)"
371
372 #########################################################################
373 ## ARM7 Systems
374 #########################################################################
375
376 LIST_ARM7="             \
377         ap7             \
378         ap720t          \
379         armadillo       \
380         B2              \
381         ep7312          \
382         evb4510         \
383         impa7           \
384         integratorap    \
385         lpc2292sodimm   \
386         modnet50        \
387         SMN42           \
388 "
389
390 #########################################################################
391 ## ARM9 Systems
392 #########################################################################
393
394 LIST_ARM9="                     \
395         a320evb                 \
396         ap920t                  \
397         ap922_XA10              \
398         ap926ejs                \
399         ap946es                 \
400         ap966                   \
401         cp920t                  \
402         cp922_XA10              \
403         cp926ejs                \
404         cp946es                 \
405         cp966                   \
406         da830evm                \
407         da850evm                \
408         edb9301                 \
409         edb9302                 \
410         edb9302a                \
411         edb9307                 \
412         edb9307a                \
413         edb9312                 \
414         edb9315                 \
415         edb9315a                \
416         edminiv2                \
417         guruplug                \
418         imx27lite               \
419         jadecpu                 \
420         lpd7a400                \
421         magnesium               \
422         mv88f6281gtw_ge         \
423         mx1ads                  \
424         mx1fs2                  \
425         netstar                 \
426         nhk8815                 \
427         nhk8815_onenand         \
428         omap1510inn             \
429         omap1610h2              \
430         omap1610inn             \
431         omap5912osk             \
432         omap730p2               \
433         openrd_base             \
434         rd6281a                 \
435         sbc2410x                \
436         scb9328                 \
437         sheevaplug              \
438         smdk2400                \
439         smdk2410                \
440         spear300                \
441         spear310                \
442         spear320                \
443         spear600                \
444         suen3                   \
445         trab                    \
446         VCMA9                   \
447         versatile               \
448         versatileab             \
449         versatilepb             \
450         voiceblue               \
451         davinci_dvevm           \
452         davinci_schmoogie       \
453         davinci_sffsdr          \
454         davinci_sonata          \
455         davinci_dm355evm        \
456         davinci_dm355leopard    \
457         davinci_dm365evm        \
458         davinci_dm6467evm       \
459 "
460
461 #########################################################################
462 ## ARM10 Systems
463 #########################################################################
464 LIST_ARM10="            \
465         integratorcp    \
466         cp1026          \
467 "
468
469 #########################################################################
470 ## ARM11 Systems
471 #########################################################################
472 LIST_ARM11="                    \
473         cp1136                  \
474         omap2420h4              \
475         apollon                 \
476         imx31_litekit           \
477         imx31_phycore           \
478         imx31_phycore_eet       \
479         mx31ads                 \
480         mx31pdk                 \
481         mx31pdk_nand            \
482         qong                    \
483         smdk6400                \
484         tnetv107x_evm           \
485 "
486
487 #########################################################################
488 ## ARMV7 Systems
489 #########################################################################
490 LIST_ARMV7="            \
491         am3517_evm              \
492         ca9x4_ct_vxp            \
493         devkit8000              \
494         igep0020                \
495         mx51evk                 \
496         omap3_beagle            \
497         omap3_overo             \
498         omap3_evm               \
499         omap3_pandora           \
500         omap3_sdp3430           \
501         omap3_zoom1             \
502         omap3_zoom2             \
503         omap4_panda             \
504         omap4_sdp4430           \
505         s5p_goni                \
506         smdkc100                \
507 "
508
509 #########################################################################
510 ## AT91 Systems
511 #########################################################################
512
513 LIST_at91="                     \
514         afeb9260                \
515         at91cap9adk             \
516         at91rm9200dk            \
517         at91rm9200ek            \
518         at91sam9260ek           \
519         at91sam9261ek           \
520         at91sam9263ek           \
521         at91sam9g10ek           \
522         at91sam9g20ek           \
523         at91sam9m10g45ek        \
524         at91sam9rlek            \
525         cmc_pu2                 \
526         CPUAT91                 \
527         CPU9260                 \
528         CPU9G20                 \
529         csb637                  \
530         eb_cpux9k2              \
531         kb9202                  \
532         meesc                   \
533         mp2usb                  \
534         m501sk                  \
535         otc570                  \
536         pm9261                  \
537         pm9263                  \
538         pm9g45                  \
539         SBC35_A9G20             \
540         TNY_A9260               \
541         TNY_A9G20               \
542 "
543
544 #########################################################################
545 ## Xscale Systems
546 #########################################################################
547
548 LIST_pxa="$(boards_by_cpu pxa)
549         polaris         \
550         trizepsiv       \
551         vpac270_nor     \
552         vpac270_onenand \
553 "
554
555 LIST_ixp="$(boards_by_cpu ixp)
556         pdnb3           \
557         scpu            \
558 "
559
560 #########################################################################
561 ## ARM groups
562 #########################################################################
563
564 LIST_arm="                      \
565         ${LIST_SA}              \
566         ${LIST_ARM7}            \
567         ${LIST_ARM9}            \
568         ${LIST_ARM10}           \
569         ${LIST_ARM11}           \
570         ${LIST_ARMV7}   \
571         ${LIST_at91}            \
572         ${LIST_pxa}             \
573         ${LIST_ixp}             \
574 "
575
576 #########################################################################
577 ## MIPS Systems         (default = big endian)
578 #########################################################################
579
580 LIST_mips4kc="          \
581         incaip          \
582         qemu_mips       \
583         vct_platinum    \
584         vct_platinum_small      \
585         vct_platinum_onenand    \
586         vct_platinum_onenand_small      \
587         vct_platinumavc \
588         vct_platinumavc_small   \
589         vct_platinumavc_onenand \
590         vct_platinumavc_onenand_small   \
591         vct_premium     \
592         vct_premium_small       \
593         vct_premium_onenand     \
594         vct_premium_onenand_small       \
595 "
596
597 LIST_mips5kc="          \
598         purple          \
599 "
600
601 LIST_au1xx0="           \
602         dbau1000        \
603         dbau1100        \
604         dbau1500        \
605         dbau1550        \
606         dbau1550_el     \
607         gth2            \
608 "
609
610 LIST_mips="             \
611         ${LIST_mips4kc} \
612         ${LIST_mips5kc} \
613         ${LIST_au1xx0}  \
614 "
615
616 #########################################################################
617 ## MIPS Systems         (little endian)
618 #########################################################################
619
620 LIST_mips4kc_el=""
621
622 LIST_mips5kc_el=""
623
624 LIST_au1xx0_el="        \
625         dbau1550_el     \
626         pb1000          \
627 "
628
629 LIST_mips_el="                  \
630         ${LIST_mips4kc_el}      \
631         ${LIST_mips5kc_el}      \
632         ${LIST_au1xx0_el}       \
633 "
634
635 #########################################################################
636 ## i386 Systems
637 #########################################################################
638
639 LIST_x86="$(boards_by_arch i386)
640         sc520_eNET      \
641 "
642
643 #########################################################################
644 ## Nios-II Systems
645 #########################################################################
646
647 LIST_nios2="$(boards_by_arch nios2)
648         nios2-generic   \
649 "
650
651 #########################################################################
652 ## MicroBlaze Systems
653 #########################################################################
654
655 LIST_microblaze="$(boards_by_arch microblaze)"
656
657 #########################################################################
658 ## ColdFire Systems
659 #########################################################################
660
661 LIST_coldfire="$(boards_by_arch m68k)
662         astro_mcf5373l          \
663         cobra5272               \
664         EB+MCF-EV123            \
665         EB+MCF-EV123_internal   \
666         M52277EVB               \
667         M5235EVB                \
668         M5329AFEE               \
669         M5373EVB                \
670         M54451EVB               \
671         M54455EVB               \
672         M5475AFE                \
673         M5485AFE                \
674 "
675
676 #########################################################################
677 ## AVR32 Systems
678 #########################################################################
679
680 LIST_avr32="$(boards_by_arch avr32)"
681
682 #########################################################################
683 ## Blackfin Systems
684 #########################################################################
685
686 LIST_blackfin="$(boards_by_arch blackfin)
687         bf527-ezkit-v2
688 "
689
690 #########################################################################
691 ## SH Systems
692 #########################################################################
693
694 LIST_sh2="              \
695         rsk7203         \
696 "
697 LIST_sh3="              \
698         mpr2            \
699         ms7720se        \
700 "
701
702 LIST_sh4="              \
703         ms7750se        \
704         ms7722se        \
705         MigoR           \
706         r7780mp         \
707         r2dplus         \
708         sh7763rdp       \
709         sh7785lcr       \
710         ap325rxa        \
711         espt            \
712 "
713
714 LIST_sh="               \
715         ${LIST_sh2}     \
716         ${LIST_sh3}     \
717         ${LIST_sh4}     \
718 "
719
720 #########################################################################
721 ## SPARC Systems
722 #########################################################################
723
724 LIST_sparc="$(boards_by_arch sparc)"
725
726 #-----------------------------------------------------------------------
727
728 build_target() {
729         target=$1
730
731         ${MAKE} distclean >/dev/null
732         ${MAKE} -s ${target}_config
733
734         ${MAKE} ${JOBS} all 2>&1 >${LOG_DIR}/$target.MAKELOG \
735                                 | tee ${LOG_DIR}/$target.ERR
736
737         # Check for 'make' errors
738         if [ ${PIPESTATUS[0]} -ne 0 ] ; then
739                 RC=1
740         fi
741
742         if [ -s ${LOG_DIR}/$target.ERR ] ; then
743                 ERR_CNT=$((ERR_CNT + 1))
744                 ERR_LIST="${ERR_LIST} $target"
745         else
746                 rm ${LOG_DIR}/$target.ERR
747         fi
748
749         TOTAL_CNT=$((TOTAL_CNT + 1))
750
751         ${CROSS_COMPILE}size ${BUILD_DIR}/u-boot \
752                                 | tee -a ${LOG_DIR}/$target.MAKELOG
753 }
754 build_targets() {
755         for t in "$@" ; do
756                 # If a LIST_xxx var exists, use it.  But avoid variable
757                 # expansion in the eval when a board name contains certain
758                 # characters that the shell interprets.
759                 case ${t} in
760                         *[-+=]*) list= ;;
761                         *)       list=$(eval echo '${LIST_'$t'}') ;;
762                 esac
763                 if [ -n "${list}" ] ; then
764                         build_targets ${list}
765                 else
766                         build_target ${t}
767                 fi
768         done
769 }
770
771 #-----------------------------------------------------------------------
772
773 print_stats() {
774         echo ""
775         echo "--------------------- SUMMARY ----------------------------"
776         echo "Boards compiled: ${TOTAL_CNT}"
777         if [ ${ERR_CNT} -gt 0 ] ; then
778                 echo "Boards with warnings or errors: ${ERR_CNT} (${ERR_LIST} )"
779         fi
780         echo "----------------------------------------------------------"
781
782         exit $RC
783 }
784
785 #-----------------------------------------------------------------------
786
787 #----- for now, just run PowerPC by default -----
788 [ $# = 0 ] && set -- powerpc
789
790 build_targets "$@"