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.

156 lines
4.4 KiB

  1. @setlocal
  2. @if "%_echo%"=="" echo off
  3. set bldtools=%~dp0
  4. path %bldtools%;%path%
  5. call %1 %1 %2 %3 %4 %5 %6 %7 %8 %9
  6. set logfile=%logpath%\%~n0.log
  7. for %%f in (%logfile%) do mkdir %%~dpf 2>nul
  8. echo %~n0: start %date% %time% > %logfile%
  9. call %bldtools%\setlog %loglinkpath% %logpath%
  10. if exist %newbuild%\%newexe% goto gotpackage
  11. echo %~n0: could not find %newexe% at %newbuild%\
  12. goto :EOF
  13. :gotpackage
  14. echo Found %newexe% at %newbuild%\
  15. rem if the timestamp still matches, don't need to rebuild the stage
  16. if not exist %forest%\stage\timestamp goto noStamp
  17. if not exist %newfiles%\*.dl* goto noStamp
  18. echo dir %newbuild%\%newexe% /tw ^| findstr /i %newexe% ^> %forest%\stage\timestamp.now >> %logfile%
  19. dir %newbuild%\%newexe% /tw | findstr /i %newexe% > %forest%\stage\timestamp.now
  20. echo comp1 %forest%\stage\timestamp %forest%\stage\timestamp.now >> %logfile%
  21. type %forest%\stage\timestamp >> %logfile%
  22. type %forest%\stage\timestamp.now >> %logfile%
  23. comp1 %forest%\stage\timestamp %forest%\stage\timestamp.now >> %logfile%
  24. if not errorlevel 1 goto noUpdate
  25. :noStamp
  26. echo rd /s /q %forest%\stage >> %logfile%
  27. rd /s /q %forest%\stage 2>nul
  28. echo md %forest%\stage >> %logfile%
  29. md %forest%\stage >> %logfile%
  30. echo cd /d %forest%\stage >> %logfile%
  31. cd /d %forest%\stage >> %logfile%
  32. rem copy all the build files
  33. if not exist %newbuild%\%newexe% goto nofiles
  34. dir %newbuild%\%newexe% /tw | findstr /i %newexe% > %forest%\stage\timestamp.tmp
  35. echo copy %newbuild%\%newexe% >> %logfile%
  36. copy %newbuild%\%newexe% >> %logfile%
  37. if not exist %newexe% goto nofiles
  38. echo %newexe% /x:%newfiles% /u >> %logfile%
  39. %newexe% /x:%newfiles% /u >> %logfile%
  40. if exist %newfiles%\update\upd* goto gotfiles
  41. :nofiles
  42. echo %~n0: no files found at %newbuild% >> %logfile%
  43. echo %~n0: no files found at %newbuild%
  44. goto leave
  45. :gotfiles
  46. del %newexe%
  47. cd %newfiles%
  48. rem TEMPORARY until SYMBOL SEARCHING is REFINED
  49. if not exist symbols\* goto nosymbols
  50. cd symbols
  51. for /d %%f in (*) do (move /y %%f\* . >nul & rd %%f)
  52. cd ..
  53. :nosymbols
  54. goto noothers
  55. echo copy %newbuild%\readmesp.htm >> %logfile%
  56. copy %newbuild%\readmesp.htm >> %logfile%
  57. echo xcopy %newbuild%\support\debug\symbols\%platform:nec98=i386% symbols\ /s /h >> %logfile%
  58. xcopy %newbuild%\support\debug\symbols\%platform:nec98=i386% symbols\ /s /h >> %logfile%
  59. if exist %newfiles%\symbols\*.cab goto gotsyms
  60. echo %~n0: no symbols found with %newbuild% >> %logfile%
  61. echo %~n0: no symbols found with %newbuild%
  62. goto symsdone
  63. :gotsyms
  64. cd symbols
  65. echo perl %bldtools%\noprompt.pl %newfiles%\symbols \< symbols_sp.inf \> z.inf >> %logfile%
  66. perl %bldtools%\noprompt.pl %newfiles%\symbols < symbols_sp.inf > z.inf
  67. echo rundll32 advpack,LaunchINFSection z.inf,DefaultInstall.x86 >> %logfile%
  68. rundll32 advpack,LaunchINFSection z.inf,DefaultInstall.x86
  69. del /f /q *
  70. cd ..
  71. :symsdone
  72. :noothers
  73. rem we don't need any special attribs around here
  74. echo attrib -r -h -s * /s >> %logfile%
  75. attrib -r -h -s * /s >> %logfile%
  76. rem expand all the simple compressed files
  77. echo for /r %%f in (*_) do call flat.bat %%~pf %%~nxf >> %logfile%
  78. for /r %%f in (*_) do call flat.bat %%~pf %%~nxf >> %logfile%
  79. for /r %%f in (*_) do call flat.bat %%~pf %%~nxf >> %logfile%
  80. for /r %%f in (*_) do call flat.bat %%~pf %%~nxf >> %logfile%
  81. rem make sure there are no attributes
  82. echo attrib -r -h -s * /s >> %logfile%
  83. attrib -r -h -s * /s >> %logfile%
  84. echo tolower . /s >> %logfile%
  85. tolower . /s >> %logfile%
  86. echo makefest . /s >> %logfile%
  87. makefest . /s >> %logfile%
  88. ren %forest%\stage\timestamp.tmp timestamp
  89. goto done
  90. :noUpdate
  91. echo %~n0 found %newfiles% was already current >> %logfile%
  92. echo %~n0 found %newfiles% was already current
  93. echo Note: del %forest%\stage\timestamp to force rebuild >> %logfile%
  94. echo Note: del %forest%\stage\timestamp to force rebuild
  95. goto leave
  96. :done
  97. echo %~n0 finished %newfiles%
  98. :leave
  99. echo %~n0: end %date% %time% >> %logfile%
  100. endlocal