924 lines
36 KiB
Batchfile
924 lines
36 KiB
Batchfile
|
@echo off && setlocal enabledelayedexpansion
|
|||
|
@echo %PATH% | findstr /c:"%~dp0tools/msys64/usr/bin">nul
|
|||
|
@if %errorlevel% equ 1 set PATH=%~dp0tools/msys64/usr/bin;%PATH%
|
|||
|
rem @set PATH=%~dp0tools/msys64/usr/bin;%PATH%
|
|||
|
cls
|
|||
|
set PROJECT_NAME=at_command
|
|||
|
set BOARD_NAME=ec7xx_0h00
|
|||
|
set CHIP_NAME=ec7xx
|
|||
|
set CHIP_TYPE=ec718um
|
|||
|
set CORE_NAME=ap
|
|||
|
set EUTRAN_MODE=cat_mode
|
|||
|
set BUILD_OPTION=merge
|
|||
|
set UNILOG=false
|
|||
|
set TOOLCHAIN_NAME=GCC
|
|||
|
set CUST=common
|
|||
|
set SDKREL=false
|
|||
|
set OPENCPU=false
|
|||
|
set RAM_ENBALE=false
|
|||
|
set ROM_ENBALE=false
|
|||
|
set LESS_LOG=false
|
|||
|
set LTO_ENABLE=false
|
|||
|
set PWR_TEST=false
|
|||
|
set BUILD_HEADBIN=false
|
|||
|
set GCCLIB_PATH="C:\gcc"
|
|||
|
set COMDBLIB_PATH=".\prebuild\PLAT\lib\gcc\%CHIP_TYPE%\full"
|
|||
|
set CPBIN_SUBPATH=oc
|
|||
|
set PKG_MAPDEF=pkg_718um_mapdef
|
|||
|
set PKG_PRODUCT="EC718UM_PRD"
|
|||
|
set OUTPUT_NAME=%BOARD_NAME%_%CHIP_TYPE%
|
|||
|
set JOBNUMBER=j4
|
|||
|
|
|||
|
echo build.bat version 20180330
|
|||
|
echo GCCLIB_PATH: %GCCLIB_PATH%
|
|||
|
|
|||
|
|
|||
|
if not %GCCLIB_PATH% == "" (
|
|||
|
if not exist %GCCLIB_PATH% (
|
|||
|
echo ERROR: Please check GCCLIB_PATH setting, exit!!!
|
|||
|
goto end
|
|||
|
)
|
|||
|
) else (
|
|||
|
echo ERROR: Please set GCCLIB_PATH firstly, exit!!!
|
|||
|
goto end
|
|||
|
)
|
|||
|
|
|||
|
rem --------- board/project parsing begain------------------
|
|||
|
|
|||
|
set PARAMETERS=%1
|
|||
|
if xx%PARAMETERS%==xx (
|
|||
|
echo no input paramter, use default build setting
|
|||
|
) else (
|
|||
|
echo build option is: %PARAMETERS%
|
|||
|
)
|
|||
|
|
|||
|
set parameterStr=%PARAMETERS%
|
|||
|
|
|||
|
|
|||
|
:parameterSplit
|
|||
|
|
|||
|
for /f "tokens=1,* delims=-" %%a in ("%parameterStr%") do (
|
|||
|
|
|||
|
set parameterStr=%%b
|
|||
|
|
|||
|
echo %%a | findstr /r "j[0-9]*[0-9]\>" > nul
|
|||
|
if !errorlevel!==0 (
|
|||
|
set JOBNUMBER=%%a
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="qcom" (
|
|||
|
set CUST=qcom
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="ec718_0h00" (
|
|||
|
set BOARD_NAME=ec718_0h00
|
|||
|
set CHIP_NAME=ec7xx
|
|||
|
set OUTPUT_NAME=ec718_0h00_%CHIP_TYPE%
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="bootloader" (
|
|||
|
set PROJECT_NAME=bootloader
|
|||
|
set BUILD_OPTION=no_merge
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="ap" (
|
|||
|
set CORE_NAME=ap
|
|||
|
set BUILD_OPTION=no_merge
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="cp" (
|
|||
|
set CORE_NAME=cp
|
|||
|
set PROJECT_NAME=cp_project
|
|||
|
set BUILD_OPTION=no_merge
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="pwrTest" (
|
|||
|
set PWR_TEST=true
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="nb_mode" (
|
|||
|
set EUTRAN_MODE=nb_mode
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="at_command" (
|
|||
|
set PROJECT_NAME=at_command
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="socket_example" (
|
|||
|
set PROJECT_NAME=socket_example
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="mqtt_example" (
|
|||
|
set PROJECT_NAME=mqtt_example
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="https_example" (
|
|||
|
set PROJECT_NAME=https_example
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="ssl_example" (
|
|||
|
set PROJECT_NAME=ssl_example
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="libapi_example" (
|
|||
|
set PROJECT_NAME=libapi_example
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="pos_example" (
|
|||
|
set PROJECT_NAME=pos_example
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="tts_example" (
|
|||
|
set PROJECT_NAME=tts_example
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="audio_example" (
|
|||
|
set PROJECT_NAME=audio_example
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="lpuart_test" (
|
|||
|
set PROJECT_NAME=lpuart_test
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="driver_example" (
|
|||
|
set PROJECT_NAME=driver_example
|
|||
|
set BUILD_OPTION=no_merge
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="dhrystone" (
|
|||
|
set PROJECT_NAME=dhrystone
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="coremark" (
|
|||
|
set PROJECT_NAME=coremark
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="slpman_example" (
|
|||
|
set PROJECT_NAME=slpman_example
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="sleep_example" (
|
|||
|
set PROJECT_NAME=sleep_example
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="slpPressure_test" (
|
|||
|
set PROJECT_NAME=slpPressure_test
|
|||
|
set BUILD_OPTION=no_merge
|
|||
|
set LTO_ENABLE=false
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="ChipIpTest" (
|
|||
|
set PROJECT_NAME=ChipIpTest
|
|||
|
set BUILD_OPTION=no_merge
|
|||
|
set LTO_ENABLE=false
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="ModemSlpPressure" (
|
|||
|
set CORE_NAME=cp
|
|||
|
set PROJECT_NAME=ModemSlpPressure
|
|||
|
set BUILD_OPTION=no_merge
|
|||
|
set LTO_ENABLE=false
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="mcu_example" (
|
|||
|
set PROJECT_NAME=mcu_example
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="soc_simple" (
|
|||
|
set PROJECT_NAME=soc_simple
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="soc_bist" (
|
|||
|
set PROJECT_NAME=soc_bist
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="simo_test" (
|
|||
|
set PROJECT_NAME=simo_test
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="clk_verify" (
|
|||
|
set PROJECT_NAME=clk_verify
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="qspi_test" (
|
|||
|
set PROJECT_NAME=qspi_test
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="fpga_sct_utfw" (
|
|||
|
set PROJECT_NAME=fpga_sct_utfw
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="spi_2boards" (
|
|||
|
set PROJECT_NAME=spi_2boards
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="merge" (
|
|||
|
set BUILD_OPTION=merge
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="sdkrel" (
|
|||
|
set SDKREL=true
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="lto" (
|
|||
|
set LTO_ENABLE=true
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="open_cpu" (
|
|||
|
set OPENCPU=true
|
|||
|
set COMDBLIB_PATH=".\prebuild\PLAT\lib\gcc\%CHIP_TYPE%\oc"
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="audio" (
|
|||
|
set AUDIO_ENABLE=true
|
|||
|
set OPENCPU=true
|
|||
|
set CPBIN_SUBPATH=audio
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="ims" (
|
|||
|
set IMS_ENABLE=true
|
|||
|
set AUDIO_ENABLE=true
|
|||
|
set OPENCPU=true
|
|||
|
set COMDBLIB_PATH=".\prebuild\PLAT\lib\gcc\%CHIP_TYPE%\ims"
|
|||
|
set CPBIN_SUBPATH=audio
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="imsfix" (
|
|||
|
set IMS_ENABLE=true
|
|||
|
set AUDIO_ENABLE=true
|
|||
|
set OPENCPU=true
|
|||
|
set COMDBLIB_PATH=".\prebuild\PLAT\lib\gcc\%CHIP_TYPE%\ims"
|
|||
|
set CPBIN_SUBPATH=audio
|
|||
|
set AUDIO_FIX_ENABLE=true
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="isms" (
|
|||
|
set IMS_SMSONLY_ENABLE=true
|
|||
|
set OPENCPU=true
|
|||
|
set COMDBLIB_PATH=".\prebuild\PLAT\lib\gcc\%CHIP_TYPE%\isms"
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="verbose" (
|
|||
|
set VERBOSE=1
|
|||
|
) else (
|
|||
|
set VERBOSE=0
|
|||
|
)
|
|||
|
|
|||
|
if "%%a"=="secboot" (
|
|||
|
set BUILD_HEADBIN=true
|
|||
|
for /f "tokens=1* delims=" %%a in ('type ".\project\%BOARD_NAME%\ap\apps\bootloader\GCC\Makefile"') do (
|
|||
|
if "%%a" equ "CONFIG_PROJ_APP_SECURITY_BOOT = n" (
|
|||
|
echo CONFIG_PROJ_APP_SECURITY_BOOT=y
|
|||
|
) else (
|
|||
|
echo %%a
|
|||
|
)
|
|||
|
)>>temp.txt
|
|||
|
|
|||
|
type temp.txt | findstr /v ECHO >>temp1.txt
|
|||
|
del temp.txt
|
|||
|
move temp1.txt ".\project\%BOARD_NAME%\ap\apps\bootloader\GCC\Makefile" >nul
|
|||
|
)
|
|||
|
)
|
|||
|
|
|||
|
if not "%parameterStr%"=="" goto parameterSplit
|
|||
|
|
|||
|
echo curr Board is: %BOARD_NAME%
|
|||
|
echo curr Chip is: %CHIP_NAME%
|
|||
|
echo curr Type is: %CHIP_TYPE%
|
|||
|
echo curr Project is: %PROJECT_NAME%
|
|||
|
echo curr core is: %CORE_NAME%
|
|||
|
echo curr option is: %BUILD_OPTION%
|
|||
|
echo cp bin subpath: %CPBIN_SUBPATH%
|
|||
|
rem duplicate comdblib.txt from 'COMDBLIB_PATH' to '.\tools\'
|
|||
|
if exist %COMDBLIB_PATH%\comdblib.txt (
|
|||
|
xcopy /f /y %COMDBLIB_PATH%\comdblib.txt .\tools\
|
|||
|
)
|
|||
|
|
|||
|
if "%CUST%"=="qcom" (
|
|||
|
rem clear AT ref for qcom
|
|||
|
for /f "tokens=1* delims=" %%a in ('type ".\device\target\board\%BOARD_NAME%\ap\%BOARD_NAME%_ap.mk"') do (
|
|||
|
if "%%a" equ "PS_AT_REF=y" (
|
|||
|
echo PS_AT_REF=n
|
|||
|
) else if "%%a" equ "BUILD_AT_REF ?=n" (
|
|||
|
echo BUILD_AT_REF=n
|
|||
|
) else (
|
|||
|
echo %%a
|
|||
|
)
|
|||
|
)>>temp.txt
|
|||
|
|
|||
|
type temp.txt | findstr /v ECHO >>temp1.txt
|
|||
|
del temp.txt
|
|||
|
move temp1.txt ".\device\target\board\%BOARD_NAME%\ap\%BOARD_NAME%_ap.mk" >nul
|
|||
|
)
|
|||
|
|
|||
|
|
|||
|
rem --------- if more board/project add here-------------
|
|||
|
rem --------- board/project parsing end------------------
|
|||
|
|
|||
|
|
|||
|
echo PARAMETERS: %PARAMETERS% | findstr "help"
|
|||
|
if not errorlevel 1 (
|
|||
|
echo "=============================================================================================="
|
|||
|
echo " "
|
|||
|
echo " >> HOW TO BUILD A PROJECT << "
|
|||
|
echo " "
|
|||
|
echo "==============================================================================================<3D><>
|
|||
|
echo " "
|
|||
|
echo " @FORMAT : Gccbuild.bat [<board>[-<core>[-<project>[-<option>]]]] "
|
|||
|
echo " @CAUTION: All parameters (<board>/<core>/<project>/<option>) are optional, "
|
|||
|
echo " and the default settings of the project will take effect if it occurs! "
|
|||
|
echo " For <board>, only 'ec618_0h00' is supportted, and it should be omitted ! "
|
|||
|
echo " "
|
|||
|
echo "**********************************************************************************************"
|
|||
|
echo " <options>: "
|
|||
|
echo " >> Basic "
|
|||
|
echo " merge compile bl, cp and ap images and merge them into a package. [default] "
|
|||
|
echo " doc run doxygen to generate the documents. "
|
|||
|
echo " clean clean the output files for a specific board and project. "
|
|||
|
echo " clall clean all output files for every board and project. "
|
|||
|
echo " allprojects trigger to compile all example projects of the default board "
|
|||
|
echo " list list all supported boards and supported projects for every board "
|
|||
|
echo " help display this help message. "
|
|||
|
echo " "
|
|||
|
echo " >> Advanced "
|
|||
|
echo " NULL(default) full feature support<72><74>no ims<6D><73>, AP lib: full, CP image<67><65>oc "
|
|||
|
echo " open_cpu for open dev, more ram, AP lib: oc, CP image<67><65>oc "
|
|||
|
echo " isms open_cpu + ims sms, AP lib: isms, CP image<67><65>oc "
|
|||
|
echo " ims volte feature support, AP lib: ims, CP image<67><65>audio "
|
|||
|
echo " audio audio support(e.g. local MP3 play), AP lib: oc, CP image<67><65>audio "
|
|||
|
echo "**********************************************************************************************"
|
|||
|
echo " Examples: "
|
|||
|
echo "----------------------- For Internal Full Source Build----------------------------------------"
|
|||
|
echo " > Gccbuild.bat "
|
|||
|
echo " build bootloader, cp, ap images and merge them into a package. "
|
|||
|
echo " > Gccbuild.bat ap-at_command "
|
|||
|
echo " build ap at_command project only. "
|
|||
|
echo " > Gccbuild.bat ap-bootloader "
|
|||
|
echo " build bootloader project only. "
|
|||
|
echo " > Gccbuild.bat cp "
|
|||
|
echo " build cp project only. "
|
|||
|
echo " > Gccbuild.bat ap-driver_example-clean "
|
|||
|
echo " clean all output files for ap driver_example project. "
|
|||
|
echo " "
|
|||
|
echo "----------------------- For Customer's SDK Build----------------------------------------------"
|
|||
|
echo " > Gccbuild.bat "
|
|||
|
echo " build bootloader,ap images, use prebuilt cp image, and merge them into a package. "
|
|||
|
echo " > Gccbuild.bat project_name e.g. project_name = at_command/driver_example "
|
|||
|
echo " build xxx(project_name) project "
|
|||
|
echo " "
|
|||
|
echo " @NOTE: SDK build always generates a package(project_name.bin + bootloader.bin + cp.bin). "
|
|||
|
echo " "
|
|||
|
echo "----------------------- For Universal Build---------------------------------------------------"
|
|||
|
echo " > Gccbuild.bat clean "
|
|||
|
echo " clean all output files for the default project. "
|
|||
|
echo " > Gccbuild.bat clall "
|
|||
|
echo " clean all output files for every board and project. "
|
|||
|
echo " > Gccbuild.bat list "
|
|||
|
echo " list all supported boards and supported projects for every board. "
|
|||
|
echo " "
|
|||
|
echo " > Gccbuild.bat open_cpu "
|
|||
|
echo " build 'open cpu' mode images of the default project, and merge them into a package. "
|
|||
|
echo " "
|
|||
|
echo "**********************************************************************************************"
|
|||
|
goto end
|
|||
|
)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
echo PARAMETERS: %PARAMETERS% | findstr "list"
|
|||
|
if not errorlevel 1 (
|
|||
|
echo ---------------Supported Board------------------------------------
|
|||
|
for /d %%i in ("project\*") do (echo %%~nxi )
|
|||
|
|
|||
|
echo ------------------------------------------------------------------
|
|||
|
|
|||
|
for /d %%i in ("project\*") do (
|
|||
|
set CURRENT_BOARD=%%~nxi
|
|||
|
echo *********supported projects for board: !CURRENT_BOARD!*************
|
|||
|
for /d %%i in ("project\!CURRENT_BOARD!\ap\apps\*") do (echo ----%%~nxi )
|
|||
|
)
|
|||
|
|
|||
|
goto end
|
|||
|
)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
echo PARAMETERS: %PARAMETERS% | findstr "doc"
|
|||
|
if not errorlevel 1 (
|
|||
|
pushd doxygen
|
|||
|
CALL genDoc.bat %CHIP_NAME%
|
|||
|
popd
|
|||
|
goto end
|
|||
|
)
|
|||
|
|
|||
|
echo PARAMETERS: %PARAMETERS% | findstr "clall"
|
|||
|
if not errorlevel 1 (
|
|||
|
make.exe -%JOBNUMBER% clean-gccall TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% PROJECT=%PROJECT_NAME% CORE=%CORE_NAME%
|
|||
|
echo clean all done ok...
|
|||
|
goto end
|
|||
|
)
|
|||
|
|
|||
|
echo PARAMETERS: %PARAMETERS% | findstr "clean"
|
|||
|
if not errorlevel 1 (
|
|||
|
make.exe -%JOBNUMBER% clean-gcc TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% PROJECT=%PROJECT_NAME% CORE=%CORE_NAME%
|
|||
|
echo clean done ok...
|
|||
|
goto end
|
|||
|
)
|
|||
|
|
|||
|
echo PARAMETERS: %PARAMETERS% | findstr "clobj"
|
|||
|
if not errorlevel 1 (
|
|||
|
|
|||
|
@del /s /q .\gccout\%OUTPUT_NAME%\%CORE_NAME%\%PROJECT_NAME%\*.o
|
|||
|
@del /s /q .\gccout\%OUTPUT_NAME%\%CORE_NAME%\%PROJECT_NAME%\*.a
|
|||
|
@del /s /q .\gccout\%OUTPUT_NAME%\%CORE_NAME%\%PROJECT_NAME%\*.elf
|
|||
|
echo clean objs done ok...
|
|||
|
goto end
|
|||
|
)
|
|||
|
|
|||
|
echo PARAMETERS: %PARAMETERS% | findstr "allprojects"
|
|||
|
if not errorlevel 1 (
|
|||
|
if exist .\gccout\%OUTPUT_NAME% (
|
|||
|
echo delete %OUTPUT_NAME% folder......
|
|||
|
rd .\gccout\%OUTPUT_NAME% /s /q
|
|||
|
)
|
|||
|
|
|||
|
rem step1 build cp if not SDK
|
|||
|
if not exist .\tools\comdblib.txt (
|
|||
|
echo start logprepass b11
|
|||
|
if exist .\tools\UpdateDBPattern.txt (
|
|||
|
del /q .\tools\UpdateDBPattern.txt
|
|||
|
)
|
|||
|
|
|||
|
echo > .failed.tmp
|
|||
|
(make.exe -%JOBNUMBER% build-unilog TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% V=%VERBOSE% PROJECT=cp_project CORE=cp BUILD_UNILOG=true BUILD_CUST=%CUST% 2>&1 && del .failed.tmp) | tee.exe .\gccout\%OUTPUT_NAME%\cp\outbuildlog.txt
|
|||
|
|
|||
|
|
|||
|
|
|||
|
if exist .failed.tmp (
|
|||
|
del .failed.tmp
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
rem this header file will compile with device code
|
|||
|
copy .\gccout\%OUTPUT_NAME%\cp\cp_project\debug_log_cp.h .\middleware\developed\debug\inc\ || (goto:failHandle)
|
|||
|
|
|||
|
|
|||
|
echo > .failed.tmp
|
|||
|
(make.exe -%JOBNUMBER% gccall TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% V=%VERBOSE% EUTRAN_MODE=%EUTRAN_MODE% PROJECT=cp_project CORE=cp BUILD_UNILOG=true BUILD_CUST=%CUST% 2>&1 && del .failed.tmp) | tee.exe .\gccout\%OUTPUT_NAME%\cp\outbuildlog.txt
|
|||
|
|
|||
|
if exist .failed.tmp (
|
|||
|
del .failed.tmp
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
)
|
|||
|
rem step2 build bootloader no matter SDK or not
|
|||
|
echo > .failed.tmp
|
|||
|
(make.exe -%JOBNUMBER% gccall TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% V=%VERBOSE% EUTRAN_MODE=%EUTRAN_MODE% PROJECT=bootloader CORE=ap BUILD_UNILOG=false BUILD_CUST=%CUST% 2>&1 && del .failed.tmp) | tee.exe .\gccout\%OUTPUT_NAME%\ap\outbuildlog.txt
|
|||
|
|
|||
|
if exist .failed.tmp (
|
|||
|
del .failed.tmp
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
echo *********supported projects for board: %BOARD_NAME%*************
|
|||
|
for /d %%i in ("project\%BOARD_NAME%\ap\apps\*") do (
|
|||
|
set CURRENT_PROJECT=%%~nxi
|
|||
|
echo ----!CURRENT_PROJECT!
|
|||
|
|
|||
|
if "!CURRENT_PROJECT!"=="bootloader" (
|
|||
|
|
|||
|
echo ignore bootloader when loop all project
|
|||
|
|
|||
|
) else (
|
|||
|
echo 111
|
|||
|
if exist .\tools\UpdateDBPattern.txt (
|
|||
|
del /q .\tools\UpdateDBPattern.txt
|
|||
|
)
|
|||
|
|
|||
|
if exist .\tools\comdblib.txt (
|
|||
|
(make.exe -%JOBNUMBER% build-unilog TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% V=%VERBOSE% PROJECT=%%~nxi CORE=ap BUILD_UNILOG=true SDK=true BUILD_CUST=%CUST% 2>&1 && del .failed.tmp) | tee.exe .\gccout\%OUTPUT_NAME%\ap\outbuildlog.txt
|
|||
|
) else (
|
|||
|
(make.exe -%JOBNUMBER% build-unilog TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% V=%VERBOSE% PROJECT=%%~nxi CORE=ap BUILD_UNILOG=true BUILD_CUST=%CUST% 2>&1 && del .failed.tmp) | tee.exe .\gccout\%OUTPUT_NAME%\ap\outbuildlog.txt
|
|||
|
)
|
|||
|
|
|||
|
rem this header file will compile with device code
|
|||
|
copy .\gccout\%OUTPUT_NAME%\ap\%%~nxi\debug_log_ap.h .\middleware\developed\debug\inc\ || (goto:failHandle)
|
|||
|
if exist .\gccout\%OUTPUT_NAME%\ap\%%~nxi\dbversion.h (
|
|||
|
copy .\gccout\%OUTPUT_NAME%\ap\%%~nxi\dbversion.h .\middleware\developed\debug\inc\ || (goto:failHandle)
|
|||
|
)
|
|||
|
|
|||
|
echo > .failed.tmp
|
|||
|
(make.exe -%JOBNUMBER% gccall TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% V=%VERBOSE% EUTRAN_MODE=%EUTRAN_MODE% PROJECT=%%~nxi CORE=ap BUILD_UNILOG=true BUILD_CUST=%CUST% 2>&1 && del .failed.tmp) | tee.exe .\gccout\%OUTPUT_NAME%\ap\outbuildlog.txt
|
|||
|
|
|||
|
if exist .failed.tmp (
|
|||
|
del .failed.tmp
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
if not exist .\tools\comdblib.txt (
|
|||
|
.\tools\fcelf.exe -T -bin .\gccout\%OUTPUT_NAME%\ap\%%~nxi\ap_%%~nxi.bin -size AP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-bin .\gccout\%OUTPUT_NAME%\cp\cp_project\cp-demo-flash.bin -size CP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-bin .\gccout\%OUTPUT_NAME%\ap\bootloader\ap_bootloader.bin -size BOOTLOADER_PKGIMG_LIMIT_SIZE ^
|
|||
|
-h .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\mem_map.txt
|
|||
|
if not errorlevel 0 (
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
.\tools\fcelf.exe -M -input .\gccout\%OUTPUT_NAME%\ap\bootloader\ap_bootloader.bin -addrname BL_PKGIMG_LNA -flashsize BOOTLOADER_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\ap\%%~nxi\ap_%%~nxi.bin -addrname AP_PKGIMG_LNA -flashsize AP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\cp\cp_project\cp-demo-flash.bin -addrname CP_PKGIMG_LNA -flashsize CP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-pkgmode 1 ^
|
|||
|
-banoldtool 1 ^
|
|||
|
-productname %PKG_PRODUCT% ^
|
|||
|
-def .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\mem_map.txt ^
|
|||
|
-outfile .\gccout\%OUTPUT_NAME%\ap\%%~nxi\%%~nxi.binpkg
|
|||
|
|
|||
|
if not errorlevel 0 (
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
.\tools\fcelf.exe -m -input .\gccout\%OUTPUT_NAME%\ap\bootloader\ap_bootloader.elf -addrname BL_PKGIMG_LNA -flashsize BOOTLOADER_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\ap\%%~nxi\ap_%%~nxi.elf -addrname AP_PKGIMG_LNA -flashsize AP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\cp\cp_project\cp-demo-flash.elf -addrname CP_PKGIMG_LNA -flashsize CP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-pkgmode 1 ^
|
|||
|
-banoldtool 1 ^
|
|||
|
-productname %PKG_PRODUCT% ^
|
|||
|
-def .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\mem_map.txt ^
|
|||
|
-outfile .\gccout\%OUTPUT_NAME%\ap\%%~nxi\%%~nxi.elf
|
|||
|
if not errorlevel 0 (
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
) else (
|
|||
|
.\tools\fcelf.exe -T -bin .\gccout\%OUTPUT_NAME%\ap\%%~nxi\ap_%%~nxi.bin -size AP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-bin .\prebuild\FW\lib\gcc\%CHIP_TYPE%\%CPBIN_SUBPATH%\cp-demo-flash.bin -size CP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-bin .\gccout\%OUTPUT_NAME%\ap\bootloader\ap_bootloader.bin -size BOOTLOADER_PKGIMG_LIMIT_SIZE ^
|
|||
|
-h .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\mem_map.txt
|
|||
|
if not errorlevel 0 (
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
.\tools\fcelf.exe -M -input .\gccout\%OUTPUT_NAME%\ap\bootloader\ap_bootloader.bin -addrname BL_PKGIMG_LNA -flashsize BOOTLOADER_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\ap\%%~nxi\ap_%%~nxi.bin -addrname AP_PKGIMG_LNA -flashsize AP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\prebuild\FW\lib\gcc\%CHIP_TYPE%\%CPBIN_SUBPATH%\cp-demo-flash.bin -addrname CP_PKGIMG_LNA -flashsize CP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-pkgmode 1 ^
|
|||
|
-banoldtool 1 ^
|
|||
|
-productname %PKG_PRODUCT% ^
|
|||
|
-def .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\mem_map.txt ^
|
|||
|
-outfile .\gccout\%OUTPUT_NAME%\ap\%%~nxi\%%~nxi.binpkg
|
|||
|
|
|||
|
if not errorlevel 0 (
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
.\tools\fcelf.exe -m -input .\gccout\%OUTPUT_NAME%\ap\bootloader\ap_bootloader.elf -addrname BL_PKGIMG_LNA -flashsize BOOTLOADER_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\ap\%%~nxi\ap_%%~nxi.elf -addrname AP_PKGIMG_LNA -flashsize AP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\prebuild\FW\lib\gcc\%CHIP_TYPE%\%CPBIN_SUBPATH%\cp-demo-flash.elf -addrname CP_PKGIMG_LNA -flashsize CP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-pkgmode 1 ^
|
|||
|
-banoldtool 1 ^
|
|||
|
-productname %PKG_PRODUCT% ^
|
|||
|
-def .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\mem_map.txt ^
|
|||
|
-outfile .\gccout\%OUTPUT_NAME%\ap\%%~nxi\%%~nxi.elf
|
|||
|
if not errorlevel 0 (
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
)
|
|||
|
if exist .\tools\UpdateDBPattern.txt (
|
|||
|
type .\tools\UpdateDBPattern.txt
|
|||
|
)
|
|||
|
|
|||
|
)
|
|||
|
|
|||
|
)
|
|||
|
|
|||
|
|
|||
|
goto complete
|
|||
|
)
|
|||
|
|
|||
|
set starttime=%time%
|
|||
|
echo Start time: %date% %starttime%
|
|||
|
|
|||
|
if "%BUILD_OPTION%"=="merge" (
|
|||
|
if exist .\tools\comdblib.txt (
|
|||
|
echo start logprepass
|
|||
|
|
|||
|
|
|||
|
echo > .failed.tmp
|
|||
|
(make.exe -%JOBNUMBER% gccall TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% V=%VERBOSE% EUTRAN_MODE=%EUTRAN_MODE% PROJECT=bootloader CORE=%CORE_NAME% BUILD_UNILOG=false BUILD_CUST=%CUST% SDK=true 2>&1 && del .failed.tmp) | tee.exe .\gccout\%OUTPUT_NAME%\%CORE_NAME%\outbuildlog.txt
|
|||
|
|
|||
|
if exist .failed.tmp (
|
|||
|
del .failed.tmp
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
if exist .\tools\UpdateDBPattern.txt (
|
|||
|
del /q .\tools\UpdateDBPattern.txt
|
|||
|
)
|
|||
|
|
|||
|
make.exe -%JOBNUMBER% build-unilog TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% PROJECT=%PROJECT_NAME% CORE=%CORE_NAME% BUILD_UNILOG=true BUILD_CUST=%CUST% SDK=true
|
|||
|
|
|||
|
|
|||
|
rem this header file will compile with device code
|
|||
|
copy .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\debug_log_ap.h .\middleware\developed\debug\inc\ || (goto:failHandle)
|
|||
|
if exist .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\dbversion.h (
|
|||
|
copy .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\dbversion.h .\middleware\developed\debug\inc\ || (goto:failHandle)
|
|||
|
)
|
|||
|
|
|||
|
echo > .failed.tmp
|
|||
|
(make.exe -%JOBNUMBER% gccall TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% V=%VERBOSE% EUTRAN_MODE=%EUTRAN_MODE% PROJECT=%PROJECT_NAME% CORE=ap BUILD_UNILOG=true BUILD_CUST=%CUST% SDK=true 2>&1 && del .failed.tmp) | tee.exe .\gccout\%OUTPUT_NAME%\ap\outbuildlog.txt
|
|||
|
|
|||
|
if exist .failed.tmp (
|
|||
|
del .failed.tmp
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
.\tools\fcelf.exe -T -bin .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\ap_%PROJECT_NAME%.bin -size AP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-bin .\prebuild\FW\lib\gcc\%CHIP_TYPE%\%CPBIN_SUBPATH%\cp-demo-flash.bin -size CP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-bin .\gccout\%OUTPUT_NAME%\ap\bootloader\ap_bootloader.bin -size BOOTLOADER_PKGIMG_LIMIT_SIZE ^
|
|||
|
-h .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\mem_map.txt
|
|||
|
|
|||
|
if not errorlevel 0 (
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
if "%BUILD_HEADBIN%"=="true" (
|
|||
|
echo general headers 1
|
|||
|
.\tools\ecsecure.exe APIMAGE=.\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\ap_%PROJECT_NAME%.bin ^
|
|||
|
CPIMAGE=.\prebuild\FW\lib\gcc\%CHIP_TYPE%\%CPBIN_SUBPATH%\cp-demo-flash.bin ^
|
|||
|
BLIMAGE=.\gccout\%OUTPUT_NAME%\ap\bootloader\ap_bootloader.bin ^
|
|||
|
BLHASH=1 SYSHASH=1 ^
|
|||
|
HEAD1=.\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\bl_sec_header.bin ^
|
|||
|
HEAD2=.\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\sys_sec_header.bin ^
|
|||
|
BLPEM=.\project\%BOARD_NAME%\ap\apps\bootloader\code\main\pub_key_bl.pem ^
|
|||
|
SYSPEM=.\project\%BOARD_NAME%\ap\apps\bootloader\code\main\pub_key_sys.pem ^
|
|||
|
ADRBASE=AP_FLASH_XIP_ADDR ^
|
|||
|
APADR=AP_FLASH_LOAD_ADDR ^
|
|||
|
CFGDEF=.\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\mem_map.txt
|
|||
|
|
|||
|
.\tools\fcelf.exe -M -input .\gccout\%OUTPUT_NAME%\ap\bootloader\ap_bootloader.bin -addrname BL_PKGIMG_LNA -flashsize BOOTLOADER_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\ap_%PROJECT_NAME%.bin -addrname AP_PKGIMG_LNA -flashsize AP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\prebuild\FW\lib\gcc\%CHIP_TYPE%\%CPBIN_SUBPATH%\cp-demo-flash.bin -addrname CP_PKGIMG_LNA -flashsize CP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\bl_sec_header.bin -addrname XPKGDBLSH_VIRTIMG_MERGE_LNA -flashsize XPKG_VIRTIMG_LOAD_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\sys_sec_header.bin -addrname XPKGDSYSH_VIRTIMG_MERGE_LNA -flashsize XPKG_VIRTIMG_LOAD_SIZE ^
|
|||
|
-input .\tools\pkgdata\%CHIP_TYPE%\xpk_PrMgrCfg_json.bin -addrname XPKGDPRM_VIRTIMG_MERGE_LNA -flashsize XPKG_VIRTIMG_LOAD_SIZE ^
|
|||
|
-input .\tools\pkgdata\%CHIP_TYPE%\xpk_format_json.bin -addrname XPKGDCMN_VIRTIMG_MERGE_LNA -flashsize XPKG_VIRTIMG_LOAD_SIZE ^
|
|||
|
-input .\tools\pkgdata\%CHIP_TYPE%\config_xpk_uart_baseini.bin -addrname XPKGDCMN_VIRTIMG_MERGE_LNA -flashsize XPKG_VIRTIMG_LOAD_SIZE ^
|
|||
|
-input .\tools\pkgdata\%CHIP_TYPE%\config_xpk_usb_baseini.bin -addrname XPKGDCMN_VIRTIMG_MERGE_LNA -flashsize XPKG_VIRTIMG_LOAD_SIZE ^
|
|||
|
-pkgmode 1 ^
|
|||
|
-banoldtool 1 ^
|
|||
|
-productname %PKG_PRODUCT%_SEC ^
|
|||
|
-def .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\mem_map.txt ^
|
|||
|
-outfile .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\%PROJECT_NAME%.binpkg
|
|||
|
) else (
|
|||
|
.\tools\fcelf.exe -M -input .\gccout\%OUTPUT_NAME%\ap\bootloader\ap_bootloader.bin -addrname BL_PKGIMG_LNA -flashsize BOOTLOADER_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\ap_%PROJECT_NAME%.bin -addrname AP_PKGIMG_LNA -flashsize AP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\prebuild\FW\lib\gcc\%CHIP_TYPE%\%CPBIN_SUBPATH%\cp-demo-flash.bin -addrname CP_PKGIMG_LNA -flashsize CP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-pkgmode 1 ^
|
|||
|
-banoldtool 1 ^
|
|||
|
-productname %PKG_PRODUCT% ^
|
|||
|
-def .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\mem_map.txt ^
|
|||
|
-outfile .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\%PROJECT_NAME%.binpkg
|
|||
|
)
|
|||
|
if not errorlevel 0 (
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
|
|||
|
if exist .\tools\UpdateDBPattern.txt (
|
|||
|
type .\tools\UpdateDBPattern.txt
|
|||
|
)
|
|||
|
|
|||
|
goto complete
|
|||
|
|
|||
|
) else (
|
|||
|
echo > .failed.tmp
|
|||
|
(make.exe -%JOBNUMBER% gccall TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% V=%VERBOSE% EUTRAN_MODE=%EUTRAN_MODE% PROJECT=bootloader CORE=%CORE_NAME% SDK_REL=%SDKREL% BUILD_UNILOG=false BUILD_CUST=%CUST% 2>&1 && del .failed.tmp) | tee.exe .\gccout\%OUTPUT_NAME%\%CORE_NAME%\outbuildlog.txt
|
|||
|
|
|||
|
if exist .failed.tmp (
|
|||
|
del .failed.tmp
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
echo start logprepass b22
|
|||
|
if exist .\tools\UpdateDBPattern.txt (
|
|||
|
del /q .\tools\UpdateDBPattern.txt
|
|||
|
)
|
|||
|
|
|||
|
echo > .failed.tmp
|
|||
|
(make.exe -%JOBNUMBER% build-unilog TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% V=%VERBOSE% PROJECT=cp_project CORE=cp SDK_REL=%SDKREL% BUILD_UNILOG=true BUILD_CUST=%CUST% 2>&1 && del .failed.tmp) | tee.exe .\gccout\%OUTPUT_NAME%\cp\outbuildlog.txt
|
|||
|
|
|||
|
|
|||
|
|
|||
|
if exist .failed.tmp (
|
|||
|
del .failed.tmp
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
rem this header file will compile with device code
|
|||
|
copy .\gccout\%OUTPUT_NAME%\cp\cp_project\debug_log_cp.h .\middleware\developed\debug\inc\ || (goto:failHandle)
|
|||
|
|
|||
|
|
|||
|
echo > .failed.tmp
|
|||
|
(make.exe -%JOBNUMBER% gccall TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% V=%VERBOSE% EUTRAN_MODE=%EUTRAN_MODE% PROJECT=cp_project CORE=cp SDK_REL=%SDKREL% BUILD_UNILOG=true BUILD_CUST=%CUST% 2>&1 && del .failed.tmp) | tee.exe .\gccout\%OUTPUT_NAME%\cp\outbuildlog.txt
|
|||
|
|
|||
|
if exist .failed.tmp (
|
|||
|
del .failed.tmp
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
echo > .failed.tmp
|
|||
|
(make.exe -%JOBNUMBER% build-unilog TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% V=%VERBOSE% PROJECT=%PROJECT_NAME% CORE=ap SDK_REL=%SDKREL% BUILD_UNILOG=true BUILD_CUST=%CUST% 2>&1 && del .failed.tmp) | tee.exe .\gccout\%OUTPUT_NAME%\ap\outbuildlog.txt
|
|||
|
|
|||
|
if exist .failed.tmp (
|
|||
|
del .failed.tmp
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
rem this header file will compile with device code
|
|||
|
copy .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\debug_log_ap.h .\middleware\developed\debug\inc\ || (goto:failHandle)
|
|||
|
if exist .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\dbversion.h (
|
|||
|
copy .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\dbversion.h .\middleware\developed\debug\inc\ || (goto:failHandle)
|
|||
|
)
|
|||
|
|
|||
|
echo > .failed.tmp
|
|||
|
(make.exe -%JOBNUMBER% gccall TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% V=%VERBOSE% EUTRAN_MODE=%EUTRAN_MODE% PROJECT=%PROJECT_NAME% CORE=ap SDK_REL=%SDKREL% BUILD_UNILOG=true BUILD_CUST=%CUST% 2>&1 && del .failed.tmp) | tee.exe .\gccout\%OUTPUT_NAME%\ap\outbuildlog.txt
|
|||
|
|
|||
|
if exist .failed.tmp (
|
|||
|
del .failed.tmp
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
.\tools\fcelf.exe -T -bin .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\ap_%PROJECT_NAME%.bin -size AP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-bin .\gccout\%OUTPUT_NAME%\cp\cp_project\cp-demo-flash.bin -size CP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-bin .\gccout\%OUTPUT_NAME%\ap\bootloader\ap_bootloader.bin -size BOOTLOADER_PKGIMG_LIMIT_SIZE ^
|
|||
|
-h .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\mem_map.txt
|
|||
|
if not errorlevel 0 (
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
if "%BUILD_HEADBIN%"=="true" (
|
|||
|
echo general headers 2
|
|||
|
.\tools\ecsecure.exe APIMAGE=.\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\ap_%PROJECT_NAME%.bin ^
|
|||
|
CPIMAGE=.\gccout\%OUTPUT_NAME%\cp\cp_project\cp-demo-flash.bin ^
|
|||
|
BLIMAGE=.\gccout\%OUTPUT_NAME%\ap\bootloader\ap_bootloader.bin ^
|
|||
|
BLHASH=1 SYSHASH=1^
|
|||
|
HEAD1=.\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\bl_sec_header.bin ^
|
|||
|
HEAD2=.\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\sys_sec_header.bin ^
|
|||
|
BLPEM=.\project\%BOARD_NAME%\ap\apps\bootloader\code\main\pub_key_bl.pem ^
|
|||
|
SYSPEM=.\project\%BOARD_NAME%\ap\apps\bootloader\code\main\pub_key_sys.pem ^
|
|||
|
ADRBASE=AP_FLASH_XIP_ADDR ^
|
|||
|
APADR=AP_FLASH_LOAD_ADDR ^
|
|||
|
CFGDEF=.\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\mem_map.txt
|
|||
|
|
|||
|
.\tools\fcelf.exe -M -input .\gccout\%OUTPUT_NAME%\ap\bootloader\ap_bootloader.bin -addrname BL_PKGIMG_LNA -flashsize BOOTLOADER_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\ap_%PROJECT_NAME%.bin -addrname AP_PKGIMG_LNA -flashsize AP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\cp\cp_project\cp-demo-flash.bin -addrname CP_PKGIMG_LNA -flashsize CP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\bl_sec_header.bin -addrname XPKGDBLSH_VIRTIMG_MERGE_LNA -flashsize BLS_FLASH_LOAD_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\sys_sec_header.bin -addrname XPKGDSYSH_VIRTIMG_MERGE_LNA -flashsize SYS_FLASH_LOAD_SIZE ^
|
|||
|
-input .\tools\pkgdata\%CHIP_TYPE%\xpk_PrMgrCfg_json.bin -addrname XPKGDPRM_VIRTIMG_MERGE_LNA -flashsize XPKG_VIRTIMG_LOAD_SIZE ^
|
|||
|
-input .\tools\pkgdata\%CHIP_TYPE%\xpk_format_json.bin -addrname XPKGDCMN_VIRTIMG_MERGE_LNA -flashsize XPKG_VIRTIMG_LOAD_SIZE ^
|
|||
|
-input .\tools\pkgdata\%CHIP_TYPE%\config_xpk_uart_baseini.bin -addrname XPKGDCMN_VIRTIMG_MERGE_LNA -flashsize XPKG_VIRTIMG_LOAD_SIZE ^
|
|||
|
-input .\tools\pkgdata\%CHIP_TYPE%\config_xpk_usb_baseini.bin -addrname XPKGDCMN_VIRTIMG_MERGE_LNA -flashsize XPKG_VIRTIMG_LOAD_SIZE ^
|
|||
|
-pkgmode 1 ^
|
|||
|
-banoldtool 1 ^
|
|||
|
-productname %PKG_PRODUCT%_SEC ^
|
|||
|
-def .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\mem_map.txt ^
|
|||
|
-outfile .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\%PROJECT_NAME%.binpkg
|
|||
|
) else (
|
|||
|
|
|||
|
.\tools\fcelf.exe -M -input .\gccout\%OUTPUT_NAME%\ap\bootloader\ap_bootloader.bin -addrname BL_PKGIMG_LNA -flashsize BOOTLOADER_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\ap_%PROJECT_NAME%.bin -addrname AP_PKGIMG_LNA -flashsize AP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\cp\cp_project\cp-demo-flash.bin -addrname CP_PKGIMG_LNA -flashsize CP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-pkgmode 1 ^
|
|||
|
-banoldtool 1 ^
|
|||
|
-productname %PKG_PRODUCT% ^
|
|||
|
-def .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\mem_map.txt ^
|
|||
|
-outfile .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\%PROJECT_NAME%.binpkg
|
|||
|
)
|
|||
|
|
|||
|
if not errorlevel 0 (
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
.\tools\fcelf.exe -m -input .\gccout\%OUTPUT_NAME%\ap\bootloader\ap_bootloader.elf -addrname BL_PKGIMG_LNA -flashsize BOOTLOADER_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\ap_%PROJECT_NAME%.elf -addrname AP_PKGIMG_LNA -flashsize AP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-input .\gccout\%OUTPUT_NAME%\cp\cp_project\cp-demo-flash.elf -addrname CP_PKGIMG_LNA -flashsize CP_PKGIMG_LIMIT_SIZE ^
|
|||
|
-pkgmode 1 ^
|
|||
|
-banoldtool 1 ^
|
|||
|
-productname %PKG_PRODUCT% ^
|
|||
|
-def .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\mem_map.txt ^
|
|||
|
-outfile .\gccout\%OUTPUT_NAME%\ap\%PROJECT_NAME%\%PROJECT_NAME%.elf
|
|||
|
|
|||
|
if not errorlevel 0 (
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
if exist .\tools\UpdateDBPattern.txt (
|
|||
|
type .\tools\UpdateDBPattern.txt
|
|||
|
)
|
|||
|
|
|||
|
|
|||
|
goto complete
|
|||
|
)
|
|||
|
|
|||
|
)
|
|||
|
|
|||
|
|
|||
|
if %PROJECT_NAME%==bootloader goto :buildimage
|
|||
|
if %PROJECT_NAME%==driver_example goto :buildimage
|
|||
|
set UNILOG=true
|
|||
|
echo start logprepass b2
|
|||
|
if exist .\tools\UpdateDBPattern.txt (
|
|||
|
del /q .\tools\UpdateDBPattern.txt
|
|||
|
)
|
|||
|
echo > .failed.tmp
|
|||
|
(make.exe -%JOBNUMBER% build-unilog TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% V=%VERBOSE% PROJECT=%PROJECT_NAME% CORE=%CORE_NAME% TOOLCHAIN_NAME=%TOOLCHAIN_NAME% BUILD_UNILOG=true BUILD_CUST=%CUST% 2>&1 && del .failed.tmp) | tee.exe .\gccout\%OUTPUT_NAME%\%CORE_NAME%\outbuildlog.txt
|
|||
|
|
|||
|
if exist .failed.tmp (
|
|||
|
del .failed.tmp
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
rem this header file will compile with device code
|
|||
|
copy .\gccout\%OUTPUT_NAME%\%CORE_NAME%\%PROJECT_NAME%\debug_log_%CORE_NAME%.h .\middleware\developed\debug\inc\ || (goto:failHandle)
|
|||
|
if exist .\gccout\%OUTPUT_NAME%\%CORE_NAME%\%PROJECT_NAME%\dbversion.h (
|
|||
|
copy .\gccout\%OUTPUT_NAME%\%CORE_NAME%\%PROJECT_NAME%\dbversion.h .\middleware\developed\debug\inc\ || (goto:failHandle)
|
|||
|
)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
echo -----build image----
|
|||
|
:buildimage
|
|||
|
REM goto end
|
|||
|
echo > .failed.tmp
|
|||
|
(make.exe -%JOBNUMBER% gccall TYPE=%CHIP_TYPE% TARGET=%BOARD_NAME% V=%VERBOSE% EUTRAN_MODE=%EUTRAN_MODE% PROJECT=%PROJECT_NAME% CORE=%CORE_NAME% BUILD_UNILOG=%UNILOG% BUILD_CUST=%CUST% 2>&1 && del .failed.tmp) | tee.exe .\gccout\%OUTPUT_NAME%\%CORE_NAME%\outbuildlog.txt
|
|||
|
|
|||
|
if exist .failed.tmp (
|
|||
|
del .failed.tmp
|
|||
|
goto failHandle
|
|||
|
)
|
|||
|
|
|||
|
rem copy log database to output dir after compile successfully
|
|||
|
REM cp .\tools\comdb_%CORE_NAME%.txt .\gccout\%OUTPUT_NAME%\%CORE_NAME%\%PROJECT_NAME%\comdb.txt
|
|||
|
|
|||
|
:complete
|
|||
|
|
|||
|
set endtime=%time%
|
|||
|
echo .
|
|||
|
echo End time: %date% %endtime%
|
|||
|
|
|||
|
set /a h1=%starttime:~0,2%
|
|||
|
set /a m1=1%starttime:~3,2%-100
|
|||
|
set /a s1=1%starttime:~6,2%-100
|
|||
|
set /a h2=%endtime:~0,2%
|
|||
|
set /a m2=1%endtime:~3,2%-100
|
|||
|
set /a s2=1%endtime:~6,2%-100
|
|||
|
if %h2% LSS %h1% set /a h2=%h2%+24
|
|||
|
set /a ts1=%h1%*3600+%m1%*60+%s1%
|
|||
|
set /a ts2=%h2%*3600+%m2%*60+%s2%
|
|||
|
set /a ts=%ts2%-%ts1%
|
|||
|
set /a h=%ts%/3600
|
|||
|
set /a m=(%ts%-%h%*3600)/60
|
|||
|
set /a s=%ts%%%60
|
|||
|
echo Built took %h% hours %m% minutes %s% seconds
|
|||
|
|
|||
|
echo #######################################################################
|
|||
|
echo ## ##
|
|||
|
echo ## ######## ### ###### ###### ##
|
|||
|
echo ## ## ## ## ## ## ## ## ## ##
|
|||
|
echo ## ## ## ## ## ## ## ##
|
|||
|
echo ## ######## ## ## ###### ###### ##
|
|||
|
echo ## ## ######### ## ## ##
|
|||
|
echo ## ## ## ## ## ## ## ## ##
|
|||
|
echo ## ## ## ## ###### ###### ##
|
|||
|
echo ## ##
|
|||
|
echo #######################################################################
|
|||
|
|
|||
|
echo build successfully
|
|||
|
|
|||
|
if %UNILOG%==true (
|
|||
|
if exist .\tools\UpdateDBPattern.txt (
|
|||
|
type .\tools\UpdateDBPattern.txt
|
|||
|
)
|
|||
|
)
|
|||
|
|
|||
|
:end
|
|||
|
goto:eof
|
|||
|
|
|||
|
:failHandle
|
|||
|
echo fail
|
|||
|
echo #######################################################################
|
|||
|
echo ## ##
|
|||
|
echo ## ######## ### #### ## ##
|
|||
|
echo ## ## ## ## ## ## ##
|
|||
|
echo ## ## ## ## ## ## ##
|
|||
|
echo ## ###### ## ## ## ## ##
|
|||
|
echo ## ## ######### ## ## ##
|
|||
|
echo ## ## ## ## ## ## ##
|
|||
|
echo ## ## ## ## #### ######## ##
|
|||
|
echo ## ##
|
|||
|
echo #######################################################################
|
|||
|
goto:eof
|
|||
|
|