muele-marlin/buildroot/bin/build_example
X-Ryl669 c759b2d2a6 Script to download & build Configurations (#20992)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2021-04-29 08:45:14 -05:00

36 lines
880 B
Bash
Executable file

#!/usr/bin/env bash
if [ "$1" != "internal" ]; then
echo "Don't call this script directly, use build_all_examples instead."
exit 1
fi
SED=$(which gsed || which sed)
HERE=`dirname "$0"`
echo "Testing $3:"
shopt -s nullglob
for sub in find $2/config/examples/$3 -type d; do
[[ -d $sub ]] || continue
base=`basename "$sub"`
if [[ ! -f $sub/Configuration.h ]] && [[ ! -f $sub/Configuration_adv.h ]]; then
echo "No configuration files found in $sub"
continue
fi
echo "Getting configuration files from $sub"
cp "$2/config/default"/*.h Marlin/
cp "$sub"/Configuration.h Marlin/ 2>/dev/null
cp "$sub"/Configuration_adv.h Marlin/ 2>/dev/null
cp "$sub"/_Bootscreen.h Marlin/ 2>/dev/null
cp "$sub"/_Statusscreen.h Marlin/ 2>/dev/null
echo "Building the firmware now..."
echo "$HERE/mftest" -a || exit 1
done
echo "Success"
exit 0