1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-01-17 06:08:15 +01:00
Grbl_Esp32/build-all.sh
Stefan de Bruijn 7b6b4b2087
Fixed C++ includes (#518)
* Moved all files to the src folder

* Removed all cpp includes; fixed by including the header file where needed

* Fixed build scripts and machine.h

* Removed temp file. sigh.

Co-authored-by: Stefan de Bruijn <stefan@nubilosoft.com>
2020-08-08 08:18:05 -10:00

42 lines
927 B
Bash
Executable File

#!/bin/bash
# This shell script uses PlatformIO to compile Grbl_ESP32
# for every machine configuration in the Machines/ directory.
# It is useful for automated testing.
trap "echo; exit 255" SIGINT
# With -v, show all output. Otherwise, show just the result
if [ "$1" = "-v" ]; then
FILTER="cat"
else
FILTER="grep error\|Took"
fi
set -o pipefail
NUM_ERRORS=0
BuildMachine () {
basename=$1
BF="\"-DMACHINE_FILENAME=$basename\""
displayname=$basename
echo "Building machine $displayname"
PLATFORMIO_BUILD_FLAGS=$BF platformio run 2>&1 | $FILTER
local re=$?
# check result
if [ $re -ne 0 ]; then
echo "Failed to build machine $displayname"
echo
NUM_ERRORS=$(( NUM_ERRORS + 1 ))
return $re
fi
echo
}
# Build all the machines
for file in `ls ./Grbl_Esp32/src/Machines/*`; do
base=`basename $file`
BuildMachine $base ""
done
exit $NUM_ERRORS