Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
3.3 KiB

  1. @echo off
  2. if defined _echo echo on
  3. REM ------------------------------------------------------------------
  4. REM
  5. REM layout.cmd
  6. REM Updates layout.inf for each sku with the sizes of the binaries
  7. REM
  8. REM Copyright (c) Microsoft Corporation. All rights reserved.
  9. REM
  10. REM ------------------------------------------------------------------
  11. if defined _CPCMAGIC goto CPCBegin
  12. perl -x "%~f0" %*
  13. goto :EOF
  14. #!perl
  15. use strict;
  16. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  17. use lib $ENV{RAZZLETOOLPATH};
  18. use PbuildEnv;
  19. use ParseArgs;
  20. sub Usage { print<<USAGE; exit(1) }
  21. layout [-l <language>]
  22. Updates layout.inf for each sku with the sizes of the binaries
  23. USAGE
  24. parseargs('?' => \&Usage);
  25. # *** NEXT FEW LINES ARE TEMPLATE ***
  26. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  27. __END__
  28. :CPCBegin
  29. set _CPCMAGIC=
  30. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  31. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  32. if exist %_NTPostBld%\build_logs\bindiff.txt (
  33. findstr /ilc:"layout" %_NTPostBld%\build_logs\bindiff.txt
  34. if /i NOT "!ErrorLevel!" == "0" (
  35. call logmsg.cmd /t "Not running layout.cmd - layout has not changed"
  36. goto end
  37. )
  38. )
  39. REM set layouts=%_NTPostBld% %_NTPostBld%\perinf %_NTPostBld%\blainf %_NTPostBld%\sbsinf %_NTPostBld%\srvinf %_NTPostBld%\entinf %_NTPostBld%\dtcinf %_NTPostBld%\realsign %_NTPostBld%\perinf\realsign %_NTPostBld%\srvinf\realsign %_NTPostBld%\entinf\realsign %_NTPostBld%\dtcinf\realsign
  40. set layouts=%_NTPostBld% %_NTPostBld%\realsign
  41. perl %RazzleToolPath%\CkSku.pm -t:per -l:%lang%
  42. if %errorlevel% EQU 0 (set layouts=%layouts% %_NTPostBld%\perinf %_NTPostBld%\perinf\realsign)
  43. perl %RazzleToolPath%\CkSku.pm -t:bla -l:%lang%
  44. if %errorlevel% EQU 0 (set layouts=%layouts% %_NTPostBld%\blainf %_NTPostBld%\blainf\realsign)
  45. perl %RazzleToolPath%\CkSku.pm -t:sbs -l:%lang%
  46. if %errorlevel% EQU 0 (set layouts=%layouts% %_NTPostBld%\sbsinf %_NTPostBld%\sbsinf\realsign)
  47. perl %RazzleToolPath%\CkSku.pm -t:srv -l:%lang%
  48. if %errorlevel% EQU 0 (set layouts=%layouts% %_NTPostBld%\srvinf %_NTPostBld%\srvinf\realsign)
  49. perl %RazzleToolPath%\CkSku.pm -t:ads -l:%lang%
  50. if %errorlevel% EQU 0 (set layouts=%layouts% %_NTPostBld%\entinf %_NTPostBld%\entinf\realsign)
  51. perl %RazzleToolPath%\CkSku.pm -t:dtc -l:%lang%
  52. if %errorlevel% EQU 0 (set layouts=%layouts% %_NTPostBld%\dtcinf %_NTPostBld%\dtcinf\realsign)
  53. REM --------------------------------------------------
  54. REM Call infsize for all the layout.infs
  55. REM --------------------------------------------------
  56. :CallInf
  57. if exist %TEMP%\layout.err del %TEMP%\layout.err
  58. if exist %TEMP%\infsize.tmp del %TEMP%\infsize.tmp
  59. for %%a in (%layouts%) do (
  60. echo Calling infsize for %%a\layout.inf>>%LogFile%
  61. echo infsize for %%a >> %TEMP%\layout.err
  62. call infsize.exe %TEMP%\infsize.tmp %%a %_NTPostBld% %_NTPostBld% | findstr "FATAL" >> %TEMP%\layout.err
  63. )
  64. REM --------------------------------------------------
  65. REM Now fixup the oc infs with the information we just added to layout.inf
  66. REM --------------------------------------------------
  67. for %%a in (%layouts%) do (
  68. echo Calling ocinf for %%a\sysoc.inf>>%LogFile%
  69. echo ocinf for %%a >> %TEMP%\layout.err
  70. call ocinf.exe -inf:%%a\sysoc.inf -layout:%%a\layout.inf >> %TEMP%\layout.err
  71. )
  72. echo Finished!! -- check %TEMP%\layout.err for errors
  73. goto end
  74. :end
  75. seterror.exe "%errors%"& goto :EOF