diff --git a/build.sh b/build.sh index 271501a..ce7e55e 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,33 @@ #!/bin/bash -set -e -set -x +usage() +{ + # Display Help + echo "This script launch the build of the code." + echo + echo "options:" + echo "-h Print this Help." + echo "-RPI Set Raspberry PI version" + echo "-clean Run clean before building" + echo "-full Run full build" + echo "-all Run the entire build" +} + +export clean=0; +export minimal=1 + +while true +do + case "$1" in + -h|--help) usage ; exit 0;; + -RPI) export RPI=$2 ; shift;; + -clean) export clean=1 ; shift;; + -all) export minimal=0 ; shift;; + --) shift ; break;; + *) break;; + esac +done + if [ -z "${RPI}" ] ; then echo "\$RPI missing, exting" @@ -20,29 +46,52 @@ if [ "${RPI}" -gt "1" ]; then OPTIONS="${OPTIONS} -o ARM_ALLOW_MULTI_CORE" fi -# Build circle-stdlib library -cd circle-stdlib/ -make mrproper || true -./configure -r ${RPI} --prefix "${TOOLCHAIN_PREFIX}" ${OPTIONS} -o KERNEL_MAX_SIZE=0x400000 -make -j +if [ ${minimal} -eq 1 ] +then -# Build additional libraries -cd libs/circle/addon/display/ -make clean || true -make -j -cd ../sensor/ -make clean || true -make -j -cd ../Properties/ -make clean || true -make -j -cd ../../../.. + # Build circle-stdlib library + cd circle-stdlib/ + if [ ${clean} -eq 1 ] + then + make mrproper || true + fi + ./configure -r ${RPI} --prefix "${TOOLCHAIN_PREFIX}" ${OPTIONS} -o KERNEL_MAX_SIZE=0x400000 + make -j -cd .. + + # Build additional libraries + cd libs/circle/addon/display/ + if [ ${clean} -eq 1 ] + then + make clean || true + fi + make -j + + cd ../sensor/ + if [ ${clean} -eq 1 ] + then + make clean || true + fi + make -j + + cd ../Properties/ + if [ ${clean} -eq 1 ] + then + make clean || true + fi + make -j + + cd ../../../.. + + cd .. +fi # Build MiniDexed cd src -make clean || true +if [ ${clean} -eq 1 ] +then + make clean || true +fi make -j ls *.img cd .. diff --git a/incrementalBuild.sh b/incrementalBuild.sh deleted file mode 100644 index 6dd6a14..0000000 --- a/incrementalBuild.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -set -e -set -x - -if [ -z "${RPI}" ] ; then -# echo "\$RPI missing, exting" -# exit 1 - export RPI=4 -fi - -if [ "${RPI}" -gt "2" ]; then - export TOOLCHAIN_PREFIX="aarch64-none-elf-" -else - export TOOLCHAIN_PREFIX="arm-none-eabi-" -fi - -# Define system options -OPTIONS="-o USE_PWM_AUDIO_ON_ZERO -o SAVE_VFP_REGS_ON_IRQ -o REALTIME -o SCREEN_DMA_BURST_LENGTH=1" -if [ "${RPI}" -gt "1" ]; then - OPTIONS="${OPTIONS} -o ARM_ALLOW_MULTI_CORE" -fi - -# Build circle-stdlib library -# cd circle-stdlib/ -# make mrproper || true -# ./configure -r ${RPI} --prefix "${TOOLCHAIN_PREFIX}" ${OPTIONS} -o KERNEL_MAX_SIZE=0x400000 -# make -j - -# Build additional libraries -# cd libs/circle/addon/display/ -# make clean || true -# make -j -# cd ../sensor/ -# make clean || true -# make -j -# cd ../Properties/ -# make clean || true -# make -j -# cd ../../../.. - -# cd .. - -# Build MiniDexed -cd src -# make clean || true -make -j -ls *.img -cd .. diff --git a/make-all.sh b/make-all.sh new file mode 100755 index 0000000..5cc45e5 --- /dev/null +++ b/make-all.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +./make.sh -RPI 4 -prepenv -sysex -zip $* \ No newline at end of file diff --git a/make.sh b/make.sh new file mode 100755 index 0000000..42b9165 --- /dev/null +++ b/make.sh @@ -0,0 +1,142 @@ +#!/bin/bash + +set +x + +# this script install the dev environment and assume that the repository is alreadw cloned +usage() +{ + # Display Help + echo "usage: make-sh [