X-Git-Url: http://git.etherboot.org/mirror/winof/.git/blobdiff_plain/34d1a3b6775be2d947b78ea9bc89f74f17084585..e767a9b2bf9558b52caa9705a7867f5aba2efd52:/BuildRelease.bat?ds=sidebyside diff --git a/BuildRelease.bat b/BuildRelease.bat index 42fba41b..320f52a3 100644 --- a/BuildRelease.bat +++ b/BuildRelease.bat @@ -6,18 +6,12 @@ rem Binary release is constructed in ..\Branches\WinOF\Wix\OS\bin. rem Processor architecture specific WIX installers are constructed rem in %IDIR% rem -rem BuildRelease {all | compile | makebin | msi} -rem -rem where: -rem all - recompile, install binaries to WIX tree, sign drivers and -rem build installers. -rem compile - recompile/link -rem makebin - assumes binaries are built, install binaries to WIX tree. -rem msi - assumes binaries are install in WIX tree, sign drivers and -rem create installers (.msi file) in IDIR. +rem BuildRelease option +rem option == all | allnoforce | compile | compilenoforce | makebin | msi | wix | clean {OPENIB_REV} rem + rem This script is an 'example' of a one-command entire IB stack build to -rem single-file installer; used to build a WinOF release. +rem single-file installer; used to build a WinOF releases. rem Script is designed to be invoked from the \gen1\trunk folder with rem \branches\WinOF\Wix\* accessible. rem @@ -28,19 +22,61 @@ if "%1" == "" goto usage if "%1" == "/?" goto usage if "%1" == "-h" goto usage if "%1" == "all" goto OK +if "%1" == "allnoforce" goto OK if "%1" == "compile" goto OK +if "%1" == "compilenoforce" goto OK if "%1" == "makebin" goto OK if "%1" == "msi" goto OK +if "%1" == "wix" goto OK +if "%1" == "clean" goto OK + echo Unknown arg '%1' ? + :usage -echo "usage: BuildRelease { all | compile | makebin | msi }" + +echo "usage: BuildRelease all | allnoforce | compile | compilenoforce | makebin | msi | wix | clean {OPENIB_REV value}" +echo where: +echo all - force recompile, install binaries to WIX tree, sign drivers and +echo build installers. + +echo allnoforce - recompile only if needed, install binaries to WIX tree, +echo sign drivers and build installers. +echo compile - force a recompile/link of everything then exit. +echo compilenoforce - recompile/link only if needed then exit. +echo makebin - assumes binaries are built, will installs binaries to WIX tree +echo then exit. +echo msi - assumes binaries are installed in WIX tree, signs drivers and +echo create installers (.msi files) in IDIR. +echo wix - build .msi installers, assumes (drivers signed) .cat files exist +echo clean - remove build artifacts for a clean build: .obj, .sys, ... +echo : +echo {OPENIB_REV} +echo optional, if set then OPENIB_REV is assigned this value. +echo example: BuildRelease all 1414 + exit /B 1 :OK +if not "%WDM_INC_PATH%" == "" ( + echo %0: Error - %0 unable to run from WDK window, + echo use %comspec% + exit /B 1 +) + +rem remove build artifacts +if "%1" == "clean" ( + echo Removing build artifacts and folders... + call %CD%\etc\clean-build.bat + exit /B 0 +) + +rem set CERTNAME=noCert +set CERTNAME=cse1CStore + rem A Digital driver signing certificate store name may be required. if "%1" == "all" ( - if "%CERTNAME%" == "" set /P CERTNAME=[Enter Certificate Store Name] + if "%CERTNAME%" == "noCert" set /P CERTNAME=[Enter Certificate Store Name] if "%CERTNAME%" == "" ( echo %0 echo %0: Err - driver signing certificate store name required. @@ -48,8 +84,9 @@ if "%1" == "all" ( exit /B 1 ) ) + if "%1" == "msi" ( - if "%CERTNAME%" == "" set /P CERTNAME=[Enter Certificate Store Name] + if "%CERTNAME%" == "noCert" set /P CERTNAME=[Enter Certificate Store Name] if "%CERTNAME%" == "" ( echo %0 echo %0: Err - driver signing certificate store name required. @@ -66,18 +103,23 @@ if NOT EXIST %_DDK% ( echo Missing WDK @ %_DDK% exit /B 1 ) -echo Building with DDK @ %_DDK% +echo %0 - Building with WDK @ %_DDK% rem Platform SDK path - watchout for missing LoadPerf.h (installsp.c) set _PSDK=C:\progra~1\mi2578~1 -rem WARNING - SVN set depends on the path '\openIB-windows-svn\xxx\gen1', where SVN is set to XXX -rem substring[23rd...26th] chars (offset counting) == xxxx +rem setup value for OPENIB_REV assignment. -rem If this example method doesn't fit your environment, set SVN accordingly. -rem Note - OPENIB_REV is assigned SVN in a child script. +if not "%2" == "" ( + set SVN=%2 +) else ( + rem WARNING - SVN value depends on the path '\openIB-windows-svn\XXX\gen1', + rem where SVN is set to XXX + rem substring[23rd...26th] chars (offset counting) == xxxx + rem Note - OPENIB_REV is assigned SVN in a child script. -set SVN=%CD:~22,4% + set SVN=%CD:~22,4% +) rem assumes %CD% == '...\gen1\trunk' set BSE=%CD% @@ -88,7 +130,7 @@ set RBIN_WNET=%WIX%\wnet\bin% set RBIN_WXP=%WIX%\wxp\bin% if NOT EXIST "..\branches\WinOF\WIX\build-all-MSI.bat" ( - echo Missing .msi installer build script + echo %0 - Missing .msi installer build script echo ..\branches\WinOF\WIX\build-all-MSI.bat exit /B 1 ) @@ -108,7 +150,7 @@ if exist %windir%\system32\timeout.exe ( ) if NOT EXIST "%IDIR%" ( - echo Missing Installer file destination folder %IDIR% + echo %0 - Missing Installer file destination folder %IDIR% exit /B 1 ) @@ -118,113 +160,139 @@ rem select wix-2.0.5325.0-binaries.zip download and unzip to rem ..\branches\WinOF\WIX\WIX_tools\ rem if NOT EXIST %WIX%\WIX_tools\wix-2.0.5325.0-binaries ( - echo Missing WIX tools @ %WIX%\WIX_tools + echo %0 - Missing WIX tools @ %WIX%\WIX_tools exit /B 1 ) if NOT EXIST etc\makebin.bat ( - echo Missing etc\makebin.bat, script must run from gen1\trunk + echo %0 - Missing etc\makebin.bat, script must run from gen1\trunk exit /B 1 ) +set STIME=%TIME% rem skip build - assumes binaries already built. -if "%1" == "msi" goto InstallBin +if "%1" == "wix" ( + set CERTNAME=nosign + goto mk_msi +) + +if "%1" == "msi" ( + if not EXIST "%RBIN_WLH%" goto InstallBin + if not EXIST "%RBIN_WNET%" goto InstallBin + if not EXIST "%RBIN_WXP%" goto InstallBin + goto mk_msi +) + if "%1" == "makebin" goto InstallBin -rem set OPS=-wgcM 3 -set OPS=-wg +set OPS=-wgcPM 3 +if "%1" == "allnoforce" ( + rem Compile everything only if needed. + set OPS=-wgPM 3 +) +if "%1" == "compilenoforce" ( + rem Compile everything only if needed. + set OPS=-wgPM 3 +) +if "%1" == "all" ( + echo Removing build artifacts and folders... + call %CD%\etc\clean-build.bat +) -rem ********* WLH - Windows Server 2008 & Vista +rem ********* Compile for WLH - Windows Server 2008 & Vista rem WLH x64 +echo %0 - Build WLH x64 Checked %COMSPEC% /C "call %BSE%\etc\IB_CHK_BLD_x64.bat %SVN% %CD% %_DDK% %_PSDK% WLH & build %OPS%" if ERRORLEVEL 1 exit /B 1 +echo %0 - Build WLH x64 Free %COMSPEC% /C "call %BSE%\etc\IB_FRE_BLD_x64.bat %SVN% %CD% %_DDK% %_PSDK% WLH & build %OPS%" if ERRORLEVEL 1 exit /B 1 rem WLH x86 +echo %0 - Build WLH x86 Checked %COMSPEC% /C "call %BSE%\etc\IB_CHK_BLD_x86.bat %SVN% %CD% %_DDK% %_PSDK% WLH & build %OPS%" if ERRORLEVEL 1 exit /B 1 +echo %0 - Build WLH x86 Free %COMSPEC% /C "call %BSE%\etc\IB_FRE_BLD_x86.bat %SVN% %CD% %_DDK% %_PSDK% WLH & build %OPS%" if ERRORLEVEL 1 exit /B 1 rem WLH ia64 +echo %0 - Build WLH ia64 Checked %COMSPEC% /C "call %BSE%\etc\IB_CHK_BLD_IA64.bat %SVN% %CD% %_DDK% %_PSDK% WLH & build %OPS%" if ERRORLEVEL 1 exit /B 1 +echo %0 - Build WLH ia64 Free %COMSPEC% /C "call %BSE%\etc\IB_FRE_BLD_IA64.bat %SVN% %CD% %_DDK% %_PSDK% WLH & build %OPS%" if ERRORLEVEL 1 exit /B 1 rem ********* WXP - Windows XP - x86 only -rem Fix XP WSD/installsp.exe build problems - -if exist .\ulp\wsd\dirs rename .\ulp\wsd\dirs Xdirs -if exist .\tools\wsdinstall\dirs rename .\tools\wsdinstall\dirs Xdirs - +echo %0 - Build XP x86 Checked %COMSPEC% /C "call %BSE%\etc\IB_CHK_BLD_x86.bat %SVN% %CD% %_DDK% %_PSDK% WXP & build %OPS%" if ERRORLEVEL 1 exit /B 1 +echo %0 - Build XP x86 Free %COMSPEC% /C "call %BSE%\etc\IB_FRE_BLD_x86.bat %SVN% %CD% %_DDK% %_PSDK% WXP & build %OPS%" if ERRORLEVEL 1 exit /B 1 -rem restore WSD/installsp builds -if exist .\ulp\wsd\Xdirs rename .\ulp\wsd\Xdirs dirs -if exist .\tools\wsdinstall\Xdirs rename .\tools\wsdinstall\Xdirs dirs - - rem ********* WNET - Windows Server 2003 - +echo %0 - Build WNET x64 Checked %COMSPEC% /C "call %BSE%\etc\IB_CHK_BLD_x64.bat %SVN% %CD% %_DDK% %_PSDK% WNET & build %OPS%" if ERRORLEVEL 1 exit /B 1 +echo %0 - Build WNET x64 Free %COMSPEC% /C "call %BSE%\etc\IB_FRE_BLD_x64.bat %SVN% %CD% %_DDK% %_PSDK% WNET & build %OPS%" if ERRORLEVEL 1 exit /B 1 +echo %0 - Build WNET x86 Checked %COMSPEC% /C "call %BSE%\etc\IB_CHK_BLD_x86.bat %SVN% %CD% %_DDK% %_PSDK% WNET & build %OPS%" if ERRORLEVEL 1 exit /B 1 +echo %0 - Build WNET x86 Free %COMSPEC% /C "call %BSE%\etc\IB_FRE_BLD_x86.bat %SVN% %CD% %_DDK% %_PSDK% WNET & build %OPS%" if ERRORLEVEL 1 exit /B 1 +echo %0 - Build WNET ia64 Checked %COMSPEC% /C "call %BSE%\etc\IB_CHK_BLD_IA64.bat %SVN% %CD% %_DDK% %_PSDK% WNET & build %OPS%" if ERRORLEVEL 1 exit /B 1 +echo %0 - Build WNET ia64 Free %COMSPEC% /C "call %BSE%\etc\IB_FRE_BLD_IA64.bat %SVN% %CD% %_DDK% %_PSDK% WNET & build %OPS%" if ERRORLEVEL 1 exit /B 1 - -if "%1" == "compile" ( - echo . - echo %0: Finished %0 %* - exit /B 0 -) +if "%1" == "compile" goto finito +if "%1" == "compilenoforce" goto finito rem Install binaries into WIX environment, build msi installers. :InstallBin + echo Create binary release tree - suitible for WinOF-WIX installer build. -if EXIST "%RBIN_WLH%" rmdir /S /Q %RBIN_WLH% -if EXIST "%RBIN_WNET%" rmdir /S /Q %RBIN_WNET% -if EXIST "%RBIN_WXP%" rmdir /S /Q %RBIN_WXP% +if EXIST "%RBIN_WLH%" (rmdir /S /Q %RBIN_WLH% & echo %0 - removed %RBIN_WLH%) +if EXIST "%RBIN_WNET%" (rmdir /S /Q %RBIN_WNET% & echo %0 - removed %RBIN_WNET%) +if EXIST "%RBIN_WXP%" (rmdir /S /Q %RBIN_WXP% & echo %0 - removed %RBIN_WXP%) mkdir %RBIN_WLH% mkdir %RBIN_WNET% mkdir %RBIN_WXP% if EXIST "%BSE%\etc\makebin.bat" ( + echo etc\makebin.bat %BSE% %RBIN_WLH% wlh call %BSE%\etc\makebin.bat %BSE% %RBIN_WLH% wlh if ERRORLEVEL 1 ( echo %0: Err in makebin.bat %BSE% %RBIN_WLH% wlh exit /B 1 ) + echo etc\makebin.bat %BSE% %RBIN_WNET% wnet call %BSE%\etc\makebin.bat %BSE% %RBIN_WNET% wnet if ERRORLEVEL 1 ( echo %0: Err in makebin.bat %BSE% %RBIN_WNET% wnet exit /B 1 ) + echo etc\makebin.bat %BSE% %RBIN_WXP% wxp call %BSE%\etc\makebin.bat %BSE% %RBIN_WXP% wxp if ERRORLEVEL 1 ( echo %0: Err in makebin.bat %BSE% %RBIN_WXP% wxp @@ -232,23 +300,26 @@ if EXIST "%BSE%\etc\makebin.bat" ( ) ) -if "%1" == "makebin" ( - echo . - echo %0: Finished %0 %* - exit /B 0 -) +if "%1" == "makebin" goto finito + +:mk_msi -echo %0 - Binary releases built in +echo %0 - Drivers Signed with %CERTNAME% , Binary releases built in echo %RBIN_WLH% echo %RBIN_WNET% echo %RBIN_WXP% rem build WIX installers --> see ..\branches\WinOF\WIX -%COMSPEC% /C "%_DDK%\bin\setenv.bat %_DDK% fre X64 WNET & cd /D %WIX% & build-all-MSI %CERTNAME% %IDIR%" +%COMSPEC% /V:on /E:on /C "%_DDK%\bin\setenv.bat %_DDK% fre X64 WNET & cd /D %WIX% & build-all-MSI %CERTNAME% %IDIR%" + + +:finito echo . echo %0: Finished %0 %* +echo %0: Started %STIME% +echo %0: Finished %TIME% endlocal @echo on