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.

180 lines
4.8 KiB

  1. @echo off
  2. break=on
  3. @rem Init values
  4. set IMNBUILDPROG=iebuild
  5. set IMNCLEAN=0
  6. set IMNROOTDIR=
  7. @rem
  8. @rem Default options
  9. @rem w for show warnings
  10. @rem F for full text errors (helps vc)
  11. @rem h if you are running my high-pri-enabled build.exe
  12. @rem
  13. set ARGS=-wF
  14. if "%T-ERIKNEBUILDEXE%"=="yes" set ARGS=%ARGS%h
  15. @rem Parse command line
  16. @rem
  17. if "%1" == "" goto usage
  18. if "%1" == "debug" goto err_ver1
  19. if "%1" == "retail" goto err_ver1
  20. if "%2" == "" goto usage
  21. set IMNROOTDIR=%1
  22. shift
  23. if "%1" == "debug" goto dodebug
  24. if "%1" == "retail" goto doretail
  25. if "%1" == "chk" goto dodebug
  26. if "%1" == "fre" goto doretail
  27. if "%1" == "check" goto dodebug
  28. if "%1" == "free" goto doretail
  29. goto usage
  30. :dodebug
  31. set ARGS=%ARGS% chk pdb nostrip
  32. goto next
  33. :doretail
  34. set ARGS=%ARGS% free
  35. goto next
  36. :options
  37. if "%1" == "clean" goto clean
  38. if "%1" == "depend" goto depend
  39. if "%1" == "noprop" goto noprop
  40. if "%1" == "debug" goto err_tricky
  41. if "%1" == "retail" goto err_tricky
  42. if "%1" == "chk" goto err_tricky
  43. if "%1" == "fre" goto err_tricky
  44. if "%1" == "check" goto err_tricky
  45. if "%1" == "free" goto err_tricky
  46. if "%1" == "" goto setup
  47. set ARGS=%ARGS% %1
  48. goto next
  49. :clean
  50. set IMNCLEAN=1
  51. set ARGS=%ARGS% -cC
  52. goto next
  53. :depend
  54. set ARGS=%ARGS% -f
  55. goto next
  56. :noprop
  57. set ARGS=%ARGS% noprop
  58. goto next
  59. :next
  60. shift
  61. goto options
  62. :setup
  63. echo *** RazBld (v2) Begins
  64. :computedrive
  65. if not "%_NTDRIVE%"=="" goto computeroot
  66. @rem note that this for is in reverse preference order
  67. for %%i in (c: e: d:) do if exist %%i\*.* set _NTDRIVE=%%i
  68. if "%_NTDRIVE%"=="" goto err_nodrive
  69. :computeroot
  70. if not "%_NTROOT%"=="" goto start
  71. @rem note that this for is in reverse preference order
  72. for %%i in (\nt \ie) do if exist %_NTDRIVE%%%i\nul set _NTROOT=%%i
  73. if not "%_NTROOT%"=="" goto start
  74. @rem Before we bail, we'll try one more drive
  75. @rem
  76. :computeroot2
  77. if "%_NTDRIVE%"=="e:" set _NTDRIVE=c:
  78. if "%_NTDRIVE%"=="d:" set _NTDRIVE=e:
  79. @rem note that this for is in reverse preference order
  80. for %%i in (\nt \ie) do if exist %_NTDRIVE%%%i\nul set _NTROOT=%%i
  81. if "%_NTROOT%"=="" goto err_noroot
  82. goto start
  83. :start
  84. echo *** NT path computed as %_NTDRIVE%%_NTROOT%
  85. cd /d %IMNROOTDIR%
  86. pushd .
  87. if "%OS%"=="Windows_NT" goto ntplat
  88. :win95
  89. echo *** OS is Win95
  90. if not exist %_NTDRIVE%%_NTROOT%\bin\win95\razzle95.bat goto err_path
  91. call %_NTDRIVE%%_NTROOT%\bin\win95\razzle95.bat > nul
  92. goto build
  93. :ntplat
  94. echo *** OS is NT
  95. set PATH=%_NTDRIVE%%_NTROOT%\idw;%_NTDRIVE%%_NTROOT%\mstools;%_NTDRIVE%%_NTROOT%\bin;%_NTDRIVE%%_NTROOT%\bin\%PROCESSOR_ARCHITECTURE%;%PATH%
  96. if not exist %_NTDRIVE%%_NTROOT%\PUBLIC\TOOLS\ntenv.cmd goto err_path
  97. call %_NTDRIVE%%_NTROOT%\PUBLIC\TOOLS\ntenv.cmd > nul
  98. goto build
  99. :build
  100. popd
  101. echo *** Building from:
  102. cd
  103. echo *** %IMNBUILDPROG% %ARGS%
  104. %IMNBUILDPROG% %ARGS%
  105. goto cleanup
  106. :usage
  107. echo ******************************************************************
  108. echo * *
  109. echo * Usage: razbld (directory) (debug/retail) [options] *
  110. echo * Builds tree under VC using NT buildenv *
  111. echo * *
  112. echo * Commands: directory -- root dir of the build relative to *
  113. echo * VC's root (d:\candle or .. are good) *
  114. echo * debug -- iebuild chk pdb nostrip *
  115. echo * retail -- iebuild free *
  116. echo * Options: (none) -- default is -wF *
  117. echo * + *
  118. echo * depend -- build dependency list *
  119. echo * clean -- do a clean build *
  120. echo * noprop -- no binplace *
  121. echo * help -- this text *
  122. echo * plus any other build.exe options *
  123. echo * *
  124. echo ******************************************************************
  125. goto end
  126. :err_tricky
  127. echo ! ! ! Please don't specify retail or debug more than once
  128. goto end
  129. :err_path
  130. echo ! ! ! Couldn't find the razzle start-up.
  131. goto end
  132. :err_nodrive
  133. echo ! ! ! Couldn't figure out _NTDRIVE, sorry.
  134. goto end
  135. :err_noroot
  136. echo ! ! ! Couldn't figure out _NTROOT, sorry.
  137. goto end
  138. :err_ver1
  139. echo ! ! ! Sorry, must specify a directory first now.
  140. echo ! ! ! (it is for a good reason)
  141. goto end
  142. echo ! ! ! RAZBLD error: shouldn't get here.
  143. :end
  144. :cleanup
  145. set ARGS=
  146. set IMNBUILDPROG=
  147. set IMNCLEAN=
  148. set IMNROOTDIR=