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.

357 lines
9.4 KiB

  1. !IF 0
  2. Copyright (c) 1994-1996 Microsoft Corporation
  3. Module Name:
  4. ia64mk.inc
  5. Abstract:
  6. This module contains the ia64 specific build controls. It is included
  7. by makefile.def.
  8. Add the following variable to your env.
  9. 1) To turn on IA64 hazard detection:
  10. set _IA64_HAZARD_DETECTION=-X explicit
  11. 2) To turn on Merced MSR access, add the following variable to your env.
  12. set _IA64_MERCED_MSR =-A MERCED
  13. Revision History:
  14. !ENDIF
  15. DELAYLOAD_SUPPORTED=1
  16. !ifndef DELAYLOAD_VERSION
  17. DELAYLOAD_VERSION=0x0200
  18. !endif
  19. #
  20. # ia64 option control
  21. #
  22. !undef USE_MAPSYM
  23. UMBASE=$(UMBASE:*=ia64)
  24. UMLIBS=$(UMLIBS:*=ia64)
  25. NTRES=$(NTRES:*=ia64)
  26. UMRES=$(UMRES:*=ia64)
  27. UMOBJS=$(UMOBJS:*=ia64)
  28. LINKLIBS=$(LINKLIBS:*=ia64)
  29. GDI_DRIVER_LIBS=$(GDI_DRIVER_LIBS:*=ia64)
  30. DLLBASE=$(DLLBASE:*=ia64)
  31. DLLDEF=$(DLLDEF:*=ia64)
  32. MACHINE_TARGETLIBS=$(MACHINE_TARGETLIBS:*=ia64)
  33. TARGET=$(TARGET:*=ia64)
  34. DYNLINK_LIB=$(DYNLINK_LIB:*=ia64)
  35. TARGETEXEFILES=$(TARGETEXEFILES:*=ia64)
  36. TARGETLIBFILES=$(TARGETLIBFILES:*=ia64)
  37. TARGETOBJFILES=$(TARGETOBJFILES:*=ia64)
  38. UMOBJFILES=$(UMOBJFILES:*=ia64)
  39. UMEXEFILES=$(UMEXEFILES:*=ia64)
  40. HEADERFILE=$(HEADERFILE:*=ia64)
  41. HEADEROBJNAME=$(HEADEROBJNAME:*=ia64)
  42. HEADEROBJ=$(HEADEROBJ:*=ia64)
  43. PRECOMPILED=$(PRECOMPILED:*=ia64)
  44. PRECOMPILED_CXX=$(PRECOMPILED_CXX:*=ia64)
  45. PRECOMPILED_TARGET=$(PRECOMPILED_TARGET:*=ia64)
  46. MFC_STATIC_LIB=$(MFC_STATIC_LIB:*=ia64)
  47. CRT_LIB_PATH=$(CRT_LIB_PATH:*=ia64)
  48. SDK_LIB_PATH=$(SDK_LIB_PATH:*=ia64)
  49. DDK_LIB_PATH=$(DDK_LIB_PATH:*=ia64)
  50. IFSKIT_LIB_PATH=$(IFSKIT_LIB_PATH:*=ia64)
  51. HALKIT_LIB_PATH=$(HALKIT_LIB_PATH:*=ia64)
  52. PROCESSOR_LIB_PATH=$(PROCESSOR_LIB_PATH:*=ia64)
  53. ORDER=$(ORDER:*=ia64)
  54. OBJLIBFILES=$(OBJLIBFILES:*=ia64)
  55. MISCFILES=$(MISCFILES) $(IA64_MISCFILES)
  56. SOURCES=$(SOURCES) $(IA64_SOURCES)
  57. # BINPLACE_FLAGS=$(BINPLACE_FLAGS) -CI 8,halo.exe,-certain,-errata,-quiet
  58. !ifdef NTTARGETFILES
  59. NTTARGETFILES=$(NTTARGETFILES:*=ia64)
  60. !endif
  61. !ifdef NTTARGETFILE0
  62. NTTARGETFILE0=$(NTTARGETFILE0:*=ia64)
  63. !endif
  64. !ifdef NTTARGETFILE1
  65. NTTARGETFILE1=$(NTTARGETFILE1:*=ia64)
  66. !endif
  67. !ifdef PROJECT_LIB_PATH
  68. PROJECT_LIB_PATH=$(PROJECT_LIB_PATH:*=ia64)
  69. !endif
  70. ENTRY_SUFFIX=
  71. GDI_ENTRY_SUFFIX=
  72. DEFAULT_STACKRESERVE=0x100000
  73. DEFAULT_STACKCOMMIT=0x4000
  74. ADDITIONAL_ATL_LIBS = $(ADDITIONAL_ATL_LIBS) $(SDK_LIB_PATH)\atl21asm.lib
  75. !if !defined(_IA64_HAZARD_DETECTION)
  76. _IA64_HAZARD_DETECTION=-X explicit
  77. !endif
  78. !if !defined(_IA64_MERCED_MSR)
  79. _IA64_MERCED_MSR=-A itanium
  80. !endif
  81. !ifndef GENIA64
  82. MSC_WARNING_LEVEL=$(MSC_WARNING_LEVEL) /Wp64
  83. !endif
  84. !IF DEFINED(IA64_WARNING_LEVEL)
  85. MSC_WARNING_LEVEL=$(IA64_WARNING_LEVEL)
  86. !ENDIF
  87. !ifndef MSC_WARNING_LEVEL
  88. MSC_WARNING_LEVEL=/W3
  89. !endif
  90. MSC_WARNING_LEVEL=$(MSC_WARNING_LEVEL) $(COMPILER_WX_SWITCH)
  91. !IF DEFINED(IA64_PERFFLAGS)
  92. PERFFLAGS = $(IA64_PERFFLAGS)
  93. !endif
  94. # Set MSC_OPTIMIZATION.
  95. # Order of precedence:
  96. # Platform specific override
  97. # Environment variable
  98. # System Default
  99. !if defined(IA64_OPTIMIZATION)
  100. MSC_OPTIMIZATION=$(IA64_OPTIMIZATION)
  101. !else
  102. !if !defined(MSC_OPTIMIZATION)
  103. MSC_OPTIMIZATION=$(DEFAULT_MSC_OPT)
  104. !endif
  105. MSC_OPTIMIZATION=$(MSC_OPTIMIZATION)
  106. !endif
  107. LINK_TIME_CODE_GENERATION_MSC_FLAG=
  108. !ifndef GENIA64
  109. !if defined(IA64_DEBUGGABLE_OPTIMIZATION)
  110. MSC_OPTIMIZATION=$(MSC_OPTIMIZATION) /Zx
  111. !endif
  112. !ifndef IA64_FULL_FLOATING_POINT
  113. MSC_OPTIMIZATION=$(MSC_OPTIMIZATION) /d2QIA64_fr32
  114. !endif
  115. !if defined(LINK_TIME_CODE_GENERATION) && !defined(FORCENATIVEOBJECT)
  116. # Some objects must be built native, so turn off GL for those
  117. LINK_TIME_CODE_GENERATION_MSC_FLAG=/GL
  118. !endif
  119. !endif
  120. DBGFLAGS=$(DBGFLAGS) $(MSC_OPTIMIZATION) $(LINK_TIME_CODE_GENERATION_MSC_FLAG)
  121. IA64_ADBGFLAGS=$(IA64_ADBGFLAGS) -d debug
  122. WIN32_LIBS=$(WIN32_LIBS) $(LIBRARY_PATH)\ntdll.lib
  123. !if defined(IA64_CPPFLAGS)
  124. MSC_CPPFLAGS=$(IA64_CPPFLAGS)
  125. !elseif defined(386_CPPFLAGS)
  126. MSC_CPPFLAGS=$(386_CPPFLAGS)
  127. !ENDIF
  128. !ifdef NO_STRING_POOLING
  129. STRING_POOLING =
  130. !else
  131. !ifdef NO_READONLY_STRINGS
  132. STRING_POOLING = /Gf
  133. !else
  134. STRING_POOLING = /GF
  135. !endif
  136. !endif
  137. !ifdef USE_NATIVE_EH
  138. EH_FLAGS=/GX
  139. !if "$(USE_NATIVE_EH)" == "ASYNC"
  140. EH_FLAGS=$(EH_FLAGS) /EHa
  141. !endif
  142. !else
  143. EH_FLAGS=/GX-
  144. !endif
  145. ! ifdef USE_RTTI
  146. RTTI_FLAGS=/GR
  147. ! else
  148. RTTI_FLAGS=/GR-
  149. ! endif
  150. ERRATA_FLAGS=
  151. STDFLAGS= /c /Zel /Zp8 /Gy /Gi- $(CBSTRING) $(MSC_WARNING_LEVEL) \
  152. $(ERATTA_FLAGS) $(EH_FLAGS) $(RTTI_FLAGS) $(STRING_POOLING)
  153. !IF $(FREEBUILD)
  154. ASM_DBG_DEFINES=-DDBG=0
  155. !ELSE
  156. IA64_ADBGFLAGS=$(IA64_ADBGFLAGS) -d debug
  157. !ENDIF
  158. # This is only needed on x86
  159. TARGET_DBG_DEFINES= $(TARGET_DBG_DEFINES) -DFPO=0
  160. # @@BEGIN_DDKSPLIT
  161. !IFDEF NTBBT
  162. DBGFLAGS=$(DBGFLAGS) /Zi
  163. IA64_ADBGFLAGS=$(IA64_ADBGFLAGS) -d debug
  164. LINKER_FLAGS=$(LINKER_FLAGS) -debug:full -debugtype:cv,fixup
  165. !ENDIF
  166. # @@END_DDKSPLIT
  167. !IFDEF SECTION_ALIGNMENT
  168. SECTION_ALIGNMENT=-align:$(SECTION_ALIGNMENT)
  169. !ENDIF
  170. KERNEL_ALIGNMENT=0x80
  171. HAL_ALIGNMENT=0x80
  172. LINKER_FLAGS = $(LINKER_FLAGS) $(SECTION_ALIGNMENT) -debugtype:pdata
  173. LINK_LIB_IGNORE_FLAG=$(LINK_LIB_IGNORE_FLAG),4006,4044,4108,4088
  174. !ifndef USE_PDB_TO_COMPILE
  175. DBGFLAGS=$(DBGFLAGS:/Zi=-Z7)
  176. DBGFLAGS=$(DBGFLAGS:-Zi=-Z7)
  177. !else
  178. ! if "$(TARGETTYPE)" == "LIBRARY"
  179. DBGFLAGS=$(DBGFLAGS) /Fd$(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).pdb
  180. ! else
  181. DBGFLAGS=$(DBGFLAGS) /Fd$(MAKEDIR)\$(_OBJ_DIR)\ia64^\
  182. ! endif
  183. !endif
  184. !ifndef NO_BROWSER_INFO
  185. ! ifdef BROWSER_INFO
  186. DBGFLAGS=$(DBGFLAGS) /FR$(MAKEDIR)\$(_OBJ_DIR)\ia64^\
  187. ! endif
  188. !endif
  189. !IF "$(HALTYPE)" == ""
  190. HALDEF=
  191. !ELSE
  192. HALDEF=-D$(HALTYPE)=1
  193. !ENDIF
  194. #
  195. #
  196. #
  197. !ifdef GENIA64
  198. STD_DEFINES= -D_WIN64 -D_IA64_=1 -DIA64=1 -DNO_HW_DETECT -D_MSC_EXTENSIONS -D_GENIA64_ $(HALDEF) $(STD_DEFINES) -D_CROSS_PLATFORM_=1
  199. !else
  200. STD_DEFINES= -D_WIN64 -D_IA64_=1 -DIA64=1 -DNO_HW_DETECT -D_MSC_EXTENSIONS $(PTR_SIZE) $(HALDEF) $(STD_DEFINES) -D_MERCED_A0_=1
  201. !endif
  202. !if defined(PC98CHANGE)
  203. STD_DEFINES=$(STD_DEFINES) -D_PC98_
  204. !endif
  205. CDEFINES=$(STD_DEFINES) $(TARGET_DBG_DEFINES) \
  206. $(LIBC_DEFINES) $(C_DEFINES) $(NET_C_DEFINES) $(MFC_DEFINES)
  207. ASM_DEFINES=$(ASM_DEFINES) -D__assembler=1
  208. CFLAGS=$(IA64_FLAGS) $(NTIA64FLAGS) $(STDFLAGS) $(DBGFLAGS) $(PERFFLAGS) $(USER_C_FLAGS)
  209. IA64_ASMFLAGS=$(IA64_ADBGFLAGS) $(STD_DEFINES) $(ASM_DBG_DEFINES)\
  210. $(TARGET_DBG_DEFINES) $(ASM_DEFINES)
  211. IA64_CDEFINES=$(CDEFINES)
  212. IA64_CFLAGS=$(CFLAGS)
  213. !ifdef RAZZLETOOLPATH
  214. ! if "$(PROCESSOR_ARCHITECTURE)" == "IA64"
  215. CC_NAME = $(RAZZLETOOLPATH)\ia64\cl -nologo
  216. ! else
  217. CC_NAME = $(RAZZLETOOLPATH)\win64\x86\cl -nologo
  218. ! endif
  219. !else
  220. CC_NAME=cl -nologo
  221. !endif
  222. C_COMPILER_NAME = $(CC_NAME)
  223. CXX_COMPILER_NAME = $(CC_NAME)
  224. C_PREPROCESSOR_NAME = $(CC_NAME)
  225. !ifndef IA64_ASSEMBLER_NAME
  226. IA64_ASSEMBLER_NAME = ias
  227. !endif
  228. GLOBAL_C_FLAGS = -Iia64\ -I. $(INCPATH1) $(CDEFINES) $(CFLAGS)
  229. NP_COMPILER_FLAGS = $(GLOBAL_C_FLAGS) $(COMPILER_WARNINGS)
  230. C_COMPILER_FLAGS = $(NP_COMPILER_FLAGS) $(PRECOMPILED)
  231. CXX_COMPILER_FLAGS = $(NP_COMPILER_FLAGS) $(PRECOMPILED_CXX) $(MSC_CPPFLAGS) $(NTCPPFLAGS)
  232. C_PREPROCESSOR_FLAGS = $(GLOBAL_C_FLAGS) -EP -Tc
  233. C_PREPROCESSOR = $(C_PREPROCESSOR_NAME) $(C_PREPROCESSOR_FLAGS)
  234. C_ASM_PREPROCESSOR = $(C_PREPROCESSOR_NAME) $(ASM_DEFINES) $(C_PREPROCESSOR_FLAGS:-EP=-E)
  235. C_COMPILER = $(C_COMPILER_NAME) $(C_COMPILER_FLAGS)
  236. NP_C_COMPILER = $(C_COMPILER_NAME) $(NP_COMPILER_FLAGS)
  237. CXX_COMPILER = $(CXX_COMPILER_NAME) $(CXX_COMPILER_FLAGS)
  238. IA64_ASSEMBLER=$(IA64_ASSEMBLER_NAME) $(_IA64_HAZARD_DETECTION) $(_IA64_MERCED_MSR) -Nso -Iia64\ -I. $(INCPATH1) $(IA64_ADBGFLAGS)
  239. ECHO_MSG=$(C_COMPILER) $<
  240. ECHO_MSG_P=$(NP_C_COMPILER) $**
  241. ECHO_CXX_MSG=$(CXX_COMPILER) $<
  242. ECHO_PRECOMPILED_MSG1=$(C_COMPILER_NAME) $(C_COMPILER_FLAGS) /Yl$(TARGETNAME) /Yc$(?F) $(HEADERFILE) \
  243. $(HEADEROBJ) $(PRECOMPILED_FLAG) $(PRECOMPILED_SOURCEFILE)
  244. ECHO_PRECOMPILED_MSG2=$(C_COMPILER_NAME) $(C_COMPILER_FLAGS) /Yl$(TARGETNAME) /Yc$(?F) $(HEADERFILE) \
  245. $(HEADEROBJ) $(PRECOMPILED_FLAG)
  246. {}.c{}.s:
  247. $(C_COMPILER_NAME) @<< /Fa $(MAKEDIR)\$(<F)
  248. $(C_COMPILER_FLAGS: =
  249. )
  250. $(C_COMPILER_FLAGS:##= )
  251. <<NOKEEP
  252. {..\ia64\}.s{}.lst:
  253. $(IA64_ASSEMBLER) -o $(_OBJ_DIR)\ia64\$(@B).obj $<
  254. {ia64\}.s{}.lst:
  255. $(IA64_ASSEMBLER) -o $(MAKEDIR)\$(_OBJ_DIR)\ia64\$(@B).obj $<
  256. {..\ia64\}.s{$(_OBJ_DIR)\ia64\}.obj:
  257. @-erase $@ >nul 2>&1
  258. $(C_ASM_PREPROCESSOR) $(MAKEDIR)\..\ia64\$(<F) >$(MAKEDIR)\$(_OBJ_DIR)\ia64\$(<B).i
  259. $(IA64_ASSEMBLER) -o $(MAKEDIR)\$@ $(MAKEDIR)\$(_OBJ_DIR)\ia64\$(<B).i
  260. @-erase $(MAKEDIR)\$(_OBJ_DIR)\ia64\$(<B).i >nul 2>&1
  261. {$(_OBJ_DIR)\ia64\}.s{$(_OBJ_DIR)\ia64\}.obj:
  262. @-erase $@ >nul 2>&1
  263. $(C_ASM_PREPROCESSOR) $(MAKEDIR)\$(_OBJ_DIR)\ia64\$(<F) >$(MAKEDIR)\$(_OBJ_DIR)\ia64\$(<B).i
  264. $(IA64_ASSEMBLER) -o $@ $(MAKEDIR)\$(_OBJ_DIR)\ia64\$(<B).i
  265. @-erase $(MAKEDIR)\$(_OBJ_DIR)\ia64\$(<B).i >nul 2>&1
  266. {ia64\}.s{$(_OBJ_DIR)\ia64\}.obj:
  267. @-erase $@ >nul 2>&1
  268. $(C_ASM_PREPROCESSOR) $(MAKEDIR)\ia64\$(<F) >$(MAKEDIR)\$(_OBJ_DIR)\ia64\$(<B).i
  269. $(IA64_ASSEMBLER) -o $@ $(MAKEDIR)\$(_OBJ_DIR)\ia64\$(<B).i
  270. @-erase $(MAKEDIR)\$(_OBJ_DIR)\ia64\$(<B).i >nul 2>&1
  271. !if defined(_NTIA64LIBS)
  272. _NTLIBS=$(_NTIA64LIBS)
  273. !elseif DEFINED(_NT386LIBS)
  274. _NTLIBS=$(_NT386LIBS)
  275. !endif
  276. !if defined(IA64COPYDST)
  277. COPYDST=$(IA64COPYDST)
  278. !elseif defined(386COPYDST)
  279. COPYDST=$(386COPYDST)
  280. !endif
  281. LIB_COPY=ntia64cp.cmd
  282. NTTEST_LINK_OPTIONS=-section:ivt,,align=0x8000 -fixed:no -base:0xE000000083000000 -entry:KiSystemBegin