Source code of Windows XP (NT5)
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.

196 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"
  16. TARGET_CPU = i386
  17. CPUDIR = intel
  18. !elseif "$(PA)"=="ALPHA"
  19. !if "$(LLP64)"=="1"
  20. TARGET_CPU = ALPHA64
  21. CPUDIR = alpha64
  22. !else
  23. TARGET_CPU = ALPHA
  24. CPUDIR = alpha
  25. !endif
  26. !elseif "$(PA)"=="MIPS"
  27. TARGET_CPU = MIPS
  28. CPUDIR = mips
  29. !elseif "$(PA)"=="PPC"
  30. TARGET_CPU = PPC
  31. CPUDIR = ppc
  32. !else
  33. !error makefile: unknown host CPU
  34. !endif
  35. !message TARGET: $(TARGET_CPU)
  36. !if "$(LLP64)" == ""
  37. LLP64 = 0
  38. !elseif "$(LLP64)" != "0" && "$(LLP64)" != "1"
  39. ! error LLP64 = $(LLP64), should be 0 or 1
  40. !endif
  41. !message LLP64: $(LLP64)
  42. !if "$(BLD_SYSCRT)" == ""
  43. ! if "$(LLP64)" == "0"
  44. BLD_SYSCRT = 0
  45. ! else
  46. BLD_SYSCRT = 1
  47. ! endif
  48. !elseif "$(BLD_SYSCRT)" != "0" && "$(BLD_SYSCRT)" != "1"
  49. ! error BLD_SYSCRT = $(BLD_SYSCRT), should be 0 or 1
  50. !endif
  51. !message BLD_SYSCRT: $(BLD_SYSCRT)
  52. # By default, we set up pointers to the compiler tool directories by searching
  53. # for the following subdirectories of DEVTOOLS, in this order:
  54. #
  55. # DEVTOOLSBIN: $(DEVTOOLS)\$(PA)\vc7\bin
  56. # else $(DEVTOOLS)\$(PA)\vclkg\bin
  57. #
  58. # DEVTOOLSLIB: $(DEVTOOLS)\$(PA)\vc7\lib
  59. # else $(DEVTOOLS)\$(PA)\vclkg\lib
  60. #
  61. # DEVTOOLSINC: $(DEVTOOLS)\common\vc7\inc
  62. # else $(DEVTOOLS)\common\vc7\include
  63. # else $(DEVTOOLS)\common\vclkg\inc
  64. # else $(DEVTOOLS)\common\vclkg\include
  65. #
  66. # DEVTOOLSSDKLIB: $(DEVTOOLS)\$(PA)\win32sdk\lib
  67. #
  68. # You can avoid all automatic choice by explicitly setting DEVTOOLSBIN,
  69. # DEVTOOLSLIB, DEVTOOLSINC, and DEVTOOLSSDKLIB.
  70. # check that DEVTOOLS is set if it is needed
  71. !if !defined(DEVTOOLSBIN) || !defined(DEVTOOLSLIB) \
  72. || !defined(DEVTOOLSINC) \
  73. || !defined(DEVTOOLSSDKLIB)
  74. ! if !defined(DEVTOOLS)
  75. ! message
  76. ! message *** ERROR: %DEVTOOLS% must be defined, or else define explicit
  77. ! message *** path variables as follows:
  78. ! message
  79. ! message DEVTOOLSBIN: path to native CL.EXE
  80. ! message DEVTOOLSINC: path to VC++ headers
  81. ! message DEVTOOLSLIB: path to native VC++ libs
  82. ! message DEVTOOLSSDKLIB: path to native Win32 SDK libs
  83. ! message
  84. ! error Set environment variables and rebuild.
  85. ! endif
  86. ! if !exist("$(DEVTOOLS)")
  87. ! message
  88. ! message *** ERROR: %DEVTOOLS% is set to "$(DEVTOOLS)", but that directory
  89. ! message *** does not exist.
  90. ! message
  91. ! error Correct DEVTOOLS and rebuild.
  92. ! endif
  93. ! if defined(VCFLAVOR)
  94. ! if !exist("$(DEVTOOLS)\$(PA)\$(VCFLAVOR)")
  95. ! message
  96. ! message *** ERROR: %VCFLAVOR% is set to "$(VCFLAVOR)", but the directory
  97. ! message *** $(DEVTOOLS)\$(PA)\$(VCFLAVOR) does not exist.
  98. ! message *** VCFLAVOR should generally be set to "vc7" or "vclkg".
  99. ! message
  100. ! error Correct VCFLAVOR and rebuild.
  101. ! endif
  102. ! elseif exist("$(DEVTOOLS)\$(PA)\vc7")
  103. VCFLAVOR = vc7
  104. ! elseif exist("$(DEVTOOLS)\$(PA)\vclkg")
  105. VCFLAVOR = vclkg
  106. ! else
  107. ! error Unable to find $(DEVTOOLS)\$(PA)\vc7 or vclkg
  108. ! endif
  109. !endif
  110. !message Paths to native-hosted toolset used to build SRCREL tools:
  111. !if defined(DEVTOOLS)
  112. ! message DEVTOOLS: $(DEVTOOLS)
  113. !endif
  114. !if defined(VCFLAVOR)
  115. ! message VCFLAVOR: $(VCFLAVOR)
  116. !endif
  117. # set DEVTOOLSCPUVC if needed
  118. !if !defined(DEVTOOLSBIN) || !defined(DEVTOOLSLIB)
  119. DEVTOOLSCPUVC = $(DEVTOOLS)\$(PA)\$(VCFLAVOR)
  120. ! if !exist("$(DEVTOOLSCPUVC)")
  121. ! error Unable to find $(DEVTOOLSCPUVC)
  122. ! endif
  123. !endif
  124. # set DEVTOOLSCOMMONVC if needed
  125. !if !defined(DEVTOOLSINC)
  126. DEVTOOLSCOMMONVC = $(DEVTOOLS)\common\$(VCFLAVOR)
  127. ! if !exist("$(DEVTOOLSCOMMONVC)")
  128. ! error Unable to find $(DEVTOOLSCOMMONVC)
  129. ! endif
  130. !endif
  131. # set DEVTOOLSCPUSDK if needed
  132. !if !defined(DEVTOOLSSDKLIB)
  133. DEVTOOLSCPUSDK = $(DEVTOOLS)\$(PA)\win32sdk
  134. ! if !exist("$(DEVTOOLSCPUSDK)")
  135. ! error Unable to find $(DEVTOOLSCPUSDK)
  136. ! endif
  137. !endif
  138. # set DEVTOOLSBIN if not already defined
  139. !if !defined(DEVTOOLSBIN)
  140. DEVTOOLSBIN = $(DEVTOOLSCPUVC)\bin
  141. !endif
  142. # set DEVTOOLSLIB if not already defined
  143. !if !defined(DEVTOOLSLIB)
  144. DEVTOOLSLIB = $(DEVTOOLSCPUVC)\lib
  145. !endif
  146. # set DEVTOOLSINC if not already defined
  147. !if !defined(DEVTOOLSINC)
  148. ! if exist("$(DEVTOOLSCOMMONVC)\inc")
  149. DEVTOOLSINC = $(DEVTOOLSCOMMONVC)\inc
  150. ! elseif exist("$(DEVTOOLSCOMMONVC)\include")
  151. DEVTOOLSINC = $(DEVTOOLSCOMMONVC)\include
  152. ! else
  153. # For better error-reporting below
  154. DEVTOOLSINC = $(DEVTOOLSCOMMONVC)\inc
  155. ! endif
  156. !endif
  157. # set DEVTOOLSSDKLIB if not already defined
  158. !if !defined(DEVTOOLSSDKLIB)
  159. DEVTOOLSSDKLIB = $(DEVTOOLSCPUSDK)\lib
  160. !endif
  161. !message DEVTOOLSBIN: $(DEVTOOLSBIN)
  162. !if !exist("$(DEVTOOLSBIN)")
  163. ! error Unable to find $(DEVTOOLSBIN)
  164. !endif
  165. !message DEVTOOLSINC: $(DEVTOOLSINC)
  166. !if !exist("$(DEVTOOLSINC)")
  167. ! error Unable to find $(DEVTOOLSINC)
  168. !endif
  169. !message DEVTOOLSLIB: $(DEVTOOLSLIB)
  170. !if !exist("$(DEVTOOLSLIB)")
  171. ! error Unable to find $(DEVTOOLSLIB)
  172. !endif
  173. !message DEVTOOLSSDKLIB: $(DEVTOOLSSDKLIB)
  174. !if !exist("$(DEVTOOLSSDKLIB)")
  175. ! error Unable to find $(DEVTOOLSSDKLIB)
  176. !endif
  177. !message