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.

238 lines
5.2 KiB

  1. @echo off
  2. REM --- Auto build for Build Project
  3. set gettools=N
  4. set bumpver=N
  5. set getsrc=Y
  6. set MkBat=N
  7. set dellib=Y
  8. set DelTarget=N
  9. REM --- Parse the command line
  10. :loop
  11. echo BLDPROJ.BAT: Parsing command line
  12. if "%1" == "" goto loopX
  13. if "%1" == "bumpver" set bumpver=Y
  14. if "%1" == "gettools" set gettools=Y
  15. if "%1" == "makebat" set MkBat=Y
  16. if "%1" == "nogetsrc" set getsrc=N
  17. if "%1" == "nodellib" set dellib=N
  18. if "%1" == "nodelnode" set DelTarget=N
  19. goto loopshift
  20. :loopShift
  21. shift
  22. goto loop
  23. :loopX
  24. REM --- OK, set our environment for local project
  25. call coreset.bat
  26. set tmp=%bldDrive%\tmp
  27. set temp=%bldDrive%\tmp
  28. REM --- Get the current build number & bump up the build number if desired
  29. if "%bumpver%" == "Y" goto bumpver
  30. call coreset.bat
  31. goto bumpverX
  32. :bumpver
  33. echo %bldproject%.BAT: Bumping build number
  34. call version.bat bumpver
  35. call coreset.bat
  36. call bt.bat
  37. :bumpverX
  38. REM --- Send starting email
  39. set subject=%bldproject% Build (%bldBldNumber%) - Started
  40. set name=hammer TeamMail
  41. call email.bat
  42. REM --- Delete target dirs
  43. call coreset.bat
  44. if "%DelTarget%" == "Y" goto delTgt
  45. goto delTgtX
  46. :delTgt
  47. echo %bldproject% bldproj.BAT: delnode /q %DRelDir% ...
  48. delnode /q %DRelDir%
  49. echo %bldproject% bldproj.BAT: delnode /q %RRelDir% ...
  50. delnode /q %RRelDir%
  51. echo %bldproject% bldproj.BAT: delnode /q %TRelDir% ...
  52. delnode /q %TRelDir%
  53. :delTgtX
  54. echo %bldproject% bldproj.BAT: md %relDrive%\%bldproject% ...
  55. if not exist %relDrive%\%bldproject% md %relDrive%\%bldproject%
  56. echo %bldproject% bldproj.BAT: md %relDrive%%relDir% ...
  57. if not exist %relDrive%%relDir% md %relDrive%%relDir%
  58. echo %bldproject% bldproj.BAT: md %DRelDir% ...
  59. if not exist %DRelDir% md %DRelDir%
  60. echo %bldproject% bldproj.BAT: md %RRelDir% ...
  61. if not exist %RRelDir% md %RRelDir%
  62. echo %bldproject% bldproj.BAT: md %TRelDir% ...
  63. if not exist %TRelDir% md %TRelDir%
  64. REM --- copy /Y version.txt to release point
  65. call bt.bat
  66. echo %bldproject%.BAT: copy /Y version.txt %relDrive%%RelDir% ...
  67. copy /Y version.txt %relDrive%%RelDir%
  68. REM --- Get Tools
  69. if "%gettools%" == "Y" goto gettools
  70. goto gettoolsX
  71. :gettools
  72. call bt.bat
  73. cd %bldDevToolsDir%
  74. tee.com ssync -r -f > %relDrive%%RelDir%\tool%bldBldNumber4%.log
  75. :gettoolsX
  76. REM --- get everything in src if desired
  77. if "%getsrc%" == "Y" goto getsrc
  78. goto getsrcX
  79. :getsrc
  80. call bt.bat
  81. cd %bldsrcrootdir%
  82. tee.com ssync -r -f > %relDrive%%RelDir%\src%bldBldNumber4%.log
  83. :getsrcX
  84. REM --- Make new build batch files if desired (Part 1)
  85. if "%MkBat%" == "Y" goto mkBat1
  86. goto mkBat1X
  87. :mkBat1
  88. echo %bldproject%.BAT: Making batch files (part 1)
  89. call bt.bat
  90. ssync %bldproject%.txt -i-
  91. call txt2dat.bat
  92. call makego.bat
  93. call makeall.bat
  94. echo %bldproject%.BAT: Making batch files (part 1) - Done
  95. :mkBat1X
  96. REM --- Delete all libs in Project %bldproject%
  97. call bt.bat
  98. call coreset.bat
  99. :dellib
  100. cd %bldsrcrootdir%\common\lib\x86
  101. if exist *.lib out -f *.lib
  102. del *.lib
  103. call bt.bat
  104. :dellibX
  105. REM --- Make new build batch files if desired (Part 2)
  106. if "%MkBat%" == "Y" goto mkBat2
  107. goto mkBat2X
  108. :mkBat2
  109. echo %bldproject%.BAT: Making batch files (part 2)
  110. call bt.bat
  111. call mkbat.bat
  112. call makego.bat
  113. echo %bldproject%.BAT: Making batch files (part 2) - Done
  114. :mkBat2X
  115. REM --- Remove any previous lock files from broken builds
  116. call bt.bat
  117. if exist *.lck del *.lck
  118. REM --- Start automagic stuff.
  119. :mk
  120. echo %bldproject%.BAT: making %bldproject% build automagically
  121. call bt.bat
  122. cd %blddevtoolsdir%
  123. nmake
  124. call bt.bat
  125. call coreset.bat
  126. call bt.bat
  127. set bldAutoMode=Y
  128. set bldSlmStatus=N
  129. @echo off
  130. call bld.bat
  131. @echo off
  132. :mkX
  133. REM --- Check for errors
  134. cd %bldDrive%%bldDir%
  135. call coreset.bat
  136. call error.bat
  137. if exist error.out goto errYes
  138. REM --- No errors
  139. :errNo
  140. echo %bldproject%.BAT: No errors detected
  141. set subject=%bldproject% Build (%bldBldNumber%) - Completed OK
  142. set name=a-msmith
  143. call pager.bat
  144. set subject=%bldproject% Build (%bldBldNumber%) - Completed OK
  145. set name=hammer TeamMail
  146. call email.bat
  147. goto cleanup
  148. REM --- Yes, errors
  149. :errYes
  150. echo %bldproject%.BAT: Errors detected
  151. set subject=%bldproject% Build (%bldBldNumber%) - Completed with ERRORS
  152. set name=a-msmith
  153. set file=error.out
  154. call pager.bat
  155. set subject=%bldproject% Build (%bldBldNumber%) - Completed with ERRORS
  156. set name=hammer TeamMail
  157. set file=error.out
  158. call email.bat
  159. goto cleanup
  160. :cleanup
  161. call bt.bat
  162. cd %bldsrcrootdir%\common\lib\x86
  163. in -fc "" *.lib
  164. REM --- Check to see if all files were copied ok and make new mkdrop.bat
  165. call bt.bat
  166. call missing.bat
  167. set name=hammer TeamMail
  168. set file=chkbuild.out
  169. call email.bat
  170. call bt.bat
  171. call drop.bat
  172. REM --- Create build done file
  173. echo.>%relDrive%%RelDir%\done
  174. goto exit
  175. :exit
  176. echo %bldproject%.BAT: Exiting