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.

185 lines
5.4 KiB

  1. # Set up DEVTOOLSBIN, DEVTOOLSLIB, DEVTOOLSINC, and DEVTOOLSSDKLIB to point
  2. # to the compiler tools to be used. Also set PA as a short alias for
  3. # PROCESSOR_ARCHITECTURE, and CPUDIR to the proper subdirectory name for
  4. # built files for the target architecture.
  5. #
  6. # If doing a 64-bit CRT build on a 32-bit system, use the native 32-bit
  7. # compiler, not a 64-bit-targetting cross-compiler
  8. #
  9. # Find the proper tools somewhere under $(DEVTOOLS), unless overridden by
  10. # explicit definitions
  11. PA = $(PROCESSOR_ARCHITECTURE) # Use a shorter name
  12. !if "$(PA)"=="IA64" || ("$(PA)"=="x86" && "$(LLP64)"=="1")
  13. TARGET_CPU = IA64
  14. CPUDIR = ia64
  15. !elseif "$(PA)"=="x86" && "$(LLP64)"=="2"
  16. TARGET_CPU = AMD64
  17. CPUDIR = amd64
  18. !elseif "$(PA)"=="x86"
  19. TARGET_CPU = i386
  20. CPUDIR = intel
  21. !else
  22. !error makefile: unknown host CPU
  23. !endif
  24. !message TARGET: $(TARGET_CPU)
  25. !if "$(LLP64)" == ""
  26. LLP64 = 0
  27. !elseif "$(LLP64)" != "0" && "$(LLP64)" != "1" && "$(LLP64)" != "2"
  28. ! error LLP64 = $(LLP64), should be 0, 1, or 2
  29. !endif
  30. !message LLP64: $(LLP64)
  31. !if "$(BLD_SYSCRT)" == ""
  32. ! if "$(LLP64)" == "0"
  33. BLD_SYSCRT = 0
  34. ! else
  35. BLD_SYSCRT = 1
  36. ! endif
  37. !elseif "$(BLD_SYSCRT)" != "0" && "$(BLD_SYSCRT)" != "1"
  38. ! error BLD_SYSCRT = $(BLD_SYSCRT), should be 0 or 1
  39. !endif
  40. !message BLD_SYSCRT: $(BLD_SYSCRT)
  41. # By default, we set up pointers to the compiler tool directories by searching
  42. # for the following subdirectories of DEVTOOLS, in this order:
  43. #
  44. # DEVTOOLSBIN: $(DEVTOOLS)\$(PA)\vc7\bin
  45. # else $(DEVTOOLS)\$(PA)\vclkg\bin
  46. #
  47. # DEVTOOLSLIB: $(DEVTOOLS)\$(PA)\vc7\lib
  48. # else $(DEVTOOLS)\$(PA)\vclkg\lib
  49. #
  50. # DEVTOOLSINC: $(DEVTOOLS)\common\vc7\inc
  51. # else $(DEVTOOLS)\common\vc7\include
  52. # else $(DEVTOOLS)\common\vclkg\inc
  53. # else $(DEVTOOLS)\common\vclkg\include
  54. #
  55. # DEVTOOLSSDKLIB: $(DEVTOOLS)\$(PA)\win32sdk\lib
  56. #
  57. # You can avoid all automatic choice by explicitly setting DEVTOOLSBIN,
  58. # DEVTOOLSLIB, DEVTOOLSINC, and DEVTOOLSSDKLIB.
  59. # check that DEVTOOLS is set if it is needed
  60. !if !defined(DEVTOOLSBIN) || !defined(DEVTOOLSLIB) \
  61. || !defined(DEVTOOLSINC) \
  62. || !defined(DEVTOOLSSDKLIB)
  63. ! if !defined(DEVTOOLS)
  64. ! message
  65. ! message *** ERROR: %DEVTOOLS% must be defined, or else define explicit
  66. ! message *** path variables as follows:
  67. ! message
  68. ! message DEVTOOLSBIN: path to native CL.EXE
  69. ! message DEVTOOLSINC: path to VC++ headers
  70. ! message DEVTOOLSLIB: path to native VC++ libs
  71. ! message DEVTOOLSSDKLIB: path to native Win32 SDK libs
  72. ! message
  73. ! error Set environment variables and rebuild.
  74. ! endif
  75. ! if !exist("$(DEVTOOLS)")
  76. ! message
  77. ! message *** ERROR: %DEVTOOLS% is set to "$(DEVTOOLS)", but that directory
  78. ! message *** does not exist.
  79. ! message
  80. ! error Correct DEVTOOLS and rebuild.
  81. ! endif
  82. ! if defined(VCFLAVOR)
  83. ! if !exist("$(DEVTOOLS)\$(PA)\$(VCFLAVOR)")
  84. ! message
  85. ! message *** ERROR: %VCFLAVOR% is set to "$(VCFLAVOR)", but the directory
  86. ! message *** $(DEVTOOLS)\$(PA)\$(VCFLAVOR) does not exist.
  87. ! message *** VCFLAVOR should generally be set to "vc7" or "vclkg".
  88. ! message
  89. ! error Correct VCFLAVOR and rebuild.
  90. ! endif
  91. ! elseif exist("$(DEVTOOLS)\$(PA)\vc7")
  92. VCFLAVOR = vc7
  93. ! elseif exist("$(DEVTOOLS)\$(PA)\vclkg")
  94. VCFLAVOR = vclkg
  95. ! else
  96. ! error Unable to find $(DEVTOOLS)\$(PA)\vc7 or vclkg
  97. ! endif
  98. !endif
  99. !message Paths to native-hosted toolset used to build SRCREL tools:
  100. !if defined(DEVTOOLS)
  101. ! message DEVTOOLS: $(DEVTOOLS)
  102. !endif
  103. !if defined(VCFLAVOR)
  104. ! message VCFLAVOR: $(VCFLAVOR)
  105. !endif
  106. # set DEVTOOLSCPUVC if needed
  107. !if !defined(DEVTOOLSBIN) || !defined(DEVTOOLSLIB)
  108. DEVTOOLSCPUVC = $(DEVTOOLS)\$(PA)\$(VCFLAVOR)
  109. ! if !exist("$(DEVTOOLSCPUVC)")
  110. ! error Unable to find $(DEVTOOLSCPUVC)
  111. ! endif
  112. !endif
  113. # set DEVTOOLSCOMMONVC if needed
  114. !if !defined(DEVTOOLSINC)
  115. DEVTOOLSCOMMONVC = $(DEVTOOLS)\common\$(VCFLAVOR)
  116. ! if !exist("$(DEVTOOLSCOMMONVC)")
  117. ! error Unable to find $(DEVTOOLSCOMMONVC)
  118. ! endif
  119. !endif
  120. # set DEVTOOLSCPUSDK if needed
  121. !if !defined(DEVTOOLSSDKLIB)
  122. DEVTOOLSCPUSDK = $(DEVTOOLS)\$(PA)\win32sdk
  123. ! if !exist("$(DEVTOOLSCPUSDK)")
  124. ! error Unable to find $(DEVTOOLSCPUSDK)
  125. ! endif
  126. !endif
  127. # set DEVTOOLSBIN if not already defined
  128. !if !defined(DEVTOOLSBIN)
  129. DEVTOOLSBIN = $(DEVTOOLSCPUVC)\bin
  130. !endif
  131. # set DEVTOOLSLIB if not already defined
  132. !if !defined(DEVTOOLSLIB)
  133. DEVTOOLSLIB = $(DEVTOOLSCPUVC)\lib
  134. !endif
  135. # set DEVTOOLSINC if not already defined
  136. !if !defined(DEVTOOLSINC)
  137. ! if exist("$(DEVTOOLSCOMMONVC)\inc")
  138. DEVTOOLSINC = $(DEVTOOLSCOMMONVC)\inc
  139. ! elseif exist("$(DEVTOOLSCOMMONVC)\include")
  140. DEVTOOLSINC = $(DEVTOOLSCOMMONVC)\include
  141. ! else
  142. # For better error-reporting below
  143. DEVTOOLSINC = $(DEVTOOLSCOMMONVC)\inc
  144. ! endif
  145. !endif
  146. # set DEVTOOLSSDKLIB if not already defined
  147. !if !defined(DEVTOOLSSDKLIB)
  148. DEVTOOLSSDKLIB = $(DEVTOOLSCPUSDK)\lib
  149. !endif
  150. !message DEVTOOLSBIN: $(DEVTOOLSBIN)
  151. !if !exist("$(DEVTOOLSBIN)")
  152. ! error Unable to find $(DEVTOOLSBIN)
  153. !endif
  154. !message DEVTOOLSINC: $(DEVTOOLSINC)
  155. !if !exist("$(DEVTOOLSINC)")
  156. ! error Unable to find $(DEVTOOLSINC)
  157. !endif
  158. !message DEVTOOLSLIB: $(DEVTOOLSLIB)
  159. !if !exist("$(DEVTOOLSLIB)")
  160. ! error Unable to find $(DEVTOOLSLIB)
  161. !endif
  162. !message DEVTOOLSSDKLIB: $(DEVTOOLSSDKLIB)
  163. !if !exist("$(DEVTOOLSSDKLIB)")
  164. ! error Unable to find $(DEVTOOLSSDKLIB)
  165. !endif
  166. !message