2018-11-26 19:24:24 +00:00
|
|
|
#!/bin/bash
|
2022-07-04 18:46:46 +00:00
|
|
|
BUILD_ENV="1.0.8"
|
2018-11-26 19:24:24 +00:00
|
|
|
SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
|
2022-08-29 10:39:54 +00:00
|
|
|
LANGUAGES=$1
|
2018-11-26 19:24:24 +00:00
|
|
|
|
|
|
|
if [ ! -d "build-env" ]; then
|
|
|
|
mkdir build-env || exit 1
|
|
|
|
fi
|
|
|
|
cd build-env || exit 2
|
|
|
|
|
2022-08-29 10:39:54 +00:00
|
|
|
if [ ! -d "../../PF-build-env-$BUILD_ENV-build" ]; then
|
2022-02-21 11:06:02 +00:00
|
|
|
if [ ! -f "PF-build-env-Linux64-$BUILD_ENV.zip" ]; then
|
2022-02-24 08:09:15 +00:00
|
|
|
#wget https://github.com/3d-gussner/PF-build-env-1/releases/download/$BUILD_ENV-Linux64/PF-build-env-Linux64-$BUILD_ENV.zip || exit 3
|
|
|
|
wget https://github.com/prusa3d/PF-build-env/releases/download/$BUILD_ENV-Linux64/PF-build-env-Linux64-$BUILD_ENV.zip || exit 3
|
2022-02-21 11:06:02 +00:00
|
|
|
fi
|
2022-08-29 10:39:54 +00:00
|
|
|
unzip -q PF-build-env-Linux64-$BUILD_ENV.zip -d ../../PF-build-env-$BUILD_ENV-build || exit 4
|
2018-11-26 19:24:24 +00:00
|
|
|
fi
|
|
|
|
|
2022-08-29 10:39:54 +00:00
|
|
|
cd ../../PF-build-env-$BUILD_ENV-build || exit 5
|
2018-11-26 19:24:24 +00:00
|
|
|
BUILD_ENV_PATH="$( pwd -P )"
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
if [ ! -d "Prusa-Firmware-build" ]; then
|
|
|
|
mkdir Prusa-Firmware-build || exit 6
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd Prusa-Firmware-build || exit 7
|
|
|
|
BUILD_PATH="$( pwd -P )"
|
|
|
|
|
|
|
|
if [ ! -f "$SCRIPT_PATH/Firmware/Configuration_prusa.h" ]; then
|
|
|
|
cp $SCRIPT_PATH/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h $SCRIPT_PATH/Firmware/Configuration_prusa.h || exit 8
|
|
|
|
fi
|
|
|
|
|
2022-08-29 10:39:54 +00:00
|
|
|
if [[ ! -z $LANGUAGES && $LANGUAGES == "EN_ONLY" ]]; then
|
|
|
|
echo "English only language firmware will be built"
|
|
|
|
sed -i -- "s/^#define LANG_MODE *1/#define LANG_MODE 0/g" $SCRIPT_PATH/Firmware/config.h
|
|
|
|
else
|
|
|
|
sed -i -- "s/^#define LANG_MODE *0/#define LANG_MODE 1/g" $SCRIPT_PATH/Firmware/config.h
|
|
|
|
fi
|
|
|
|
|
2022-02-21 11:06:02 +00:00
|
|
|
$BUILD_ENV_PATH/arduino $SCRIPT_PATH/Firmware/Firmware.ino --verify --board PrusaResearch:avr:prusa_einsy_rambo --pref build.path=$BUILD_PATH --pref compiler.warning_level=all || exit 9
|
2018-11-26 19:24:24 +00:00
|
|
|
|
|
|
|
export ARDUINO=$BUILD_ENV_PATH
|
|
|
|
|
2022-08-29 10:39:54 +00:00
|
|
|
if [ -z $LANGUAGES ]; then
|
|
|
|
cd $SCRIPT_PATH/lang
|
|
|
|
./fw-build.sh || exit 10
|
|
|
|
fi
|
|
|
|
|
|
|
|
#Reset lang_mode
|
|
|
|
sed -i -- "s/^#define LANG_MODE *0/#define LANG_MODE 1/g" $SCRIPT_PATH/Firmware/config.h
|