summaryrefslogtreecommitdiff
path: root/bsp/renesas/ra8p1-titan-board/build_solution_sbd.bat
blob: caa8fb8f1305e6af344970df62832fdb830220ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@echo off
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

set "BspRoot=%~dp0"
set "Cpu0Bundle=%BspRoot%m85\Objects\template.sbd"
set "Cpu1Bundle=%BspRoot%m33\Objects\template.sbd"
set "RascVersionFile=%BspRoot%m85\rasc_version.txt"

if not exist "%Cpu0Bundle%" (
    echo [ERROR] CPU0 Smart Bundle "%Cpu0Bundle%" does not exist.
    echo [ERROR] Build the m85 Keil project first.
    exit /b 1
)

if not exist "%Cpu1Bundle%" (
    echo [ERROR] CPU1 Smart Bundle "%Cpu1Bundle%" does not exist.
    echo [ERROR] Build the m33 Keil project first.
    exit /b 1
)

call "%BspRoot%m85\rasc_version.bat" "%RascVersionFile%"
if errorlevel 1 exit /b 1

set /a idx=0
for /f "usebackq tokens=*" %%a in ("%RascVersionFile%") do (
    if !idx! EQU 2 set "RascExe=%%a"
    set /a idx+=1
)

if not defined RascExe (
    echo [ERROR] RASC executable is not configured.
    exit /b 1
)

set "RascExe=%RascExe:rasc.exe=rascc.exe%"
powershell -NoProfile -ExecutionPolicy Bypass -File "%BspRoot%build_solution_sbd.ps1" -RascExe "%RascExe%"
exit /b %errorlevel%