summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsummon-arm-toolchain34
1 files changed, 16 insertions, 18 deletions
diff --git a/summon-arm-toolchain b/summon-arm-toolchain
index c8c29d5..46724fd 100755
--- a/summon-arm-toolchain
+++ b/summon-arm-toolchain
@@ -28,6 +28,7 @@ LIBOPENSTM32=master
LIBSTM32_EN=0
LIBOPENSTM32_EN=0
+SUDO=
SUMMON_DIR=$(pwd)
SOURCES=${SUMMON_DIR}/sources
STAMPS=${SUMMON_DIR}/stamps
@@ -60,6 +61,12 @@ function unpack {
tar xvaf $1
}
+# Install a build
+function install {
+ log $1
+ ${SUDO} make ${PARALLEL} $2 $3 $4 $5 $6 $7 $8
+}
+
case "$(uname)" in
Linux)
echo "Found Linux OS."
@@ -153,8 +160,7 @@ if [ ! -e ${STAMPS}/${BINUTILS}.build ]; then
${BINUTILFLAGS}
log "Building ${BINUTILS}"
make ${PARALLEL}
- log "Installing ${BINUTILS}"
- make install
+ install ${BINUTILS} install
cd ..
log "Cleaning up ${BINUTILS}"
touch ${STAMPS}/${BINUTILS}.build
@@ -181,8 +187,7 @@ if [ ! -e ${STAMPS}/${GCC}-boot.build ]; then
${GCCFLAGS}
log "Building ${GCC}-boot"
make ${PARALLEL} all-gcc
- log "Installing ${GCC}-boot"
- make install-gcc
+ install ${GCC}-boot install-gcc
cd ..
log "Cleaning up ${GCC}-boot"
touch ${STAMPS}/${GCC}-boot.build
@@ -205,8 +210,7 @@ if [ ! -e ${STAMPS}/${NEWLIB}.build ]; then
--disable-newlib-supplied-syscalls
log "Building ${NEWLIB}"
make ${PARALLEL}
- log "Installing ${NEWLIB}"
- make install
+ install ${NEWLIB} install
cd ..
log "Cleaning up ${NEWLIB}"
touch ${STAMPS}/${NEWLIB}.build
@@ -233,8 +237,7 @@ if [ ! -e ${STAMPS}/${GCC}.build ]; then
${GCCFLAGS}
log "Building ${GCC}"
make ${PARALLEL}
- log "Installing ${GCC}"
- make install
+ install ${GCC} install
cd ..
log "Cleaning up ${GCC}"
touch ${STAMPS}/${GCC}.build
@@ -254,8 +257,7 @@ if [ ! -e ${STAMPS}/${GDB}.build ]; then
${GDBFLAGS}
log "Building ${GDB}"
make ${PARALLEL}
- log "Installing ${GDB}"
- make install
+ install ${GDB} install
cd ..
log "Cleaning up ${GDB}"
touch ${STAMPS}/${GDB}.build
@@ -269,8 +271,7 @@ if [ ! -e .libcmsis-${LIBCMSIS}.build ]; then
cd libcmsis-${LIBCMSIS}
log "Building libcmsis-${LIBCMSIS}"
make arch_prefix=${TARGET} prefix=${PREFIX}
- log "Installing libcmsis-${LIBCMSIS}"
- make arch_prefix=${TARGET} prefix=${PREFIX} install
+ install libcmsis-${LIBCMSIS} arch_prefix=${TARGET} prefix=${PREFIX} install
cd ..
log "Cleaning up libcmsis-${LIBCMSIS}"
touch .libcmsis-${LIBCMSIS}.build
@@ -283,8 +284,7 @@ if [ ! -e .libstm32-${LIBSTM32}.build ]; then
cd libstm32-${LIBSTM32}
log "Building libstm32-${LIBSTM32}"
make arch_prefix=${TARGET} prefix=${PREFIX}
- log "Installing libstm32-${LIBSTM32}"
- make arch_prefix=${TARGET} prefix=${PREFIX} install
+ install libstm32-${LIBSTM32} arch_prefix=${TARGET} prefix=${PREFIX} install
cd ..
log "Cleaning up libstm32-${LIBSTM32}"
touch .libstm32-${LIBSTM32}.build
@@ -297,8 +297,7 @@ if [ ! -e .libstm32usb-${LIBSTM32USB}.build ]; then
cd libstm32usb-${LIBSTM32USB}
log "Building libstm32usb-${LIBSTM32USB}"
make arch_prefix=${TARGET} prefix=${PREFIX}
- log "Installing libstm32usb-${LIBSTM32USB}"
- make arch_prefix=${TARGET} prefix=${PREFIX} install
+ install libstm32usb-${LIBSTM32USB} arch_prefix=${TARGET} prefix=${PREFIX} install
cd ..
log "Cleaning up libstm32usb-${LIBSTM32USB}"
touch .libstm32usb-${LIBSTM32USB}.build
@@ -312,8 +311,7 @@ if [ $LIBOPENSTM32_EN != 0 ]; then
cd libopenstm32-${LIBOPENSTM32}
log "Building libopenstm32-${LIBOPENSTM32}"
make PREFIX=${TARGET} DESTDIR=${PREFIX}
- log "Installing libopenstm32-${LIBOPENSTM32}"
- make PREFIX=${TARGET} DESTDIR=${PREFIX} install
+ install libopenstm32-${LIBOPENSTM32} PREFIX=${TARGET} DESTDIR=${PREFIX} install
cd ..
log "Cleaning up libopenstm32-${LIBOPENSTM32}"
touch .libopenstm32-${LIBOPENSTM32}.build