2017-06-02 09:33:45 -07:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
rem Needed for board overrides
|
2019-03-28 04:38:15 -07:00
|
|
|
IF "%BOOTLOADER_CODE_DESTINATION_PATH%"=="" (SET BOOTLOADER_CODE_DESTINATION_PATH="..")
|
2017-06-02 09:33:45 -07:00
|
|
|
|
2019-03-28 04:38:15 -07:00
|
|
|
BOOTLOADER_CODE_DESTINATION_FILE=%BOOTLOADER_CODE_DESTINATION_PATH%/bootloader_generated.hxx
|
|
|
|
rm -f %BOOTLOADER_CODE_DESTINATION_FILE%
|
|
|
|
|
|
|
|
echo Starting bootloader compilation...
|
|
|
|
make -j4 -f src/Makefile %1 %2 %3
|
2017-06-02 09:33:45 -07:00
|
|
|
|
|
|
|
if errorlevel 1 echo make compilation failed
|
|
|
|
if errorlevel 1 exit -1
|
|
|
|
|
2019-03-28 04:38:15 -07:00
|
|
|
echo Bootloader build success.
|
2017-06-02 09:33:45 -07:00
|
|
|
|
|
|
|
cd blbuild
|
|
|
|
rem Generate a header file with binary bootloader code
|
2019-03-28 04:38:15 -07:00
|
|
|
java -jar ../../../java_tools/bin2header.jar bootloader.bin %BOOTLOADER_CODE_DESTINATION_FILE% "static const volatile uint8_t bootloader_code[] BOOTLOADER_SECTION"
|
2017-06-02 09:33:45 -07:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
rem Touch 'bootloader_storage.c' to update its modification date (needed for make)
|
|
|
|
copy /b bootloader_storage.c +,,
|