fpgapei/autobuild_support/synthesis/local_synth.bat

134 lines
3.4 KiB
Batchfile

REM ---------------------------------------------------
REM Variables that are set externally to synthesis.bat
REM ---------------------------------------------------
@echo ----------------------------
@echo Current Error Level is %errorlevel%
REM Directories. Can be overridden by setting environment variable externally
if "%WORKSPACE%" == "" set WORKSPACE=E:\workspace\HV_1.10000_EL_synth
if "%LOCALREPO%" == "" set LOCALREPO=%cd%\..\..
if "%FWTOOLSREPO%" == "" set FWTOOLSREPO=%LOCALREPO%\..\fw_development_tools
if "%GENERICREPO%" == "" set GENERICREPO=%LOCALREPO%\..\EL-GENERIC-IP
if "%QSYS_PKG_VER%" == "" set QSYS_PKG_VER=18.1
:: Take BUILD DIR NAME from argument (if unset, will default to build in synthesis.py
set BUILD_DIR_NAME=%1
set PYTHONPATH=%FWTOOLSREPO%\logic_memory_mapper
set ISUNIX=False
REM variables used for autogeneration scripts
set AUTO_GEN_QSYS_SUFFIX=_system
:: e.g. helps to find directory containing build,doc,src etc
set AUTO_GEN_TOP_NAME=top
REM variables used for build process
set QPF_TOP=top
set QSYS_TOP=top_system
REM Set "True" to Allow unencrypted images to be created (Caution!)
set CREATE_UNENCRYPTED_RBF=true
REM Set "true" to not update generic_versioning
set PREVENT_AUTO_VERSIONING=false
REM executables
set GIT_EXECUTABLE=c:\Program Files\Git\cmd\git
if "%PYTHON%"=="" (
set PYTHON=python
)
REM Do some checks
if not exist "%LOCALREPO%" (
echo "***Error: can't find firmware repository %LOCALREPO%"
popd
exit /b 1
)
if not exist "%FWTOOLSREPO%" (
echo "***Error: can't find firmware tools repository %FWTOOLSREPO%"
popd
exit /b 1
)
if not exist "%GENERICREPO%" (
echo "***Error: can't find EL-GENERIC-IP repository %GENERICREPO%"
popd
exit /b 1
)
REM Check that the specified LOCAREPO directory is a GIT root directory
if not exist "%LOCALREPO%\.git" (
echo "***Error: directory %LOCALREPO% does not appear to be a GIT root directory"
popd
exit /b 1
)
echo ----------------------------
echo Current Error Level is %errorlevel%
REM Turn on error checking of checksynthesis.py
set RAISE_ERRORS=true
@echo ----------------------------
@echo Current Error Level is %errorlevel%
dir e:\
echo ----------------------------
echo Current Error Level is %errorlevel%
REM make sure we have a work space
if exist "%WORKSPACE%" (
echo ----------------------------
echo Current Error Level is %errorlevel%
dir
rmdir /s /q "%WORKSPACE%"
)
if errorlevel 1 (
popd
exit /b 1
)
REM Create a new workspace and change directory to it
mkdir "%WORKSPACE%"
if errorlevel 1 (
echo "***Error trying to create directory %WORKSPACE%"
popd
exit /b 1
)
set VERSION_DIR=%WORKSPACE%\version
if not exist "%VERSION_DIR%" mkdir "%VERSION_DIR%"
if errorlevel 1 exit /b 1
pushd "%WORKSPACE%"
REM set default build stamp value for local build
set BUILD_STAMP=1.30000.0.0
REM create the links from the repository like that on Jenkins servers
mklink /J a c:\altera
mklink /J el "%LOCALREPO%"
mklink /J el\firmware\generic_ip "%GENERICREPO%"\generic_ip
mklink /J jobscripts "%FWTOOLSREPO%"\autobuild\synthesis
mklink /J autogenscripts "%FWTOOLSREPO%"
if errorlevel 1 (
popd
exit /b 1
)
REM ---------------------------------------------------
REM Call the autobuild top level synthesis script
REM ---------------------------------------------------
REM Change to the scripts directory
cd jobscripts
REM Run the synthesis script that's used on Jenkins
%PYTHON% synthesis.py
if errorlevel 1 (
popd
exit /b 1
)
REM Script finished successfully
popd