Leaked source code of windows server 2003
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.

164 lines
3.3 KiB

  1. @echo off
  2. REM
  3. REM --- Batch file controlling the building of project components.
  4. REM
  5. REM
  6. REM --- Check for valid parameters passed to us
  7. REM
  8. if "%bldProject%" == "" goto exit
  9. if not exist %bldProject%?.dat goto noDat
  10. REM
  11. REM --- OK, we've got a target and data file.
  12. REM Set home dirs and tools path
  13. REM
  14. if "%bldDrive%" == "" goto exit
  15. if "%bldDir%" == "" goto exit
  16. if "%bldLogFile%" == "" goto exit
  17. %bldDrive%
  18. cd %bldDir%
  19. REM --- Hook for pre-build goodies
  20. if exist bld%bldProject%1.bat call bld%bldProject%1.bat
  21. REM
  22. REM --- Start logging.
  23. REM
  24. echotime /t "*******************************************************" >> \tmp\bld%bldProject%.log
  25. echotime /t "%bldProject% Build Started" >> \tmp\bld%bldProject%.log
  26. echotime /t "*******************************************************" >> %bldLogFile%
  27. echotime /t "%bldProject% Build Started" >> %bldLogFile%
  28. md %bldDir%\errwrn
  29. md %bldDir%\errwrn\%bldProject%d.wrn
  30. md %bldDir%\errwrn\%bldProject%d.err
  31. md %bldDir%\errwrn\%bldProject%r.wrn
  32. md %bldDir%\errwrn\%bldProject%r.err
  33. md %bldDir%\errwrn\%bldProject%t.wrn
  34. md %bldDir%\errwrn\%bldProject%t.err
  35. md %bldDir%\errwrn\bldbreak
  36. %bldDrive%
  37. cd %bldDir%
  38. REM
  39. REM --- Main body ---
  40. REM
  41. for %%x in (Y y) do if "%bldRelease%" == "%%x" goto relOn
  42. goto relExit
  43. :relOn
  44. echo WARNING: Release flag on!
  45. if "%relDrive%" == "" set relDrive=q:
  46. :relSet
  47. echo Release Drive = %RelDrive%
  48. echo Release Dir = %RelDir%
  49. echo Debug Dir = %DRelDir%
  50. echo Retail Dir = %RRelDir%
  51. echo Test Dir = %TRelDir%
  52. set relSet=
  53. :relExit
  54. :mainBody
  55. %bldDrive%
  56. cd %bldDir%
  57. if exist %bldProject%d.dat goto dDat
  58. if exist %bldProject%r.dat goto rDat
  59. if exist %bldProject%t.dat goto tDat
  60. goto datX
  61. :dDat
  62. awk -f bld.awk %bldProject%d.dat > tmpmk%bldProject%.bat
  63. call tmpmk%bldProject%.bat
  64. goto datX
  65. :rDat
  66. gawk -f bld.awk %bldProject%r.dat > tmpmk%bldProject%.bat
  67. call tmpmk%bldProject%.bat
  68. goto datX
  69. :tDat
  70. gawk -f bld.awk %bldProject%t.dat > tmpmk%bldProject%.bat
  71. call tmpmk%bldProject%.bat
  72. goto datX
  73. :datX
  74. %bldDrive%
  75. cd %bldDir%
  76. del tmpmk%bldProject%.bat
  77. REM
  78. REM --- Any "after build" batch file to run?
  79. REM
  80. rem if exist bld%bldProject%2.bat call bld%bldProject%2.bat
  81. REM
  82. REM --- We're done. Delete the lock file and log an entry
  83. REM
  84. echotime /t "%bldProject% Build Done" >> \tmp\bld%bldProject%.log
  85. echotime /t "*******************************************************" >> \tmp\bld%bldProject%.log
  86. echotime /t "%bldProject% Build Done" >> %bldLogFile%
  87. echotime /t "*******************************************************" >> %bldLogFile%
  88. %bldDrive%
  89. cd %bldDir%
  90. %bldBldDoneSound%
  91. :cleanUp
  92. set bldAutoMode=
  93. goto exit
  94. :noDat
  95. echo.
  96. echo ERROR: No data file found for %bldProject%
  97. goto usage
  98. :noEnv
  99. echo.
  100. echo ERROR: No environment settings file (%bldProject%env.bat) found for %bldProject%
  101. echo.
  102. echo Create one and restart.
  103. goto usage
  104. :usage
  105. echo.
  106. echo usage: bld Target
  107. echo.
  108. echo Examples:
  109. echo.
  110. echo.
  111. goto exit
  112. :exit