- Allows configuration files to be placed in separate folders, with paths in config files now relative to the config file's location. - Added `cd /d "%~dp0"` at the beginning of the `.bat` template to ensure paths are based on the script's location, enhancing portability and consistency.
34 lines
747 B
Batchfile
34 lines
747 B
Batchfile
@echo off
|
|
cd /d "%~dp0"
|
|
|
|
set "platform=xilinx"
|
|
set "platform_ver=2019.1"
|
|
set "work_dir=%~dp0build"
|
|
set "config=%~dp0config.json"
|
|
set "tools_dir=%~dp0scripts\platform\%platform%"
|
|
|
|
REM Set up environment
|
|
call "%tools_dir%\setenv.bat" "%platform_ver%"
|
|
if "%ERRORLEVEL%" neq "0" (
|
|
echo Error: Failed to initialize environment.
|
|
pause >nul
|
|
exit /b 1
|
|
)
|
|
|
|
REM Build project
|
|
call "%tools_dir%\build.bat" "%config%" "%work_dir%"
|
|
if "%ERRORLEVEL%" neq "0" (
|
|
echo Error: Failed to build project.
|
|
pause >nul
|
|
exit /b 1
|
|
)
|
|
|
|
REM Launch SDK
|
|
call "%tools_dir%\launch.bat" "%platform_ver%" "%work_dir%"
|
|
if "%ERRORLEVEL%" neq "0" (
|
|
echo Error: Failed to launch SDK.
|
|
pause >nul
|
|
exit /b 1
|
|
)
|
|
|
|
exit /b 0 |