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.

290 lines
7.9 KiB

  1. !IF 0
  2. Copyright (c) 1994-1996 Microsoft Corporation
  3. Module Name:
  4. mppcmk.inc
  5. Abstract:
  6. This module contains the MPPC specific build controls. It is included
  7. by makefile.def.
  8. Revision History:
  9. !ENDIF
  10. # add the powermac stuff to the path
  11. PATH=$(IMPORT)\msdev\bin\mppc;$(PATH)
  12. #
  13. # MPPC option control
  14. #
  15. !undef USE_MAPSYM
  16. UMBASE=$(UMBASE:*=mppc)
  17. UMLIBS=$(UMLIBS:*=mppc)
  18. NTRES=$(NTRES:*=mppc)
  19. UMRES=$(UMRES:*=mppc)
  20. UMOBJS=$(UMOBJS:*=mppc)
  21. LINKLIBS=$(LINKLIBS:*=mppc)
  22. GDI_DRIVER_LIBS=$(GDI_DRIVER_LIBS:*=mppc)
  23. DLLBASE=$(DLLBASE:*=mppc)
  24. DLLDEF=$(DLLDEF:*=mppc)
  25. MACHINE_TARGETLIBS=$(MACHINE_TARGETLIBS:*=mppc)
  26. TARGET=$(TARGET:*=mppc)
  27. DYNLINK_LIB=$(DYNLINK_LIB:*=mppc)
  28. TARGETEXEFILES=$(TARGETEXEFILES:*=mppc)
  29. TARGETLIBFILES=$(TARGETLIBFILES:*=mppc)
  30. TARGETOBJFILES=$(TARGETOBJFILES:*=mppc)
  31. UMOBJFILES=$(UMOBJFILES:*=mppc)
  32. UMEXEFILES=$(UMEXEFILES:*=mppc)
  33. HEADERFILE=$(HEADERFILE:*=mppc)
  34. HEADEROBJNAME=$(HEADEROBJNAME:*=mppc)
  35. HEADEROBJ=$(HEADEROBJ:*=mppc)
  36. PRECOMPILED=$(PRECOMPILED:*=mppc)
  37. PRECOMPILED_CXX=$(PRECOMPILED_CXX:*=mppc)
  38. PRECOMPILED_TARGET=$(PRECOMPILED_TARGET:*=mppc)
  39. MFC_STATIC_LIB=$(MFC_STATIC_LIB:*=mppc)
  40. CRT_LIB_PATH=$(CRT_LIB_PATH:*=mppc)
  41. SDK_LIB_PATH=$(SDK_LIB_PATH:*=mppc)
  42. DDK_LIB_PATH=$(DDK_LIB_PATH:*=mppc)
  43. ORDER=$(ORDER:*=mppc)
  44. MISCFILES=$(MISCFILES) $(MPPC_MISCFILES)
  45. SOURCES=$(SOURCES) $(MPPC_SOURCES)
  46. #
  47. # Include 64-bit helper library
  48. #
  49. !if "$(TARGETTYPE)" == "DRIVER" || \
  50. "$(TARGETTYPE)" == "EXPORT_DRIVER" || \
  51. "$(TARGETTYPE)" == "HAL" || \
  52. "$(TARGETTYPE)" == "GDI_DRIVER" || \
  53. "$(TARGETTYPE)" == "MINIPORT"
  54. MACHINE_TARGETLIBS=$(SDK_LIB_PATH)\int64.lib $(MACHINE_TARGETLIBS)
  55. !elseif defined(USE_NTDLL) || \
  56. defined(USE_SYSDLL) || \
  57. defined (USE_NOLIBS)
  58. MACHINE_TARGETLIBS=$(SDK_LIB_PATH)\int64.lib $(MACHINE_TARGETLIBS)
  59. ! if "$(UMTYPE)" == "nt" || \
  60. "$(UMTYPE)" == "ntss"
  61. # Do this to avoid multiple library warnings (and allow building csr/server)
  62. UMLIBS=$(SDK_LIB_PATH)\int64.lib $(UMLIBS)
  63. ! endif
  64. !elseif "$(UMTYPE)" == "nt" || \
  65. "$(UMTYPE)" == "ntss"
  66. UMLIBS=$(SDK_LIB_PATH)\int64.lib $(UMLIBS)
  67. !endif
  68. !ifdef NTTARGETFILES
  69. NTTARGETFILES=$(NTTARGETFILES:*=mppc)
  70. !endif
  71. !ifdef NTTARGETFILE0
  72. NTTARGETFILE0=$(NTTARGETFILE0:*=mppc)
  73. !endif
  74. !ifdef NTTARGETFILE1
  75. NTTARGETFILE1=$(NTTARGETFILE1:*=mppc)
  76. !endif
  77. !ifdef PROJECT_LIB_PATH
  78. PROJECT_LIB_PATH=$(PROJECT_LIB_PATH:*=mppc)
  79. !endif
  80. !IF "$(GPSIZE)" != "0"
  81. #
  82. # GPSIZE is irrelevant on PowerPC
  83. #
  84. LINKGPSIZE=
  85. !ENDIF
  86. ENTRY_SUFFIX=
  87. GDI_ENTRY_SUFFIX=
  88. !ifndef USE_PDB_TO_COMPILE
  89. DBGFLAGS=$(DBGFLAGS:/Zi=-Z7)
  90. DBGFLAGS=$(DBGFLAGS:-Zi=-Z7)
  91. !else
  92. ! if "$(TARGETTYPE)" == "LIBRARY"
  93. DBGFLAGS=$(DBGFLAGS) /Fd$(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).pdb
  94. ! else
  95. DBGFLAGS=$(DBGFLAGS) /Fd$(MAKEDIR)\$(_OBJ_DIR)\mppc^\
  96. ! endif
  97. !endif
  98. !ifdef BROWSER_INFO
  99. DBGFLAGS=$(DBGFLAGS) /FR$(MAKEDIR)\$(_OBJ_DIR)\mppc^\
  100. !endif
  101. !IFDEF NTBBT
  102. DBGFLAGS=$(DBGFLAGS) /Z7
  103. LINKER_FLAGS=$(LINKER_FLAGS) -debug:full -debugtype:cv,fixup
  104. !ENDIF
  105. !IFDEF MPPC_WARNING_LEVEL
  106. MSC_WARNING_LEVEL=$(MPPC_WARNING_LEVEL)
  107. !ENDIF
  108. !ifdef MPPC_PERFFLAGS
  109. PERFFLAGS = $(MPPC_PERFFLAGS)
  110. !endif
  111. # DEFAULT_MSC_OPT = $(DEFAULT_MSC_OPT:/Oxs=/Ox)
  112. # Set MSC_OPTIMIZATION.
  113. # Order of precedence:
  114. # Platform specific override
  115. # Environment variable
  116. # System Default
  117. !if defined(MPPC_OPTIMIZATION)
  118. MSC_OPTIMIZATION=$(MPPC_OPTIMIZATION)
  119. !elseif !defined(MSC_OPTIMIZATION)
  120. MSC_OPTIMIZATION=$(DEFAULT_MSC_OPT)
  121. !endif
  122. DBGFLAGS=$(DBGFLAGS) $(MSC_OPTIMIZATION)
  123. !IFDEF MPPC_CPPFLAGS
  124. MSC_CPPFLAGS=$(MPPC_CPPFLAGS)
  125. !ENDIF
  126. !ifdef NO_READONLY_STRINGS
  127. STRING_POOLING = /Gf
  128. !else
  129. STRING_POOLING = /GF
  130. !endif
  131. !ifdef USE_NATIVE_EH
  132. EH_FLAGS=/GX /GR
  133. !else
  134. EH_FLAGS=/GX- /GR-
  135. !endif
  136. MPPC_AS=pas
  137. MPPC_DIS=pdis
  138. MPPC_AS_WARNINGS=
  139. MPPC_START_FILE=start.obj
  140. ENV_DEFINES=$(LIBC_DEFINES) $(C_DEFINES) $(NET_C_DEFINES) $(MSC_CPPFLAGS) $(NTCPPFLAGS) $(PM_DEFINES)
  141. STD_DEFINES=-DMPPC=1 -D_MPPC_=1 -DNO_EXT_KEYS $(STD_DEFINES) -D_MAC
  142. STDFLAGS=-c -Zel -Zp2 -Gy $(STRING_POOLING) $(EH_FLAGS)
  143. MPPC_C_COMPILER_NAME = cl -nologo
  144. # MPPC_C_COMPILER_NAME = cl
  145. MPPC_CC = $(MPPC_C_COMPILER_NAME)
  146. CDEFINES=$(STD_DEFINES) $(TARGET_DBG_DEFINES) $(ENV_DEFINES) $(MFC_DEFINES)
  147. CFLAGS=$(MPPC_FLAGS) $(NTMPPCFLAGS) $(STDFLAGS) $(DBGFLAGS) $(USER_C_FLAGS) $(PERFFLAGS)
  148. MPPC_CDEFINES= $(CDEFINES)
  149. MPPC_CFLAGS = $(CFLAGS) $(MSC_WARNING_LEVEL) # -DALLOC_TEXT
  150. !IFNDEF MPPC_OPTIONS
  151. MPPC_OPTIONS=
  152. !ENDIF
  153. C_COMPILER_NAME = $(MPPC_C_COMPILER_NAME)
  154. C_PREPROCESSOR_NAME = $(MPPC_C_COMPILER_NAME)
  155. CXX_COMPILER_NAME = $(MPPC_C_COMPILER_NAME)
  156. GLOBAL_C_FLAGS = -nologo -Imppc\ -I. $(INCPATH0) $(CDEFINES) $(MPPC_OPTIONS) \
  157. $(MPPC_CFLAGS) -D__stdcall= -D__cdecl= -DFPO=1 -DLANGUAGE_C
  158. # Disable -WX for now, unless explicitly allowed
  159. !ifndef ALLOW_WX
  160. GLOBAL_C_FLAGS = $(GLOBAL_C_FLAGS:-WX=)
  161. GLOBAL_C_FLAGS = $(GLOBAL_C_FLAGS:/WX=)
  162. !endif
  163. NP_COMPILER_FLAGS = $(GLOBAL_C_FLAGS) $(COMPILER_WARNINGS)
  164. C_COMPILER_FLAGS = $(NP_COMPILER_FLAGS) $(PRECOMPILED)
  165. CXX_COMPILER_FLAGS = $(NP_COMPILER_FLAGS) $(PRECOMPILED_CXX)
  166. C_PREPROCESSOR_FLAGS = $(GLOBAL_C_FLAGS) $(PRECOMPILED) -EP -Tc
  167. C_PREPROCESSOR = $(C_PREPROCESSOR_NAME) $(C_PREPROCESSOR_FLAGS)
  168. C_COMPILER = $(C_COMPILER_NAME) $(C_COMPILER_FLAGS)
  169. CXX_COMPILER = $(CXX_COMPILER_NAME) $(CXX_COMPILER_FLAGS)
  170. MPPC_ASSEMBLER = $(MPPC_AS) $(MPPC_AS_WARNINGS)
  171. ECHO_MSG = ClPpc $< " $(C_COMPILER) "
  172. ECHO_CXX_MSG = ClPpc $< " $(CXX_COMPILER) "
  173. ECHO_PRECOMPILED_MSG1=CpPpc $(PRECOMPILED_INCLUDE) \
  174. "$(C_COMPILER_NAME) $(PRECOMPILED_FLAG) $(PRECOMPILED_SOURCEFILE) \
  175. $(C_COMPILER_FLAGS) /Yl$(TARGETNAME) /Yc$(?F) $(HEADERFILE) $(HEADEROBJ)"
  176. ECHO_PRECOMPILED_MSG2=CpPpc $(PRECOMPILED_INCLUDE) \
  177. "$(C_COMPILER_NAME) $(PRECOMPILED_FLAG) \
  178. $(C_COMPILER_FLAGS) /Yl$(TARGETNAME) /Yc$(?F) $(HEADERFILE) $(HEADEROBJ)"
  179. {.\}.cxx{}.obj:
  180. @$(ECHO_MSG)
  181. @$(CXX_COMPILER) -Fo$(MAKEDIR)\$@ $(MAKEDIR)\..\$(<F)
  182. {.\}.cxx{$(_OBJ_DIR)\$(TARGET_DIRECTORY)\}.obj:
  183. @$(ECHO_MSG)
  184. @$(CXX_COMPILER) -Fo$(MAKEDIR)\$@ $(MAKEDIR)\..\$(<F)
  185. {}.cxx{$(_OBJ_DIR)\$(TARGET_DIRECTORY)\}.obj:
  186. @$(ECHO_MSG)
  187. @$(CXX_COMPILER) -Fo$(MAKEDIR)\$@ $(MAKEDIR)\..\$(<F)
  188. {..\mppc\}.s{$(_OBJ_DIR)\mppc\}.obj:
  189. @-erase $@ >nul 2>&1
  190. @echo AsPpc $< " $(MPPC_ASSEMBLER) "
  191. @$(C_PREPROCESSOR) $(MAKEDIR)\..\mppc\$(<F) > $(MAKEDIR)\$(_OBJ_DIR)\mppc\$(<B).i && $(MPPC_ASSEMBLER) -o $@ $(MAKEDIR)\$(_OBJ_DIR)\mppc\$(<B).i
  192. @-erase $(MAKEDIR)\$(_OBJ_DIR)\mppc\$(<B).i >nul 2>&1
  193. {..\mppc\}.s.pp:
  194. @-erase $@ >nul 2>&1
  195. @echo AsPpc $< " $(MPPC_ASSEMBLER) "
  196. @$(C_PREPROCESSOR) $(MAKEDIR)\..\mppc\$(<F) > $(MAKEDIR)\$(<B).pp
  197. {mppc\}.s{$(_OBJ_DIR)\mppc\}.obj:
  198. @-erase $@ >nul 2>&1
  199. @echo AsPpc $< " $(MPPC_ASSEMBLER) "
  200. @$(C_PREPROCESSOR) $(MAKEDIR)\mppc\$(<F) > $(MAKEDIR)\$(_OBJ_DIR)\mppc\$(<B).i && $(MPPC_ASSEMBLER) -o $@ $(MAKEDIR)\$(_OBJ_DIR)\mppc\$(<B).i
  201. @-erase $(MAKEDIR)\$(_OBJ_DIR)\mppc\$(<B).i >nul 2>&1
  202. {mppc\}.s.pp:
  203. @-erase $@ >nul 2>&1
  204. @echo AsPpc $< " $(MPPC_ASSEMBLER) "
  205. @$(C_PREPROCESSOR) $(MAKEDIR)\mppc\$(<F) > $(MAKEDIR)\$(<B).pp
  206. .SUFFIXES: .il
  207. {}.il{}.cod:
  208. @-erase $@ >nul 2>&1
  209. @echo cl $<" $(C_COMPILER) "
  210. @$(C_COMPILER) -FAac -Fa$(<B).cod -B1..\bootbin\null.exe -Bk$(<B). -Fo$(MAKEDIR)\$(_OBJ_DIR)\mppc\$(<B).o $(MAKEDIR)\$(<B).c
  211. @del $(_OBJ_DIR)\mppc\$(<B).o
  212. !IFDEF CAIRO_PRODUCT
  213. !IFDEF _CAIROMPPCTREE
  214. _NTTREE=$(_CAIROMPPCTREE)
  215. _NTTREE_NO_SPLIT=$(_CAIROMPPCTREE_NS)
  216. !ENDIF
  217. !ELSE
  218. !IFDEF _NTMPPCTREE
  219. _NTTREE=$(_NTMPPCTREE)
  220. _NTTREE_NO_SPLIT=$(_NTMPPCTREE_NS)
  221. !ENDIF
  222. !ENDIF
  223. !IFDEF _NTMPPCLIBS
  224. _NTLIBS=$(_NTMPPCLIBS)
  225. !ENDIF
  226. COPYDST=$(MPPCCOPYDST)
  227. LIB_COPY=ntmppccp.cmd
  228. NTTEST_LINK_OPTIONS= -base:0x80010000 -entry:KiSystemStartup