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.

317 lines
9.4 KiB

  1. #
  2. # sources.vip
  3. #
  4. # Common sources directives for all of Viper.
  5. # The line
  6. #
  7. # !include "$(NTMAKEENV)\sources.vip"
  8. #
  9. # should be the first line in all of Viper's sources files
  10. #
  11. # Bob Atkinson
  12. # April, 1997
  13. MAJORCOMP =mts
  14. SUBSYSTEM_VERSION =4.00
  15. USE_PDB_TO_COMPILE =1
  16. USE_MAPSYM =1
  17. NT_UP =0
  18. !ifndef KERNELMODE
  19. #######################################################################################
  20. #
  21. # User mode: Do not Use the DLL version of the C runtime
  22. #
  23. CRTLIBS =
  24. #######################################################################################
  25. #
  26. # User mode: Set the DLL entry point as sent to the linker
  27. #
  28. DLLENTRY =_DllMainCRTStartup
  29. !else
  30. #######################################################################################
  31. #
  32. # Kernel mode: Use the auxiliary kernel mode C runtime support
  33. #
  34. !if $(AMD64) || $(386)
  35. CRTLIBS =$(SDK_LIB_PATH)\libcntpr.lib
  36. !endif
  37. !endif
  38. #######################################################################################
  39. #
  40. # As we don't want any proxy or stub files (at least for now;
  41. # an interesting idea to add same!) we make the file names
  42. # used for these file to be nul. MIDL_OPTIMIZATION is a macro
  43. # that happens to get passed through LAST (!) to the MIDL compiler,
  44. # allowing us to override pretty much anything that makefile.def
  45. # is doing instead.
  46. #
  47. # REVIEW: Make this a better flag, something like VIPER_MIDL_FLAGS
  48. # Some of this has now been done, but many sources files
  49. # should be updated.
  50. #
  51. MIDL_DEFAULT_OPTIMIZATION =/Oicf
  52. MIDL_HEADER_AND_IID =$(MIDL_DEFAULT_OPTIMIZATION) /dlldata nul /proxy nul
  53. MIDL_HEADER_ONLY =$(MIDL_DEFAULT_OPTIMIZATION) /iid nul /dlldata nul /proxy nul
  54. MIDL_EVERYTHING =$(MIDL_DEFAULT_OPTIMIZATION)
  55. # This is the macro that the IDL build line actually sees. It's
  56. # last on the command line, so takes precedence.
  57. #
  58. MIDL_OPTIMIZATION =$(MIDL_DEFAULT_OPTIMIZATION) $(VIPER_MIDL_FLAGS)
  59. # If you want in your sources file to control which files MIDL generates, then
  60. # set the VIPER_MIDL_FLAGS macro. The following:
  61. #
  62. # VIPER_MIDL_FLAGS =$(MIDL_HEADER_ONLY)
  63. # VIPER_MIDL_FLAGS =$(MIDL_HEADER_AND_IID)
  64. # VIPER_MIDL_FLAGS =$(MIDL_EVERYTHING)
  65. #
  66. # are the common settings, though fancier ones are possible by setting various
  67. # of the generated files to be built to the file named 'nul'. The default is
  68. # to only emit the header; if you want for example the typelib you need to override.
  69. #
  70. VIPER_MIDL_FLAGS =$(MIDL_HEADER_ONLY)
  71. #######################################################################################
  72. #
  73. # Generate stack checking calls in the checked builds. A custom
  74. # __chkstk is linked to expose uses of uninitialized local variables.
  75. #
  76. VIPDEBUGLIBS =
  77. USE_STACK_CHECK =
  78. !if $(FREEBUILD) || defined(KERNELMODE)
  79. !else
  80. !if $(386)
  81. VIPDEBUGLIBS = $(VIPLIBS)\chkstk.lib
  82. USE_STACK_CHECK = /Ge
  83. !endif #386
  84. !endif #FREEBUILD
  85. #######################################################################################
  86. #
  87. # Set DDKBUILDENV
  88. #
  89. !if $(FREEBUILD)
  90. DDKBUILDENV = Free
  91. !else
  92. DDKBUILDENV = Checked
  93. !endif
  94. #
  95. # Set DEBUG,_DEBUG
  96. #
  97. !if $(FREEBUILD)
  98. USE_MSVCRT = 1
  99. !else
  100. C_DEFINES = $(C_DEFINES) -D_DEBUG=1 -DDEBUG=1
  101. DEBUG_CRTS = 1
  102. USE_LIBCMT = 1
  103. !endif
  104. #
  105. # Set COFFBASE_TXT_FILE
  106. #
  107. COFFBASE_TXT_FILE = $(VIPBASE)\common\coffbase.txt
  108. # If you need to link a library that is built by Viper itself,
  109. # then use (for example)
  110. #
  111. # $(VIPLIBS)\util.lib
  112. #
  113. # as the name of said library. If you need a special non-Viper library,
  114. # use
  115. # $(SDK_LIB_PATH)\oldnames.lib
  116. #
  117. VIPLIBS = $(VIPBASE)\bin\$(TARGET_DIRECTORY)\$(DDKBUILDENV)
  118. #
  119. # When linking Win32 DLLs and EXEs, we have a standard set of libraries that
  120. # we use. For a DLL (aka DYNLINK) you don't have to say anything special in
  121. # your SOURCES file to get these, as the definition of WIN32DLL_LIBS below
  122. # takes care of that. However, for EXEs you'll have to do something special,
  123. # like
  124. # UMLIBS = $(VIPWIN32_LIBS)
  125. #
  126. # However, depending on your situation, TARGETLIBS or LINKLIBS might be more
  127. # appropriate. See Build.Hlp for info.
  128. #
  129. # We must be sure to link against thunk libs before any Win32 libs.
  130. # Viper binaries that must run on both Win95 and NT must link against the
  131. # thunks. Those rare few that are NT-only can chose to not do so by setting
  132. #
  133. # VIPTHUNKLIBS =
  134. #
  135. # in their Sources file.
  136. #
  137. # Components that use the shared version of MFC (and not MFCSubs) need to stay
  138. # away from using our own version of heap allocation (malloc, free, etc). To do so
  139. # they should define
  140. #
  141. # VIPPERFLIBS =
  142. #
  143. # in their Sources file.
  144. #
  145. VIPTHUNKLIBS =
  146. VIPPERFLIBS =
  147. VIPWIN32_LIBS =$(VIPTHUNKLIBS) $(VIPPERFLIBS) $(VIPDEBUGLIBS)
  148. VIPWIN32_LIBS =$(VIPWIN32_LIBS) $(SDK_LIB_PATH)\user32.lib $(SDK_LIB_PATH)\kernel32.lib $(SDK_LIB_PATH)\gdi32.lib
  149. VIPWIN32_LIBS =$(VIPWIN32_LIBS) $(SDK_LIB_PATH)\ole32.lib $(SDK_LIB_PATH)\oleaut32.lib $(SDK_LIB_PATH)\atl.lib
  150. VIPWIN32_LIBS =$(VIPWIN32_LIBS) $(SDK_LIB_PATH)\uuid.lib $(SDK_LIB_PATH)\advapi32.lib $(SDK_LIB_PATH)\rpcndr.lib
  151. VIPWIN32_LIBS =$(VIPWIN32_LIBS) $(SDK_LIB_PATH)\rpcrt4.lib $(SDK_LIB_PATH)\rpcns4.lib
  152. VIPWIN32_LIBS =$(VIPWIN32_LIBS) $(SDK_LIB_PATH)\comctl32.lib $(SDK_LIB_PATH)\netapi32.lib
  153. #
  154. # By setting WIN32DLL_LIBs we set the default for DYNLINK to be what we want
  155. # so you don't have to say anything special in sources
  156. #
  157. WIN32DLL_LIBS =$(VIPWIN32_LIBS)
  158. #######################################################################################
  159. #
  160. # Set our include paths to be the tree of 'inc'lude directories above
  161. # us. Each is assumed, if it exists, to be a include directory of increasingly
  162. # greater degree of public disclosure.
  163. #
  164. !if ($(IA64) || $(AMD64))
  165. #
  166. # The 64 bit targets need to use the updated CRT includes. The reason they aren't
  167. # merged is that we'd need to go to a newer compiler, and the newer compiler breaks
  168. # MORE stuff. Note that this makes things look in a "more global" directory before looking
  169. # in a local directory.
  170. #
  171. INCLUDES=$(VIPBASE)\inc64;$(VIPBASE)\inc64\ntos;$(VIPBASE)\inc64\mfc;.\inc;.;..\inc;..\..\inc;..\..\..\inc;..\..\..\..\inc;
  172. !else
  173. INCLUDES=.\inc;.;..\inc;..\..\inc;..\..\..\inc;..\..\..\..\inc;
  174. !endif
  175. #######################################################################################
  176. #
  177. # Setup paths indicating where targets should be built to.
  178. #
  179. TARGETVIPBIN = $(VIPBASE)\bin
  180. TARGETVIPBIN_NS = $(VIPBASE)\bin.ns
  181. TARGETVIPLIB = $(VIPBASE)\bin
  182. #######################################################################################
  183. #
  184. # Control the extraction of .dbg files and the use of incremental linking.
  185. #
  186. # .dbg files are produced only on the build machine, not on developers' workstations.
  187. # When produced, the are placed in the Symbols subdirectory of the build directory,
  188. # e.g.:
  189. # \viper\bin\i386\checked\Symbols\...
  190. #
  191. # Incremental linking is used only in checked builds, and only not on the build machine
  192. # (using incremental linking requires the use of .PDBs).
  193. #
  194. # When splitsym'ing DLL/EXEs, we also copy the .PDBs for mere libraries.
  195. # The binaries are copied over to a non-split folder so that we have a copy of the non-split
  196. # binaries too
  197. !ifndef VIPER_BUILD_MACHINE
  198. VIPER_BUILD_MACHINE =0
  199. !endif
  200. !if $(VIPER_BUILD_MACHINE)
  201. NTDBGFILES =1
  202. _NTTREE =$(TARGETVIPBIN)\$(TARGET_DIRECTORY)\$(DDKBUILDENV)
  203. _NTTREE_NS =$(TARGETVIPBIN_NS)\$(TARGET_DIRECTORY)\$(DDKBUILDENV)
  204. CUSTOM_BINPLACE_CMD =xcopy $@ $(_NTTREE_NS) && xcopy $(@R).pdb $(_NTTREE_NS) && splitsym -a $(BINPLACE_DBGFLAGS_NT) $@
  205. !undef USE_PDB
  206. !undef USE_INCREMENTAL_LINKING
  207. PLACE_LIBRARY_PDB =$(_NTTREE)\Symbols
  208. !else
  209. USE_PDB =1
  210. ! if $(FREEBUILD)
  211. ! undef USE_INCREMENTAL_LINKING
  212. ! else
  213. USE_INCREMENTAL_LINKING =1
  214. ! endif
  215. !endif
  216. #######################################################################################
  217. #
  218. # Various forms of exception handling that we can use
  219. #
  220. !if ($(AMD64) || $(386) || $(IA64))
  221. FULLCXXEH = /EHs- /EHa /EHc-
  222. SYNCCXXEH = /EHs /EHa- /EHc-
  223. SEHONLY = /EHs- /EHa- /EHc-
  224. !ELSE
  225. ! error Unknown CPU type
  226. !endif
  227. # Set the default exception handling paradigm. In a local Sources file you
  228. # can use, eg, to override
  229. #
  230. # EXCEPTION_HANDLING = $(FULLCXXEH)
  231. #
  232. EXCEPTION_HANDLING = $(SYNCCXXEH)
  233. #######################################################################################
  234. #
  235. # Allow minimal rebuild in the checked builds
  236. #
  237. !if $(FREEBUILD)
  238. !else
  239. USE_INCREMENTAL_COMPILING=1
  240. !endif
  241. #######################################################################################
  242. #
  243. # The actual set of flags passed to the compiler. Set VIPER_C_FLAGS if you
  244. # want something special.
  245. #
  246. USER_C_FLAGS = $(EXCEPTION_HANDLING) $(USE_STACK_CHECK) $(VIPER_C_FLAGS)
  247. #######################################################################################
  248. #
  249. # Allow custom resource compiler flags for viper
  250. #
  251. RCOPTIONS = $(RCOPTIONS) $(VIPER_RCOPTIONS)
  252. #######################################################################################
  253. #
  254. # Use a global warning-control file.
  255. #
  256. COMPILER_WARNINGS =/FIWarningControl.h
  257. #######################################################################################
  258. #
  259. # We have a pair of global version files on which .res files should depend.
  260. #
  261. !undef DEFAULT_VERSION_FILE
  262. MASTER_VERSION_FILE =$(VIPBASE)\src\inc\version\__official__.ver $(VIPBASE)\src\inc\version\__private__.ver