source: rtems-testing/rtems/bit_all_bsps @ 43b4eb4

Last change on this file since 43b4eb4 was a452c57, checked in by Ralph Holmes <ralph@…>, on Dec 19, 2015 at 4:07:53 PM

avr/avrtest: Remove avrtest references.

Closes #2442.

  • Property mode set to 100755
File size: 6.5 KB
Line 
1#! /bin/sh
2#
3#  Test build all the tool configurations
4#
5
6#  Checks the status returned by executables and exits if it is non-zero.
7check_fatal()
8{
9  if [ $1 -eq 0 ] ; then
10    return
11  fi
12  shift
13  echo "ERROR: $*" >&2
14  exit $?
15}
16
17# Include user configurable information
18test -r ./user.cfg || \
19  check_fatal 1 "Cannot find user configuration (user.cfg)"
20. ./user.cfg
21
22# Verify that the environment is correct
23if [ ! -d log ] ; then
24  echo No log directory
25  exit 1
26fi
27
28usage()
29{
30  echo "$0: arguments"
31  echo "  where arguments are:"
32  echo "    -t                     enable test mode (default=no)"
33  echo "    -p                     execute builds with GNU parallel"
34  echo "                             default is sequential"
35  echo "    -j N                   when parallel, number of jobs"
36  echo "    -v                     disable verbose mode"
37}
38
39toggle()
40{
41  if [ $1 = "no" ] ; then
42    echo "yes"
43    return
44  fi
45  echo "no"
46}
47
48#  Set up variables which control the scripts behavior
49verbose=yes
50testing=no
51do_parallel=no
52jobs=NOT_SET
53
54while getopts j:ptv OPT
55do
56  case "$OPT" in
57    t) testing=`toggle ${testing}` ;;
58    j) jobs="${OPTARG}" ;;
59    p) do_parallel=`toggle ${do_parallel}` ;;
60    v) verbose=`toggle ${verbose}` ;;
61    *) usage ; exit 1 ;;
62  esac
63done
64
65shiftcount=`expr $OPTIND - 1`
66shift $shiftcount
67
68if [ ${do_parallel} = "yes" ] ; then
69  parallel --version 2>&1 | grep "GNU Parallel" >/dev/null
70  check_fatal $? "GNU parallel is not installed"
71
72  JOBS=
73  case ${jobs} in
74    NOT_SET)
75      JOBS=""
76      ;;
77    ''|*[!0-9]*)
78      check_fatal 1 "Number of jobs (${jobs}) specified is not a number"
79      ;;
80    *)
81      JOBS="-j ${jobs}"
82      ;;
83  esac
84fi
85
86#
87#  Now get started
88#
89start=`date`
90
91# Determine the list of CPUs to build
92if [ $# -ne 0 ] ; then
93  CPUS=$*
94else
95  # leave out nios2 tic4x
96  CPUs=
97  for c in arm avr bfin h8300 i386 lm32 m32c m32r m68k mips moxie \
98           nios2 or1k powerpc sh sparc sparc64 v850
99  do
100    if [ -r ${RTEMS}/cpukit/score/cpu/${c} ] ; then
101      CPUS="${CPUS} ${c}"
102    else
103      rm -f log/${CPU}-*.log
104    fi
105  done
106fi
107
108# we collect the ticker executables for users to try out
109rm -rf ticker-executables
110mkdir ticker-executables
111
112#
113#  Calculate the set of BSPs which could be built
114#
115#  Pick up the minimum set and then see if we are doing everything.
116#
117get_bsps()
118{
119  if [ -d ${RTEMS}/c/src/lib/libbsp/i386/pc386/make/custom ] ; then
120    ALL_BSPS=`ls -1 ${RTEMS}/c/src/lib/libbsp/${CPU}/*/make/custom/*.cfg | \
121      while read f; do \
122        basename $f; done | sed -e 's/.cfg$//' `
123     
124  else
125    # RTEMS before 4.10
126    case $CPU in   
127      bfin)    all_bsps="eZKit533 bf537Stamp" ;;
128      arm)     all_bsps="csb336 csb337 csb637 edb7312"
129               all_bsps="${all_bsps} rtl22xx rtl22xx_t smdk2410"
130               all_bsps="${all_bsps} lpc2478 gumstix" ;;
131      h8300)   all_bsps="h8sim" ;;
132      i386)    all_bsps="i386ex pc386 pc386dx pc486 pc586 pc686"
133               all_bsps="${all_bsps} ts_386ex" ;;
134      lm32)    all_bsps="lm32_evr" ;;
135      m32c)    all_bsps="m32csim" ;;
136      m32r)    all_bsps="" ;;
137      m68k)    all_bsps="gen68360 gen68360_040 mvme147 mvme147s"
138               all_bsps="${all_bsps} mvme162 mvme162lx mvme167 ods68302"
139               all_bsps="${all_bsps} mcf5206elite "
140               all_bsps="${all_bsps} uC5282 mcf52235 mcf5329"
141               all_bsps="${all_bsps} gen68302 csb360 simcpu32 mrm332 av5282"
142               all_bsps="${all_bsps} gen68340 mcf5235 idp pgh360"
143               all_bsps="${all_bsps} m5484FireEngine" ;;
144      mips)    all_bsps="jmr3904 csb350 hurricane"
145               all_bsps="${all_bsps} rbtx4925 rbtx4938" ;;
146      nios2)   all_bsps="nios2_iss" ;;
147      powerpc) all_bsps="psim mcp750 mvme2100 mvme2307 mvme3100"
148               all_bsps="${all_bsps} mpc8260ads ss555 mvme5500"
149               all_bsps="${all_bsps} pm520_cr825 pm520_ze30"
150               all_bsps="${all_bsps} mbx821_001 mbx821_002 mbx821_002b"
151               all_bsps="${all_bsps} mbx860_1b mbx860_001b mbx860_002"
152               all_bsps="${all_bsps} mbx860_005b mtx603e brs5l icecube"
153               all_bsps="${all_bsps} virtex mpc8349eamds hsc_cm01 haleakala"
154               all_bsps="${all_bsps} mpc8313erdb mpc5566evb"
155               all_bsps="${all_bsps} pghplus tqm8xx_stk8xx" ;;
156      sh)      all_bsps="gensh1 gensh2 gensh4"
157               all_bsps="${all_bsps} simsh1 simsh2 simsh4" ;;
158      sparc)   all_bsps="sis erc32 leon2 leon3" ;;
159      sparc64) all_bsps="usiii niagara" ;;
160      tic4x)   all_bsps="c3xsim c4xsim" ;;
161      unix)    all_bsps="posix"
162
163        supported=no
164        # check to see if this host has a simulator port
165        case `${RTEMS}/config.guess` in
166          i[3456]86-pc-linux*)  supported=yes ;;
167          sparc-sun-solaris*)   supported=yes ;;
168          i[3456]86-*freebsd2*) supported=yes ;;
169          *hpux*)
170             echo "You are on a platform which needs to be tested".
171             echo "HPUX has not been tested with the autoconf configuration."
172             exit 0
173             ;;
174        esac
175        ;;
176      *)
177        echo "UNKNOWN CPU ${CPU} -- add to bit_all"
178        ;;
179    esac
180
181    ALL_BSPS=
182    for b in ${all_bsps}
183    do
184      if [ -r ${RTEMS}/make/custom/${b}.cfg ] ; then
185        ALL_BSPS="${ALL_BSPS} ${b}"
186      else
187        rm -f log/${CPU}-${b}.log
188      fi
189    done
190  fi
191}
192
193if [ ${do_parallel} = "yes" ] ; then
194  cp /dev/null parallel_bsps.tmp
195fi
196
197# Now cycle through all the CPUs selected
198for CPU in ${CPUS}
199do
200  #
201  #  Decide to cycle over all the BSPs
202  #
203  get_bsps
204
205  for BSP_TO_TEST in ${ALL_BSPS}
206  do
207    logfile=log/${CPU}-${BSP_TO_TEST}.log
208    CMD="./bit_rtems $CPU $BSP_TO_TEST"
209
210    # build the BSPs serially
211    if [ ${do_parallel} = no ] ; then
212      if [ ${verbose} = yes ] ; then
213        echo "Building RTEMS targetting ${CPU} for the ${BSP_TO_TEST} board"
214      fi
215
216      # echo the command which will be used to build the BSP
217      if [ ${testing} = yes ] ; then
218        echo "${CMD} >${logfile} 2>&1"
219        continue
220      fi
221
222      ${CMD} >${logfile} 2>&1
223      continue
224    fi
225
226    # generate parallel script
227    echo "cd `pwd` ; PATH=${PATH} ${CMD} >${logfile} 2>&1" >>parallel_bsps.tmp
228
229  done
230done
231
232if [ ${do_parallel} = yes ] ; then
233  if [ ${verbose} = yes ] ; then
234    echo "Initiating parallel build of `wc -l parallel_bsps.tmp` RTEMS BSPs"
235    echo "  parallel_bsps.tmp is the script being executed"
236  fi
237  if [ ${testing} = no ] ; then
238    cat parallel_bsps.tmp | parallel ${JOBS} ${PARALLEL_ARGS} --verbose
239  fi
240   
241fi
242
243# Now we are done
244
245stop=`date`
246
247echo
248echo "Started:  " $start
249echo "Finished: " $stop
250exit 0
Note: See TracBrowser for help on using the repository browser.