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.

118 lines
3.5 KiB

  1. @REM -----------------------------------------------------------------
  2. @REM
  3. @REM MiniWinFuseSfcGen.cmd - SXSCore
  4. @REM Smaller version of winfusesfcgen.cmd that can run in an "incomplete"
  5. @REM build environment, such as the SP build process
  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. use Logmsg;
  20. sub Usage { print<<USAGE; exit(1) }
  21. MiniWinFuseSfcGen [-?] [-hashes:yes] [-cdfs:yes] [-verbose:yes] [-asmsroot:{path to asms, like %_nttree%\\asms}]
  22. Twiddles Side-by-side assemblies to create .cdf files, add SHA hashes of member files,
  23. and any other last-second junk that has to happen to make SxS work right.
  24. -? this message
  25. -hashes injects hashes into manifests
  26. -cdfs sets the CDF logging depot
  27. -verbose turns on verbose operation
  28. USAGE
  29. sub Dependencies {
  30. if ( !open DEPEND, ">>$ENV{_NTPOSTBLD}\\..\\build_logs\\dependencies.txt" ) {
  31. errmsg("Unable to open dependency list file.");
  32. die;
  33. }
  34. print DEPEND<<DEPENDENCIES;
  35. \[$0\]
  36. IF { asms\\... }
  37. ADD {}
  38. DEPENDENCIES
  39. close DEPEND;
  40. exit;
  41. }
  42. my $qfe;
  43. parseargs('?' => \&Usage,
  44. 'plan' => \&Dependencies,
  45. 'qfe:' => \$qfe,
  46. 'cdfs:' => \$ENV{CDFS},
  47. 'hashes:' => \$ENV{HASHES},
  48. 'verbose:' => \$ENV{VERBOSE},
  49. 'compress:' => \$ENV{SXSCOMPRESS} );
  50. if ( -f "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  51. if ( !open SKIP, "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  52. errmsg("Unable to open skip list file.");
  53. die;
  54. }
  55. while (<SKIP>) {
  56. chomp;
  57. exit if lc$_ eq lc$0;
  58. }
  59. close SKIP;
  60. }
  61. # *** TEMPLATE CODE ***
  62. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  63. __END__
  64. @:CPCBegin
  65. @set _CPCMAGIC=
  66. @setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  67. @if not defined DEBUG echo off
  68. @REM *** CMD SCRIPT BELOW ***
  69. setlocal
  70. set asmsrootpath=%_NTPOSTBLD%\asms
  71. set buildtool=mt.exe
  72. set buildtoolparams=
  73. if /i "%CDFS%" EQU "yes" set buildtoolparams=%buildtoolparams% -makecdfs
  74. if /i "%HASHES%" EQU "yes" set buildtoolparams=%buildtoolparams% -hashupdate
  75. if /i "%VERBOSE%" EQU "yes" set buildtoolparams=%buildtoolparams% -verbose
  76. if /i "%ASMSROOT%" NEQ "" set asmsrootpath=%ASMSROOT%
  77. call Logmsg.cmd "Processing assemblies in %asmsrootpath%"
  78. for /f %%f in ('dir /s /b /a-d %asmsrootpath%\*.man') do (
  79. REM Add the hash, generate the .cdf file
  80. pushd %%~dpf
  81. call ExecuteCmd.cmd "%buildtool% -manifest %%f %buildtoolparams%"
  82. if not exist "%%f.cdf" call errmsg.cmd "Didn't create .cdf file for %%f!"
  83. call ExecuteCmd.cmd "makecat.exe %%f.cdf"
  84. if not exist "%%~dpnf.cat" call errmsg.cmd "Didn't create catalog for %%f from %%f.cdf!"
  85. call ExecuteCmd.cmd "ntsign.cmd %%~dpnf.cat"
  86. del %%f.cdf
  87. popd
  88. )
  89. if /i "%_buildarch%" equ "ia64" (
  90. set asmsrootpath=%_NTPOSTBLD%\wowbins
  91. call Logmsg.cmd "Processing assemblies in !asmsrootpath! dir"
  92. for /f %%f in ('dir /s /b /a-d !asmsrootpath!\*.man') do (
  93. REM Add the hash, generate the .cdf file
  94. pushd %%~dpf
  95. call ExecuteCmd.cmd "%buildtool% -manifest %%f %buildtoolparams%"
  96. if not exist "%%f.cdf" call errmsg.cmd "Didn't create .cdf file for %%f!"
  97. call ExecuteCmd.cmd "makecat.exe %%f.cdf"
  98. if not exist "%%~dpnf.cat" call errmsg.cmd "Didn't create catalog for %%f from %%f.cdf!"
  99. call ExecuteCmd.cmd "ntsign.cmd %%~dpnf.cat"
  100. del %%f.cdf
  101. popd
  102. )
  103. )