##############################################################################
TARGET=arm-none-eabi # Or: TARGET=arm-elf
PREFIX=${HOME}/sat # Install location of your final toolchain
-PARALLEL= # Or: PARALLEL="-j 5" for 4 CPUs
DARWIN_OPT_PATH=/opt/local # Path in which MacPorts or Fink is installed
# Set to 'sudo' if you need superuser privileges while installing
SUDO=
# Flags section
##############################################################################
+CPUS=$(getconf _NPROCESSORS_ONLN)
+PARALLEL=-j$((CPUS + 1))
+echo "${CPUS} cpu's detected running make with '${PARALLEL}' flag"
+
GDBFLAGS=
BINUTILFLAGS=
GCCFLAGS=
else
# To default to the Cortex-M3:
- GCCFLAGS="--with-arch=armv7-m --with-mode=thumb"
+ GCCFLAGS="--with-arch=armv7-m --with-mode=thumb --with-float=soft"
fi
# Pull in the local configuration, if any
--with-gnu-ld \
--disable-nls \
--disable-werror \
- --disable-newlib-supplied-syscalls
+ --disable-newlib-supplied-syscalls \
+ --with-float=soft
log "Building ${NEWLIB}"
- make ${MAKEFLAGS}
+ make ${MAKEFLAGS} CFLAGS_FOR_TARGET="-msoft-float" CCASFLAGS="-msoft-float"
install ${NEWLIB} install
cd ..
log "Cleaning up ${NEWLIB}"
fi
if [ ${LIBSTM32_EN} != 0 ]; then
-if [ ! -e .libcmsis-${LIBCMSIS}.build ]; then
+if [ ! -e ${STAMPS}/libcmsis-${LIBCMSIS}.build ]; then
unpack libcmsis-${LIBCMSIS}
cd libcmsis-${LIBCMSIS}
log "Building libcmsis-${LIBCMSIS}"
install libcmsis-${LIBCMSIS} arch_prefix=${TARGET} prefix=${PREFIX} install
cd ..
log "Cleaning up libcmsis-${LIBCMSIS}"
- touch .libcmsis-${LIBCMSIS}.build
+ touch ${STAMPS}/libcmsis-${LIBCMSIS}.build
rm -rf libcmsis-${LIBCMSIS}
fi
-if [ ! -e .libstm32-${LIBSTM32}.build ]; then
+if [ ! -e ${STAMPS}/libstm32-${LIBSTM32}.build ]; then
unpack libstm32-${LIBSTM32}
cd libstm32-${LIBSTM32}
log "Building libstm32-${LIBSTM32}"
install libstm32-${LIBSTM32} arch_prefix=${TARGET} prefix=${PREFIX} install
cd ..
log "Cleaning up libstm32-${LIBSTM32}"
- touch .libstm32-${LIBSTM32}.build
+ touch ${STAMPS}/libstm32-${LIBSTM32}.build
rm -rf libstm32-${LIBSTM32}
fi
-if [ ! -e .libstm32usb-${LIBSTM32USB}.build ]; then
+if [ ! -e ${STAMPS}/libstm32usb-${LIBSTM32USB}.build ]; then
unpack libstm32usb-${LIBSTM32USB}
cd libstm32usb-${LIBSTM32USB}
log "Building libstm32usb-${LIBSTM32USB}"
install libstm32usb-${LIBSTM32USB} arch_prefix=${TARGET} prefix=${PREFIX} install
cd ..
log "Cleaning up libstm32usb-${LIBSTM32USB}"
- touch .libstm32usb-${LIBSTM32USB}.build
+ touch ${STAMPS}/libstm32usb-${LIBSTM32USB}.build
rm -rf libstm32usb-${LIBSTM32USB}
fi
fi
if [ $LIBOPENSTM32_EN != 0 ]; then
+if [ ! -e ${STAMPS}/libopenstm32-${LIBOPENSTM32}.build ]; then
unpack libopenstm32-${LIBOPENSTM32}
cd libopenstm32-${LIBOPENSTM32}
log "Building libopenstm32-${LIBOPENSTM32}"
install libopenstm32-${LIBOPENSTM32} PREFIX=${TARGET} DESTDIR=${PREFIX} install
cd ..
log "Cleaning up libopenstm32-${LIBOPENSTM32}"
- touch .libopenstm32-${LIBOPENSTM32}.build
+ touch ${STAMPS}/libopenstm32-${LIBOPENSTM32}.build
rm -rf libopenstm32-${LIBOPENSTM32}
fi
+fi