LIBOPENSTM32_EN=1
# Make the gcc default to Cortex-M3
DEFAULT_TO_CORTEX_M3=0
+# Override automatic detection of cpus to compile on
+CPUS=
##############################################################################
# Parsing command line parameters
DEFAULT_TO_CORTEX_M3=*)
DEFAULT_TO_CORTEX_M3=$(echo $1 | sed 's,^DEFAULT_TO_CORTEX_M3=,,')
;;
+ CPUS=*)
+ CPUS=$(echo $1 | sed 's,^CPUS=,,')
+ ;;
*)
echo "Unknown parameter: $1"
exit 1
echo "LIBSTM32_EN=$LIBSTM32_EN"
echo "LIBOPENSTM32_EN=$LIBOPENSTM32_EN"
echo "DEFAULT_TO_CORTEX_M3=$DEFAULT_TO_CORTEX_M3"
+echo "CPUS=$CPUS"
##############################################################################
# Version and download url settings section
# Flags section
##############################################################################
-if which getconf > /dev/null; then
- CPUS=$(getconf _NPROCESSORS_ONLN)
+if [ "x${CPUS}" == "x" ]; then
+ if which getconf > /dev/null; then
+ CPUS=$(getconf _NPROCESSORS_ONLN)
+ else
+ CPUS=1
+ fi
+
+ PARALLEL=-j$((CPUS + 1))
else
- CPUS=1
+ PARALLEL=-j${CPUS}
fi
-PARALLEL=-j$((CPUS + 1))
+
echo "${CPUS} cpu's detected running make with '${PARALLEL}' flag"
GDBFLAGS=
function fetch {
if [ ! -e ${STAMPS}/$1.fetch ]; then
log "Downloading $1 sources..."
- wget -c --no-passive-ftp $2
- touch ${STAMPS}/$1.fetch
+ wget -c --no-passive-ftp $2 && touch ${STAMPS}/$1.fetch
fi
}