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.

82 lines
2.8 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM <<template_script.cmd>>
  5. REM <<purpose of this script>>
  6. REM
  7. REM Copyright (c) Microsoft Corporation. All rights reserved.
  8. REM
  9. REM ------------------------------------------------------------------
  10. if defined _CPCMAGIC goto CPCBegin
  11. perl -x "%~f0" %*
  12. goto :EOF
  13. #!perl
  14. use strict;
  15. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  16. use lib $ENV{RAZZLETOOLPATH};
  17. use PbuildEnv;
  18. use ParseArgs;
  19. sub Usage { print<<USAGE; exit(1) }
  20. <<Insert your usage message here>>
  21. USAGE
  22. parseargs('?' => \&Usage);
  23. # *** NEXT FEW LINES ARE TEMPLATE ***
  24. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  25. __END__
  26. :CPCBegin
  27. set _CPCMAGIC=
  28. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  29. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  30. REM Swap in unprocessed files so that rebase won't rebase them, thus allowing incremental postbuild
  31. REM to work.
  32. if /i NOT "%lang%" == "usa" goto :EOF
  33. set AlternateDir=prerebase
  34. set FakeSymbolName=sym
  35. set SymbolDirs=dll exe
  36. set BinFile=%_NTPostBld%\build_logs\build.binlist
  37. set SwapDir=%_NTPostBld%\SwapFiles
  38. set SwapSymbolDllDir=%_NTPostBld%\%AlternateDir%\%FakeSymbolName%\dll
  39. set SwapSymbolExeDir=%_NTPostBld%\%AlternateDir%\%FakeSymbolName%\exe
  40. set SymbolDllDir=%_NTPostBld%\symbols.pri\retail\dll
  41. set SymbolExeDir=%_NTPostBld%\symbols.pri\retail\exe
  42. set SwapList=termdd.sys tdasync.sys tdipx.sys tdnetb.sys tdpipe.sys tdspx.sys
  43. set SwapList=%SwapList% tdtcp.sys tsddd.dll rdpdd.dll rdpwd.sys rdpwsx.dll
  44. if NOT "%_BuildArch%" == "x86" goto NoScpP
  45. set SwapList=%SwapList% winlogon.exe licdll.dll licwmi.dll
  46. set SwapSymbolDllList=licdll.pdb licwmi.pdb
  47. set SwapSymbolExeList=winlogon.pdb
  48. :NoScp
  49. REM First off, rename the symbols directory so that populatefromvbl
  50. REM won't filter out the symbols. Do not do this on machines running populatefromvbl
  51. if exist %_NTPostBld%\symbols.pri\%AlternateDir% (
  52. if not exist %AlternateDir%\%FakeSymbolName% md %AlternateDir%\%FakeSymbolName%
  53. for %%a in (%SymbolDirs%) do (
  54. if not exist %_NTPostBld%\%AlternateDir%\%FakeSymbolName%\%%a call executecmd.cmd "md %_NTPostBld%\%AlternateDir%\%FakeSymbolName%\%%a"
  55. call executecmd.cmd "copy %_NTPostBld%\symbols.pri\%AlternateDir%\%%a\*.* %_NTPostBld%\%AlternateDir%\%FakeSymbolName%\%%a\*.*"
  56. )
  57. )
  58. REM Now fake out populatefromvbl by adding these lines to build.binlist
  59. dir /b /s /a-d %_NTPostBld%\%AlternateDir%\%FakeSymbolName% >> %BinFile%
  60. REM Copy in the alternate directory to binaries
  61. for %%a in (%SwapList%) do call executecmd.cmd "copy %_NTPostBld%\%AlternateDir%\%%a %_NTPostBld%"
  62. if not exist %SymbolDllDir% md %SymbolDllDir%
  63. for %%a in (%SwapSymbolDllList%) do call executecmd.cmd "copy %SwapSymbolDllDir%\%%a %SymbolDllDir%"
  64. if not exist %SymbolExeDir% md %SymbolExeDir%
  65. for %%a in (%SwapSymbolExeList%) do call executecmd.cmd "copy %SwapSymbolExeDir%\%%a %SymbolExeDir%"