summaryrefslogblamecommitdiffstats
path: root/scripts/buildall
blob: b4b3c69091581c7bf8d441644a516496b7fa72b6 (plain) (tree)
1
2
3
4
5




                                                               










                                                              
                       
                                                      
 
















                                                
                    





                                
                      

                        



                                                                

                 



                                                      



                                                                       
                                                                   
 



                                                                   
 
                               

    

                                                         
 
      
#! /bin/sh
#
#  Generate all the specs and then cycle through building them.
#

# This is the full list .. hppa1.1 does not build now.
#ALL_TARGETS="hppa1.1-rtems i386-rtems i960-rtems m68k-rtems \
#  m68k-rtemself mips64orion-rtems \
#  powerpc-rtems sh-rtems sh-rtemself sparc-rtems"

# This is the full buildable set.
ALL_TARGETS="i386-rtems i960-rtems m68k-rtems \
  m68k-rtemself mips64orion-rtems \
  powerpc-rtems sh-rtems sh-rtemself sparc-rtems"

# This is what we are building this time
#TARGETS=${ALL_TARGETS}
TARGETS="i386-rtems m68k-rtems powerpc-rtems sh-rtems"

# Some linux distributions use /usr/src/packages
# redhat uses /usr/src/redhat
# others might use /usr/src
if test -d /usr/src/packages/SPECS;
then
dst=/usr/src/packages/SPECS;
elif test -d /usr/src/redhat/SPECS;
 then
dst=/usr/src/redhat/SPECS;
elif test -d /usr/src/SPECS/;
then
dst=/usr/src/SPECS;
fi

#  Now generate all the specs
for target in ${TARGETS}
do
  ./mkspec ${target}
done

# clean up a bit before we start
cd ${dst}
test -d log || mkdir log

#  do all the binutils
for target in ${TARGETS}
do
  rpm -ba --buildroot=/opt/tmp \
     ${dst}/${target}-binutils.spec >log/${target}-binutils 2>&1
  rm -rf ${dst}/../BUILD/${target}-binutils
  rm -rf /opt/tmp/opt

  # now build gdb
  rpm -ba --buildroot=/opt/tmp \
     ${dst}/${target}-gdb.spec >log/${target}-gdb 2>&1
  rm -rf ${dst}/../BUILD/${target}-gdb
  rm -rf /opt/tmp/opt

  # now build gcc/newlib
  #    NOTE: This requires having binutils installed and we immediately
  #          remove it once finished.
  rpm -i ${dst}/../RPMS/i386/${target}-binutils-19991011-0.i386.rpm

  rpm -ba --buildroot=/opt/tmp \
     ${dst}/${target}-gcc_newlib.spec >log/${target}-gccnewlib 2>&1
  rm -rf ${dst}/../BUILD/${target}-gcc_newlib
  rm -rf /opt/tmp/opt

  rpm -e `rpm -qa | grep rtems`
done

mv ${dst}/../RPMS/i386/*.rpm /usr3/rtems_cds/test_cd/RPMS
mv ${dst}/../SRPMS/*.rpm /usr3/rtems_cds/test_cd/SRPMS

exit 0