source: rtems/scripts/buildall @ c5fc4a0b

4.104.114.84.95
Last change on this file since c5fc4a0b was 5f7b118, checked in by Joel Sherrill <joel.sherrill@…>, on 10/20/99 at 15:29:35

Restored joel's changes after merging old version from Ralf.

  • Property mode set to 100644
File size: 3.4 KB
Line 
1#! /bin/sh
2#
3#  Generate all the specs and then cycle through building them.
4#
5
6RTEMS_DIR=`dirname $0`
7
8# This is the full list .. hppa1.1 does not build now.
9#ALL_TARGETS="hppa1.1-rtems i386-rtems i960-rtems m68k-rtems \
10#  m68k-rtemself mips64orion-rtems \
11#  powerpc-rtems sh-rtems sh-rtemself sparc-rtems"
12
13# This is the full buildable set.
14ALL_TARGETS="i386-rtems i960-rtems m68k-rtems \
15  m68k-rtemself mips64orion-rtems \
16  powerpc-rtems sh-rtems sh-rtemself sparc-rtems"
17
18# This is what we are building this time
19#TARGETS=${ALL_TARGETS}
20TARGETS="sh-rtems"
21
22testing=no
23
24binutils=990901
25gcc=2.95.1
26gdb=4.18
27newlib=1.8.2
28buildroot=/opt/tmp
29
30#
31#  Now get started
32#
33start=`date`
34
35
36echo PATH=$PATH
37
38if [ ${testing} = yes ] ; then
39  ECHO=echo
40fi
41
42installed_count=`rpm -qa | grep rtems | wc -l`
43if [ ${installed_count} -ne 0 ] ; then
44  echo This script should be run with NO rtems RPMs installed.
45  echo It appears that the following rtems RPMs are installed:
46  echo
47  rpm -qa | grep rtems
48  echo
49  echo Please remove these and restart this script.
50  exit 1
51fi
52
53# Some linux distributions use /usr/src/packages
54# redhat uses /usr/src/redhat
55# others might use /usr/src
56if test -d /usr/src/packages/SPECS;
57then
58dst=/usr/src/packages/SPECS;
59elif test -d /usr/src/redhat/SPECS;
60 then
61dst=/usr/src/redhat/SPECS;
62elif test -d /usr/src/SPECS/;
63then
64dst=/usr/src/SPECS;
65fi
66
67#  Now generate all the specs
68for target in ${TARGETS}
69do
70  ${ECHO} ${RTEMS_DIR}/mkspec ${target}
71done
72
73# clean up a bit before we start
74cd ${dst}
75test -d log || mkdir log
76
77
78#  do all the tools
79for target in ${TARGETS}
80do
81  logfile=log/${target}-binutils
82  specfile=${dst}/${target}-binutils-${binutils}.spec
83  echo "rpm -ba --buildroot=${buildroot} ${specfile} >${logfile} 2>&1"
84  if [ ${testing} = no ] ; then
85    rpm -ba --buildroot=${buildroot} ${specfile} >${logfile} 2>&1
86  fi
87  ${ECHO} rm -rf ${dst}/../BUILD/${target}-binutils*
88  ${ECHO} rm -rf ${buildroot}/opt
89
90  # now build gdb
91  logfile=log/${target}-gdb
92  specfile=${dst}/${target}-gdb-${gdb}.spec
93  echo "rpm -ba --buildroot=${buildroot} ${specfile} >${logfile} 2>&1"
94  if [ ${testing} = no ] ; then
95    rpm -ba --buildroot=${buildroot} ${specfile} >${logfile} 2>&1
96  fi
97  ${ECHO} rm -rf ${dst}/../BUILD/${target}-gdb*
98  ${ECHO} rm -rf ${buildroot}/opt
99
100  # now build gcc/newlib
101  #    NOTE: This requires having binutils installed and we immediately
102  #          remove it once finished.
103  ${ECHO} rpm -i ${dst}/../RPMS/i386/${target}-binutils-${binutils}-0.i386.rpm
104
105  logfile=log/${target}-gccnewlib
106  specfile=${dst}/${target}-gcc-${gcc}-newlib-${newlib}.spec
107  echo "rpm -ba --buildroot=${buildroot} ${specfile} >${logfile} 2>&1"
108  if [ ${testing} = no ] ; then
109    rpm -ba --buildroot=${buildroot} ${specfile} >${logfile} 2>&1
110  fi
111  ${ECHO} rm -rf ${dst}/../BUILD/${target}-gcc*
112  ${ECHO} rm -rf ${buildroot}/opt
113
114  echo uninstalling binutils for ${target}
115  if [ ${testing} = no ] ; then
116    rpm -e `rpm -qa | grep rtems`
117  fi
118done
119
120staging_dir=/usr3/rtems_cds/test_cd/linux
121
122${ECHO} mkdir ${staging_dir}
123${ECHO} mkdir ${staging_dir}/RPMS
124${ECHO} mkdir ${staging_dir}/SRPMS
125
126echo Moving RPMs to CD staging directory
127for file in `ls -1 ${dst}/../RPMS/i386/*.rpm 2>/dev/null`
128do
129  ${ECHO} mv ${file} ${staging_dir}/RPMS
130done
131
132echo Moving SRPMs to CD staging directory
133for file in `ls -1 ${dst}/../SRPMS/*.rpm 2>/dev/null`
134do
135  ${ECHO} mv ${file} ${staging_dir}/SRPMS
136done
137
138# Now we are done
139
140stop=`date`
141
142echo
143echo "Started:  " $start
144echo "Finished: " $stop
145exit 0
Note: See TracBrowser for help on using the repository browser.