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.

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