]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - MAKEALL
FPGA: fix support for non-Lattice devices
[karo-tx-uboot.git] / 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         igep0030                \
496         mx51evk                 \
497         omap3_beagle            \
498         omap3_overo             \
499         omap3_evm               \
500         omap3_pandora           \
501         omap3_sdp3430           \
502         omap3_zoom1             \
503         omap3_zoom2             \
504         omap4_panda             \
505         omap4_sdp4430           \
506         s5p_goni                \
507         smdkc100                \
508 "
509
510 #########################################################################
511 ## AT91 Systems
512 #########################################################################
513
514 LIST_at91="                     \
515         afeb9260                \
516         at91cap9adk             \
517         at91rm9200dk            \
518         at91rm9200ek            \
519         at91sam9260ek           \
520         at91sam9261ek           \
521         at91sam9263ek           \
522         at91sam9g10ek           \
523         at91sam9g20ek           \
524         at91sam9m10g45ek        \
525         at91sam9rlek            \
526         cmc_pu2                 \
527         CPUAT91                 \
528         CPU9260                 \
529         CPU9G20                 \
530         csb637                  \
531         eb_cpux9k2              \
532         kb9202                  \
533         meesc                   \
534         mp2usb                  \
535         m501sk                  \
536         otc570                  \
537         pm9261                  \
538         pm9263                  \
539         pm9g45                  \
540         SBC35_A9G20             \
541         TNY_A9260               \
542         TNY_A9G20               \
543 "
544
545 #########################################################################
546 ## Xscale Systems
547 #########################################################################
548
549 LIST_pxa="$(boards_by_cpu pxa)
550         polaris         \
551         trizepsiv       \
552         vpac270_nor     \
553         vpac270_onenand \
554 "
555
556 LIST_ixp="$(boards_by_cpu ixp)
557         pdnb3           \
558         scpu            \
559 "
560
561 #########################################################################
562 ## ARM groups
563 #########################################################################
564
565 LIST_arm="                      \
566         ${LIST_SA}              \
567         ${LIST_ARM7}            \
568         ${LIST_ARM9}            \
569         ${LIST_ARM10}           \
570         ${LIST_ARM11}           \
571         ${LIST_ARMV7}   \
572         ${LIST_at91}            \
573         ${LIST_pxa}             \
574         ${LIST_ixp}             \
575 "
576
577 #########################################################################
578 ## MIPS Systems         (default = big endian)
579 #########################################################################
580
581 LIST_mips4kc="          \
582         incaip          \
583         qemu_mips       \
584         vct_platinum    \
585         vct_platinum_small      \
586         vct_platinum_onenand    \
587         vct_platinum_onenand_small      \
588         vct_platinumavc \
589         vct_platinumavc_small   \
590         vct_platinumavc_onenand \
591         vct_platinumavc_onenand_small   \
592         vct_premium     \
593         vct_premium_small       \
594         vct_premium_onenand     \
595         vct_premium_onenand_small       \
596 "
597
598 LIST_mips5kc="          \
599         purple          \
600 "
601
602 LIST_au1xx0="           \
603         dbau1000        \
604         dbau1100        \
605         dbau1500        \
606         dbau1550        \
607         dbau1550_el     \
608         gth2            \
609 "
610
611 LIST_mips="             \
612         ${LIST_mips4kc} \
613         ${LIST_mips5kc} \
614         ${LIST_au1xx0}  \
615 "
616
617 #########################################################################
618 ## MIPS Systems         (little endian)
619 #########################################################################
620
621 LIST_mips4kc_el=""
622
623 LIST_mips5kc_el=""
624
625 LIST_au1xx0_el="        \
626         dbau1550_el     \
627         pb1000          \
628 "
629
630 LIST_mips_el="                  \
631         ${LIST_mips4kc_el}      \
632         ${LIST_mips5kc_el}      \
633         ${LIST_au1xx0_el}       \
634 "
635
636 #########################################################################
637 ## i386 Systems
638 #########################################################################
639
640 LIST_x86="$(boards_by_arch i386)
641         sc520_eNET      \
642 "
643
644 #########################################################################
645 ## Nios-II Systems
646 #########################################################################
647
648 LIST_nios2="$(boards_by_arch nios2)
649         nios2-generic   \
650 "
651
652 #########################################################################
653 ## MicroBlaze Systems
654 #########################################################################
655
656 LIST_microblaze="$(boards_by_arch microblaze)"
657
658 #########################################################################
659 ## ColdFire Systems
660 #########################################################################
661
662 LIST_coldfire="$(boards_by_arch m68k)
663         astro_mcf5373l          \
664         cobra5272               \
665         EB+MCF-EV123            \
666         EB+MCF-EV123_internal   \
667         M52277EVB               \
668         M5235EVB                \
669         M5329AFEE               \
670         M5373EVB                \
671         M54451EVB               \
672         M54455EVB               \
673         M5475AFE                \
674         M5485AFE                \
675 "
676
677 #########################################################################
678 ## AVR32 Systems
679 #########################################################################
680
681 LIST_avr32="$(boards_by_arch avr32)"
682
683 #########################################################################
684 ## Blackfin Systems
685 #########################################################################
686
687 LIST_blackfin="$(boards_by_arch blackfin)
688         bf527-ezkit-v2
689 "
690
691 #########################################################################
692 ## SH Systems
693 #########################################################################
694
695 LIST_sh2="              \
696         rsk7203         \
697 "
698 LIST_sh3="              \
699         mpr2            \
700         ms7720se        \
701 "
702
703 LIST_sh4="              \
704         ms7750se        \
705         ms7722se        \
706         MigoR           \
707         r7780mp         \
708         r2dplus         \
709         sh7763rdp       \
710         sh7785lcr       \
711         ap325rxa        \
712         espt            \
713 "
714
715 LIST_sh="               \
716         ${LIST_sh2}     \
717         ${LIST_sh3}     \
718         ${LIST_sh4}     \
719 "
720
721 #########################################################################
722 ## SPARC Systems
723 #########################################################################
724
725 LIST_sparc="$(boards_by_arch sparc)"
726
727 #-----------------------------------------------------------------------
728
729 build_target() {
730         target=$1
731
732         ${MAKE} distclean >/dev/null
733         ${MAKE} -s ${target}_config
734
735         ${MAKE} ${JOBS} all 2>&1 >${LOG_DIR}/$target.MAKELOG \
736                                 | tee ${LOG_DIR}/$target.ERR
737
738         # Check for 'make' errors
739         if [ ${PIPESTATUS[0]} -ne 0 ] ; then
740                 RC=1
741         fi
742
743         if [ -s ${LOG_DIR}/$target.ERR ] ; then
744                 ERR_CNT=$((ERR_CNT + 1))
745                 ERR_LIST="${ERR_LIST} $target"
746         else
747                 rm ${LOG_DIR}/$target.ERR
748         fi
749
750         TOTAL_CNT=$((TOTAL_CNT + 1))
751
752         ${CROSS_COMPILE}size ${BUILD_DIR}/u-boot \
753                                 | tee -a ${LOG_DIR}/$target.MAKELOG
754 }
755 build_targets() {
756         for t in "$@" ; do
757                 # If a LIST_xxx var exists, use it.  But avoid variable
758                 # expansion in the eval when a board name contains certain
759                 # characters that the shell interprets.
760                 case ${t} in
761                         *[-+=]*) list= ;;
762                         *)       list=$(eval echo '${LIST_'$t'}') ;;
763                 esac
764                 if [ -n "${list}" ] ; then
765                         build_targets ${list}
766                 else
767                         build_target ${t}
768                 fi
769         done
770 }
771
772 #-----------------------------------------------------------------------
773
774 print_stats() {
775         echo ""
776         echo "--------------------- SUMMARY ----------------------------"
777         echo "Boards compiled: ${TOTAL_CNT}"
778         if [ ${ERR_CNT} -gt 0 ] ; then
779                 echo "Boards with warnings or errors: ${ERR_CNT} (${ERR_LIST} )"
780         fi
781         echo "----------------------------------------------------------"
782
783         exit $RC
784 }
785
786 #-----------------------------------------------------------------------
787
788 #----- for now, just run PowerPC by default -----
789 [ $# = 0 ] && set -- powerpc
790
791 build_targets "$@"