Subversion Repositories QNX 8.QNX8 IFS tool

Rev

Rev 37 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. @echo off
  2. setlocal enableextensions enabledelayedexpansion
  3.  
  4. rem echo Setting up the toolchain...
  5. set THISDIR=%~dp0
  6. cd /d %~dp0\..\qnx800
  7. call qnxsdp-env.bat > nul || goto :eof
  8. cd /d "%THISDIR%"
  9.  
  10. set BINARIES=%~1
  11. if "%BINARIES%"=="" set BINARIES=ifstool
  12.  
  13. call :build_for aarch64-unknown-nto-qnx8.0.0 "%BINARIES%" || exit /b 1
  14. call :build_for x86_64-pc-nto-qnx8.0.0       "%BINARIES%" || exit /b 1
  15. goto :end
  16.  
  17.  
  18. :build_for
  19.         set CC=%1-gcc-12.2.0
  20.         set CPPFLAGS=-D_QNX_SOURCE -Ilibucl/include -Ilibucl/src -Ilibucl -Iliblzo
  21.         set LDFLAGS=
  22.  
  23.         if not "%BINARIES:ifstool=%"=="%BINARIES%" del /f /q %1-ifstool > nul 2>&1
  24.         del /f /s /q .build > nul 2>&1
  25.         mkdir .build > nul 2>&1
  26.  
  27.         if not "%BINARIES:ifstool=%"=="%BINARIES%" (
  28.                 echo Building ifstool for %1...
  29.                 set SRCLIST=
  30.                 for /f usebackq^ tokens^=2^ delims^=^" %%f in (`findstr /c:"ClCompile Include" ifstool.vcxproj`) do set SRCLIST=!SRCLIST! %%f
  31.                 set SRCLIST=!SRCLIST:\=/!
  32.                 "%CC%" %CPPFLAGS% !SRCLIST! %LDFLAGS% -o %1-ifstool || goto :eof
  33.  
  34.                 if "%1"=="aarch64-unknown-nto-qnx8.0.0" (
  35.                         echo Deploying ifstool to QNX8 native aarch64le toolchain...
  36.                         copy /b %1-ifstool ..\qnx800\target\qnx\aarch64le\usr\bin\ifstool || goto :eof
  37.                 ) else if "%1"=="x86_64-pc-nto-qnx8.0.0" (
  38.                         echo Deploying ifstool to QNX8 native x86_64 toolchain...
  39.                         copy /b %1-ifstool ..\qnx800\target\qnx\x86_64\usr\bin\ifstool || goto :eof
  40.                 )
  41.         )
  42.  
  43.         goto :eof
  44.  
  45.  
  46. :end
  47. if "%~1"=="" echo Done
  48. if "%~1"=="" pause
  49.