Skip to content

Commit

Permalink
Pulled all logging out into a function
Browse files Browse the repository at this point in the history
  • Loading branch information
nzmichaelh committed Sep 11, 2010
1 parent 5a82a41 commit 4e03b34
Showing 1 changed file with 48 additions and 123 deletions.
171 changes: 48 additions & 123 deletions summon-arm-toolchain
Expand Up @@ -44,6 +44,13 @@ function fetch {
fi
}

# Log a message out to the console
function log {
echo "******************************************************************"
echo "* $*"
echo "******************************************************************"
}

case "$(uname)" in
Linux)
echo "Found Linux OS."
Expand Down Expand Up @@ -121,14 +128,10 @@ if [ ! -e build ]; then
fi

if [ ! -e ${STAMPS}/${BINUTILS}.build ]; then
echo "******************************************************************"
echo "* Unpacking ${BINUTILS}"
echo "******************************************************************"
log "Unpacking ${BINUTILS}"
tar xfvj ${SOURCES}/${BINUTILS}.tar.bz2
cd build
echo "******************************************************************"
echo "* Configuring ${BINUTILS}"
echo "******************************************************************"
log "Configuring ${BINUTILS}"
../${BINUTILS}/configure --target=${TARGET} \
--prefix=${PREFIX} \
--enable-interwork \
Expand All @@ -138,31 +141,21 @@ if [ ! -e ${STAMPS}/${BINUTILS}.build ]; then
--disable-nls \
--disable-werror \
${BINUTILFLAGS} || exit
echo "******************************************************************"
echo "* Building ${BINUTILS}"
echo "******************************************************************"
log "Building ${BINUTILS}"
make ${PARALLEL} || exit
echo "******************************************************************"
echo "* Installing ${BINUTILS}"
echo "******************************************************************"
log "Installing ${BINUTILS}"
make install || exit
cd ..
echo "******************************************************************"
echo "* Cleaning up ${BINUTILS}"
echo "******************************************************************"
log "Cleaning up ${BINUTILS}"
touch ${STAMPS}/${BINUTILS}.build
rm -rf build/* ${BINUTILS}
fi

if [ ! -e ${STAMPS}/${GCC}-boot.build ]; then
echo "******************************************************************"
echo "* Unpacking ${GCC}-boot"
echo "******************************************************************"
log "Unpacking ${GCC}-boot"
tar xfvj ${SOURCES}/${GCC}.tar.bz2
cd build
echo "******************************************************************"
echo "* Configuring ${GCC}-boot"
echo "******************************************************************"
log "Configuring ${GCC}-boot"
../${GCC}/configure --target=${TARGET} \
--prefix=${PREFIX} \
--enable-interwork \
Expand All @@ -176,31 +169,21 @@ if [ ! -e ${STAMPS}/${GCC}-boot.build ]; then
--disable-nls \
--disable-werror \
${GCCFLAGS} || exit
echo "******************************************************************"
echo "* Building ${GCC}-boot"
echo "******************************************************************"
log "Building ${GCC}-boot"
make ${PARALLEL} all-gcc || exit
echo "******************************************************************"
echo "* Installing ${GCC}-boot"
echo "******************************************************************"
log "Installing ${GCC}-boot"
make install-gcc || exit
cd ..
echo "******************************************************************"
echo "* Cleaning up ${GCC}-boot"
echo "******************************************************************"
log "Cleaning up ${GCC}-boot"
touch ${STAMPS}/${GCC}-boot.build
rm -rf build/* ${GCC}
fi

if [ ! -e ${STAMPS}/${NEWLIB}.build ]; then
echo "******************************************************************"
echo "* Unpacking ${NEWLIB}"
echo "******************************************************************"
log "Unpacking ${NEWLIB}"
tar xfvz ${SOURCES}/${NEWLIB}.tar.gz
cd build
echo "******************************************************************"
echo "* Configuring ${NEWLIB}"
echo "******************************************************************"
log "Configuring ${NEWLIB}"
../${NEWLIB}/configure --target=${TARGET} \
--prefix=${PREFIX} \
--enable-interwork \
Expand All @@ -210,32 +193,22 @@ if [ ! -e ${STAMPS}/${NEWLIB}.build ]; then
--disable-nls \
--disable-werror \
--disable-newlib-supplied-syscalls || exit
echo "******************************************************************"
echo "* Building ${NEWLIB}"
echo "******************************************************************"
log "Building ${NEWLIB}"
make ${PARALLEL} || exit
echo "******************************************************************"
echo "* Installing ${NEWLIB}"
echo "******************************************************************"
log "Installing ${NEWLIB}"
make install || exit
cd ..
echo "******************************************************************"
echo "* Cleaning up ${NEWLIB}"
echo "******************************************************************"
log "Cleaning up ${NEWLIB}"
touch ${STAMPS}/${NEWLIB}.build
rm -rf build/* ${NEWLIB}
fi

# Yes, you need to build gcc again!
if [ ! -e ${STAMPS}/${GCC}.build ]; then
echo "******************************************************************"
echo "* Unpacking ${GCC}"
echo "******************************************************************"
log "Unpacking ${GCC}"
tar xfvj ${SOURCES}/${GCC}.tar.bz2
cd build
echo "******************************************************************"
echo "* Configuring ${GCC}"
echo "******************************************************************"
log "Configuring ${GCC}"
../${GCC}/configure --target=${TARGET} \
--prefix=${PREFIX} \
--enable-interwork \
Expand All @@ -248,139 +221,91 @@ if [ ! -e ${STAMPS}/${GCC}.build ]; then
--disable-nls \
--disable-werror \
${GCCFLAGS} || exit
echo "******************************************************************"
echo "* Building ${GCC}"
echo "******************************************************************"
log "Building ${GCC}"
make ${PARALLEL} || exit
echo "******************************************************************"
echo "* Installing ${GCC}"
echo "******************************************************************"
log "Installing ${GCC}"
make install || exit
cd ..
echo "******************************************************************"
echo "* Cleaning up ${GCC}"
echo "******************************************************************"
log "Cleaning up ${GCC}"
touch ${STAMPS}/${GCC}.build
rm -rf build/* ${GCC}
fi

if [ ! -e ${STAMPS}/${GDB}.build ]; then
echo "******************************************************************"
echo "* Unpacking ${GDB}"
echo "******************************************************************"
log "Unpacking ${GDB}"
tar xfvj ${SOURCES}/${GDB}.tar.bz2
cd build
echo "******************************************************************"
echo "* Configuring ${GDB}"
echo "******************************************************************"
log "Configuring ${GDB}"
../${GDB}/configure --target=${TARGET} \
--prefix=${PREFIX} \
--enable-interwork \
--enable-multilib \
--disable-werror \
${GDBFLAGS} || exit
echo "******************************************************************"
echo "* Building ${GDB}"
echo "******************************************************************"
log "Building ${GDB}"
make ${PARALLEL} || exit
echo "******************************************************************"
echo "* Installing ${GDB}"
echo "******************************************************************"
log "Installing ${GDB}"
make install || exit
cd ..
echo "******************************************************************"
echo "* Cleaning up ${GDB}"
echo "******************************************************************"
log "Cleaning up ${GDB}"
touch ${STAMPS}/${GDB}.build
rm -rf build/* ${GDB}
fi

if [ ${LIBSTM32_EN} != 0 ]; then
if [ ! -e .libcmsis-${LIBCMSIS}.build ]; then
echo "******************************************************************"
echo "* Unpacking libcmsis-${LIBCMSIS}"
echo "******************************************************************"
log "Unpacking libcmsis-${LIBCMSIS}"
tar xfvj ${SOURCES}/libcmsis-${LIBCMSIS}.tar.bz2
cd libcmsis-${LIBCMSIS}
echo "******************************************************************"
echo "* Building libcmsis-${LIBCMSIS}"
echo "******************************************************************"
log "Building libcmsis-${LIBCMSIS}"
make arch_prefix=${TARGET} prefix=${PREFIX} || exit
echo "******************************************************************"
echo "* Installing libcmsis-${LIBCMSIS}"
echo "******************************************************************"
log "Installing libcmsis-${LIBCMSIS}"
make arch_prefix=${TARGET} prefix=${PREFIX} install || exit
cd ..
echo "******************************************************************"
echo "* Cleaning up libcmsis-${LIBCMSIS}"
echo "******************************************************************"
log "Cleaning up libcmsis-${LIBCMSIS}"
touch .libcmsis-${LIBCMSIS}.build
rm -rf libcmsis-${LIBCMSIS}
fi

if [ ! -e .libstm32-${LIBSTM32}.build ]; then
echo "******************************************************************"
echo "* Unpacking libstm32-${LIBSTM32}"
echo "******************************************************************"
log "Unpacking libstm32-${LIBSTM32}"
tar xfvj ${SOURCES}/libstm32-${LIBSTM32}.tar.bz2
cd libstm32-${LIBSTM32}
echo "******************************************************************"
echo "* Building libstm32-${LIBSTM32}"
echo "******************************************************************"
log "Building libstm32-${LIBSTM32}"
make arch_prefix=${TARGET} prefix=${PREFIX} || exit
echo "******************************************************************"
echo "* Installing libstm32-${LIBSTM32}"
echo "******************************************************************"
log "Installing libstm32-${LIBSTM32}"
make arch_prefix=${TARGET} prefix=${PREFIX} install || exit
cd ..
echo "******************************************************************"
echo "* Cleaning up libstm32-${LIBSTM32}"
echo "******************************************************************"
log "Cleaning up libstm32-${LIBSTM32}"
touch .libstm32-${LIBSTM32}.build
rm -rf libstm32-${LIBSTM32}
fi

if [ ! -e .libstm32usb-${LIBSTM32USB}.build ]; then
echo "******************************************************************"
echo "* Unpacking libstm32usb-${LIBSTM32USB}"
echo "******************************************************************"
log "Unpacking libstm32usb-${LIBSTM32USB}"
tar xfvj ${SOURCES}/libstm32usb-${LIBSTM32USB}.tar.bz2
cd libstm32usb-${LIBSTM32USB}
echo "******************************************************************"
echo "* Building libstm32usb-${LIBSTM32USB}"
echo "******************************************************************"
log "Building libstm32usb-${LIBSTM32USB}"
make arch_prefix=${TARGET} prefix=${PREFIX} || exit
echo "******************************************************************"
echo "* Installing libstm32usb-${LIBSTM32USB}"
echo "******************************************************************"
log "Installing libstm32usb-${LIBSTM32USB}"
make arch_prefix=${TARGET} prefix=${PREFIX} install || exit
cd ..
echo "******************************************************************"
echo "* Cleaning up libstm32usb-${LIBSTM32USB}"
echo "******************************************************************"
log "Cleaning up libstm32usb-${LIBSTM32USB}"
touch .libstm32usb-${LIBSTM32USB}.build
rm -rf libstm32usb-${LIBSTM32USB}
fi
fi

if [ $LIBOPENSTM32_EN != 0 ]; then
echo "******************************************************************"
echo "* Unpacking libopenstm32-${LIBOPENSTM32}"
echo "******************************************************************"
log "Unpacking libopenstm32-${LIBOPENSTM32}"
tar xfvj ${SOURCES}/libopenstm32-${LIBOPENSTM32}.tar.bz2
cd libopenstm32-${LIBOPENSTM32}
echo "******************************************************************"
echo "* Building libopenstm32-${LIBOPENSTM32}"
echo "******************************************************************"
log "Building libopenstm32-${LIBOPENSTM32}"
make PREFIX=${TARGET} DESTDIR=${PREFIX} || exit
echo "******************************************************************"
echo "* Installing libopenstm32-${LIBOPENSTM32}"
echo "******************************************************************"
log "Installing libopenstm32-${LIBOPENSTM32}"
make PREFIX=${TARGET} DESTDIR=${PREFIX} install || exit
cd ..
echo "******************************************************************"
echo "* Cleaning up libopenstm32-${LIBOPENSTM32}"
echo "******************************************************************"
log "Cleaning up libopenstm32-${LIBOPENSTM32}"
touch .libopenstm32-${LIBOPENSTM32}.build
rm -rf libopenstm32-${LIBOPENSTM32}
fi

0 comments on commit 4e03b34

Please sign in to comment.