2020-07-09 07:27:20 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-07-01 11:09:01 -07:00
|
|
|
SCRIPT_NAME="common_make.sh"
|
|
|
|
echo "Entering $SCRIPT_NAME"
|
|
|
|
|
2020-09-28 15:25:15 -07:00
|
|
|
cd ../../..
|
|
|
|
|
2020-07-01 11:09:01 -07:00
|
|
|
mkdir .dep
|
|
|
|
# todo: start using env variable for number of threads or for '-r'
|
2021-03-06 09:55:46 -08:00
|
|
|
make -j$(nproc) -r
|
2020-07-01 11:09:01 -07:00
|
|
|
[ -e build/rusefi.hex ] || { echo "FAILED to compile by $SCRIPT_NAME with $PROJECT_BOARD $DEBUG_LEVEL_OPT and $EXTRA_PARAMS"; exit 1; }
|
2021-11-05 16:28:55 -07:00
|
|
|
if [ $USE_OPENBLT = "yes" ]; then
|
|
|
|
make openblt
|
|
|
|
[ -e build-openblt/openblt_$PROJECT_BOARD.hex ] || { echo "FAILED to compile OpneBLT by $SCRIPT_NAME with $PROJECT_BOARD"; exit 1; }
|
|
|
|
fi
|
2020-07-01 11:09:01 -07:00
|
|
|
|
|
|
|
if uname | grep "NT"; then
|
2021-11-02 04:41:41 -07:00
|
|
|
HEX2DFU=../misc/encedo_hex2dfu/hex2dfu.exe
|
2020-07-01 11:09:01 -07:00
|
|
|
else
|
2021-11-02 04:41:41 -07:00
|
|
|
HEX2DFU=../misc/encedo_hex2dfu/hex2dfu.bin
|
2020-07-01 11:09:01 -07:00
|
|
|
fi
|
2021-11-02 04:41:41 -07:00
|
|
|
chmod u+x $HEX2DFU
|
|
|
|
|
|
|
|
mkdir -p deliver
|
|
|
|
|
|
|
|
rm -f deliver/rusefi.dfu
|
|
|
|
echo "$SCRIPT_NAME: invoking hex2dfu for RusEFI"
|
2021-11-05 16:28:55 -07:00
|
|
|
$HEX2DFU -i build/rusefi.hex -C 0x1C -o deliver/rusefi.dfu
|
2021-11-02 04:41:41 -07:00
|
|
|
|
2020-09-29 15:50:51 -07:00
|
|
|
# rusEFI console does not use .hex files but for Cypress that's the primary binary format
|
2020-09-29 14:04:41 -07:00
|
|
|
cp build/rusefi.hex deliver/
|
2020-07-01 11:09:01 -07:00
|
|
|
cp build/rusefi.bin deliver/
|
2021-11-02 04:41:41 -07:00
|
|
|
cp build/rusefi.srec deliver/
|
2020-07-01 11:09:01 -07:00
|
|
|
|
2021-11-05 16:28:55 -07:00
|
|
|
# bootloader
|
|
|
|
if [ $USE_OPENBLT = "yes" ]; then
|
|
|
|
rm -f deliver/openblt_$PROJECT_BOARD.dfu
|
|
|
|
echo "$SCRIPT_NAME: invoking hex2dfu for OpenBLT"
|
|
|
|
$HEX2DFU -i build-openblt/openblt_$PROJECT_BOARD.hex -o deliver/openblt_$PROJECT_BOARD.dfu
|
|
|
|
|
|
|
|
cp build-openblt/openblt_$PROJECT_BOARD.hex deliver/
|
|
|
|
cp build-openblt/openblt_$PROJECT_BOARD.bin deliver/
|
|
|
|
cp build-openblt/openblt_$PROJECT_BOARD.srec deliver/
|
|
|
|
|
|
|
|
rm -f deliver/rusefi_openblt.dfu
|
|
|
|
echo "$SCRIPT_NAME: invoking hex2dfu for composite RusEFI+OpenBLT image"
|
|
|
|
$HEX2DFU -i build-openblt/openblt_$PROJECT_BOARD.hex -i build/rusefi.hex -C 0x1C -o deliver/rusefi_openblt.dfu
|
|
|
|
fi
|
|
|
|
|
2020-09-27 03:13:58 -07:00
|
|
|
echo "$SCRIPT_NAME: build folder content:"
|
|
|
|
ls -l build
|
|
|
|
|
|
|
|
echo "$SCRIPT_NAME: deliver folder content:"
|
2020-07-01 11:09:01 -07:00
|
|
|
ls -l deliver
|
|
|
|
|
2020-07-09 07:27:20 -07:00
|
|
|
bash config/boards/clean_env_variables.sh
|