Build_IFWI.bat 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. @REM @file
  2. @REM Windows batch file to build BIOS ROM
  3. @REM
  4. @REM Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
  5. @REM SPDX-License-Identifier: BSD-2-Clause-Patent
  6. @REM
  7. @echo off
  8. SetLocal EnableDelayedExpansion EnableExtensions
  9. :: Assign initial values
  10. set exitCode=0
  11. set "Build_Flags= "
  12. set PLATFORM_PACKAGE=Vlv2TbltDevicePkg
  13. set PLATFORM_PATH=%WORKSPACE%
  14. if not exist %PLATFORM_PATH%\%PLATFORM_PACKAGE% (
  15. if defined PACKAGES_PATH (
  16. for %%i IN (%PACKAGES_PATH%) DO (
  17. if exist %%~fi\%PLATFORM_PACKAGE% (
  18. set PLATFORM_PATH=%%~fi
  19. goto PlatformPackageFound
  20. )
  21. )
  22. ) else (
  23. echo.
  24. echo !!! ERROR !!! Cannot find %PLATFORM_PACKAGE% !!!
  25. echo.
  26. goto Exit
  27. )
  28. )
  29. :PlatformPackageFound
  30. :: Parse Optional arguments
  31. :OptLoop
  32. if /i "%~1"=="/?" goto Usage
  33. if /i "%~1"=="/l" (
  34. set Build_Flags=%Build_Flags% /l
  35. shift
  36. goto OptLoop
  37. )
  38. if /i "%~1"=="/y" (
  39. set Build_Flags=%Build_Flags% /y
  40. shift
  41. goto OptLoop
  42. )
  43. if /i "%~1"=="/m" (
  44. set Build_Flags=%Build_Flags% /m
  45. shift
  46. goto OptLoop
  47. )
  48. if /i "%~1" == "/c" (
  49. set Build_Flags=%Build_Flags% /c
  50. shift
  51. goto OptLoop
  52. )
  53. if /i "%~1"=="/x64" (
  54. set Build_Flags=%Build_Flags% /x64
  55. shift
  56. goto OptLoop
  57. )
  58. if /i "%~1"=="/IA32" (
  59. set Build_Flags=%Build_Flags% /IA32
  60. shift
  61. goto OptLoop
  62. )
  63. :: Require 2 input parameters
  64. if "%~2"=="" goto Usage
  65. :: Assign required arguments
  66. set Platform_Type=%~1
  67. set Build_Target=%~2
  68. :: Build BIOS
  69. echo ======================================================================
  70. echo Build_IFWI: Calling BIOS build Script...
  71. call %PLATFORM_PATH%\%PLATFORM_PACKAGE%\bld_vlv.bat %Build_Flags% %Platform_Type% %Build_Target%
  72. if %ERRORLEVEL% NEQ 0 (
  73. echo echo -- Error Building BIOS & echo.
  74. set exitCode=1
  75. goto exit
  76. )
  77. echo.
  78. echo Finished Building BIOS.
  79. goto Exit
  80. :Usage
  81. echo Script to build BIOS firmware and stitch the entire IFWI.
  82. echo.
  83. echo Usage: Build_IFWI.bat [options] PlatformType BuildTarget
  84. echo.
  85. echo /c CleanAll
  86. echo /l Generate build log file
  87. echo /y Generate build report file
  88. echo /m Enable multi-processor build
  89. echo /IA32 Set Arch to IA32 (default: X64)
  90. echo /X64 Set Arch to X64 (default: X64)
  91. echo.
  92. echo Platform Types: MNW2
  93. echo Build Targets: Debug, Release (default: Debug)
  94. echo.
  95. echo Examples:
  96. echo Build_IFWI.bat MNW2 debug : X64 Debug build for MinnowMax
  97. echo Build_IFWI.bat /IA32 MNW2 release : IA32 Release build for MinnowMax
  98. echo.
  99. set exitCode=1
  100. :Exit
  101. @REM CD to platform package.
  102. cd %PLATFORM_PATH%
  103. exit /b %exitCode%
  104. EndLocal