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.

125 lines
4.1 KiB

  1. @echo off
  2. if not "%CRTMKDEP%"=="TEMP" goto temp
  3. rem Turn off the environment variable if it is TEMP
  4. echo Warning: CRTMKDEP is set to %CRTMKDEP%, but should not be.
  5. set CRTMKDEP=
  6. echo Warning: CRTMKDEP is now unset.
  7. goto chkarg1
  8. :temp
  9. if not "%CLEANSE_ONLY%"=="TEMP" goto chkarg1
  10. rem Turn off the environment variable if it is TEMP
  11. echo Warning: CLEANSE_ONLY is set to %CLEANSE_ONLY%, but should not be.
  12. set CLEANSE_ONLY=
  13. echo Warning: CLEANSE_ONLY is now unset.
  14. :chkarg1
  15. if not "%1" == "CRTMKDEP" goto no_depend
  16. rem if first argument is CRTMKDEP then set that env var temporarily
  17. set CRTMKDEP=TEMP
  18. echo NOTE: CRTMKDEP set temporarily to %CRTMKDEP% to make dependencies.
  19. shift
  20. goto chkarg1
  21. :no_depend
  22. if not "%1" == "CLEANSE_ONLY" goto no_only
  23. rem if first argument is CLEANSE_ONLY then set that env var temporarily
  24. set CLEANSE_ONLY=TEMP
  25. echo NOTE: CLEANSE_ONLY set temporarily to %CLEANSE_ONLY% to only cleanse sources.
  26. shift
  27. goto chkarg1
  28. :no_only
  29. if NOT "%CRT_SRC%"=="" goto env_okay
  30. set CRT_SRC=\crt
  31. :env_okay
  32. if NOT "%VCTOOLS%"=="" goto VCTOOLS
  33. echo.
  34. echo ###############################################################
  35. echo # The environment variable VCTOOLS must be set to build CRTL. #
  36. echo ###############################################################
  37. echo.
  38. goto finish
  39. :VCTOOLS
  40. echo **** NOTE: The environment variable CRT_SRC is set to "%CRT_SRC%"
  41. if "%NMK_IFLAG%"=="" set NMK_IFLAG=-i
  42. echo **** NOTE: The environment variable NMK_IFLAG is set to "%NMK_IFLAG%"
  43. echo.
  44. if not exist \msdev\NUL call srcrel\mkdire \msdev
  45. if not exist \msdev\crt\NUL call srcrel\mkdire \msdev\crt
  46. if not exist \msdev\crt\prebuild\NUL call srcrel\mkdire \msdev\crt\prebuild
  47. if not exist \msdev\crt\src\NUL call srcrel\mkdire \msdev\crt\src
  48. echo =-=-=-=-= Updating Source Cleansing Files... =-=-=-=-=
  49. cd srcrel
  50. nmake -nologo %NMK_IFLAG%
  51. if errorlevel 1 goto errlev
  52. cd ..
  53. echo =-=-=-=-= Updating Pre-Build Source Files... =-=-=-=-=
  54. cd srcrel
  55. nmake -nologo %NMK_IFLAG% -f makefile.pre SRC=%CRT_SRC%
  56. if errorlevel 1 goto errlev
  57. cd ..
  58. echo =-=-=-=-= Updating Post-Build Source Files... =-=-=-=-=
  59. cd srcrel
  60. nmake -nologo %NMK_IFLAG% -f makefile.rel
  61. if errorlevel 1 goto errlev
  62. cd ..
  63. if "%CRTMKDEP%"=="" goto NO_MKDEP
  64. echo =-=-=-=-= Building Dependencies for Pre-build =-=-=-=-=
  65. cd \msdev\crt\prebuild
  66. nmake -nologo PRE_BLD=1 depend
  67. if errorlevel 1 goto errlev
  68. echo =-=-=-=-= Building Dependencies for Post-build =-=-=-=-=
  69. cd \msdev\crt\src
  70. nmake -nologo POST_BLD=1 depend
  71. if errorlevel 1 goto errlev
  72. cd %CRT_SRC%
  73. :NO_MKDEP
  74. if "%CLEANSE_ONLY%"=="" goto do_build
  75. echo *****
  76. echo NOTE: Stopping after cleansing processes because CLEANSE_ONLY is set.
  77. echo *****
  78. goto finish
  79. :do_build
  80. cd \msdev\crt\prebuild
  81. if errorlevel 1 goto errlev
  82. echo =-=-=-=-= Doing Pre-build (Objects) =-=-=-=-=
  83. nmake -nologo -i -n PRE_BLD=1 BLD_OBJ=1 %1 %2 %3 %4 %5 > do_build.out
  84. sed -f %CRT_SRC%\prebld.sed do_build.out > do_build.bat
  85. call do_build.bat
  86. if errorlevel 1 goto errlev
  87. set CL=
  88. set ML=
  89. echo =-=-=-=-= Doing Pre-build (Libraries) =-=-=-=-=
  90. nmake -nologo PRE_BLD=1 BLD_LIB=1 %1 %2 %3 %4 %5
  91. if errorlevel 1 goto errlev
  92. cd %CRT_SRC%
  93. echo =-=-=-=-= Copying Pre-Build Objects =-=-=-=-=
  94. cd srcrel
  95. nmake -nologo -f objects.mkf %1 %2 %3 %4 %5
  96. if errorlevel 1 goto errlev
  97. cd \msdev\crt\src
  98. if errorlevel 1 goto errlev
  99. echo =-=-=-=-= Doing Post-build (Objects) =-=-=-=-=
  100. nmake -nologo -i -n POST_BLD=1 BLD_OBJ=1 %1 %2 %3 %4 %5 > do_build.out
  101. sed -f %CRT_SRC%\prebld.sed do_build.out > do_build.bat
  102. call do_build.bat
  103. if errorlevel 1 goto errlev
  104. set CL=
  105. set ML=
  106. echo =-=-=-=-= Doing Post-build (Libraries) =-=-=-=-=
  107. nmake -nologo POST_BLD=1 BLD_LIB=1 %1 %2 %3 %4 %5
  108. if errorlevel 1 goto errlev
  109. cd %CRT_SRC%
  110. echo =-=-=-=-= Copying Assembler Objects and External Files =-=-=-=-=
  111. cd srcrel
  112. nmake -nologo %NMK_IFLAG% -f external.mkf %1 %2 %3 %4 %5
  113. cd ..
  114. goto finish
  115. :errlev
  116. echo.
  117. echo ***
  118. echo *** BUILD ABORTED -- ErrorLevel is non-zero!
  119. echo ***
  120. :finish
  121. set CL=
  122. set ML=
  123. if "%CRTMKDEP%"=="TEMP" set CRTMKDEP=
  124. if "%CLEANSE_ONLY%"=="TEMP" set CLEANSE_ONLY=
  125. cd %CRT_SRC%