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.

5060 lines
127 KiB

  1. !IF 0
  2. Copyright (c) 1989-1996 Microsoft Corporation
  3. Module Name:
  4. makefile.def
  5. Abstract:
  6. This is the standard makefile for the components of the NT project.
  7. It includes the following files:
  8. .\sources. - developer supplies this file. It defines the
  9. required TARGETNAME, TARGETPATH, TARGETTYPE and
  10. SOURCES as well as optional macros that control
  11. the behavior of the compiler and linker:
  12. obj\_objects.mac - built by BUILD.EXE from .\sources.
  13. Targets:
  14. all - Builds all targets in this make file
  15. clean - Erase all targets that can be produced by this make
  16. file, ignoring errors. Also rebuilds the depend target.
  17. depend - Rebuilts source file dependencies, using BUILD.EXE tool
  18. Useful Variables Set:
  19. CPUTYPE={I386|AXP64|ALPHA|MPPC|IA64|AMD64|ARM}
  20. Optional Controls Variables (partial list), these are environment variables,
  21. remember they can be set with env=value on the command line as well:
  22. NOTE: xxx_... is {MSC|386|axp64|alpha|MPPC|ia64|amd64} where MSC_ applies to the C8 compiler
  23. independent of the cpu type. Specific cpu_ will take precedence
  24. over the equivalent MSC_ variable.
  25. EXAMPLE: To compile with codeview symbols for windbg:
  26. set NTDEBUG=ntsd
  27. set NTDEBUGTYPE=windbg
  28. set MSC_OPTIMIZATION=/Od
  29. nttest=filename
  30. umtest=filename
  31. umappl=filename
  32. NT_UP
  33. Define as 0 in environment to turn on MP.
  34. If undefined or equal to 1, you get UP.
  35. xxx_warning_level
  36. xxx_optimization
  37. xxx_STDCALL = 1 use _stdcall calling convention
  38. 0 use _cdecl calling convention
  39. ntdebug
  40. browser_info
  41. xxx_cppflags
  42. ntcppflags
  43. NT_INST - set to turn on instrumentation
  44. BASEDIR - \nt or \ntrel (default \nt)
  45. PRECOMPILED_CXX=1 - do precompiled headers for CXX instead of C files
  46. note: precompiled headers can not be used on both
  47. c and cxx files in a single directory.
  48. !ENDIF
  49. !if 0
  50. ! message You must use nmake version 1.30 or greater...
  51. !endif
  52. # See if the user wants BROWSER_INFO.
  53. !ifdef BROWSER_INFO
  54. USER_ENV_BROWSER_INFO=1
  55. !endif
  56. !ifdef COMPRESS_PDBS
  57. COMPRESS_CMD=-compact /c /q $(@D)\$(@B).pdb
  58. !else
  59. COMPRESS_CMD=
  60. !endif
  61. #
  62. # Select build target and set platform specific variables.
  63. #
  64. !ifdef BUILD_ALLOW_ALL_WARNINGS
  65. BUILD_ALLOW_LINKER_WARNINGS=1
  66. BUILD_ALLOW_COMPILER_WARNINGS=1
  67. BUILD_ALLOW_MIDL_WARNINGS=1
  68. !endif
  69. !ifndef BUILD_ALLOW_LINKER_WARNINGS
  70. LINKER_WX_SWITCH=/WX
  71. !else
  72. LINKER_WX_SWITCH=
  73. !endif
  74. !ifndef BUILD_ALLOW_COMPILER_WARNINGS
  75. COMPILER_WX_SWITCH=/WX
  76. !else
  77. COMPILER_WX_SWITCH=
  78. !endif
  79. !ifndef BUILD_ALLOW_MIDL_WARNINGS
  80. MIDL_WX_SWITCH=/WX
  81. !else
  82. MIDL_WX_SWITCH=
  83. !endif
  84. !INCLUDE makefile.plt
  85. !ifndef MASTER_VERSION_FILE
  86. !if "$(POCKETPC)" == ""
  87. MASTER_VERSION_FILE = $(SDK_INC_PATH)\ntverp.h
  88. !endif
  89. DEFAULT_VERSION_FILE=1
  90. !endif
  91. #
  92. # IDL/RDL/TDL build rules.
  93. #
  94. !ifdef IDL_RULES
  95. IDL_OUT_DIR =.
  96. IDL_HDR_OUT_DIR =.
  97. RDL_OUT_DIR =.
  98. RDL_HDR_OUT_DIR =.
  99. ! ifndef MIDL_INCS
  100. MIDL_INCS = $(_OBJ_DIR)\$(TARGET_DIRECTORY)
  101. ! endif
  102. !endif
  103. !ifndef LANGUAGE
  104. LANGUAGE=usa
  105. !endif
  106. # define a simple macro that can be used for the object subdir in makefile.inc/sources files
  107. O = $(_OBJ_DIR)\$(TARGET_DIRECTORY)
  108. #
  109. # Include the developer supplied file that defines the TARGETNAME, TARGETPATH,
  110. # TARGETTYPE and SOURCES macros. Make sure it defines them.
  111. #
  112. !if defined(USE_CAPK)
  113. # Kernel profiling - icecap api's come from the kernel or from rtl\icecap.c when building the kernel/hal/ntdll
  114. USE_ICECAP4=1
  115. PERFLIBS=
  116. C_DEFINES=$(C_DEFINES) /D_CAPKERN=1
  117. ASM_DEFINES=$(ASM_DEFINES) /D_CAPKERN=1
  118. !endif
  119. !if defined(USE_ICECAP) || defined(USE_ICECAP4) || defined(USE_DLP)
  120. ! ifdef USE_ICECAP
  121. PERFFLAGS=-Gh
  122. PERFLIBS=$(SDK_LIB_PATH)\icap.lib
  123. ! else
  124. ! ifdef USE_ICECAP4
  125. PERFFLAGS=/fastcap
  126. ! else # USE_DLP
  127. PERFFLAGS=/dlp
  128. ! endif
  129. ! ifndef PERFLIBS
  130. PERFLIBS=$(SDK_LIB_PATH)\icecap.lib
  131. ! endif
  132. ! endif
  133. ! if $(FREEBUILD)
  134. NTDEBUG=ntsdnodbg
  135. ! else
  136. NTDEBUG=ntsd
  137. ! endif
  138. NTDEBUGTYPE=windbg
  139. NTBBT=1
  140. !endif
  141. LATEST_WIN32_WIN95_VERSION=0x0400
  142. LATEST_WIN32_WCE_VERSION=0x0300
  143. #
  144. # Set versions correctly for NT4/2000/XP
  145. # Default to XP
  146. #
  147. !if $(_NT_TARGET_VERSION) == 0x600 ## Windows Longhorn ##
  148. LATEST_WIN32_IE_VERSION =0x0605
  149. LATEST_WIN32_WINNT_VERSION=0x0600
  150. SUBSYSTEM_VERSION_CURRENT =4.10
  151. SUBSYSTEM_VERSION_LATEST =6.00
  152. LINKER_APP_VERSION=6.0
  153. LINKER_OS_VERSION=6.0
  154. !elseif $(_NT_TARGET_VERSION) == 0x502 ## Windows .NET ##
  155. LATEST_WIN32_IE_VERSION =0x0600
  156. LATEST_WIN32_WINNT_VERSION=0x0502
  157. SUBSYSTEM_VERSION_CURRENT =4.10
  158. SUBSYSTEM_VERSION_LATEST =5.02
  159. LINKER_APP_VERSION=5.2
  160. LINKER_OS_VERSION=5.2
  161. !elseif $(_NT_TARGET_VERSION) == 0x501 ## Windows XP ##
  162. LATEST_WIN32_IE_VERSION =0x0600
  163. LATEST_WIN32_WINNT_VERSION=0x0501
  164. SUBSYSTEM_VERSION_CURRENT=4.10
  165. SUBSYSTEM_VERSION_LATEST =5.01
  166. LINKER_APP_VERSION=5.1
  167. LINKER_OS_VERSION=5.1
  168. !elseif $(_NT_TARGET_VERSION) == 0x500 ## Windows 2000 ##
  169. LATEST_WIN32_IE_VERSION =0x0501
  170. LATEST_WIN32_WINNT_VERSION=0x0500
  171. SUBSYSTEM_VERSION_CURRENT=4.10
  172. SUBSYSTEM_VERSION_LATEST =5.00
  173. LINKER_APP_VERSION=5.0
  174. LINKER_OS_VERSION=5.0
  175. !elseif $(_NT_TARGET_VERSION) == 0x400 ## Windows NT 4 ##
  176. LATEST_WIN32_IE_VERSION =0x0200
  177. LATEST_WIN32_WINNT_VERSION=0x0400
  178. SUBSYSTEM_VERSION_CURRENT =4.00
  179. SUBSYSTEM_VERSION_LATEST =4.00
  180. LINKER_APP_VERSION=4.0
  181. LINKER_OS_VERSION=4.0
  182. !else
  183. !message NMAKE : Uxxxx: _NT_TARGET_VERSION value is unknown. Update Makefile.def to understand the new version.
  184. !endif # _NT_TARGET_VERSION
  185. #
  186. # Set Windows CE/PocketPC variables.
  187. #
  188. !if "$(POCKETPC)" != ""
  189. ! if "$(POCKETPC_EMULATION)" != ""
  190. WINCE_IMAGE = -WINDOWSCE:EMULATION
  191. ! else
  192. WINCE_IMAGE = -WINDOWSCE
  193. ! endif
  194. CVTRES_PLATFORM_FLAGS = $(WINCE_IMAGE)
  195. !endif
  196. #
  197. # Run miscfiles rules during both compile and link phases. Sources file
  198. # can override by setting this a value other than 0
  199. #
  200. MISCFILES_DURING_LINK=0
  201. !INCLUDE .\sources
  202. SOURCES_USED=$(SOURCES_USED) .\sources
  203. #
  204. # Attempt to include the sources file from the target subdirectory.
  205. #
  206. !IF EXIST(.\$(TARGET_DIRECTORY)\sources)
  207. ! INCLUDE .\$(TARGET_DIRECTORY)\sources
  208. SOURCES_USED=$(SOURCES_USED) .\$(TARGET_DIRECTORY)\sources
  209. !ENDIF
  210. !ifdef PASS1_LINK
  211. MAKEDLL=1
  212. !undef NOLINK
  213. !endif
  214. #
  215. # Attempt to include the sources file from the parent target subdirectory.
  216. #
  217. !IF EXIST(..\$(TARGET_DIRECTORY)\sources)
  218. ! INCLUDE ..\$(TARGET_DIRECTORY)\sources
  219. SOURCES_USED=$(SOURCES_USED) ..\$(TARGET_DIRECTORY)\sources
  220. !ENDIF
  221. !if $(LTCG_DRIVER) && "$(TARGETTYPE)" == "DRIVER"
  222. LINK_TIME_CODE_GENERATION=1
  223. !endif
  224. !if $(LTCG_DRIVER_LIBRARY) && "$(TARGETTYPE)" == "DRIVER_LIBRARY"
  225. LINK_TIME_CODE_GENERATION=1
  226. !endif
  227. !if $(LTCG_DYNLINK) && "$(TARGETTYPE)" == "DYNLINK"
  228. LINK_TIME_CODE_GENERATION=1
  229. !endif
  230. !if $(LTCG_EXPORT_DRIVER) && "$(TARGETTYPE)" == "EXPORT_DRIVER"
  231. LINK_TIME_CODE_GENERATION=1
  232. !endif
  233. !if $(LTCG_GDI_DRIVER) && "$(TARGETTYPE)" == "GDI_DRIVER"
  234. LINK_TIME_CODE_GENERATION=1
  235. !endif
  236. !if $(LTCG_HAL) && "$(TARGETTYPE)" == "HAL"
  237. LINK_TIME_CODE_GENERATION=1
  238. !endif
  239. !if $(LTCG_LIBRARY) && "$(TARGETTYPE)" == "LIBRARY"
  240. LINK_TIME_CODE_GENERATION=1
  241. !endif
  242. !if $(LTCG_MINIPORT) && "$(TARGETTYPE)" == "MINIPORT"
  243. LINK_TIME_CODE_GENERATION=1
  244. !endif
  245. !if $(LTCG_PROGRAM) && "$(TARGETTYPE)" == "PROGRAM"
  246. LINK_TIME_CODE_GENERATION=1
  247. !endif
  248. !if $(LTCG_PROGLIB) && "$(TARGETTYPE)" == "PROGLIB"
  249. LINK_TIME_CODE_GENERATION=1
  250. !endif
  251. !if $(LTCG_UMAPPL_NOLIB) && "$(TARGETTYPE)" == "UMAPPL_NOLIB"
  252. LINK_TIME_CODE_GENERATION=1
  253. !endif
  254. # Allow separate LTCG definitions loosely based on SKU.
  255. !if defined(LTCG_SRV) || defined(LTCG_WKS) || defined(LTCG_SRVWKS)
  256. LINK_TIME_CODE_GENERATION=1
  257. !endif
  258. # Avoid publishing ANONYMOUS PCH objects to public.
  259. !if defined(LINK_TIME_CODE_GENERATION) && defined(PASS1_PUBLISH) && "$(BUILD_PASS)" != "PASS0" && "$(BUILD_PASS)" != "PASS2" && !defined(NOLIB) && "$(TARGETTYPE)" != "DYNLINK" && "$(TARGETTYPE)" != "EXPORT_DRIVER"
  260. NTNOPCH=1
  261. !endif
  262. # Allow alternate object directories.
  263. !ifndef BUILD_ALT_DIR
  264. BUILD_ALT_DIR=
  265. ! ifdef CHECKED_ALT_DIR
  266. ! if !$(FREEBUILD)
  267. BUILD_ALT_DIR=d
  268. ! endif
  269. ! endif
  270. !endif
  271. _OBJ_DIR = obj$(BUILD_ALT_DIR)
  272. #
  273. # SXS Build
  274. #
  275. # Step by Step
  276. #
  277. # For building a monolithic application, foo.ext (where .ext is usually .exe but for example .scr).
  278. # For building an application that hosts arbitrary (3rd party) code.
  279. # For building a single file component like comctl32.dll.
  280. # For building a multiple file component.
  281. #
  282. # Reference
  283. #
  284. # An assembly contains a manifest and one or more files, usually .dlls.
  285. # The manifest can be in a resource in one of the files, or it can be in a seperate
  286. # .manifest file. For purposes of fitting on an 8.3 CD, .man is allowed.
  287. # For preprocessing, the source file can be .manifest-src.
  288. # Build.exe is generally limited to building one .dll per directory, so
  289. # you can be building files for an assembly without building a manifest.
  290. #
  291. # To build/binplace a manifest:
  292. #
  293. # SXS_MANIFEST required
  294. # This is the source file that contains your manifest.
  295. # It must end in .manifest or .manifest-src.
  296. # It is always preprocessed. Available macros include:
  297. # SXS_ASSEMBLY_NAME
  298. # SXS_ASSEMBLY_VERSION
  299. # SXS_ASSEMBLY_LANGUAGE
  300. # SXS_PROCESSOR_ARCHITECTURE
  301. #
  302. # SXS_MANIFEST_IN_RESOURCES optional
  303. # This is defined or not, so you just say
  304. # SXS_MANIFEST_IN_RESOURCES=
  305. # or don't say anything.
  306. #
  307. # SXS_ASSEMBLY_NAME and/or SXS_SHORT_ASSEMBLY_NAME required
  308. # One can be generated from the other.
  309. # SXS_SHORT_ASSEMBLY_NAME is used where 8.3 limits apply, like on the product CD.
  310. # Both of these macros can be hierarchical, using dot, dash, or underscore to seperate
  311. # elements. SXS_SHORT_ASSEMBLY_NAME should actually only contain 8 character elements.
  312. #
  313. # SXS_ASSEMBLY_VERSION optional, defaults to 5.1.
  314. # We append .0.0 to this.
  315. #
  316. # SXS_ASSEMBLY_LANGUAGE or SXS_ASSEMBLY_LANGUAGE_INDEPENDENT required
  317. # SXS_ASSEMBLY_LANGUAGE_INDEPENDENT is defined or not.
  318. # SXS_ASSEMBLY_LANGUAGE is four digits like
  319. # 0409 for English US
  320. # 0009 for English
  321. # 0000 for language independent
  322. # We should make this easier as is done for resources (LANGUAGE => RCCODEPAGE), but for now we don't.
  323. #
  324. # To build/binplace a file into an assembly, a subset of the information
  325. # needed for manifests is needed:
  326. #
  327. # SXS_ASSEMBLY_NAME and/or SXS_SHORT_ASSEMBLY_NAME
  328. # SXS_ASSEMBLY_VERSION
  329. # SXS_ASSEMBLY_LANGUAGE or SXS_ASSEMBLY_LANGUAGE_INDEPENDENT
  330. #
  331. # There are restrictions on the values of these macros and not all restrictions
  332. # are currently enforced by the build. Enforcements that are present are done
  333. # ifdef VERIFY_SOURCES in verify.src.
  334. #
  335. !if defined(SXS_MANIFEST) \
  336. || defined(SXS_BINPLACE_ALSO_ROOT) \
  337. || defined(SXS_ASSEMBLY_NAME) \
  338. || defined(SXS_ASSEMBLY_VERSION) \
  339. || defined(SXS_ASSEMBLY_LANGUAGE_INDEPENDENT) \
  340. || defined(SXS_ASSEMBLY_LANGUAGE)
  341. VERIFY_SOURCES=1
  342. !endif
  343. !if "$(ALT_PROJECT)" == "WOW6432" || "$(ALT_PROJECT_TARGET)" == "WOW6432"
  344. SXS_PDB_WOW6432_W_PREFIX=w
  345. SXS_LOG_WOWBINS_W_ASMS_PREFIX=w
  346. SXS_LOG_BINPLACE_WOW6432_PREFIX=wow6432^\
  347. SXS_WOW6432=1
  348. !endif
  349. # Form this particularly so build.exe reports errors.
  350. # Using !error doesn't work as well.
  351. # It is based on what \nt\base\wow64\tools and verify.src do.
  352. SXS_BUILD_ERROR_MSG=NMAKE : U1234: 'SXS_BUILD' ($(NTMAKEENV)\makefile.def)
  353. SXS_MERGE_MODULE_ERROR_MSG=NMAKE : U1234: 'SXS_MERGE_MODULE_GENERATION' ($(NTMAKEENV)\makefile.def)
  354. #
  355. # There's two meta-modes of operation in SXS - Application manifest mode and component manifest mode.
  356. # Depending on what you have defined in your sources file, you can simplify all of the build process
  357. # down to a very minimal set of commands in your sources files and still get Fusionization goodness.
  358. #
  359. # Example:
  360. #
  361. # SXS_APPLICATION_MANIFEST=MyAppManifest.manifest
  362. #
  363. # (or)
  364. #
  365. # SXS_COMPONENT_MANIFEST=MyComponentManifest.manifest
  366. #
  367. # See the code below for what gets defined based on each - it's more or less the defaults, but
  368. # explicitly spelled out.
  369. #
  370. # No fair using either app and component manifest, and specifying sxs_manifest, or using both by accident
  371. !if defined(SXS_APPLICATION_MANIFEST) && defined(SXS_COMPONENT_MANIFEST)
  372. !message $(SXS_BUILD_ERROR_MSG) You can have only one of SXS_APPLICATION_MANIFEST or SXS_COMPONENT_MANIFEST, not both
  373. !elseif defined(SXS_MANIFEST) && ( defined(SXS_APPLICATION_MANIFEST) || defined(SXS_COMPONENT_MANIFEST) )
  374. !message $(SXS_BUILD_ERROR_MSG) When using SXS_APPLICATION_MANIFEST or SXS_COMPONENT_MANIFEST, do not specify SXS_MANIFEST
  375. !endif
  376. # Applications get the following defaults that are not defaulted later:
  377. # - SXS_ASSEMBLY_LANGUAGE=SXS_ASSEMBLY_LANGUAGE_INDEPENDENT
  378. # - SXS_ASSEMBLY_NAME=Microsoft.Windows.$(PROJECT).$(TARGETNAME)
  379. # - Manifest in resources
  380. !if defined(SXS_APPLICATION_MANIFEST)
  381. SXS_MANIFEST=$(SXS_APPLICATION_MANIFEST)
  382. SXS_MANIFEST_IN_RESOURCES=1
  383. SXS_NO_BINPLACE=1
  384. !if !defined(SXS_ASSEMBLY_NAME)
  385. SXS_ASSEMBLY_NAME=Microsoft.Windows.$(_PROJECT_).$(TARGETNAME)
  386. !endif
  387. !if !defined(SXS_ASSEMBLY_LANGUAGE)
  388. SXS_ASSEMBLY_LANGUAGE_INDEPENDENT=1
  389. !endif
  390. # Components get the following defaulted:
  391. # - SXS_ASSEMBLY_NAME=Microsoft.Windows.$(PROJECT).$(TARGETNAME)
  392. # - Language independent
  393. !elseif defined(SXS_COMPONENT_MANIFEST)
  394. SXS_MANIFEST=$(SXS_COMPONENT_MANIFEST)
  395. !if !defined(SXS_ASSEMBLY_NAME)
  396. SXS_ASSEMBLY_NAME=Microsoft.Windows.$(_PROJECT_).$(TARGETNAME)
  397. !endif
  398. !if !defined(SXS_ASSEMBLY_LANGUAGE)
  399. SXS_ASSEMBLY_LANGUAGE_INDEPENDENT=1
  400. !endif
  401. !endif
  402. !ifdef VERIFY_SOURCES
  403. !include $(NTMAKEENV)\verify.src
  404. !endif
  405. !if defined(ISOLATION_AWARE_ENABLED)
  406. C_DEFINES=$(C_DEFINES) -DISOLATION_AWARE_ENABLED=1
  407. !endif
  408. #
  409. # NO_BINPLACE implies SXS_NO_BINPLACE
  410. #
  411. !if defined(NO_BINPLACE)
  412. SXS_NO_BINPLACE=1
  413. !endif
  414. #
  415. # Building an .exe implies SXS_NO_BINPLACE.
  416. #
  417. !if "$(TARGETTYPE)" == "PROGRAM"
  418. SXS_NO_BINPLACE=1
  419. !endif
  420. #
  421. # We can build SXS_ASSEMBLY_NAME out of SXS_SHORT_ASSEMBLY_NAME
  422. # and vice versa.
  423. #
  424. !if !defined(SXS_ASSEMBLY_NAME) && defined(SXS_SHORT_ASSEMBLY_NAME)
  425. SXS_ASSEMBLY_NAME=$(SXS_SHORT_ASSEMBLY_NAME)
  426. !endif
  427. !if !defined(SXS_SHORT_ASSEMBLY_NAME) && defined(SXS_ASSEMBLY_NAME)
  428. SXS_SHORT_ASSEMBLY_NAME=$(SXS_ASSEMBLY_NAME)
  429. !endif
  430. #
  431. # Support the idea of a hierarchical 8.3 name, besides that this
  432. # transform might be applied after the preceding assignment.
  433. #
  434. # eg: msft-vcrtl => msft\vcrtl
  435. #
  436. # Turn hierarchical names using [-._ ] as the element divider
  437. # into hierarchical file system names. (Note that _ and . are not
  438. # currently allowed in assembly names.)
  439. SXS_SHORT_ASSEMBLY_NAME=$(SXS_SHORT_ASSEMBLY_NAME:-=\)
  440. SXS_SHORT_ASSEMBLY_NAME=$(SXS_SHORT_ASSEMBLY_NAME:_=\)
  441. SXS_SHORT_ASSEMBLY_NAME=$(SXS_SHORT_ASSEMBLY_NAME:.=\)
  442. SXS_SHORT_ASSEMBLY_NAME=$(SXS_SHORT_ASSEMBLY_NAME: =\)
  443. # Shorten one special name that is likely to appear in long assembly names.
  444. SXS_SHORT_ASSEMBLY_NAME=$(SXS_SHORT_ASSEMBLY_NAME:Microsoft=Msft)
  445. SXS_SHORT_ASSEMBLY_NAME=$(SXS_SHORT_ASSEMBLY_NAME:microsoft=msft)
  446. !if defined(SXS_MANIFEST_IN_RESOURCES) && !defined(SXS_MANIFEST)
  447. !message $(SXS_BUILD_ERROR_MSG) You must specify SXS_MANIFEST if you specify SXS_MANIFEST_IN_RESOURCES.
  448. !endif
  449. !if defined(SXS_ASSEMBLY_VERSION) && !defined(SXS_ASSEMBLY_NAME)
  450. !message $(SXS_BUILD_ERROR_MSG) You may not specify SXS_ASSEMBLY_VERSION without SXS_ASSEMBLY_NAME or SXS_SHORT_ASSEMBLY_NAME.
  451. !endif
  452. !if (defined(SXS_ASSEMBLY_LANGUAGE) || defined(SXS_ASSEMBLY_LANGUAGE_INDEPENDENT)) && !defined(SXS_ASSEMBLY_NAME)
  453. !message $(SXS_BUILD_ERROR_MSG) You may not specify SXS_ASSEMBLY_LANGUAGE or SXS_ASSEMBLY_LANGUAGE_INDEPENDENT without SXS_ASSEMBLY_NAME or SXS_SHORT_ASSEMBLY_NAME.
  454. !endif
  455. !if defined(SXS_BINPLACE_ALSO_ROOT) && !defined(SXS_ASSEMBLY_NAME)
  456. !message $(SXS_BUILD_ERROR_MSG) You may not specify SXS_BINPLACE_ALSO_ROOT without SXS_ASSEMBLY_NAME or SXS_SHORT_ASSEMBLY_NAME.
  457. !endif
  458. !if defined(MANAGED_CXX) || defined(MANAGED_CODE) || defined(MANAGED_VB)
  459. # "managed" == urt, clr, .net, c#, vs7, mscoree, etc.
  460. SXS_MANAGED=1
  461. !else
  462. # "unmanaged" == C++/C/assembly, native x86/ia64/amd64/etc.
  463. SXS_MANAGED=0
  464. !endif
  465. !if defined(SXS_ASSEMBLY_NAME) # {
  466. #
  467. # SXS_ASSEMBLY_VERSION may only contain dots and digits.
  468. # Removing them should leave nothing.
  469. #
  470. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_ASSEMBLY_VERSION)
  471. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:.=)
  472. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:0=)
  473. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:1=)
  474. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:2=)
  475. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:3=)
  476. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:4=)
  477. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:5=)
  478. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:6=)
  479. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:7=)
  480. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:8=)
  481. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:9=)
  482. !if "$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS)" != ""
  483. !message $(SXS_BUILD_ERROR_MSG) SXS_ASSEMBLY_VERSION ($(SXS_ASSEMBLY_VERSION)) may only contain dots and digits.
  484. !endif
  485. #
  486. # ASSERT(SXS_ASSEMBLY_LANGUAGE xor SXS_ASSEMBLY_LANGUAGE_INDEPENDENT)
  487. #
  488. !if (!defined(SXS_ASSEMBLY_LANGUAGE) && !defined(SXS_ASSEMBLY_LANGUAGE_INDEPENDENT)) \
  489. || ( defined(SXS_ASSEMBLY_LANGUAGE) && defined(SXS_ASSEMBLY_LANGUAGE_INDEPENDENT))
  490. !message $(SXS_BUILD_ERROR_MSG) Must specify SXS_ASSEMBLY_LANGUAGE or SXS_ASSEMBLY_LANGUAGE_INDEPENDENT, not both.
  491. !endif
  492. #
  493. # Derive from SXS_ASSEMBLY_LANGUAGE from SXS_ASSEMBLY_LANGUAGE_INDEPENDENT.
  494. #
  495. !if defined(SXS_ASSEMBLY_LANGUAGE_INDEPENDENT) && !defined(SXS_ASSEMBLY_LANGUAGE)
  496. SXS_ASSEMBLY_LANGUAGE=x-ww
  497. !endif
  498. #
  499. # This is for Fusion stuff only. It does not need to match the nt subsystem version.
  500. #
  501. !if !defined(SXS_ASSEMBLY_VERSION)
  502. SXS_ASSEMBLY_VERSION=5.1
  503. !endif
  504. #
  505. # Clients usually only provide major.minor, and we append .0.0.
  506. #
  507. !if defined(SXS_ASSEMBLY_VERSION) # {
  508. !if !defined(SXS_ASSEMBLY_VERSION_PART_3)
  509. SXS_ASSEMBLY_VERSION_PART_3=0
  510. !endif
  511. !if !defined(SXS_ASSEMBLY_VERSION_PART_4)
  512. SXS_ASSEMBLY_VERSION_PART_4=0
  513. !endif
  514. SXS_ASSEMBLY_VERSION=$(SXS_ASSEMBLY_VERSION).$(SXS_ASSEMBLY_VERSION_PART_3).$(SXS_ASSEMBLY_VERSION_PART_4)
  515. !endif # }
  516. !if !defined(SXS_NO_BINPLACE) # {
  517. #
  518. # We might need SXS_ASSEMBLY_LANGUAGE and even SXS_ASSEMBLY_PROCESSOR_ARCHITECTURE
  519. # in SXS_BINPLACE_DIR, esp. for example if we have any data only assemblies with
  520. # the same name/version as code containing assemblies.
  521. #
  522. # Eventually the mapping from assembly metadata to run-time paths and
  523. # build-time paths will be exposed by sxs.dll/sxs.lib consumed
  524. # by build tools written in C/C++ (possibly just binplace).
  525. # Build/Make are too constraining for our needs.
  526. # For now we get by.
  527. #
  528. # "asms" is very special, it is the root of where assemblies are binplaced
  529. # and it is the root of where they appear on the CD. This string appears in
  530. # a number of places:
  531. # \nt\tools\PostBuildScripts
  532. # \nt\admin\ntsetup\inf\win4\inf\dosnet.inx
  533. # \nt\admin\ntsetup\inf\win4\inf\syssetup.inx
  534. #
  535. !if $(SXS_MANAGED)
  536. SXS_BINPLACE_DIR1=managed_asms
  537. !else
  538. SXS_BINPLACE_DIR1=asms
  539. !endif
  540. # Remove dots from SXS_ASSEMBLY_VERSION to make it legal 8.3 (only one dot allowed)
  541. # We place version in front of name due to restrictions on how the manifest
  542. # file name related to the name of leaf directory it is in.
  543. SXS_BINPLACE_DIR2=$(SXS_ASSEMBLY_VERSION:.=)\$(SXS_SHORT_ASSEMBLY_NAME)
  544. SXS_BINPLACE_DIR3=$(SXS_BINPLACE_DIR1)\$(SXS_BINPLACE_DIR2)
  545. SXS_BINPLACE_SLASH_DIR3=\$(SXS_BINPLACE_DIR3)
  546. #
  547. # create msms destination directory
  548. #
  549. !if defined(SXS_GENERATE_MERGE_MODULE) # {
  550. #
  551. # if the generate mode is not defined, set it default : 0
  552. #
  553. !if !defined(SXS_MERGE_MODULE_FOR_ASSEMBLY_GROUP)
  554. SXS_MERGE_MODULE_FOR_ASSEMBLY_GROUP=0
  555. !else
  556. SXS_MERGE_MODULE_FOR_ASSEMBLY_GROUP=1
  557. !endif
  558. !if "$(SXS_MERGE_MODULE_GUID)" == "" || "$(SXS_MERGE_MODULE_COMPONENT_GUID)" == "" # {
  559. !error $(SXS_MERGE_MODULE_ERROR_MSG) MergeModule GUID and MergeModule Component must be specified
  560. !endif # }
  561. !if !defined(SXS_MERGE_MODULE) # { use the manifest basename as the msm basename
  562. SXS_MERGE_MODULE=$(SXS_MANIFEST_BASENAME).msm
  563. !endif #}
  564. !if !defined(SXS_MERGE_MODULE_LOCATION)
  565. SXS_MERGE_MODULE_DESTINATION=asm_msm\$(SXS_BINPLACE_DIR2)
  566. !else
  567. #
  568. #parse this string to generate the real path
  569. #
  570. SXS_MERGE_MODULE_LOCATION=$(SXS_ASSEMBLY_VERSION:.=)\$(SXS_MERGE_MODULE_LOCATION)
  571. SXS_MERGE_MODULE_LOCATION=$(SXS_MERGE_MODULE_LOCATION:-=\)
  572. SXS_MERGE_MODULE_LOCATION=$(SXS_MERGE_MODULE_LOCATION:_=\)
  573. SXS_MERGE_MODULE_LOCATION=$(SXS_MERGE_MODULE_LOCATION:.=\)
  574. SXS_MERGE_MODULE_LOCATION=$(SXS_MERGE_MODULE_LOCATION: =\)
  575. SXS_MERGE_MODULE_LOCATION=asm_msm\$(SXS_MERGE_MODULE_LOCATION)
  576. !endif
  577. !endif # }
  578. BINPLACE_GENERATE_PLACEFILE=1
  579. !if "$(BINPLACE_DESTINATIONS)" == ""
  580. BINPLACE_DESTINATIONS=$(SXS_BINPLACE_DIR3)
  581. !else
  582. BINPLACE_DESTINATIONS=$(BINPLACE_DESTINATIONS):$(SXS_BINPLACE_DIR3)
  583. !endif
  584. BINPLACE_DESTINATIONS_NORETAIL=$(BINPLACE_DESTINATIONS)
  585. !if defined(SXS_BINPLACE_ALSO_ROOT)
  586. BINPLACE_DESTINATIONS=$(BINPLACE_DESTINATIONS):retail
  587. !endif
  588. !endif # !SXS_NO_BINPLACE }
  589. #
  590. # Optionally uniquize the .pdb names, so they can go in a flat directory (%_nttree%\symbols.pri\retail\dll)
  591. #
  592. !if !defined(SXS_LONG_PDB_NAME)
  593. SXS_LONG_PDB_NAME=$(SXS_PDB_WOW6432_W_PREFIX)$(SXS_ASSEMBLY_NAME:.=)-$(SXS_ASSEMBLY_VERSION:.=)-$(TARGETNAME:.=)
  594. !endif
  595. !if !defined(SXS_NO_BINPLACE) #{
  596. !if !defined(TARGETPDB) && "$(SXS_USE_LONG_PDB_NAME)" == "1"
  597. LINKER_FLAGS=$(LINKER_FLAGS) -pdb:$(TARGETPATH)\$(TARGET_DIRECTORY)\$(SXS_LONG_PDB_NAME).pdb
  598. !endif
  599. SXS_BINPLACE_FLAGS=-ChangeAsmsToRetailForSymbols
  600. !endif #}
  601. !endif # !SXS_ASSEMBLY_NAME }
  602. !if defined(BINPLACE_LOG) && !defined(NO_SXS_LOG)
  603. !if !defined(NO_BINPLACE) && ("$(TARGETTYPE)" == "NOTARGET" || "$(MAKEDLL)" != "" || "$(BUILD_PASS)" == "PASS2")
  604. SXS_LOG_PASS=1
  605. SXS_LOG_CMD= ( echo. )
  606. !endif
  607. !endif
  608. !if defined(SXS_LOG_PASS) && !defined(APPEND_TOOL)
  609. APPEND_TOOL=appendtool.exe
  610. !endif
  611. !if defined(SXS_MANIFEST) # {
  612. #
  613. # If removing .manifest or .Manifest from SXS_MANIFEST leaves it unchanged,
  614. # it doesn't contain either one and is invalid.
  615. #
  616. !if "$(SXS_MANIFEST:.Manifest=)" == "$(SXS_MANIFEST)" \
  617. && "$(SXS_MANIFEST:.manifest=)" == "$(SXS_MANIFEST)"
  618. !message $(SXS_BUILD_ERROR_MSG) SXS_MANIFEST ($(SXS_MANIFEST)) must contain ".Manifest", it must end in ".Manifest or ".Manifest-src"
  619. !endif
  620. SXS_MANIFEST_SOURCE_FILENAME=$(SXS_MANIFEST:..\=)
  621. SXS_MANIFEST_BASENAME=$(SXS_MANIFEST_SOURCE_FILENAME)
  622. SXS_MANIFEST_BASENAME=$(SXS_MANIFEST_BASENAME:.manifest-src=)
  623. SXS_MANIFEST_BASENAME=$(SXS_MANIFEST_BASENAME:.Manifest-src=)
  624. SXS_MANIFEST_BASENAME=$(SXS_MANIFEST_BASENAME:.manifest=)
  625. SXS_MANIFEST_BASENAME=$(SXS_MANIFEST_BASENAME:.Manifest=)
  626. SXS_MANIFEST_BASENAME=$(SXS_MANIFEST_BASENAME:.man=)
  627. SXS_MANIFEST_BASENAME=$(SXS_MANIFEST_BASENAME:.Man=)
  628. SXS_MANIFEST_BASENAME=$(SXS_MANIFEST_BASENAME:.man-src=)
  629. SXS_MANIFEST_BASENAME=$(SXS_MANIFEST_BASENAME:.Man-src=)
  630. #
  631. # Always make .man file in the obj directory.
  632. #
  633. SXS_MANIFEST_OBJ1=$(O)\$(SXS_MANIFEST_BASENAME).man
  634. !if !defined(SXS_MANIFEST_IN_RESOURCES)
  635. #
  636. # OBJ is files in obj\i386.
  637. # BIN is binplaced files, possibly also in obj\i386.
  638. #
  639. # The binplaced file must be 8.3.
  640. # The obj\i386 file
  641. # - should allow .exes to be run from obj\i386 that don't have manifest-in-resources
  642. # - not override manifest-in-resources
  643. #
  644. SXS_MANIFEST_BIN_FILENAME=$(SXS_MANIFEST_BASENAME).man
  645. !if !defined(NO_BINPLACE) && !defined(SXS_NO_BINPLACE) && ("$(BUILD_PASS)" == "PASS1" || "$(BUILD_PASS)" == "PASSALL")
  646. SXS_MISCFILES=$(SXS_MISCFILES) $(SXS_MANIFEST_OBJ1)
  647. !endif
  648. # Make a .manifest file identical to the .man file (we just copy it).
  649. !if "$(TARGETTYPE)" != "NOTARGET" && ("$(MAKEDLL)" != "" || "$(BUILD_PASS)" == "PASS2")
  650. SXS_MANIFEST_OBJ2=$(O)\$(TARGETNAME).$(TARGETEXT).manifest
  651. !endif
  652. !else
  653. SXS_MANIFEST_BIN_FILENAME=$(TARGETNAME).$(TARGETEXT)
  654. !if !defined(SXS_MANIFEST_RESOURCE_ID)
  655. !if defined(ISOLATION_AWARE_ENABLED) || "$(TARGETTYPE)" == "DYNLINK"
  656. SXS_MANIFEST_RESOURCE_ID=ISOLATIONAWARE_MANIFEST_RESOURCE_ID
  657. !elseif "$(TARGETTYPE)" == "PROGRAM" || "$(TARGETTYPE)" == "PROGLIB" || "$(TARGETTYPE)" == "UMAPPL_NOLIB"
  658. SXS_MANIFEST_RESOURCE_ID=CREATEPROCESS_MANIFEST_RESOURCE_ID
  659. !endif
  660. !endif
  661. #
  662. # Putting manifests in resources requires no editing of the .rc file.
  663. # We can do this via forceinclude-file or forceinclude-string.
  664. # I thought rc.exe had a forceinclude-file feature like the C++ compiler.
  665. # By the time I realized that it doesn't, it seemed better to press ahead
  666. # with simulating it than not depend on it. There is unlikely any other way
  667. # to support SXS_MANIFEST_IN_RESOURCES without requiring "nonlocal" .rc file
  668. # edits (ie: without further fanning out how many files need to touched in how
  669. # many places by clients who want to build sxs assemblies).
  670. #
  671. RCOPTIONS=-DSXS_MANIFEST_OBJ1="\"$(SXS_MANIFEST_OBJ1:\=/)\"" $(RCOPTIONS)
  672. INCPATHRC=$(INCPATHRC)
  673. RC_FORCE_INCLUDE_STRING=$(RC_FORCE_INCLUDE_STRING)^
  674. ^#include "windows.h"^
  675. ^/* RT_MANIFEST is in winuser.h and winuser.rh */^
  676. $(SXS_MANIFEST_RESOURCE_ID) RT_MANIFEST SXS_MANIFEST_OBJ1
  677. #RC_FORCE_INCLUDE_FILES=$(RC_FORCE_INCLUDE_FILES);$(BASE_INC_PATH)\SxsManifestInResource.rc2
  678. #RC_FORCE_INCLUDE_STRING=
  679. !endif # SXS_MANIFEST_IN_RESOURCES
  680. !if defined(SXS_LOG_PASS) # {
  681. #
  682. # data for PostBuild/ManifestMangler
  683. #
  684. !if $(SXS_MANAGED)
  685. SXS_BINPLACE_LOG=$(BINPLACE_LOG)-managed-sxs
  686. !else
  687. SXS_BINPLACE_LOG=$(BINPLACE_LOG)-sxs
  688. !endif
  689. !if !defined(APPEND_CMD)
  690. APPEND_CMD=$(APPEND_TOOL) -file $(SXS_BINPLACE_LOG) -
  691. !endif
  692. SXS_LOG_CMD= ( $(SXS_LOG_CMD) ) & \
  693. ( echo \
  694. SXS_ASSEMBLY_NAME="$(SXS_ASSEMBLY_NAME)" \
  695. SXS_ASSEMBLY_VERSION="$(SXS_ASSEMBLY_VERSION)" \
  696. SXS_ASSEMBLY_LANGUAGE="$(SXS_ASSEMBLY_LANGUAGE)" \
  697. SXS_MANIFEST="$(SXS_LOG_BINPLACE_WOW6432_PREFIX)$(SXS_BINPLACE_DIR3)\$(SXS_MANIFEST_BIN_FILENAME)" \
  698. | $(APPEND_CMD) )
  699. #
  700. # Produce manifest-related, including
  701. # Required: catalog,
  702. # Optional: merge module
  703. #
  704. !if !defined(SXS_NO_BINPLACE) # {
  705. !if 1 #{ begin create log-file-entry for Assembly Catalog
  706. !if !defined(SXS_FUSIONLIST_TXT_DATA_VALIDLANGS)
  707. SXS_FUSIONLIST_TXT_DATA_VALIDLANGS=all
  708. !endif
  709. !if !defined(SXS_FUSIONLIST_TXT_DATA_LANGEXCEPTIONS)
  710. SXS_FUSIONLIST_TXT_DATA_LANGEXCEPTIONS=-
  711. !endif
  712. !if !defined(SXS_FUSIONLIST_TXT_DATA_VALIDARCHS)
  713. SXS_FUSIONLIST_TXT_DATA_VALIDARCHS=all
  714. !endif
  715. !if !defined(SXS_FUSIONLIST_TXT_DATA_VALIDDEBUG)
  716. SXS_FUSIONLIST_TXT_DATA_VALIDDEBUG=all
  717. !endif
  718. #
  719. # Filename ValidLangs Exceptions ValidArchs ValidDebug AltName
  720. #
  721. !if !defined(SXS_FUSIONLIST_TXT_DATA) #{
  722. SXS_FUSIONLIST_TXT_DATA=\
  723. $(SXS_BINPLACE_DIR3)\$(SXS_MANIFEST_BASENAME).cat \
  724. $(SXS_FUSIONLIST_TXT_DATA_VALIDLANGS) \
  725. $(SXS_FUSIONLIST_TXT_DATA_LANGEXCEPTIONS) \
  726. $(SXS_FUSIONLIST_TXT_DATA_VALIDARCHS) \
  727. $(SXS_FUSIONLIST_TXT_DATA_VALIDDEBUG)
  728. !endif #}
  729. !if !defined(SXS_FUSIONLIST_TXT_DATA_WOW) #{
  730. SXS_FUSIONLIST_TXT_DATA_WOW=\
  731. $(SXS_BINPLACE_DIR1)\x86\$(SXS_BINPLACE_DIR2)\$(SXS_MANIFEST_BASENAME).cat \
  732. $(SXS_FUSIONLIST_TXT_DATA_VALIDLANGS) \
  733. $(SXS_FUSIONLIST_TXT_DATA_LANGEXCEPTIONS) \
  734. ia64 \
  735. $(SXS_FUSIONLIST_TXT_DATA_VALIDDEBUG)
  736. !endif #}
  737. !endif #} end create log-file-entry for Assembly Catalog
  738. !if defined(SXS_GENERATE_MERGE_MODULE) # { begin create log-file-entry for Assembly MergeModule
  739. #
  740. # the msm-log lsitfile is in the format of
  741. # SourceFileDirectory | Destination-MSM-Filename | MergeModuleID | MergeModuleComponent ID
  742. #
  743. !if !defined(SXS_MERGE_MODULE_TXT_DATA) #{
  744. SXS_MERGE_MODULE_TXT_DATA=\
  745. $(SXS_MERGE_MODULE_FOR_ASSEMBLY_GROUP),\
  746. $(SXS_MERGE_MODULE_GUID),\
  747. ..\$(SXS_MERGE_MODULE_LOCATION)\$(SXS_MERGE_MODULE),\
  748. ..\$(SXS_BINPLACE_DIR3)\$(SXS_MANIFEST_BASENAME).man,\
  749. $(SXS_MERGE_MODULE_COMPONENT_GUID)
  750. !endif # }
  751. !endif # } end create log-file-entry for Assembly MergeModule
  752. !endif # SXS_NO_BINPLACE }
  753. !endif # SXS_LOG_PASS }
  754. !endif # SXS_MANIFEST }
  755. !if !$(SXS_MANAGED) && defined(SXS_LOG_PASS) && (defined(SXS_FUSIONLIST_TXT_DATA) || defined(SXS_FUSIONLIST_TXT_DATA_WOW)) # {
  756. # $(COMPUTERNAME) for unique per build machine names in a distributed build environment.
  757. # These files are combined in postbuild.
  758. SXS_NEWPRS_FUSIONLIST_TXT=$(BINPLACE_LOG)\..\fusionlist_$(COMPUTERNAME).txt
  759. !if defined(SXS_FUSIONLIST_TXT_DATA)
  760. SXS_LOG_CMD=( $(SXS_LOG_CMD) ) & ( echo $(SXS_FUSIONLIST_TXT_DATA) | $(APPEND_TOOL) -file $(SXS_NEWPRS_FUSIONLIST_TXT) - )
  761. !endif
  762. !if defined(SXS_FUSIONLIST_TXT_DATA_WOW)
  763. SXS_LOG_CMD=( $(SXS_LOG_CMD) ) & ( echo $(SXS_FUSIONLIST_TXT_DATA_WOW) | $(APPEND_TOOL) -file $(SXS_NEWPRS_FUSIONLIST_TXT) - )
  764. !endif
  765. !endif # }
  766. !if !$(SXS_MANAGED) && defined(SXS_LOG_PASS) && defined(SXS_MERGE_MODULE_TXT_DATA) # {
  767. SXS_MERGEMODULE_LIST_TXT=$(BINPLACE_LOG)\..\sxsMsmList_$(COMPUTERNAME).txt
  768. !if defined(SXS_MERGE_MODULE_TXT_DATA)
  769. SXS_LOG_CMD=( $(SXS_LOG_CMD) ) & ( echo $(SXS_MERGE_MODULE_TXT_DATA) | $(APPEND_TOOL) -file $(SXS_MERGEMODULE_LIST_TXT) - )
  770. !endif
  771. !endif # }
  772. #
  773. # Do this independently of the presence of any other SXS options
  774. # to aid .manifest preprocessing in the absense of any other sxs build support,
  775. # like for users of CreateActCtx. The MultiRes test case uses this.
  776. #
  777. !if !$(SXS_MANAGED) && !defined(SXS_PROCESSOR_ARCHITECTURE)
  778. !if defined(SXS_WOW6432)
  779. SXS_PROCESSOR_ARCHITECTURE=wow64
  780. !elseif defined(_BUILDARCH)
  781. SXS_PROCESSOR_ARCHITECTURE=$(_BUILDARCH)
  782. !elseif $(386)
  783. SXS_PROCESSOR_ARCHITECTURE=x86
  784. !elseif $(IA64)
  785. SXS_PROCESSOR_ARCHITECTURE=ia64
  786. !else
  787. !message $(SXS_BUILD_ERROR_MSG) Cannot determine processorArchitecture.
  788. !endif
  789. !endif
  790. # makefile.def debugging support
  791. !if defined(BUILD_DEBUG)
  792. TYPE=rem
  793. NOECHO=
  794. !else
  795. TYPE=@type
  796. NOECHO=@
  797. !endif
  798. !if defined(LOCALIZED_RESOURCES) && !defined(RCCODEPAGE)
  799. ! if "$(LANGUAGE)" == "JPN" || "$(LANGUAGE)" == "jpn"
  800. RCCODEPAGE=932
  801. ! elseif "$(LANGUAGE)" == "KOR" || "$(LANGUAGE)" == "kor"
  802. RCCODEPAGE=949
  803. ! elseif "$(LANGUAGE)" == "CHS" || "$(LANGUAGE)" == "chs"
  804. RCCODEPAGE=936
  805. ! elseif "$(LANGUAGE)" == "CHP" || "$(LANGUAGE)" == "chp"
  806. RCCODEPAGE=936
  807. ! elseif "$(LANGUAGE)" == "CHT" || "$(LANGUAGE)" == "cht"
  808. RCCODEPAGE=950
  809. ! endif
  810. !endif
  811. #
  812. # Set far east specific defines based on the project
  813. #
  814. DO_FE_SB=0
  815. !if "$(ALT_PROJECT_TARGET)" == ""
  816. ALT_PROJECT_TARGET=.
  817. !endif
  818. !if "$(ALT_PROJECT)" == "FE" || \
  819. "$(ALT_PROJECT)" == "CHT" || \
  820. "$(ALT_PROJECT)" == "CHS" || \
  821. "$(ALT_PROJECT)" == "CHP" || \
  822. "$(ALT_PROJECT)" == "JPN" || \
  823. "$(ALT_PROJECT)" == "KOR" || \
  824. "$(ALT_PROJECT)" == "NEC_98"
  825. C_DEFINES=$(C_DEFINES) -DDBCS -DKKBUGFIX
  826. ASM_DEFINES=$(ASM_DEFINES) -DDBCS -DKKBUGFIX
  827. DO_FE_SB=1
  828. !endif
  829. !if "$(ALT_PROJECT)" == "CHT"
  830. C_DEFINES=$(C_DEFINES) -DTAIWAN
  831. ASM_DEFINES=$(ASM_DEFINES) -DTAIWAN
  832. !elseif "$(ALT_PROJECT)" == "CHS" || "$(ALT_PROJECT)" == "CHP"
  833. C_DEFINES=$(C_DEFINES) -DPRC
  834. ASM_DEFINES=$(ASM_DEFINES) -DPRC
  835. !elseif "$(ALT_PROJECT)" == "JPN"
  836. C_DEFINES=$(C_DEFINES) -DJAPAN
  837. ASM_DEFINES=$(ASM_DEFINES) -DJAPAN
  838. !elseif "$(ALT_PROJECT)" == "KOR"
  839. C_DEFINES=$(C_DEFINES) -DKOREA
  840. ASM_DEFINES=$(ASM_DEFINES) -DKOREA
  841. !elseif "$(ALT_PROJECT)" == "NEC_98"
  842. C_DEFINES=$(C_DEFINES) -DJAPAN -DNEC_98
  843. ASM_DEFINES=$(ASM_DEFINES) -DJAPAN -DNEC_98
  844. !elseif "$(ALT_PROJECT)" != ""
  845. C_DEFINES=$(C_DEFINES) -D_$(ALT_PROJECT)_
  846. !endif
  847. !IF "$(ALT_PROJECT)" == "HYDRA"
  848. ASM_DEFINES=$(ASM_DEFINES) -D_HYDRA_
  849. HYDRA=1
  850. !ENDIF
  851. !IF "$(ALT_PROJECT)" == "JANUS"
  852. ASM_DEFINES=$(ASM_DEFINES) -D_JANUS_
  853. C_DEFINES=$(C_DEFINES) -D_JANUS_
  854. JANUS=1
  855. !ENDIF
  856. !IF ("$(NO_W32_SB)" == "" && "$(W32_SB)" == "1")
  857. DO_FE_SB=1
  858. ! ENDIF
  859. !IF "$(DO_FE_SB)" == "1"
  860. C_DEFINES=$(C_DEFINES) -DFE_SB -DFE_IME
  861. ASM_DEFINES=$(ASM_DEFINES) -DFE_SB
  862. !ENDIF
  863. !IF "$(ALT_PROJECT)" == "DS"
  864. # Nothing, just -D_DS_ from above
  865. !ENDIF
  866. !ifdef RESOURCE_ONLY_DLL
  867. # Resource only DLL's have no exports, no entrypoint, no code, no data, no debug symbolic.
  868. LINKER_DBG_SECTION=-debug:NONE
  869. NO_DLL_EXPORTS=1
  870. !undef NTBBT
  871. !undef DLLENTRY
  872. !undef USE_MAPSYM
  873. !undef NOLINK
  874. NO_BROWSER_FILE=1
  875. LINK_NO_RELEASE=1
  876. MAKEDLL=1
  877. TARGETLIBS=
  878. LINKLIBS=
  879. USE_NOLIBS=1
  880. NO_NTDLL=1
  881. AFX_FORCE_STDAFX=
  882. AFX_FORCE_USRDLL=
  883. MFC_LIBS=
  884. !else
  885. LINKER_DBG_SECTION=-debug:FULL
  886. AFX_FORCE_STDAFX=/include:__afxForceSTDAFX
  887. AFX_FORCE_USRDLL=/include:__afxForceUSRDLL
  888. !endif
  889. !ifdef DEPRECATE_DDK_FUNCTIONS
  890. C_DEFINES=$(C_DEFINES) -DDEPRECATE_DDK_FUNCTIONS
  891. !endif
  892. !IFNDEF TARGETPATH
  893. ! ERROR Your .\sources. file must define the TARGETPATH= macro
  894. !ENDIF
  895. !if "$(TARGETPATH)" == "obj" || "$(TARGETPATH)" == "OBJ"
  896. TARGETPATH=$(_OBJ_DIR)
  897. !endif
  898. !if "$(TARGETPATHLIB)" == "obj" || "$(TARGETPATHLIB)" == "OBJ"
  899. TARGETPATHLIB=$(_OBJ_DIR)
  900. !endif
  901. !ifdef TARGETPATHLIB
  902. ! if ("$(TARGETTYPE)" == "DYNLINK") || ("$(TARGETTYPE)" == "EXPORT_DRIVER")
  903. ! if "$(MAKEDLL)" == ""
  904. # Pass 1 of a two pass build. Make sure TargetPath is the same as targetpathlib.
  905. NO_BROWSER_FILE=1
  906. TARGETPATH=$(TARGETPATHLIB)
  907. ! endif
  908. ! endif
  909. !else
  910. TARGETPATHLIB=$(TARGETPATH)
  911. !endif
  912. !IF ("$(TARGETPATH)" == "$(BASEDIR)\lib") || ("$(TARGETPATH)" == "$(BASEDIR)\LIB")
  913. ! ERROR Setting TARGETPATH= $(BASEDIR)\lib in .\sources is not valid - please use obj.
  914. !ENDIF
  915. !IFNDEF TARGETTYPE
  916. ! ERROR Your .\sources. file must define the TARGETTYPE= macro
  917. !ENDIF
  918. !IFNDEF TARGETNAME
  919. ! IF "$(TARGETTYPE)" != "NOTARGET"
  920. ! ERROR Your .\sources. file must define the TARGETNAME= macro
  921. ! ELSE
  922. TARGETNAME=
  923. ! ENDIF
  924. !ENDIF
  925. !IFNDEF SOURCES
  926. ! ERROR Your .\sources. file must define the SOURCES= macro
  927. !ENDIF
  928. !if ("$(BUILD_ALT_DIR)" != "" && "$(BUILD_ALT_DIR)" != "d")
  929. ! if ("$(UMAPPL:*=X)" != "$(UMAPPL)")
  930. ! error Can't use multiple UMAPPL with Alternate Directories (other than "d")
  931. ! elseif ("$(UMTEST:*=X)" != "$(UMTEST)")
  932. ! error Can't use multiple UMTEST with Alternate Directories (other than "d")
  933. ! endif
  934. !endif
  935. !ifndef COFFBASE_TXT_FILE
  936. COFFBASE_TXT_FILE = $(NTMAKEENV)\coffbase.txt
  937. !endif
  938. !IFNDEF UMBASE
  939. ! IFDEF COFFBASE
  940. UMBASE=@$(COFFBASE_TXT_FILE),$(COFFBASE)
  941. ! ELSE
  942. ! if $(WIN64)
  943. # wait for wow64/CreateProcess support
  944. #UMBASE=@$(COFFBASE_TXT_FILE),usermode64
  945. UMBASE=@$(COFFBASE_TXT_FILE),usermode
  946. ! else
  947. UMBASE=@$(COFFBASE_TXT_FILE),usermode
  948. ! endif
  949. ! ENDIF
  950. !ENDIF
  951. LINKLIBS=$(LINKLIBS) $(PERFLIBS)
  952. !if !defined(ATL_VER) || ("$(ATL_VER)" == "10")
  953. ATL_VER=21
  954. !endif
  955. !if defined(USE_ATL)
  956. !ifdef ATL_INC_PATH
  957. ATL_INCLUDES=$(ATL_INC_PATH)\atl$(ATL_VER)
  958. !else
  959. ATL_INCLUDES=$(SDK_INC_PATH)\atl$(ATL_VER)
  960. !endif
  961. ATL_DEFINES=/D_ATL_DLL
  962. ! if "$(ATL_VER)" == "10"
  963. ATL_LIBS=
  964. ! else
  965. ATL_LIBS=$(SDK_LIB_PATH)\atl.lib $(ADDITIONAL_ATL_LIBS)
  966. ! endif
  967. !elseif defined(USE_STATIC_ATL)
  968. !ifdef ATL_INC_PATH
  969. ATL_INCLUDES=$(ATL_INC_PATH)\atl$(ATL_VER)
  970. !else
  971. ATL_INCLUDES=$(SDK_INC_PATH)\atl$(ATL_VER)
  972. !endif
  973. ATL_LIBS=$(ADDITIONAL_ATL_LIBS)
  974. ATL_DEFINES=/D_ATL_STATIC_REGISTRY
  975. !endif
  976. !if !defined(WTL_VER)
  977. WTL_VER=10
  978. !endif
  979. !if defined(USE_WTL)
  980. !ifdef WTL_INC_PATH
  981. WTL_INCLUDES=$(WTL_INC_PATH)\wtl$(WTL_VER)
  982. !else
  983. WTL_INCLUDES=$(SDK_INC_PATH)\wtl$(WTL_VER)
  984. !endif
  985. !endif
  986. !IF DEFINED(USE_MFC) || DEFINED(USE_MFCUNICODE)
  987. !if "$(PLATFORM_MFC_VER)" != "0x0600"
  988. # MFC versions before 6.0 need NT4/Win95 values. Override at your own risk.
  989. !ifndef WIN32_WINNT_VERSION
  990. WIN32_WINNT_VERSION=0x0400
  991. !endif
  992. !ifndef WIN32_IE_VERSION
  993. WIN32_IE_VERSION=0x0300
  994. !endif
  995. !else # MFC post 6x defaults to the current version of IE/Win2k.
  996. !ifndef WIN32_WINNT_VERSION
  997. WIN32_WINNT_VERSION=$(LATEST_WIN32_WINNT_VERSION)
  998. !endif
  999. !ifndef WIN32_IE_VERSION
  1000. WIN32_IE_VERSION=$(LATEST_WIN32_IE_VERSION)
  1001. !endif
  1002. !endif
  1003. !ifndef WIN32_WIN95_VERSION
  1004. WIN32_WIN95_VERSION=0x0400
  1005. !endif
  1006. !ifndef WIN32_WCE_VERSION
  1007. WIN32_WCE_VERSION=0x0300
  1008. !endif
  1009. #---------------------------------------------------------#
  1010. # this set of defines establishes the "correct" build #
  1011. # environment for an app that needs to use MFC. the #
  1012. # app's sources file only needs to specify USE_MFC=1 #
  1013. # and this makefile will set the enviroment up correctly. #
  1014. #---------------------------------------------------------#
  1015. ! ifndef UMENTRY
  1016. ! ifdef USE_MFCUNICODE
  1017. UMENTRY=wwinmain
  1018. ! else
  1019. UMENTRY=winmain
  1020. ! endif
  1021. ! endif
  1022. ! if "$(TARGETTYPE)" == "DYNLINK" && !defined(RESOURCE_ONLY_DLL)
  1023. ! ifndef DLLENTRY
  1024. DLLENTRY=_DllMainCRTStartup
  1025. ! endif
  1026. ! endif
  1027. ! ifndef UMTYPE
  1028. UMTYPE=windows
  1029. ! endif
  1030. UMENTRYABS=
  1031. # Allow other MFC's.
  1032. # To do so, you need to:
  1033. # 1. Define MFC_INCLUDES to point to your MFC headers.
  1034. # 2. Define MFC_LIBS to point to your MFC libraries (specifically, the dll
  1035. # library)
  1036. # 3. Define USE_MSVCRT=1 if you don't want to link with the NT CRT DLL.
  1037. #
  1038. # Note:
  1039. # There is only one type of build (_AFXDLL or MFC in a DLL linking to the
  1040. # CRT in a dll).
  1041. # You should disable the alternate MFC's if compiling for RISC platforms.
  1042. # You need to handle specifying the correct libs for Check/Free and
  1043. # Ansi/Unicode.
  1044. ! if !defined(USE_MSVCRT) && !defined(USE_NOLIBS) && !defined(USE_MSVCRT40)
  1045. ! if defined(USE_STATIC_MFC)
  1046. USE_LIBCMT=1
  1047. ! else
  1048. USE_CRTDLL=1
  1049. ! endif
  1050. ! endif
  1051. # Add MFC_FLAGS in just in case there's old sources files that use it.
  1052. MFC_DEFINES=$(MFC_DEFINES) $(MFC_FLAGS) -D_AFX_NOFORCE_LIBS -D_MFC_VER=$(PLATFORM_MFC_VER)
  1053. ! ifdef DEBUG_CRTS
  1054. MFC_DEFINES=$(MFC_DEFINES) -D_AFX_ENABLE_INLINES
  1055. ! endif
  1056. ! IFDEF USE_MFCUNICODE
  1057. MFC_DEFINES=$(MFC_DEFINES) -DUNICODE -D_UNICODE
  1058. ! ENDIF
  1059. # Assume Latest MFC (4.0 for now)
  1060. ! ifndef USE_STATIC_MFC
  1061. MFC_DEFINES=$(MFC_DEFINES) -D_AFXDLL
  1062. LINKER_FLAGS = $(LINKER_FLAGS) $(AFX_FORCE_STDAFX)
  1063. ! endif
  1064. ! ifdef MFC_USRDLL
  1065. MFC_DEFINES=$(MFC_DEFINES) -D_USRDLL
  1066. LINKER_FLAGS = $(LINKER_FLAGS) $(AFX_FORCE_USRDLL)
  1067. ! endif
  1068. # MFC 4 uses Native EH only
  1069. !ifndef USE_NATIVE_EH
  1070. USE_NATIVE_EH=1
  1071. !endif
  1072. USE_RTTI=1
  1073. # UNICODE must use the UNICODE entrypoint
  1074. ! ifdef USE_MFCUNICODE
  1075. ! if "$(UMENTRY)" == "winmain"
  1076. UMENTRY = wwinmain
  1077. ! else if "$(UMENTRY)" == "main"
  1078. UMENTRY = wmain
  1079. ! endif
  1080. ! endif
  1081. ! ifndef MFC_VER
  1082. MFC_VER=42
  1083. ! else if "$(MFC_VER)" == "40" && !defined(USE_STATIC_MFC)
  1084. !undef USE_MSVCRT
  1085. !undef USE_CRTDLL
  1086. USE_MSVCRT40=1
  1087. ! endif
  1088. ! ifndef MFC_DAO_INC
  1089. MFC_DAO_INC=$(SDK_INC_PATH)\dao350
  1090. ! endif
  1091. ! ifndef MFC_INCLUDES
  1092. MFC_INCLUDES=$(SDK_INC_PATH)\mfc$(MFC_VER);$(MFC_DAO_INC)
  1093. ! ifdef MFC_LANGUAGE
  1094. MFC_INCLUDES=$(SDK_INC_PATH)\mfc$(MFC_VER)\l.$(MFC_LANGUAGE);$(MFC_INCLUDES)
  1095. ! endif
  1096. ! endif
  1097. ! ifndef MFC_LIBS
  1098. ! ifdef USE_STATIC_MFC
  1099. ! ifdef DEBUG_CRTS
  1100. ! ifdef USE_MFCUNICODE
  1101. MFC_STATIC_LIB =
  1102. MFC_LIBS=$(SDK_LIB_PATH)\uafxcwd.lib
  1103. ! else
  1104. MFC_STATIC_LIB =
  1105. MFC_LIBS=$(SDK_LIB_PATH)\nafxcwd.lib
  1106. ! endif
  1107. ! else
  1108. ! ifdef USE_MFCUNICODE
  1109. MFC_STATIC_LIB =
  1110. MFC_LIBS=$(SDK_LIB_PATH)\uafxcw.lib
  1111. ! else
  1112. MFC_STATIC_LIB =
  1113. MFC_LIBS=$(SDK_LIB_PATH)\nafxcw.lib
  1114. ! endif
  1115. ! endif
  1116. ! else # USE_STATIC_MFC
  1117. ! ifdef DEBUG_CRTS
  1118. ! ifdef USE_MFCUNICODE
  1119. MFC_STATIC_LIB = $(SDK_LIB_PATH)\mfcs$(MFC_VER)ud.lib
  1120. MFC_LIBS=$(SDK_LIB_PATH)\mfc$(MFC_VER)ud.lib \
  1121. $(SDK_LIB_PATH)\mfcd$(MFC_VER)ud.lib \
  1122. $(SDK_LIB_PATH)\mfcn$(MFC_VER)ud.lib \
  1123. $(SDK_LIB_PATH)\mfco$(MFC_VER)ud.lib
  1124. ! else
  1125. MFC_STATIC_LIB = $(SDK_LIB_PATH)\mfcs$(MFC_VER)d.lib
  1126. MFC_LIBS=$(SDK_LIB_PATH)\mfc$(MFC_VER)d.lib \
  1127. $(SDK_LIB_PATH)\mfcd$(MFC_VER)d.lib \
  1128. $(SDK_LIB_PATH)\mfcn$(MFC_VER)d.lib \
  1129. $(SDK_LIB_PATH)\mfco$(MFC_VER)d.lib
  1130. ! endif
  1131. ! else
  1132. ! ifdef USE_MFCUNICODE
  1133. MFC_STATIC_LIB = $(SDK_LIB_PATH)\mfcs$(MFC_VER)u.lib
  1134. MFC_LIBS=$(SDK_LIB_PATH)\mfc$(MFC_VER)u.lib
  1135. ! else
  1136. MFC_STATIC_LIB = $(SDK_LIB_PATH)\mfcs$(MFC_VER).lib
  1137. MFC_LIBS=$(SDK_LIB_PATH)\mfc$(MFC_VER).lib
  1138. ! endif
  1139. ! endif
  1140. MFC_LIBS=$(MFC_STATIC_LIB) $(MFC_LIBS)
  1141. ! endif # USE_STATIC_MFC
  1142. ! endif # MFC_LIBS
  1143. !endif # USE_MFC
  1144. !IFNDEF UMTYPE
  1145. !if "$(TARGETTYPE)" == "DYNLINK"
  1146. UMTYPE=console
  1147. !ifndef SUBSYSTEM_VERSION
  1148. SUBSYSTEM_VERSION=$(SUBSYSTEM_VERSION_CURRENT)
  1149. !endif
  1150. !else
  1151. UMTYPE=nt
  1152. !endif
  1153. !ENDIF
  1154. !ifdef USE_MFC30
  1155. LIBC_DEFINES=
  1156. !else
  1157. ! ifdef DEBUG_CRTS
  1158. DCRT=d
  1159. LIBC_DEFINES = -D_DEBUG
  1160. ! else
  1161. DCRT=
  1162. LIBC_DEFINES = -DNDEBUG
  1163. ! endif
  1164. !endif
  1165. # For all but X86, MSVCRT20==MSVCRT40==CRTDLL==MSVCRT
  1166. !if !$(386)
  1167. ! if defined(USE_MSVCRT20)
  1168. USE_MSVCRT=1
  1169. ! undef USE_MSVCRT20
  1170. ! elseif defined(USE_MSVCRT40)
  1171. USE_MSVCRT=1
  1172. ! undef USE_MSVCRT40
  1173. ! elseif defined(USE_CRTDLL)
  1174. USE_MSVCRT=1
  1175. ! undef USE_CRTDLL
  1176. ! endif
  1177. !endif
  1178. !if defined(USE_CRTDLL) || defined(USE_MSVCRT)
  1179. ! if !$(MPPC)
  1180. LIBC_LIB=$(CRT_LIB_PATH)\msvcrt$(DCRT).lib
  1181. ! if defined(USE_IOSTREAM)
  1182. LIBC_LIB=$(LIBC_LIB) $(CRT_LIB_PATH)\msvcirt$(DCRT).lib
  1183. ! endif
  1184. ! if defined(USE_STL)
  1185. LIBC_LIB=$(LIBC_LIB) $(CRT_LIB_PATH)\msvcprt$(DCRT).lib
  1186. ! endif
  1187. LIBC_DEFINES=$(LIBC_DEFINES) -D_DLL=1 -D_MT=1
  1188. ! endif
  1189. !elseif defined(USE_IERT)
  1190. ! ERROR USE_IERT is no longer supported. Switch to USE_LIBCMT or USE_MSVCRT.
  1191. !elseif defined(USE_LIBCMT)
  1192. LIBC_LIB=$(CRT_LIB_PATH)\libcmt$(DCRT).lib
  1193. ! if defined(USE_IOSTREAM)
  1194. LIBC_LIB=$(CRT_LIB_PATH)\libcimt$(DCRT).lib $(LIBC_LIB)
  1195. ! endif
  1196. ! if defined(USE_STL)
  1197. LIBC_LIB=$(CRT_LIB_PATH)\libcpmt$(DCRT).lib $(LIBC_LIB)
  1198. ! endif
  1199. LIBC_DEFINES=$(LIBC_DEFINES) -D_MT=1
  1200. !elseif defined(USE_LIBCNTPR)
  1201. LIBC_LIB=$(CRT_LIB_PATH)\libcntpr.lib
  1202. !elseif (defined(USE_NTDLL) || \
  1203. "$(TARGETTYPE)" == "DRIVER" || \
  1204. "$(TARGETTYPE)" == "EXPORT_DRIVER" || \
  1205. defined(USE_SYSDLL) )
  1206. LIBC_DEFINES=$(LIBC_DEFINES) -D_DLL=1
  1207. LIBC_LIB=
  1208. !elseif defined(USE_NOLIBS) || \
  1209. "$(TARGETTYPE)" == "HAL" || \
  1210. "$(TARGETTYPE)" == "GDI_DRIVER"
  1211. NO_NTDLL=1
  1212. LIBC_LIB=
  1213. !elseif defined(USE_MSVCRT20)
  1214. LIBC_LIB=$(CRT_LIB_PATH)\msvcrt2$(DCRT).lib
  1215. LIBC_DEFINES=$(LIBC_DEFINES) -D_DLL=1 -D_MT=1
  1216. !elseif defined(USE_MSVCRT40)
  1217. LIBC_LIB=$(CRT_LIB_PATH)\msvcrt4$(DCRT).lib
  1218. LIBC_DEFINES=$(LIBC_DEFINES) -D_DLL=1 -D_MT=1
  1219. !else
  1220. LIBC_LIB=$(CRT_LIB_PATH)\libc$(DCRT).lib
  1221. ! if defined(USE_IOSTREAM)
  1222. LIBC_LIB=$(CRT_LIB_PATH)\libci$(DCRT).lib $(LIBC_LIB)
  1223. ! endif
  1224. ! if defined(USE_STL)
  1225. LIBC_LIB=$(CRT_LIB_PATH)\libcp$(DCRT).lib $(LIBC_LIB)
  1226. ! endif
  1227. !endif
  1228. !if defined(USE_VCCOM)
  1229. LIBC_LIB = $(SDK_LIB_PATH)\vccomsup.lib $(LIBC_LIB)
  1230. !endif
  1231. !IFNDEF GPSIZE
  1232. GPSIZE= 0
  1233. !ENDIF
  1234. !ifdef NTLIBPATH
  1235. LIBRARY_PATH = $(NTLIBPATH)\*\lib
  1236. !else
  1237. LIBRARY_PATH = $(SDK_LIB_PATH)
  1238. !endif
  1239. !if defined(USE_MFC) || defined(USE_MFCUNICODE)
  1240. LIBC_LIB = $(MFC_LIBS) $(LIBC_LIB)
  1241. !endif
  1242. !if defined(USE_ATL) || defined(USE_STATIC_ATL)
  1243. LIBC_LIB = $(LIBC_LIB) $(ATL_LIBS)
  1244. # Piggy back on MFC_DEFINES for now.
  1245. MFC_DEFINES = $(MFC_DEFINES) $(ATL_DEFINES)
  1246. !endif
  1247. !if $(386) && defined(USE_MSLU)
  1248. # MSLU goes after MFC/ATL/CRT but before everything else
  1249. LIBC_LIB = $(LIBC_LIB) $(SDK_LIB_PATH)\unicows.lib
  1250. !endif
  1251. NT_LIBS=$(LIBRARY_PATH)\ntdll.lib
  1252. GUI32_LIBS=$(LIBRARY_PATH)\gdi32.lib \
  1253. $(LIBRARY_PATH)\user32.lib
  1254. NT_CRT=$(LIBRARY_PATH)\nt.lib
  1255. WIN32_LIBS=$(LIBC_LIB) \
  1256. $(LIBRARY_PATH)\advapi32.lib \
  1257. $(LIBRARY_PATH)\kernel32.lib
  1258. NTSS_LIBS=$(NT_LIBS) $(NT_CRT) $(BASE_LIB_PATH)\smdll.lib
  1259. OS2_LIBS=$(NT_LIBS) $(SDK_LIB_PATH)\os2dll.lib
  1260. !if "$(DRIVERTYPE)" == "wdm" || "$(DRIVERTYPE)" == "WDM"
  1261. # Building a WDM driver. Default the subsystem version to the DDK version # (currently 1.0)
  1262. ! ifndef SUBSYSTEM_VERSION
  1263. SUBSYSTEM_VERSION=1.10
  1264. ! endif
  1265. !endif
  1266. !ifndef SUBSYSTEM_VERSION
  1267. ! ifndef EXPECTED_WINVER
  1268. SUBSYSTEM_WINVER = ,4.00
  1269. ! else
  1270. SUBSYSTEM_WINVER = ,$(EXPECTED_WINVER)
  1271. ! endif
  1272. SUBSYSTEM_CONVER = ,4.00
  1273. SUBSYSTEM_OS2VER =
  1274. SUBSYSTEM_NATVER =,$(SUBSYSTEM_VERSION_LATEST)
  1275. !else
  1276. SUBSYSTEM_WINVER = ,$(SUBSYSTEM_VERSION)
  1277. SUBSYSTEM_CONVER = ,$(SUBSYSTEM_VERSION)
  1278. SUBSYSTEM_OS2VER = ,$(SUBSYSTEM_VERSION)
  1279. SUBSYSTEM_NATVER = ,$(SUBSYSTEM_VERSION)
  1280. # Set the appropriate default WIN32_xxxxx values
  1281. ! if "$(SUBSYSTEM_VERSION)" == "4.00"
  1282. ! ifndef WIN32_WINNT_VERSION
  1283. WIN32_WINNT_VERSION=0x0400
  1284. ! endif
  1285. ! ifndef WIN32_WIN95_VERSION
  1286. WIN32_WIN95_VERSION=0x0400
  1287. ! endif
  1288. ! ifndef WIN32_WCE_VERSION
  1289. WIN32_WCE_VERSION=0x0400
  1290. ! endif
  1291. ! ifndef WIN32_IE_VERSION
  1292. WIN32_IE_VERSION=0x0300
  1293. ! endif
  1294. ! elseif "$(SUBSYSTEM_VERSION)" == "3.51"
  1295. ! ifndef WIN32_WINNT_VERSION
  1296. WIN32_WINNT_VERSION=0x0351
  1297. ! endif
  1298. ! ifndef WIN32_WIN95_VERSION
  1299. WIN32_WIN95_VERSION=0x0300
  1300. ! endif
  1301. ! ifndef WIN32_WCE_VERSION
  1302. WIN32_WCE_VERSION=0x0300
  1303. ! endif
  1304. ! ifndef WIN32_IE_VERSION
  1305. WIN32_IE_VERSION=0x0200
  1306. ! endif
  1307. ! ifndef WINVER_VERSION
  1308. WINVER_VERSION=0x0400 # Special case - WINVER was 4.00 for NT 3.51
  1309. ! endif
  1310. ! elseif "$(SUBSYSTEM_VERSION)" == "3.50"
  1311. ! ifndef WIN32_WINNT_VERSION
  1312. WIN32_WINNT_VERSION=0x0350
  1313. ! endif
  1314. ! ifndef WIN32_WIN95_VERSION
  1315. WIN32_WIN95_VERSION=0x0300
  1316. ! endif
  1317. ! ifndef WIN32_WCE_VERSION
  1318. WIN32_WCE_VERSION=0x0300
  1319. ! endif
  1320. ! ifndef WIN32_IE_VERSION
  1321. WIN32_IE_VERSION=0x0100
  1322. ! endif
  1323. ! ifndef WINVER_VERSION
  1324. WINVER_VERSION=0x0400 # Special case - WINVER was 4.00 for NT 3.50
  1325. ! endif
  1326. ! endif
  1327. !endif
  1328. CRT_INCLUDES=$(CRT_INC_PATH)
  1329. !ifdef USE_IOSTREAM
  1330. CRT_INCLUDES=$(CRT_INCLUDES);$(IOSTREAMS_INC_PATH)
  1331. !endif
  1332. !ifdef USE_STL
  1333. CRT_INCLUDES=$(CRT_INCLUDES);$(STL6_INC_PATH)
  1334. !endif
  1335. !IF "$(UMTYPE)" == "nt"
  1336. SUBSYSTEM=native$(SUBSYSTEM_NATVER)
  1337. UMINCL=$(CRT_INCLUDES)
  1338. STD_CALL_ENTRY=1
  1339. UMENTRY=-entry:NtProcessStartup
  1340. UMLIBS=$(UMLIBS) $(NT_LIBS) $(NT_CRT)
  1341. NOT_TERMINAL_SERVER_AWARE=1
  1342. !ELSEIF "$(UMTYPE)" == "windows"
  1343. SUBSYSTEM=windows$(SUBSYSTEM_WINVER)
  1344. UMINCL=$(CRT_INCLUDES)
  1345. ! IF "$(UMENTRY)" == "winmain"
  1346. UMENTRY=-entry:WinMainCRTStartup
  1347. ! ELSEIF "$(UMENTRY)" == "wwinmain"
  1348. UMENTRY=-entry:wWinMainCRTStartup
  1349. ! ELSEIF "$(UMENTRY)" == "wmain"
  1350. UMENTRY=-entry:wmainCRTStartup
  1351. ! ELSEIF "$(UMENTRYABS)" == ""
  1352. UMENTRY=-entry:mainCRTStartup
  1353. ! ELSE
  1354. UMENTRY=-entry:$(UMENTRYABS)
  1355. ! ENDIF
  1356. UMLIBS=$(UMLIBS) $(WIN32_LIBS) $(GUI32_LIBS)
  1357. !ELSEIF "$(UMTYPE)" == "console"
  1358. SUBSYSTEM=console$(SUBSYSTEM_CONVER)
  1359. UMINCL=$(CRT_INCLUDES)
  1360. ! IF "$(UMENTRY)" == "winmain"
  1361. UMENTRY=-entry:WinMainCRTStartup
  1362. ! ELSEIF "$(UMENTRY)" == "wwinmain"
  1363. UMENTRY=-entry:wWinMainCRTStartup
  1364. ! ELSEIF "$(UMENTRY)" == "wmain"
  1365. UMENTRY=-entry:wmainCRTStartup
  1366. ! ELSEIF "$(UMENTRYABS)" == ""
  1367. UMENTRY=-entry:mainCRTStartup
  1368. ! ELSE
  1369. UMENTRY=-entry:$(UMENTRYABS)
  1370. ! ENDIF
  1371. !IF !$(MPPC)
  1372. UMLIBS=$(UMLIBS) $(WIN32_LIBS)
  1373. !ENDIF
  1374. !ELSEIF "$(UMTYPE)" == "ntss"
  1375. SUBSYSTEM=native$(SUBSYSTEM_NATVER)
  1376. UMINCL=$(CRT_INCLUDES)
  1377. STD_CALL_ENTRY=1
  1378. UMENTRY=-entry:NtProcessStartup
  1379. NOT_TERMINAL_SERVER_AWARE=1
  1380. !IF !$(MPPC)
  1381. UMLIBS=$(UMLIBS) $(NTSS_LIBS)
  1382. !ENDIF
  1383. !ELSEIF "$(UMTYPE)" == "os2"
  1384. SUBSYSTEM=os2$(SUBSYSTEM_OS2VER)
  1385. UMINCL=$(SDK_INC_PATH)\os2;$(CRT_INCLUDES)
  1386. STD_CALL_ENTRY=1
  1387. UMENTRY=-entry:NtProcessStartup
  1388. NOT_TERMINAL_SERVER_AWARE=1
  1389. UMLIBS=$(UMLIBS) $(OS2_LIBS)
  1390. !ELSE
  1391. ! ERROR Invalid UMTYPE value - $(UMTYPE)
  1392. !ENDIF # UMTYPE tests
  1393. #
  1394. # If you edit this line you need to modify $(BASEDIR)\sdktools\build\build.c
  1395. #
  1396. NTINCLUDES=$(OAK_INC_PATH);$(SDK_INC_PATH)
  1397. #
  1398. # Let drivers include files such as ntddk.h.
  1399. # WDM drivers\libs can only include wdm.h type of files though ...
  1400. # DDK_INC_PATH must be first for precedence.
  1401. #
  1402. !IF "$(DRIVERTYPE)" == "wdm" || "$(DRIVERTYPE)" == "WDM"
  1403. NTINCLUDES=$(NTINCLUDES);$(WDM_INC_PATH)
  1404. !ELSEIF "$(DRIVERTYPE)" == "fs" || "$(DRIVERTYPE)" == "FS"
  1405. NTINCLUDES=$(NTINCLUDES);$(DDK_INC_PATH);$(IFSKIT_INC_PATH)
  1406. !ELSEIF "$(TARGETTYPE)" == "DRIVER" || \
  1407. "$(TARGETTYPE)" == "EXPORT_DRIVER" || \
  1408. "$(TARGETTYPE)" == "MINIPORT" || \
  1409. "$(TARGETTYPE)" == "DRIVER_LIBRARY"
  1410. NTINCLUDES=$(NTINCLUDES);$(DDK_INC_PATH);$(WDM_INC_PATH)
  1411. !ENDIF
  1412. !IFNDEF CBSTRING
  1413. ! IF "$(MAJORCOMP)" == "ntos" || \
  1414. "$(MAJORCOMP)" == "NTOS" || \
  1415. "$(TARGETTYPE)" == "DRIVER" || \
  1416. "$(TARGETTYPE)" == "DRIVER_LIBRARY" || \
  1417. "$(TARGETTYPE)" == "GDI_DRIVER" || \
  1418. "$(TARGETTYPE)" == "HAL" || \
  1419. "$(TARGETTYPE)" == "EXPORT_DRIVER" || \
  1420. "$(TARGETTYPE)" == "MINIPORT"
  1421. ! IF "$(DRIVERTYPE)" != "VXD"
  1422. CBSTRING= -cbstring
  1423. ! ENDIF
  1424. ! ELSE
  1425. CBSTRING=
  1426. ! ENDIF
  1427. !ENDIF
  1428. !if "$(TARGETTYPE)" == "DRIVER_LIBRARY"
  1429. TARGETTYPE=LIBRARY
  1430. !endif
  1431. #
  1432. # Add PROJECT_INC_PATH to NTINCLUDES, if NO_PRIVATE_INC is not set
  1433. #
  1434. !IFDEF PROJECT_INC_PATH
  1435. ! IFNDEF NO_PRIVATE_INC
  1436. NTINCLUDES=$(PROJECT_ROOT)\inc;$(PROJECT_ROOT)\inc\$(O);$(PROJECT_INC_PATH);$(NTINCLUDES)
  1437. ! ENDIF
  1438. !ENDIF
  1439. NTINCLUDES=$(O);$(NTINCLUDES)
  1440. !IFDEF INCLUDES_FROM
  1441. ! IF [process-includes-from $(INCLUDES_FROM) >__makefile.def.tmp]
  1442. ! ENDIF
  1443. ! INCLUDE __makefile.def.tmp
  1444. ! IF [del __makefile.def.tmp >nul 2>nul]
  1445. ! ENDIF
  1446. !ENDIF
  1447. !IFDEF LIBS_FROM
  1448. ! IF [process-libs-from $(LIBS_FROM) >__makefile.def.tmp]
  1449. ! ENDIF
  1450. ! INCLUDE __makefile.def.tmp
  1451. ! IF [del __makefile.def.tmp >nul 2>nul]
  1452. ! ENDIF
  1453. !ENDIF
  1454. !if "$(POCKETPC)" == ""
  1455. !IFNDEF COMPILER_WARNINGS
  1456. COMPILER_WARNINGS=-FI$(SDK_INC_PATH)\warning.h $(PROJECT_COMPILER_WARNINGS)
  1457. !ifdef USE_LINT
  1458. LINT_FORCEDINCS=$(LINT_FORCEDINCS) -header($(SDK_INC_PATH)\warning.h)
  1459. !endif
  1460. !ENDIF
  1461. !endif
  1462. # If you change this to 600, fix MIDL_OPTIMIZATION default below.
  1463. !ifndef WIN32_WINNT_VERSION
  1464. WIN32_WINNT_VERSION=$(LATEST_WIN32_WINNT_VERSION)
  1465. !endif
  1466. !ifndef WIN32_WIN95_VERSION
  1467. WIN32_WIN95_VERSION=$(LATEST_WIN32_WIN95_VERSION)
  1468. !endif
  1469. !ifndef WIN32_WCE_VERSION
  1470. WIN32_WCE_VERSION=$(LATEST_WIN32_WCE_VERSION)
  1471. !endif
  1472. !ifndef WIN32_IE_VERSION
  1473. WIN32_IE_VERSION=$(LATEST_WIN32_IE_VERSION)
  1474. !endif
  1475. !ifndef WINVER_VERSION
  1476. !if defined(CHICAGO_PRODUCT)
  1477. WINVER_VERSION=$(WIN32_WIN95_VERSION)
  1478. !elseif defined(POCKETPC)
  1479. WINVER_VERSION=$(WIN32_WCE_VERSION)
  1480. !else
  1481. WINVER_VERSION=$(WIN32_WINNT_VERSION)
  1482. !endif
  1483. !endif
  1484. !ifdef UNDEF_WINVER
  1485. _WINVER_VERSION=/UWINVER
  1486. !else
  1487. _WINVER_VERSION=/DWINVER=$(WINVER_VERSION)
  1488. !endif
  1489. !IF defined(POCKETPC)
  1490. NO_NTDLL=1
  1491. ! IFNDEF WIN32_DEFINE
  1492. WIN32_DEFINE=-DWIN32=300 -D_WIN32_WCE=$(WIN32_WCE_VERSION) $(_WINVER_VERSION)
  1493. ! if "$(POCKETPC_EMULATION)" != ""
  1494. WIN32_DEFINE = $(WIN32_DEFINE) -D_WIN32_WCE_EMULATION
  1495. ! endif
  1496. ! ENDIF
  1497. !ELSEIF defined(CHICAGO_PRODUCT)
  1498. NO_NTDLL=1
  1499. ! IFNDEF WIN32_DEFINE
  1500. WIN32_DEFINE=-DWIN32=200 -D_CHICAGO_=200 -D_WIN32_WINDOWS=$(WIN32_WIN95_VERSION) $(_WINVER_VERSION)
  1501. ! ENDIF
  1502. !ELSEIF $(MPPC)
  1503. ! IFNDEF MAC_INCLUDES
  1504. MAC_INCLUDES=$(BASEDIR)\com\macdcom\dll\src\inc
  1505. MAC_INCLUDES=$(MAC_INCLUDES); $(SDK_INC_PATH)\mppc
  1506. MAC_INCLUDES=$(MAC_INCLUDES); $(SDK_INC_PATH)
  1507. MAC_INCLUDES=$(MAC_INCLUDES); $(SDK_INC_PATH)\mppc\macos
  1508. MAC_INCLUDES=$(MAC_INCLUDES); $(SDK_INC_PATH)\mppc\mrc
  1509. ! ENDIF
  1510. NTINCLUDES= $(MAC_INCLUDES);$(NTINCLUDES)
  1511. NO_NTDLL=1
  1512. WIN32_DEFINE=-DPOWERMAC=1
  1513. !ELSE
  1514. WIN32_DEFINE=-DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=$(WIN32_WINNT_VERSION) $(_WINVER_VERSION)
  1515. !ENDIF
  1516. WIN32_DEFINE = $(WIN32_DEFINE) -D_WIN32_IE=$(WIN32_IE_VERSION)
  1517. INCLUDES = $(INCLUDES: =)
  1518. NTINCLUDES = $(NTINCLUDES: =)
  1519. UMINCL = $(UMINCL: =)
  1520. MFC_INCLUDES = $(MFC_INCLUDES: =)
  1521. USER_INCLUDES =$(USER_INCLUDES: =)
  1522. ATL_INCLUDES = $(ATL_INCLUDES: =)
  1523. WTL_INCLUDES = $(WTL_INCLUDES: =)
  1524. # MFC, ATL, WTL, and USER first
  1525. INCPATH0=-I$(MFC_INCLUDES:;= -I) -I$(ATL_INCLUDES:;= -I) -I$(WTL_INCLUDES:;= -I) -I$(USER_INCLUDES:;= -I)
  1526. INCPATH1=-I$(MFC_INCLUDES:;= -I) -I$(ATL_INCLUDES:;= -I) -I$(WTL_INCLUDES:;= -I) -I$(USER_INCLUDES:;= -I)
  1527. # INCLUDES if set
  1528. !ifdef INCLUDES
  1529. INCPATH0 = $(INCPATH0) -I$(INCLUDES:;= -I)
  1530. INCPATH1 = $(INCPATH1) -I$(INCLUDES:;= -I)
  1531. !endif
  1532. # Finally NT and UM
  1533. INCPATH0=$(INCPATH0) -I$(NTINCLUDES:;= -I) -I$(UMINCL:;= -I)
  1534. INCPATH1=$(INCPATH1) -I$(NTINCLUDES:;= -I) -I$(UMINCL:;= -I)
  1535. # Remove empty "-I " settings (INCL/NTINCLUDES/UMINCL/MFC_INCLUDES macros may be empty above)
  1536. INCPATH0=$(INCPATH0:-I =)
  1537. INCPATH1=$(INCPATH1:-I =)
  1538. !ifdef USE_LINT
  1539. LINT_INCLUDES=-i$(TARGET_DIRECTORY)\ -i. $(LINT_PRECOMPPATH) $(INCPATH1:-I=-i)
  1540. !endif
  1541. !IFNDEF DLLENTRY
  1542. DLLENTRY=-noentry
  1543. !ELSE
  1544. ! if "$(DLLENTRY:-entry:=)" == "$(DLLENTRY)"
  1545. DLLENTRY=-entry:$(DLLENTRY)
  1546. ! endif
  1547. !ENDIF
  1548. !IF $(MPPC)
  1549. DLLENTRY=-noentry
  1550. !ENDIF
  1551. !IFNDEF DLLBASE
  1552. ! IFDEF COFFBASE
  1553. DLLBASE=@$(COFFBASE_TXT_FILE),$(COFFBASE)
  1554. ! ELSE
  1555. DLLBASE=@$(COFFBASE_TXT_FILE),$(TARGETNAME)
  1556. ! ENDIF
  1557. !ENDIF
  1558. !IFNDEF DLLDEF
  1559. DLLDEF=$(@B).def
  1560. !ENDIF
  1561. !IFNDEF BOOTBASE
  1562. ! IFDEF FRAZZLE
  1563. BOOTBASE=0xd0100000,0xd0104000
  1564. ! ELSE
  1565. BOOTBASE=0xd0ff0000,0xd0ff4000
  1566. ! ENDIF
  1567. !ENDIF
  1568. !IFNDEF DRIVERBASE
  1569. DRIVERBASE=0x10000
  1570. !ENDIF
  1571. !IFNDEF HALBASE
  1572. HALBASE=0x80010000
  1573. !ENDIF
  1574. !if "$(URTBASE)" != ""
  1575. # Allow 1.1 or 2.0 - default to 1.0 if nothing (or unknown).
  1576. !if "$(URT_VER)" == "1.1"
  1577. COMPLUS_VERSION=$(URT_VER_1_1)
  1578. !elseif "$(URT_VER)" == "2.0"
  1579. COMPLUS_VERSION=$(URT_VER_2_0)
  1580. !else
  1581. COMPLUS_VERSION=$(URT_VER_1_0)
  1582. !endif
  1583. URTTARGET=$(URTBASE)\urt\$(COMPLUS_VERSION)
  1584. PATH=$(PATH);$(URTTARGET)
  1585. # Do this even if we're not building managed code so dirs w/o MANAGED_xxx set can still use resgen/al/etc.
  1586. !if [set path=$(PATH)]
  1587. !endif
  1588. !endif
  1589. !if (defined(MANAGED_CODE) || defined(MANAGED_VB) || defined(MANAGED_CXX))
  1590. #
  1591. # If there's a different path for the managed compiler, use it.
  1592. #
  1593. ! if defined(MANAGED_TOOL_PATH)
  1594. PATH=$(MANAGED_TOOL_PATH);$(PATH)
  1595. ! endif
  1596. ! if [set path=$(PATH)]
  1597. ! endif
  1598. VC7_SYMBOLS=1
  1599. #
  1600. # The managed compilers emits comdat'd debug symbols that aren't related to anything else - if
  1601. # opt:ref is used, you can't effectively debug your code (yeah it's a lame bug).
  1602. #
  1603. LINKER_NOREF=1
  1604. !endif
  1605. !if (defined(MANAGED_CODE) || defined(MANAGED_VB))
  1606. #
  1607. # Figure out the target type if the user didn't specify.
  1608. #
  1609. ! if !defined(MANAGED_TARGET_TYPE)
  1610. ! if "$(TARGETTYPE)" == "PROGRAM"
  1611. ! if "$(UMTYPE)" != "console"
  1612. MANAGED_TARGET_TYPE=winexe
  1613. ! else
  1614. MANAGED_TARGET_TYPE=exe
  1615. ! endif
  1616. ! elseif "$(TARGETTYPE)" == "DYNLINK"
  1617. MANAGED_TARGET_TYPE=library
  1618. ! endif
  1619. ! endif
  1620. #
  1621. # tlbimp doesn't support /baseaddress - dummy up rebase_cmd so it can be called in makefile.inc
  1622. #
  1623. REBASE_CMD=rebase.exe -i $(COFFBASE_TXT_FILE) $@
  1624. #
  1625. # Generate a macro file to include for managed code base address
  1626. #
  1627. ! if !defined(GENBASEMAC_CMD)
  1628. GENBASEMAC_CMD=$(_NTBINDIR)\tools\genbasemac.pl
  1629. ! endif
  1630. ! if "$(GENBASEMAC_CMD)"!=""
  1631. ! if !exist($(GENBASEMAC_CMD))
  1632. ! message NMAKE : Uxxxx: unable to find $(GENBASEMAC_CMD)
  1633. ! endif
  1634. ! message BUILD: $(GENBASEMAC_CMD) $(O) $(TARGETNAME) $(COFFBASE_TXT_FILE)
  1635. ! IF ([-perl $(GENBASEMAC_CMD) $(O) $(TARGETNAME) $(COFFBASE_TXT_FILE)])
  1636. ! ENDIF
  1637. ! IF EXIST( $(O)\coffbase.mac )
  1638. ! INCLUDE $(O)\coffbase.mac
  1639. ! ELSE
  1640. MANAGED_COFFBASE=0x400000
  1641. ! ENDIF
  1642. ! endif
  1643. #
  1644. # Build up list of referenced modules for c# compiler
  1645. #
  1646. ! if "$(REFERENCES)" != ""
  1647. ! IF $(386)
  1648. REFERENCES=$(REFERENCES:*=I386)
  1649. ! ELSEIF $(IA64)
  1650. REFERENCES=$(REFERENCES:*=IA64)
  1651. ! elseif $(AMD64)
  1652. REFERENCES=$(REFERENCES:*=AMD64)
  1653. ! endif
  1654. REFERENCES=$(REFERENCES: =)
  1655. MANAGED_REFERENCES=/r:$(REFERENCES:;= /r:)
  1656. ! endif
  1657. #
  1658. # Define the standard switches
  1659. #
  1660. !if $(FREEBUILD)
  1661. MANAGED_DBG_FLAGS=/optimize+ /debug:pdbonly
  1662. !else
  1663. !if defined(MANAGED_VB)
  1664. MANAGED_DBG_FLAGS=/debug:full /define:DEBUG=1
  1665. !else
  1666. MANAGED_DBG_FLAGS=/debug:full /define:DEBUG
  1667. !endif
  1668. !endif
  1669. !if "$(MANAGED_RESOURCES)" != ""
  1670. MANAGED_RESOURCES=$(MANAGED_RESOURCES: =)
  1671. MANAGED_RESOURCES=/resource:$(MANAGED_RESOURCES:;= /resource:)
  1672. !endif
  1673. MANAGED_CODE_BUILD_TOOL= \
  1674. !if defined(MANAGED_VB)
  1675. $(VB_NET_COMPILER_NAME)
  1676. !else
  1677. $(CS_COMPILER_NAME)
  1678. !endif
  1679. MANAGED_CODE_DEFAULT_REFERENCES= \
  1680. /r:Accessibility.dll \
  1681. /r:Microsoft.Vsa.dll \
  1682. /r:System.Configuration.Install.dll \
  1683. /r:System.Data.dll \
  1684. /r:System.Design.dll \
  1685. /r:System.DirectoryServices.dll \
  1686. /r:System.dll \
  1687. /r:System.Drawing.Design.dll \
  1688. /r:System.Drawing.dll \
  1689. /r:System.EnterpriseServices.dll \
  1690. /r:System.Management.dll \
  1691. /r:System.Messaging.dll \
  1692. /r:System.Runtime.Remoting.dll \
  1693. /r:System.Runtime.Serialization.Formatters.Soap.dll \
  1694. /r:System.Security.dll \
  1695. /r:System.ServiceProcess.dll \
  1696. /r:System.Web.dll \
  1697. /r:System.Web.RegularExpressions.dll \
  1698. /r:System.Web.Services.dll \
  1699. /r:System.Windows.Forms.Dll \
  1700. /r:System.XML.dll
  1701. MANAGED_CODE_BUILD_SWITCHES= \
  1702. $(MANAGED_CODE_DEFAULT_REFERENCES) \
  1703. /target:$(MANAGED_TARGET_TYPE) \
  1704. /out:$(TARGET) \
  1705. /baseaddress:$(MANAGED_COFFBASE) \
  1706. $(MANAGED_STD_FLAGS) \
  1707. $(MANAGED_REFERENCES) \
  1708. $(MANAGED_RESOURCES)
  1709. MANAGED_CODE_BUILD_CMD = \
  1710. $(MANAGED_CODE_BUILD_TOOL) \
  1711. $(MANAGED_CODE_BUILD_SWITCHES) \
  1712. $(SOURCES)
  1713. REFERENCE_DIR=$(PROJECT_ROOT)\Reference\$(TARGET_DIRECTORY)
  1714. ! IF "$(SERVICEBASE)" == ""
  1715. SERVICEBASE=http://localhost
  1716. ! ENDIF
  1717. #
  1718. # Managed code always defined MAKEDLL (it's a single pass build after all).
  1719. #
  1720. MAKEDLL=1
  1721. !endif # MANAGED_CODE || MANAGED_VB
  1722. #
  1723. # Map lower case to upper case for variables that can be specified from the
  1724. # command line.
  1725. #
  1726. !IFDEF nttest
  1727. NTTEST=$(nttest)
  1728. !ENDIF
  1729. !IFDEF makedll
  1730. MAKEDLL=$(makedll)
  1731. !ENDIF
  1732. !IFDEF umtest
  1733. UMTEST=$(umtest)
  1734. !ENDIF
  1735. #
  1736. # Include the list of object files (defined as the OBJECTS macro) that was
  1737. # built by BUILD program, using the SOURCES= macro defined in the sources.
  1738. # file. Use macro substitution to build the supported target objects.
  1739. #
  1740. !if !exist($(_OBJ_DIR)\_objects.mac)
  1741. !if [-build -O]
  1742. !endif
  1743. !endif
  1744. !if "$(BINPLACE_LOG)" != ""
  1745. !if [-mkdir $(BINPLACE_LOG)\.. > nul 2>&1]
  1746. !endif
  1747. !endif
  1748. !INCLUDE $(_OBJ_DIR)\_objects.mac
  1749. !IF $(386)
  1750. OBJECTS=$(386_OBJECTS)
  1751. DLLLIBOBJECTS=$(DLLLIBOBJECTS) $(386_DLLLIBOBJECTS)
  1752. !ELSEIF $(MPPC)
  1753. OBJECTS=$(MPPC_OBJECTS)
  1754. DLLLIBOBJECTS=$(DLLLIBOBJECTS) $(MPPC_DLLLIBOBJECTS)
  1755. !ELSEIF $(IA64)
  1756. OBJECTS=$(IA64_OBJECTS)
  1757. DLLLIBOBJECTS=$(DLLLIBOBJECTS) $(IA64_DLLLIBOBJECTS)
  1758. !ELSEIF $(AMD64)
  1759. OBJECTS=$(AMD64_OBJECTS)
  1760. DLLLIBOBJECTS=$(DLLLIBOBJECTS) $(AMD64_DLLLIBOBJECTS)
  1761. !ELSEIF $(ARM)
  1762. OBJECTS=$(ARM_OBJECTS)
  1763. DLLLIBOBJECTS=$(DLLLIBOBJECTS) $(ARM_DLLLIBOBJECTS)
  1764. !ENDIF
  1765. !ifdef MAC_RESOURCE
  1766. MAC_RESOURCE_OBJECT=$(_OBJ_DIR)\$(TARGET_DIRECTORY)\$(MAC_RESOURCE:.r=.rsc)
  1767. OBJECTS=$(OBJECTS) $(MAC_RESOURCE_OBJECT)
  1768. !endif
  1769. #
  1770. # BUILD.EXE defines the NOLINK variable to disable the building of any
  1771. # test executables when it is recursing on a dirs. file to build components
  1772. # in subdirectories.
  1773. #
  1774. !IF "$(BUILDMSG)" != "Stop."
  1775. ! IFDEF NOLINK
  1776. ! UNDEF NTTEST
  1777. ! UNDEF MAKEDLL
  1778. ! ELSE
  1779. ! IFDEF nolink
  1780. ! UNDEF NTTEST
  1781. ! UNDEF MAKEDLL
  1782. ! ENDIF
  1783. ! ENDIF # DEF NOLINK
  1784. !ENDIF # BUILDMSG != "Stop."
  1785. !IF (!defined(MANAGED_CODE) && !defined(MANAGED_VB))
  1786. DYNLINK_LIB=$(TARGETPATHLIB)\$(TARGET_DIRECTORY)\$(TARGETNAME).lib
  1787. DYNLINK_LIBDIR=$(ALT_PROJECT_TARGET)\$(TARGET_DIRECTORY)\$(TARGETNAME).lib
  1788. !ENDIF
  1789. !IF "$(TARGETNAMEP)" != ""
  1790. DYNLINK_LIBP=$(TARGETPATHLIB)\$(TARGET_DIRECTORY)\$(TARGETNAMEP).lib
  1791. DYNLINK_LIBPDIR=$(ALT_PROJECT_TARGET)\$(TARGET_DIRECTORY)\$(TARGETNAMEP).lib
  1792. !ENDIF
  1793. !IF !$(MPPC)
  1794. DYNLINK_EXP=$(TARGETPATHLIB)\$(TARGET_DIRECTORY)\$(TARGETNAME).exp
  1795. !ENDIF
  1796. #
  1797. # Determine type of target link we are doing
  1798. #
  1799. !IF "$(TARGETTYPE)" == "PROGLIB"
  1800. ! IF "$(TARGETEXT)" == ""
  1801. TARGETEXT=exe
  1802. !endif
  1803. TARGETLIB=
  1804. !ELSEIF "$(TARGETTYPE)" == "PROGRAM"
  1805. ! IF "$(TARGETEXT)" == ""
  1806. TARGETEXT=exe
  1807. !endif
  1808. !ifdef USE_NTDLL
  1809. TARGETLIB=$(SDK_LIB_PATH)\ntdll.lib
  1810. !else
  1811. TARGETLIB=
  1812. !endif
  1813. !ELSEIF "$(TARGETTYPE)" == "DYNLINK"
  1814. ! IF "$(MAKEDLL)" != ""
  1815. ! IF "$(TARGETNAME)" == "ntdll"
  1816. TARGETLIB=
  1817. ! ELSEIF defined (USE_NTDLL) # USE_NTDLL never links with LIBC_LIB
  1818. TARGETLIB=$(WIN32DLL_LIBS) $(SDK_LIB_PATH)\ntdll.lib
  1819. ! ELSEIF defined (USE_SYSDLL) # USE_SYSDLL uses either kernel32 (Win95) or ntdll (NT) for CRT support
  1820. ! if defined(CHICAGO_PRODUCT)
  1821. TARGETLIB=$(WIN32DLL_LIBS) $(SDK_LIB_PATH)\kernel32.lib
  1822. ! else
  1823. TARGETLIB=$(WIN32DLL_LIBS) $(SDK_LIB_PATH)\ntdll.lib
  1824. ! endif
  1825. ! ELSEIF defined (NO_NTDLL) # NO_NTDLL never links with ntdll
  1826. TARGETLIB=$(WIN32DLL_LIBS) $(LIBC_LIB)
  1827. ! ELSE # Everything else uses ntdll after libc.
  1828. TARGETLIB=$(WIN32DLL_LIBS) $(LIBC_LIB) $(SDK_LIB_PATH)\ntdll.lib
  1829. ! ENDIF
  1830. ! IF "$(TARGETEXT)" == ""
  1831. TARGETEXT=dll
  1832. ! ENDIF
  1833. ! ELSE # "$(MAKEDLL)" != ""
  1834. TARGETEXT=lib
  1835. TARGETLIB=
  1836. ! ENDIF # "$(MAKEDLL)" != ""
  1837. !ELSEIF "$(TARGETTYPE)" == "LIBRARY"
  1838. TARGETEXT=lib
  1839. TARGETLIB=
  1840. !ELSEIF "$(TARGETTYPE)" == "DRIVER"
  1841. TARGETEXT=sys
  1842. !if "$(DRIVERTYPE)" == "wdm" || "$(DRIVERTYPE)" == "WDM"
  1843. TARGETLIB=$(DDK_LIB_PATH)\wdm.lib
  1844. !ELSEIF "$(DRIVERTYPE)" == "VXD"
  1845. TARGETEXT=vxd
  1846. !ELSE
  1847. TARGETLIB=$(DDK_LIB_PATH)\ntoskrnl.lib $(DDK_LIB_PATH)\hal.lib $(DDK_LIB_PATH)\wmilib.lib
  1848. !ENDIF
  1849. !ELSEIF "$(TARGETTYPE)" == "EXPORT_DRIVER"
  1850. ! IF "$(MAKEDLL)" != ""
  1851. TARGETEXT=sys
  1852. !if "$(DRIVERTYPE)" == "wdm" || "$(DRIVERTYPE)" == "WDM"
  1853. TARGETLIB=$(DDK_LIB_PATH)\wdm.lib
  1854. !ELSE
  1855. TARGETLIB=$(DDK_LIB_PATH)\ntoskrnl.lib $(DDK_LIB_PATH)\hal.lib $(DDK_LIB_PATH)\wmilib.lib
  1856. !ENDIF
  1857. ! ELSE
  1858. TARGETEXT=lib
  1859. TARGETLIB=
  1860. ! ENDIF
  1861. !ELSEIF "$(TARGETTYPE)" == "HAL"
  1862. ! IF "$(MAKEDLL)" != ""
  1863. TARGETEXT=dll
  1864. TARGETLIB=$(DDK_LIB_PATH)\ntoskrnl.lib
  1865. ! ELSE
  1866. TARGETEXT=lib
  1867. TARGETLIB=
  1868. ! ENDIF
  1869. !ELSEIF "$(TARGETTYPE)" == "MINIPORT"
  1870. TARGETEXT=sys
  1871. !ELSEIF "$(TARGETTYPE)" == "GDI_DRIVER"
  1872. TARGETEXT=dll
  1873. TARGETLIB=$(DDK_LIB_PATH)\win32k.lib
  1874. !ifdef USE_LIBCNTPR_FOR_GDI_DRIVER_CRTS
  1875. TARGETLIB=$(SDK_LIB_PATH)\libcntpr.lib $(TARGETLIB)
  1876. !endif
  1877. !ENDIF # TARGETTYPE
  1878. TARGET=
  1879. !ifdef NOLIB
  1880. !undef NTTARGETFILE1
  1881. !endif
  1882. !IF "$(TARGETTYPE)" != "UMAPPL_NOLIB" && !defined(NOLIB) && !defined(NOTARGET)
  1883. ! IF "$(OBJECTS)" != ""
  1884. TARGET=$(TARGETPATH)\*\$(TARGETNAME).$(TARGETEXT)
  1885. ! ELSEIF "$(OBJLIBFILES)" != "" && "$(TARGETTYPE)" == "LIBRARY"
  1886. TARGET=$(TARGETPATH)\*\$(TARGETNAME).$(TARGETEXT)
  1887. ! ENDIF
  1888. !ENDIF # TARGETTYPE != UMAPPL_NOLIB
  1889. !IFDEF NOTARGETLIB
  1890. TARGETLIB=
  1891. !ENDIF
  1892. !IFNDEF MACHINE_TARGETLIBS
  1893. MACHINE_TARGETLIBS=$(TARGETLIB) $(TARGETLIBS)
  1894. !ENDIF
  1895. !if (!defined(MANAGED_CODE) && !defined(MANAGED_VB))
  1896. TARGETOBJFILES=$(TARGETOBJFILES) $(OBJECTS)
  1897. !ENDIF
  1898. !IF "$(NOLINK)" == "" || \
  1899. ("$(NOLINK)" != "" && ("$(TARGETTYPE)"=="LIBRARY" || \
  1900. ( ("$(TARGETTYPE)"=="DYNLINK" || \
  1901. "$(TARGETTYPE)"=="PROGLIB" || \
  1902. "$(TARGETTYPE)"=="EXPORT_DRIVER" || \
  1903. "$(TARGETTYPE)"=="HAL") && \
  1904. "$(MAKEDLL)" == "") \
  1905. ) \
  1906. )
  1907. ! IF "$(NOLINK)" != "" && "$(TARGET)" != ""
  1908. ! ifndef NO_DLL_EXPORTS
  1909. TARGETLIBFILES=$(TARGETLIBFILES) $(TARGETPATH)\*\$(TARGETNAME).lib
  1910. ! endif
  1911. ! ELSE
  1912. TARGETEXEFILES=$(TARGETEXEFILES) $(TARGET)
  1913. ! ENDIF
  1914. !ENDIF # NOLINK == "" || building .lib file for dll
  1915. !IF "$(NTTEST)" != ""
  1916. TARGETOBJFILES=$(TARGETOBJFILES) $(O)\$(NTTEST).obj
  1917. ! IFNDEF NOLINK
  1918. TARGETEXEFILES=$(TARGETEXEFILES) $(O)\$(NTTEST).exe
  1919. ! ENDIF # NDEF NOLINK
  1920. !ENDIF # NTTEST != ""
  1921. UMOBJFILES=
  1922. UMEXEFILES=
  1923. !IF "$(UMAPPLEXT)" == ""
  1924. UMAPPLEXT=.exe
  1925. !ENDIF
  1926. !IF "$(UMAPPL)" != ""
  1927. UMOBJFILES=obj\*\$(UMAPPL:*=.obj obj\*\).obj
  1928. ! IF "$(UMAPPLEXT)" == ".com"
  1929. ! IFNDEF NOLINK
  1930. UMEXEFILES=obj\*\$(UMAPPL:*=.com obj\*\).com
  1931. ! ENDIF
  1932. ! ELSEIF "$(UMAPPLEXT)" == ".exe"
  1933. ! IFNDEF NOLINK
  1934. UMEXEFILES=obj\*\$(UMAPPL:*=.exe obj\*\).exe
  1935. ! ENDIF
  1936. ! ELSEIF "$(UMAPPLEXT)" == ".scr"
  1937. ! IFNDEF NOLINK
  1938. UMEXEFILES=obj\*\$(UMAPPL:*=.scr obj\*\).scr
  1939. ! ENDIF
  1940. ! ELSE
  1941. ! ERROR Unsupport UMAPPLEXT = $(UMAPPLEXT)
  1942. ! ENDIF # UMAPPLEXT
  1943. !ENDIF # UMAPPL != ""
  1944. !IF "$(UMTEST)" != ""
  1945. UMOBJFILES=$(UMOBJFILES) obj\*\$(UMTEST:*=.obj obj\*\).obj
  1946. ! IFNDEF NOLINK
  1947. UMEXEFILES=$(UMEXEFILES) obj\*\$(UMTEST:*=.exe obj\*\).exe
  1948. ! ENDIF
  1949. !ENDIF
  1950. !if "$(BUILD_ALT_DIR)" == "d"
  1951. UMOBJFILES=$(UMOBJFILES:obj\*\=objd\*\)
  1952. UMEXEFILES=$(UMEXEFILES:obj\*\=objd\*\)
  1953. !endif
  1954. !IFDEF USE_LINT
  1955. ! IFNDEF LINT_OUTPUT
  1956. LINT_OUTPUT=$(TARGETNAME)
  1957. ! ENDIF
  1958. ! IFNDEF LINT_EXT
  1959. LINT_EXT=tmp
  1960. ! ENDIF
  1961. ! IF "$(LINT_TYPE)" == "all"
  1962. TARGETLOBFILES1=
  1963. TARGETLOBFILES2=$(O)\$(LINT_OUTPUT).$(LINT_EXT)
  1964. ! ELSEIF "$(LINT_TYPE)" == "lob"
  1965. TARGETLOBFILES1=$(TARGETOBJFILES:.obj=.lob)
  1966. TARGETLOBFILES2=
  1967. ! ELSE
  1968. TARGETLOBFILES1=
  1969. TARGETLOBFILES2=$(TARGETOBJFILES:.obj=.lob)
  1970. ! ENDIF
  1971. !ELSE
  1972. TARGETLOBFILES1=
  1973. TARGETLOBFILES2=
  1974. !ENDIF
  1975. #
  1976. # Define NT_UP as 0 in environment to turn on MP.
  1977. # If undefined or equal to 1, you get UP.
  1978. #
  1979. !IFNDEF NT_UP
  1980. NT_UP=1
  1981. !ENDIF
  1982. !IF "$(NT_UP)"=="0"
  1983. NT_UP_DEFINES=
  1984. !ELSE
  1985. NT_UP_DEFINES=-DNT_UP=1
  1986. !ENDIF
  1987. !IFNDEF NT_INST
  1988. NT_INST=0
  1989. !ENDIF
  1990. #
  1991. # User defined variables (environment variables or command line).
  1992. # A cpu specific definition will take precedence over the MSC definition.
  1993. #
  1994. # xxx_WARNING_LEVEL
  1995. # xxx_OPTIMIZATION
  1996. # xxx_CPPFLAGS
  1997. #
  1998. !IFNDEF MSC_WARNING_LEVEL
  1999. MSC_WARNING_LEVEL=/W3
  2000. !ENDIF
  2001. DEFAULT_MSC_OPT = /Oxs
  2002. #
  2003. # End of user defined variables.
  2004. #
  2005. STD_DEFINES=-DCONDITION_HANDLING=1 $(NT_UP_DEFINES) \
  2006. -DNT_INST=$(NT_INST) $(WIN32_DEFINE) $(NT_PNP_POWER_DEFINES) \
  2007. $(NT_PNP_STUB_DEFINES)
  2008. !IFNDEF NOT_LEAN_AND_MEAN
  2009. STD_DEFINES = $(STD_DEFINES) -DWIN32_LEAN_AND_MEAN=1
  2010. !ENDIF
  2011. !if "$(NTDEBUG)" == "ntsd" || "$(NTDEBUG)" == "cvp" || "$(NTDEBUG)" == "sym"
  2012. TARGET_DBG_DEFINES= -DDEVL=1 -DDBG=1
  2013. !else
  2014. TARGET_DBG_DEFINES= -DDEVL=1
  2015. !endif
  2016. !if !defined(RESOURCE_ONLY_DLL) || \
  2017. ("$(NTDEBUG)" == "ntsd") || \
  2018. ("$(NTDEBUG)" == "ntsdnodbg") || \
  2019. ("$(NTDEBUG)" == "cvp") || \
  2020. ("$(NTDEBUG)" == "sym")
  2021. DBGFLAGS=/Zi
  2022. !else
  2023. DBGFLAGS=
  2024. !endif
  2025. !ifdef OFFICIAL_BUILD_MACHINE
  2026. TARGET_DBG_DEFINES=$(TARGET_DBG_DEFINES) -DOFFICIAL_BUILD=1
  2027. !endif
  2028. !ifndef __BUILDMACHINE__
  2029. __BUILDMACHINE__=$(USERNAME: =)
  2030. !endif
  2031. !if exist ($(BASEDIR)\__blddate__)
  2032. !include $(BASEDIR)\__blddate__
  2033. !endif
  2034. TARGET_DBG_DEFINES=$(TARGET_DBG_DEFINES)\
  2035. !ifdef BUILDDATE
  2036. -D__BUILDDATE__=$(BUILDDATE)\
  2037. !endif
  2038. -D__BUILDMACHINE__=$(__BUILDMACHINE__)
  2039. !IF "$(PRECOMPILED_OPTION)" == ""
  2040. ! IF "$(PRECOMPILED_INCLUDE)" != ""
  2041. ! IF "$(PRECOMPILED_INCLUDE)" != "$(PRECOMPILED_INCLUDE:.hxx=)"
  2042. PRECOMPILED_CXX=1
  2043. ! ENDIF
  2044. ! IF "$(PRECOMPILED_INCLUDE)" != "$(PRECOMPILED_INCLUDE:.hpp=)"
  2045. PRECOMPILED_CXX=1
  2046. ! ENDIF
  2047. ! IF "$(PRECOMPILED_INCLUDE)" != "$(PRECOMPILED_INCLUDE:.cxx=)"
  2048. PRECOMPILED_CXX=1
  2049. ! ENDIF
  2050. ! IF "$(PRECOMPILED_INCLUDE)" != "$(PRECOMPILED_INCLUDE:.cpp=)"
  2051. PRECOMPILED_CXX=1
  2052. ! ENDIF
  2053. ! IF "$(PRECOMPILED_PCH)" == ""
  2054. PRECOMPILED_PCH=$(PRECOMPILED_INCLUDE:.hxx=.pch)
  2055. PRECOMPILED_PCH=$(PRECOMPILED_PCH:.hpp=.pch)
  2056. PRECOMPILED_PCH=$(PRECOMPILED_PCH:.h=.pch)
  2057. PRECOMPILED_PCH=$(PRECOMPILED_PCH:.cxx=.pch)
  2058. PRECOMPILED_PCH=$(PRECOMPILED_PCH:.cpp=.pch)
  2059. PRECOMPILED_PCH=$(PRECOMPILED_PCH:.c=.pch)
  2060. PRECOMPILED_PCH=$(PRECOMPILED_PCH:..\=)
  2061. ! ENDIF
  2062. ! IF "$(PRECOMPILED_OBJ)" == ""
  2063. PRECOMPILED_OBJ=$(PRECOMPILED_PCH:.pch=.obj)
  2064. ! ENDIF
  2065. ! ENDIF
  2066. !ENDIF
  2067. !IF "$(PRECOMPILED_OPTION)" == ""
  2068. ! IF "$(PRECOMPILED_INCLUDE)" != ""
  2069. ! IF "$(PRECOMPILED_PCH)" != ""
  2070. HEADERFILE=/Fp$(O)\$(PRECOMPILED_PCH)
  2071. ! ENDIF
  2072. ! IF "$(PRECOMPILED_OBJ)" != ""
  2073. HEADEROBJNAME=$(O)\$(PRECOMPILED_OBJ)
  2074. HEADEROBJ=/Fo"$(MAKEDIR)\$(HEADEROBJNAME)"
  2075. ! ENDIF
  2076. ! IF !$(MPPC)
  2077. ! IF "$(PRECOMPILED_CXX)" == ""
  2078. PRECOMPILED=/Yu$(PRECOMPILED_INCLUDE:..\=) $(HEADERFILE)
  2079. PRECOMPILED_CXX=
  2080. ! ELSE
  2081. PRECOMPILED=
  2082. PRECOMPILED_CXX=/Yu$(PRECOMPILED_INCLUDE:..\=) $(HEADERFILE)
  2083. ! ENDIF
  2084. ! ENDIF
  2085. PRECOMPILED_TARGET=$(O)\$(PRECOMPILED_PCH)
  2086. ! ELSE
  2087. PRECOMPILED=
  2088. PRECOMPILED_CXX=
  2089. ! ENDIF
  2090. !ELSE
  2091. ! IF "$(PRECOMPILED_CXX)" == ""
  2092. PRECOMPILED=$(PRECOMPILED_OPTION)
  2093. PRECOMPILED_CXX=
  2094. ! ELSE
  2095. PRECOMPILED=
  2096. PRECOMPILED_CXX=$(PRECOMPILED_OPTION)
  2097. ! ENDIF
  2098. PRECOMPILED_TARGET=$(PRECOMPILED_TARGET)
  2099. ! IF "$(PRECOMPILED_TARGET)" != ""
  2100. HEADERFILE=/Fp$(PRECOMPILED_TARGET)
  2101. ! ENDIF
  2102. ! IF "$(PRECOMPILED_OBJ)" != ""
  2103. HEADEROBJNAME=$(PRECOMPILED_OBJ)
  2104. HEADEROBJ=/Fo$(HEADEROBJNAME)
  2105. ! ENDIF
  2106. !ENDIF
  2107. !IF "$(NTNOPCH)" != ""
  2108. # Need to do this conditionally. If the pch obj exists, it's likely existing files
  2109. # reference it (ie: this isn't a clean build). Keep the file ref but delete the
  2110. # pch stuff so links will work.
  2111. !ifdef HEADEROBJNAME
  2112. !if !exist($(HEADEROBJNAME))
  2113. HEADEROBJNAME=
  2114. HEADEROBJ=
  2115. PRECOMPILED_OBJ=
  2116. !endif
  2117. !endif
  2118. PRECOMPILED=
  2119. PRECOMPILED_CXX=
  2120. PRECOMPILED_INCLUDE=
  2121. PRECOMPILED_TARGET=
  2122. PRECOMPILED_PCH=
  2123. !ENDIF
  2124. USECXX_FLAG=$(USECXX_FLAG:p=P)
  2125. !IF ("$(PRECOMPILED_CXX)" == "") && ("$(USECXX_FLAG)" == "")
  2126. PRECOMPILED_FLAG=$(PRECOMPILED_FLAG) /Tc
  2127. !ELSE
  2128. PRECOMPILED_FLAG=$(PRECOMPILED_FLAG) /Tp
  2129. !ENDIF
  2130. #
  2131. # Set linker options
  2132. #
  2133. #
  2134. # Merge _PAGE with PAGE, _TEXT with .text, and make sure
  2135. # INIT sections are discardable
  2136. #
  2137. !if !$(MPPC)
  2138. !ifdef LINKER_NOREF
  2139. LINK_REF_FLAG=-OPT:NOREF -OPT:NOICF
  2140. !else
  2141. ! ifdef LINKER_NOICF
  2142. LINK_REF_FLAG=-OPT:REF -OPT:NOICF
  2143. ! else
  2144. LINK_REF_FLAG=-OPT:REF -OPT:ICF
  2145. ! endif
  2146. !endif
  2147. !endif
  2148. !ifdef NOT_TERMINAL_SERVER_AWARE
  2149. TSLINKER_FLAG=
  2150. !else
  2151. ! if $(_NT_TOOLS_VERSION) >= 0x700
  2152. TSLINKER_FLAG=/tsaware
  2153. ! else
  2154. TSLINKER_FLAG=
  2155. ! endif
  2156. !endif
  2157. DEFAULT_LINK_LIB_IGNORE=4010,4037,4039,4065,4070,4078,4087,4089,4221
  2158. !if "$(BUILD_PRODUCT)" == "NT" || defined(LINK_ALLOW_MISSING_BASE_ADDRESS)
  2159. # Missing base address not interesting for OS (entire product rebased at postbuild time)
  2160. DEFAULT_LINK_LIB_IGNORE=$(DEFAULT_LINK_LIB_IGNORE),4198
  2161. !endif
  2162. !ifdef LINK_LIB_IGNORE
  2163. LINK_LIB_IGNORE_FLAG=-IGNORE:$(LINK_LIB_IGNORE),$(DEFAULT_LINK_LIB_IGNORE)
  2164. !else
  2165. LINK_LIB_IGNORE_FLAG=-IGNORE:$(DEFAULT_LINK_LIB_IGNORE)
  2166. !endif
  2167. !IF $(IA64)
  2168. LINK_LIB_IGNORE_FLAG= $(LINK_LIB_IGNORE_FLAG),4108,4088,4218
  2169. !ENDIF
  2170. !if defined(LINK_TIME_CODE_GENERATION) && !defined(FORCENATIVEOBJECT)
  2171. # 4218: non-native module found; restarting link with /LTCG
  2172. # 4235: /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance
  2173. LINK_LIB_IGNORE_FLAG= $(LINK_LIB_IGNORE_FLAG),4218,4235
  2174. !endif
  2175. !ifdef LINK_NO_RELEASE
  2176. LINK_RELEASE=
  2177. !else
  2178. LINK_RELEASE=/release
  2179. !endif
  2180. !ifdef USE_INCREMENTAL_LINKING
  2181. LINK_INCREMENTAL_FLAG = -OPT:NOREF \
  2182. $(LINK_LIB_IGNORE_FLAG)
  2183. !else
  2184. LINK_INCREMENTAL_FLAG = $(LINK_REF_FLAG) \
  2185. $(LINK_LIB_IGNORE_FLAG) \
  2186. -INCREMENTAL:NO \
  2187. -FULLBUILD \
  2188. $(LINK_RELEASE)
  2189. !endif
  2190. !ifdef BACKGROUND_USE
  2191. LINKER_FLAGS = $(LINKER_FLAGS) -WS:aggressive
  2192. !endif
  2193. !ifdef LARGE_ADDRESS_AWARE
  2194. LINKER_FLAGS = $(LINKER_FLAGS) -LARGEADDRESSAWARE
  2195. !endif
  2196. LINK_TIME_CODE_GENERATION_LINKER_FLAGS=
  2197. !if defined(LINK_TIME_CODE_GENERATION) && !defined(FORCENATIVEOBJECT)
  2198. # If NTPOGO is true or NTPOGO_TARGENAME is defined, a package is
  2199. # generated in $(_NTTREE)\POGO\$(NTPOGO_TARGETNAME) that contains
  2200. # all of files necessary to build a POGO instrumented/optimized binary.
  2201. # pgi.cmd and pgo.cmd are generated to do the PGI and PGO builds.
  2202. !if (defined(NTPOGO) || defined(NTPOGO_TARGETNAME)) && defined(_NTPOGODIR)
  2203. !if !defined(NTPOGO_TARGETNAME)
  2204. NTPOGO_TARGETNAME=$(TARGETNAME)
  2205. !endif
  2206. NTPOGO_TARGETDIR=$(_NTTREE)\$(_NTPOGODIR)\$(NTPOGO_TARGETNAME)
  2207. !if [rmdir /s /q $(NTPOGO_TARGETDIR)]
  2208. !endif
  2209. !if [-mkdir $(NTPOGO_TARGETDIR) > nul 2>&1]
  2210. !endif
  2211. # Profiling has to be turned off for POGO.
  2212. !if [@echo findstr -i -v -r "[-/^]order:@" link.rsp ^> pogo.rsp > $(NTPOGO_TARGETDIR)\pgi.cmd]
  2213. !endif
  2214. !if [@echo findstr -i -v -r "[-/^]order:@" link.rsp ^> pogo.rsp > $(NTPOGO_TARGETDIR)\pgo.cmd]
  2215. !endif
  2216. # Kernel?
  2217. !if (("$(MAJORCOMP)" == "ntos" || "$(MAJORCOMP)" == "NTOS") && \
  2218. ("$(MINORCOMP)" == "init" || "$(MINORCOMP)" == "INIT")) || \
  2219. ("$(TARGETTYPE)" == "HAL")
  2220. !if [@copy $(ENDUSER_LIB_PATH)\pogortntos.lib $(NTPOGO_TARGETDIR)]
  2221. !endif
  2222. !if [@echo link @pogo.rsp -ltcg:PGI pogortntos.lib -d2:-PogoNtoskrnl >> $(NTPOGO_TARGETDIR)\pgi.cmd]
  2223. !endif
  2224. !if [@echo link @pogo.rsp -ltcg:PGO -d2:-PogoNtoskrnl >> $(NTPOGO_TARGETDIR)\pgo.cmd]
  2225. !endif
  2226. # Driver?
  2227. !elseif (("$(TARGETTYPE)" == "DRIVER") || ("$(TARGETTYPE)" == "EXPORT_DRIVER"))
  2228. !if [@copy $(ENDUSER_LIB_PATH)\pogortsys.lib $(NTPOGO_TARGETDIR)]
  2229. !endif
  2230. !if [@echo link @pogo.rsp -ltcg:PGI pogortsys.lib -d2:-PogoKmode >> $(NTPOGO_TARGETDIR)\pgi.cmd]
  2231. !endif
  2232. !if [@echo link @pogo.rsp -ltcg:PGO -d2:-PogoKmode >> $(NTPOGO_TARGETDIR)\pgo.cmd]
  2233. !endif
  2234. # Neither kernel or driver?
  2235. !else
  2236. !if [@copy $(ENDUSER_LIB_PATH)\pogort.lib $(NTPOGO_TARGETDIR)]
  2237. !endif
  2238. !if [@echo link @pogo.rsp -ltcg:PGI pogort.lib >> $(NTPOGO_TARGETDIR)\pgi.cmd]
  2239. !endif
  2240. !if [@echo link @pogo.rsp -ltcg:PGO >> $(NTPOGO_TARGETDIR)\pgo.cmd]
  2241. !endif
  2242. !endif
  2243. LINKER_FLAGS=$(LINKER_FLAGS) -linkrepro:$(NTPOGO_TARGETDIR)
  2244. !endif
  2245. LINK_TIME_CODE_GENERATION_LINKER_FLAGS=-ltcg
  2246. LINKER_FLAGS=$(LINKER_FLAGS) $(LINK_TIME_CODE_GENERATION_LINKER_FLAGS)
  2247. !endif
  2248. !if $(MPPC)
  2249. LINKER_FLAGS = $(LINKER_FLAGS) \
  2250. -SECTION:INIT,d \
  2251. $(LINK_INCREMENTAL_FLAG) \
  2252. -NODEFAULTLIB
  2253. !else
  2254. LINKER_FLAGS = $(LINKER_FLAGS) \
  2255. -MERGE:_PAGE=PAGE \
  2256. -MERGE:_TEXT=.text \
  2257. -SECTION:INIT,d \
  2258. $(LINK_INCREMENTAL_FLAG) \
  2259. -NODEFAULTLIB
  2260. !endif
  2261. LINKER_FLAGS=$(LINKER_FLAGS) $(LINKER_WX_SWITCH)
  2262. LINK_OS_VERSIONS = -version:$(LINKER_APP_VERSION) -osversion:$(LINKER_OS_VERSION)
  2263. !IF $(MPPC)
  2264. #*****MacPPC linker flags
  2265. TARGET_DIRECTORY=mppc
  2266. UMLIBS=$(UMLIBS:*=mppc)
  2267. LINKLIBS=$(LINKLIBS:*=mppc)
  2268. DLLDEF=$(DLLDEF:*=mppc)
  2269. PRECOMPILED_TARGET= $(PRECOMPILED_TARGET:*=mppc)
  2270. PRECOMPILED_OBJ= $(PRECOMPILED_OBJ:*=mppc)
  2271. PRECOMPILED_OPTION= $(PRECOMPILED_OPTION:*=mppc)
  2272. #
  2273. # Set the default creator and type. If were building a dll then use
  2274. # cfmg and shlb, for apps use ???? and APPL.
  2275. #
  2276. !ifndef MAC_CREATOR
  2277. !if "$(TARGETTYPE)" == "DYNLINK"
  2278. MAC_CREATOR=cfmg
  2279. !else
  2280. MAC_CREATOR=????
  2281. !endif
  2282. !endif
  2283. !ifndef MAC_TYPE
  2284. !if "$(TARGETTYPE)" == "DYNLINK"
  2285. MAC_TYPE=shlb
  2286. !else
  2287. MAC_TYPE=APPL
  2288. !endif
  2289. !endif
  2290. #
  2291. # MAC_CREATOR and MAC_TYPE may contain embedded spaces. To do this we need to
  2292. # enclose their operand in quotes. Now get rid of the quotes leaving the spaces
  2293. #
  2294. MAC_CREATOR=$(MAC_CREATOR:^"=)
  2295. MAC_TYPE=$(MAC_TYPE:^"=)
  2296. #
  2297. # Setup for the linker
  2298. #
  2299. !if "$(TARGETTYPE)"=="DYNLINK"
  2300. LINKER_FLAGS=$(LINKER_FLAGS) -mac:nobundle -dll -def:$(DLLDEF)
  2301. LINKER_FLAGS=$(LINKER_FLAGS) -mac:MFILEPAD
  2302. LINKER_FLAGS=$(LINKER_FLAGS) -mac:init="$(MAC_INITPROC)"
  2303. LINKER_FLAGS=$(LINKER_FLAGS) -mac:term="$(MAC_TERMPROC)"
  2304. !else
  2305. LINKER_FLAGS=-mac:bundle
  2306. !endif
  2307. LINKER_FLAGS=$(LINKER_FLAGS) -mac:type="$(MAC_TYPE)"
  2308. LINKER_FLAGS=$(LINKER_FLAGS) -mac:creator="$(MAC_CREATOR)"
  2309. LINKER_FLAGS=$(LINKER_FLAGS) -debug:FULL
  2310. LINKER_FLAGS=$(LINKER_FLAGS) -debugtype:both
  2311. LINKER_FLAGS=$(LINKER_FLAGS) -NODEFAULTLIB
  2312. #*****End Mac linker flags
  2313. !ELSE
  2314. LINKER_FLAGS = $(LINKER_FLAGS) $(LINKER_DBG_SECTION) -debugtype:cv $(LINK_OS_VERSIONS)
  2315. !ENDIF
  2316. LIBRARIAN_FLAGS = $(LINK_LIB_IGNORE_FLAG) $(LIBRARIAN_FLAGS) $(LINKER_WX_SWITCH) -nodefaultlib
  2317. LIBRARIAN_FLAGS = $(LIBRARIAN_FLAGS) -machine:$(MACHINE_TYPE)
  2318. LINK_TIME_CODE_GENERATION_LIBRARIAN_FLAGS =
  2319. !if defined(LINK_TIME_CODE_GENERATION) && !defined(FORCENATIVEOBJECT)
  2320. LINK_TIME_CODE_GENERATION_LIBRARIAN_FLAGS = -ltcg
  2321. LIBRARIAN_FLAGS = $(LIBRARIAN_FLAGS) $(LINK_TIME_CODE_GENERATION_LIBRARIAN_FLAGS)
  2322. !endif
  2323. !ifndef LIB_NAME
  2324. LIB_NAME=lib
  2325. !endif
  2326. LIBRARIAN=$(LIB_NAME) -out:$@ $(LIBRARIAN_FLAGS)
  2327. !ifndef LINK_NAME
  2328. LINK_NAME=link
  2329. !endif
  2330. LINKER=$(LINK_NAME) -out:$@ -machine:$(MACHINE_TYPE)
  2331. !if defined(NTPROFILEINPUT) && ("$(TARGETTYPE)" == "LIBRARY")
  2332. ! message NTPROFILEINPUT s/b removed in: $(MAKEDIR).
  2333. !endif
  2334. !IF defined(NTPROFILEINPUT) || defined(EXEPROFILEINPUT)
  2335. ORDER=-order:@$(@B).prf
  2336. !ENDIF
  2337. !IFDEF DLLORDER
  2338. ORDER=-order:@$(DLLORDER)
  2339. !ENDIF
  2340. !if "$(SUBSYSTEM_NATVER)" != ",5.02"
  2341. ! ifndef DRIVER_ALIGNMENT
  2342. DRIVER_ALIGNMENT=0x80
  2343. ! endif
  2344. ! ifndef HAL_ALIGNMENT
  2345. HAL_ALIGNMENT=0x80
  2346. ! endif
  2347. ! ifndef KERNEL_ALIGNMENT
  2348. KERNEL_ALIGNMENT=0x80
  2349. ! endif
  2350. !endif
  2351. !ifdef DRIVER_ALIGNMENT
  2352. DRIVER_ALIGN_SWITCH=-align:$(DRIVER_ALIGNMENT) /stub:$(SDK_LIB_DEST)\stub512.com
  2353. !endif
  2354. !ifdef HAL_ALIGNMENT
  2355. HAL_ALIGN_SWITCH=-align:$(HAL_ALIGNMENT) /stub:$(SDK_LIB_DEST)\stub512.com
  2356. !endif
  2357. !ifdef KERNEL_ALIGNMENT
  2358. KERNEL_ALIGN_SWITCH=-align:$(KERNEL_ALIGNMENT) /stub:$(SDK_LIB_DEST)\stub512.com
  2359. !endif
  2360. #
  2361. # [GorN] 3/30/2000
  2362. #
  2363. # WPP section (WMI tracing preprocessor)
  2364. #
  2365. # env. vars:
  2366. #
  2367. # RUN_WPP=list of files to run wpp on
  2368. # WPP_REVISION=override default revision
  2369. #
  2370. !if !defined(WPP_REVISION)
  2371. WPP_REVISION=rev1
  2372. !endif
  2373. !if !defined(WPP_NAME)
  2374. WPP_NAME=tracewpp.exe
  2375. !endif
  2376. !if $(ANSI_ANNOTATION)
  2377. WPP_MAKEFILE_FLAGS=-DWPP_ANSI_ANNOTATION
  2378. !endif
  2379. !if defined(RUN_WPP)
  2380. RUN_WPP=$(WPP_MAKEFILE_FLAGS) -cfgdir:$(WPP_CONFIG_PATH)\$(WPP_REVISION) -odir:$(O) $(RUN_WPP)
  2381. # execute wpp now
  2382. ! if [-$(WPP_NAME) $(RUN_WPP)]
  2383. ! endif
  2384. ! if exist(obj\_tracewpp.mac)
  2385. ! include obj\_tracewpp.mac
  2386. WPP_TARGETS=$(WPP_EXTRA_TARGETS)
  2387. ! endif
  2388. BINPLACE_FLAGS = $(BINPLACE_FLAGS) -:TMF
  2389. C_DEFINES=$(C_DEFINES) -DRUN_WPP
  2390. !else
  2391. WPP_TARGETS=
  2392. !endif
  2393. #
  2394. # LINT section
  2395. #
  2396. # Main env. vars:
  2397. # USE_LINT=1 to turn on PC-lint processing
  2398. # LINT_TYPE={all,lob,<nothing>}
  2399. # all - processes all $(SOURCES) files at once
  2400. # lob - processes $(SOURCES) individually and then consolidates
  2401. # <nothing> - processes $(SOURCES) individually (like John Daly's tool)
  2402. #
  2403. # Other env. vars:
  2404. # LINT_PATH=path to PC-lint directory (default=$(BASEDIR)\lint)
  2405. # LINT_APP=name of PC-lint executable (default=lint-nt)
  2406. # LINT_OUTPUT=base name of lint output file (default=$(TARGETNAME))
  2407. # LINT_EXT=extension of output files (default=tmp)
  2408. # LINT_FORCEDINCS=list of forced include files. same as in -FI compiler switch
  2409. # LINT_OPTS=options passed to PC-lint (default=+v -zero)
  2410. # LINT_PRECOMPPATH=paths that were used for precompiled header.
  2411. # - some components generate a pch in
  2412. # a separate step and use the pch amongst several
  2413. # subdirs. This env. var. lets one specify the
  2414. # include paths used for the pch.
  2415. #
  2416. !ifdef USE_LINT
  2417. # Convert CDEFINES which may contain /DSYMBOL1, -DSYMBOL2 to
  2418. # -dSYMBOL1 and -dSYMBOL2 which PC-Lint wants
  2419. LINT_DEFS=$(CDEFINES:-D=-d)
  2420. LINT_DEFINES=$(LINT_DEFS:/D=-d)
  2421. ! ifndef LINT_PATH
  2422. LINT_PATH=$(BASEDIR)\lint
  2423. ! endif
  2424. ! ifndef LINT_APP
  2425. LINT_APP=$(LINT_PATH)\lint-nt
  2426. ! endif
  2427. !ifndef LINT_OPTS
  2428. LINT_OPTS=+v -zero
  2429. !endif
  2430. ! if "$(LINT_TYPE)" == "all"
  2431. ! ifndef LINT_ALL_CMD
  2432. LINT_ALL_CMD=$(LINT_APP) $(LINT_OPTS) $(LINT_INCLUDES) $(LINT_DEFINES) $(LINT_FORCEDINCS) -i$(LINT_PATH)\ std.lnt -os($(O)\$(LINT_OUTPUT).$(LINT_EXT))
  2433. ! endif
  2434. ! else
  2435. ! if "$(LINT_TYPE)" == "lob"
  2436. ! ifndef LINT_CMD
  2437. LINT_CMD=$(LINT_APP) -u $(LINT_OPTS) $(LINT_INCLUDES) $(LINT_DEFINES) $(LINT_FORCEDINCS) -i$(LINT_PATH)\ std.lnt +os($(O)\$(LINT_OUTPUT).$(LINT_EXT)) -oo($@)
  2438. ! endif
  2439. ! ifndef LINT_CMD2
  2440. LINT_CMD2=$(LINT_APP) $(LINT_OPTS) -i$(LINT_PATH)\ std.lnt +os($(O)\$(LINT_OUTPUT).$(LINT_EXT)) $(O)\*.lob
  2441. ! endif
  2442. ! else
  2443. ! ifndef LINT_CMD
  2444. LINT_CMD=$(LINT_APP) $(LINT_OPTS) $(LINT_INCLUDES) $(LINT_DEFINES) $(LINT_FORCEDINCS) -i$(LINT_PATH)\ std.lnt +os($(O)\$(LINT_OUTPUT).$(LINT_EXT))
  2445. ! endif
  2446. ! endif
  2447. ! endif
  2448. !else
  2449. LINT_CMD2=
  2450. !endif
  2451. !ifndef LINT_CMD2
  2452. LINT_CMD2=
  2453. !endif
  2454. #
  2455. # Standard inference rules for C files that produce object files.
  2456. #
  2457. .SUFFIXES: .asm .asmx .c .class .cs .cxx .cpp .exe .f .java .obj .odl .p .rc .rcpp .res .resx .resz .resources .s .sdl .tdl .thk .txt .vb
  2458. #
  2459. # Processor specific control and options.
  2460. #
  2461. DRIVER_ENTRY=DriverEntry
  2462. GDI_DRIVER_ENTRY=DrvEnableDriver
  2463. !include $(TARGET_DIRECTORY)mk.inc
  2464. !ifdef VERIFIER_DDK_EXTENSIONS
  2465. !if "$(TARGETTYPE)" == "DRIVER" && \
  2466. "$(DRIVERTYPE)" != "wdm" && "$(DRIVERTYPE)" != "WDM" && \
  2467. "$(DRIVERTYPE)" != "VXD"
  2468. C_DEFINES=$(C_DEFINES) -DVERIFIER_DDK_EXTENSIONS
  2469. ENTRY_SUFFIX=_DDK$(ENTRY_SUFFIX)
  2470. TARGETLIB=$(DDK_LIB_PATH)\DDK_EXT.LIB $(TARGETLIB)
  2471. !endif
  2472. !endif
  2473. !ifndef LINKER_STACKSIZE
  2474. !ifdef LINKER_STACKCOMMITSIZE
  2475. LINKER_STACKSIZE = -STACK:$(DEFAULT_STACKRESERVE),$(LINKER_STACKCOMMITSIZE)
  2476. !else
  2477. LINKER_STACKSIZE = -STACK:$(DEFAULT_STACKRESERVE),$(DEFAULT_STACKCOMMIT)
  2478. !endif
  2479. !endif
  2480. LINKER_STACKSIZE_DLL=-STACK:0x40000,0x1000
  2481. !if defined(USE_MAPSYM) && !defined(NO_MAPSYM)
  2482. MAPSYM_CMD = mapsym -o $(@D)\$(@B).sym $(@D)\$(@B).map
  2483. LINKER_FLAGS=$(LINKER_FLAGS) -map
  2484. BINPLACE_FLAGS = $(BINPLACE_FLAGS) -W
  2485. !else
  2486. MAPSYM_CMD =
  2487. !endif
  2488. # @@BEGIN_DDKSPLIT
  2489. !if defined(_NTTREE) && defined(NO_PDB_PATHS)
  2490. LINKER_FLAGS = $(LINKER_FLAGS) -PDBPATH:NONE
  2491. !endif
  2492. # @@END_DDKSPLIT
  2493. LIBRARY_OBJS=$(IMPLIB_OBJS) $(MFC_STATIC_LIB) $(LINKLIBS) $(OBJECTS)
  2494. !if "$(TARGETTYPE)" != "DRIVER" && \
  2495. "$(TARGETTYPE)" != "EXPORT_DRIVER" && \
  2496. "$(TARGETTYPE)" != "MINIPORT" && \
  2497. "$(TARGETTYPE)" != "GDI_DRIVER"
  2498. LINKER_FLAGS = $(LINKER_FLAGS) -merge:.rdata=.text
  2499. !endif
  2500. !if $(DELAYLOAD_SUPPORTED)
  2501. ! if "$(DELAYLOAD)" != ""
  2502. ! if "$(DLOAD_ERROR_HANDLER)" != ""
  2503. ! if "$(DLOAD_ERROR_HANDLER)" == "KERNEL32" || \
  2504. "$(DLOAD_ERROR_HANDLER)" == "kernel32.dll" || \
  2505. "$(DLOAD_ERROR_HANDLER)" == "KERNEL32.DLL" || \
  2506. "$(DLOAD_ERROR_HANDLER)" == "Kernel32.DLL" || \
  2507. "$(DLOAD_ERROR_HANDLER)" == "Kernel32.dll"
  2508. DLOAD_ERROR_HANDLER = kernel32
  2509. ! endif
  2510. ! if "$(DLOAD_FORCE_ERROR_CHECK)" != ""
  2511. # force delayload checking as if this module used kernel32 as its error handler
  2512. BINPLACE_FLAGS = -dl $(TARGETNAME).$(TARGETEXT),FORCE $(BINPLACE_FLAGS)
  2513. ! else
  2514. BINPLACE_FLAGS = -dl $(TARGETNAME).$(TARGETEXT),$(DLOAD_ERROR_HANDLER) $(BINPLACE_FLAGS)
  2515. ! endif
  2516. ! else
  2517. ! if "$(NOLINK)" == ""
  2518. ! message BUILDMSG: Warning: DLOAD_ERROR_HANDLER not specified in $(MAKEDIR)
  2519. ! endif
  2520. ! endif
  2521. ! if "$(DLOAD_ERROR_HANDLER)" == "kernel32"
  2522. CRTLIBS=$(CRTLIBS) $(BASE_LIB_PATH)\kernel32dloadhandler.lib
  2523. TARGETLIBS = $(TARGETLIBS) $(SDK_LIB_PATH)\kernl32p.lib
  2524. ! else
  2525. CRTLIBS=$(CRTLIBS) $(SDK_LIB_PATH)\delayimp.lib
  2526. ! endif
  2527. DELAYLOAD = $(DELAYLOAD: =)
  2528. DELAYLOAD_FLAGS = /delayload:$(DELAYLOAD:;= /delayload:)
  2529. ! ifdef DELAYLOAD_UNLOAD_SUPPORT
  2530. DELAYLOAD_FLAGS = $(DELAYLOAD_FLAGS) /delay:unload
  2531. ! endif
  2532. LINKER_FLAGS = $(LINKER_FLAGS) $(DELAYLOAD_FLAGS)
  2533. C_DEFINES=$(C_DEFINES) /DDELAYLOAD_VERSION=$(DELAYLOAD_VERSION)
  2534. ! endif
  2535. !endif
  2536. #
  2537. # Clear the suffixes list so we can ensure only pass zero stuff will be built
  2538. #
  2539. !IFDEF PASS0ONLY
  2540. .SUFFIXES:
  2541. !ENDIF
  2542. # @@BEGIN_DDKSPLIT
  2543. #
  2544. # DDK does not allow signing of binaries or SCP
  2545. #
  2546. !ifdef NT_SIGNCODE
  2547. SIGNCODE_CMD=signtool sign /q $(SIGNTOOL_SIGN) $@
  2548. !endif
  2549. # SCP is ms internal
  2550. !if $(SCP_SUPPORTED)
  2551. ! if defined(SCP_ENABLED) && defined(SCP_CONFIGFILE)
  2552. SCP_CMD=copy $@ $(O)\vsp_input.tmp & vsp21.exe $(O)\vsp_input.tmp /F=$(SCP_CONFIGFILE) /O=$@
  2553. ! else
  2554. SCP_CMD=
  2555. ! endif
  2556. !else
  2557. SCP_CMD=
  2558. !endif
  2559. # @@END_DDKSPLIT
  2560. DRIVER_SWITCH = -driver
  2561. !if "$(DRIVERTYPE)" == "wdm" || "$(DRIVERTYPE)" == "WDM"
  2562. DRIVER_SWITCH = $(DRIVER_SWITCH) -driver:wdm
  2563. !else if "$(DRIVERTYPE)" == "VXD"
  2564. DRIVER_SWITCH = -vxd $(SDK_LIB_DEST)\i386\vxdwraps.clb
  2565. !endif
  2566. !ifdef BINARY_PUBLISH_DIR
  2567. ! ifndef BINARY_PUBLISH_FILES
  2568. ! error Must define BINARY_PUBLISH_FILES if defining BINARY_PUBLISH_DIR
  2569. ! endif
  2570. BINARY_PUBLISH_ROOT=$(BASEDIR)\$(_PROJECT_)\$(PROJECT_BINDROP_DIR)
  2571. BINARY_PUBLISH_ROOT=$(BINARY_PUBLISH_ROOT)\$(BINARY_PUBLISH_DIR)
  2572. BINARY_PUBLISH_ROOT=$(BINARY_PUBLISH_ROOT)\$(TARGET_DIRECTORY)\$(BUILD_TYPE)
  2573. !endif
  2574. !if defined(BINARY_PUBLISH) || defined(BINARY_PUBLISH_DIR) || !defined(_NTTREE)
  2575. #
  2576. # since we're generating binary drops of this source there's no need to
  2577. # binplace the files. The files should be binplaced from the binary_release
  2578. # directory.
  2579. #
  2580. NO_BINPLACE=1
  2581. !endif
  2582. !ifdef NO_BINPLACE
  2583. BINPLACE_CMD=echo Skip Binplace:
  2584. BINPLACE_FLAGS=
  2585. !else
  2586. ! ifndef BINPLACE_PLACEFILE
  2587. ! if defined(BINPLACE_GENERATE_PLACEFILE)
  2588. BINPLACE_PLACEFILE = $(O)\placefil.txt
  2589. ! elseif "$(BUILD_PRODUCT)" == "IE"
  2590. BINPLACE_PLACEFILE = $(BINPLACE_PLACEFILE_DIR)\ieplace.txt
  2591. ! else
  2592. BINPLACE_PLACEFILE = $(BINPLACE_PLACEFILE_DIR)\placefil.txt
  2593. ! endif
  2594. ! endif
  2595. ! ifdef BINPLACE_GENERATE_PLACEFILE
  2596. MAKE_PLACEFILE_CMD=for %i in ($(SXS_MISCFILES) $(TARGET)) do echo %~nxi $(BINPLACE_DESTINATIONS) >> $(BINPLACE_PLACEFILE)
  2597. ! if defined(SXS_LOG_PASS) && defined(SXS_ASSEMBLY_NAME) && "$(TARGETTYPE)" != "NOTARGET"
  2598. MAKE_PLACEFILE_CMD=( $(MAKE_PLACEFILE_CMD) ) && ( for /f "delims=:" %i in ('echo $(BINPLACE_DESTINATIONS_NORETAIL)') do for %j in ($(TARGET)) do echo %i\%~nxj | $(APPEND_TOOL) -file $(BINPLACE_LOG)\..\symbolcd_cablists_asms_$(COMPUTERNAME).lst - )
  2599. ! endif
  2600. ! ifdef BINPLACE_ADDITIONAL_PLACEFILES
  2601. #
  2602. # BINPLACE_ADDITIONAL_PLACEFILES is a semicolon delimited list of additional placefiles.
  2603. # The last parameter is the output (which we also use as an input, so we repeat it).
  2604. #
  2605. MAKE_PLACEFILE_CMD=( $(MAKE_PLACEFILE_CMD) ) && ( merge_placefiles $(BINPLACE_ADDITIONAL_PLACEFILES:;= ) $(BINPLACE_PLACEFILE) $(BINPLACE_PLACEFILE) )
  2606. !endif
  2607. !else
  2608. MAKE_PLACEFILE_CMD=echo.
  2609. ! endif
  2610. BINPLACE_FLAGS = -P $(BINPLACE_PLACEFILE) $(BINPLACE_FLAGS) $(SXS_BINPLACE_FLAGS)
  2611. ! if !defined(BUILD_NO_SYMCHK)
  2612. BINPLACE_FLAGS = -:DBG -j $(BINPLACE_FLAGS)
  2613. ! endif
  2614. _NTTREE= $(_NTTREE)\$(ALT_PROJECT_TARGET)
  2615. # If NTDBGFILES is defined then use binplace to split the symbols.
  2616. # Define BINPLACE flags as needed if separate .DBG file requested.
  2617. ! IFDEF NTDBGFILES
  2618. BINPLACE_DBGFLAGS_NT = -S $(_NTTREE)\Symbols
  2619. ! ifdef NTDBGFILES_PRIVATE
  2620. BINPLACE_DBGFLAGS_NT = $(BINPLACE_DBGFLAGS_NT) -n $(_NTTREE)\Symbols.pri
  2621. ! endif
  2622. ! else
  2623. BINPLACE_DBGFLAGS_NT=
  2624. ! ENDIF
  2625. ! if "$(VERIFY_LC)" == "1"
  2626. ! ifndef LC_PATH
  2627. LC_PATH=.
  2628. ! endif
  2629. BINPLACE_LC_FLAGS = -G $(LC_PATH)\$(@F).lc
  2630. BINPLACE_LC_MISCFLAGS = -G $(LC_PATH)\$(**F).lc
  2631. ! else
  2632. BINPLACE_LC_FLAGS=
  2633. BINPLACE_LC_MISCFLAGS=
  2634. ! endif
  2635. BINPLACE_FLAGS=-R $(_NTTREE) $(BINPLACE_DBGFLAGS_NT) $(BINPLACE_FLAGS)
  2636. BINPLACE_TOOL=@binplace
  2637. BINPLACE_CMD = $(BINPLACE_TOOL) $(BINPLACE_FLAGS) $(BINPLACE_LC_FLAGS) $@
  2638. !endif
  2639. BINPLACE_CMD_NT=$(BINPLACE_CMD)
  2640. !ifdef NTDUMPAMAP
  2641. MAPDUMP_CMD = link -dump -map $@ | sort /R /+62 > $(_NTDUMPAMAP)\$(@B).srt
  2642. !else
  2643. MAPDUMP_CMD =
  2644. !endif
  2645. #
  2646. # Define this macro so including make files can supply a yes prompt
  2647. # as appropriate. Put the "yes." file in a visible place for OEM's
  2648. # so they can make too.
  2649. #
  2650. !IFNDEF NOPASS0
  2651. #
  2652. # Pass Zero Inference Rules: IDL files (MIDL) and MC files
  2653. #
  2654. .SUFFIXES: .h .idl .mc .odl .tdl .asn .thk .mof
  2655. ! IF $(386)
  2656. PASS0_OBJECTS=$(PASS0_386_OBJECTS)
  2657. ! ELSEIF $(MPPC)
  2658. PASS0_OBJECTS=$(PASS0_MPPC_OBJECTS)
  2659. ! ELSEIF $(IA64)
  2660. PASS0_OBJECTS=$(PASS0_IA64_OBJECTS)
  2661. ! ELSEIF $(AMD64)
  2662. PASS0_OBJECTS=$(PASS0_AMD64_OBJECTS)
  2663. ! ELSEIF $(ARM)
  2664. PASS0_OBJECTS=$(PASS0_ARM_OBJECTS)
  2665. ! ENDIF
  2666. !ENDIF # IFNDEF NOPASS0
  2667. MIDL = midl
  2668. MKTYPLIB = mktyplib
  2669. ASN = asn1
  2670. # Disable midl timestamps wherever possible
  2671. MIDL_FLAGS=$(MIDL_FLAGS) -no_stamp -nologo $(MIDL_WX_SWITCH)
  2672. !IFDEF USE_OLE_MC
  2673. MC = mc -o
  2674. !ELSE
  2675. MC = mc
  2676. !ENDIF
  2677. MOFCOMP = mofcomp
  2678. !IF "$(IDL_TYPE)" == "ole" || "$(IDL_TYPE)" == ""
  2679. IDL_TYPE=OLE
  2680. !ELSEIF "$(IDL_TYPE)" == "rpc"
  2681. IDL_TYPE=RPC
  2682. !ENDIF
  2683. !IFNDEF PASS0_HEADERDIR
  2684. PASS0_HEADERDIR=.
  2685. !ENDIF
  2686. !IF "$(WIN32_WINNT_VERSION)" == "0x0500"
  2687. MIDL_OPTIMIZATION=$(MIDL_OPTIMIZATION_NT5)
  2688. !ELSE
  2689. ! IF "$(WIN32_WINNT_VERSION)" != "$(LATEST_WIN32_WINNT_VERSION)"
  2690. MIDL_OPTIMIZATION=$(MIDL_OPTIMIZATION_NT4)
  2691. ! ENDIF
  2692. !ENDIF
  2693. !IF DEFINED(MIDL_NO_ROBUST)
  2694. MIDL_OPTIMIZATION=$(MIDL_OPTIMIZATION_NO_ROBUST)
  2695. !ENDIF
  2696. # If the user specified a midl protocol, switch to it. This assumes that it
  2697. # is defaulted in makefile.plt to "-protocol all" or ""
  2698. !ifdef MIDL_PROTOCOL
  2699. MIDL_OPTIMIZATION=$(MIDL_OPTIMIZATION:-protocol all=)
  2700. MIDL_OPTIMIZATION=$(MIDL_OPTIMIZATION) -protocol $(MIDL_PROTOCOL)
  2701. !endif
  2702. ! ifdef MIDL_TLBDIR
  2703. MIDL_TLBSWITCH=/tlb $(MIDL_TLBDIR)\$(<F:.idl=.tlb)
  2704. ! else
  2705. MIDL_TLBSWITCH=
  2706. ! endif
  2707. !IF "$(IDL_TYPE)" == "OLE"
  2708. #! IF DEFINED(PASS0_CLIENTDIR) || DEFINED(PASS0_SERVERDIR)
  2709. #! ERROR PASS0_CLIENTDIR and PASS0_SERVERDIR can only be used with IDL_TYPE=RPC!
  2710. #! ENDIF
  2711. ! IFNDEF PASS0_SOURCEDIR
  2712. PASS0_SOURCEDIR=.
  2713. ! ENDIF
  2714. ! IFNDEF MIDL_UUIDDIR
  2715. MIDL_UUIDDIR=$(PASS0_SOURCEDIR)
  2716. ! ENDIF
  2717. ! ifndef PASS0_UUIDDIR
  2718. PASS0_UUIDDIR=$(MIDL_UUIDDIR)
  2719. ! endif
  2720. !ifndef PACKING
  2721. !if $(MPPC)
  2722. PACKING= -Zp2
  2723. !else
  2724. PACKING= -Zp8
  2725. !endif
  2726. !endif
  2727. !ifdef USE_IDLBASED_DLLDATA
  2728. DLLDATA_NAME=$(<F:.idl=_dlldata.c)
  2729. !else
  2730. DLLDATA_NAME=dlldata.c
  2731. !endif
  2732. ! IFNDEF NO_PASS0_RULES
  2733. .idl{$(PASS0_HEADERDIR)}.h:
  2734. $(MIDL) \
  2735. $(PACKING) \
  2736. $(INCPATH0) \
  2737. -char unsigned \
  2738. -ms_ext -c_ext \
  2739. -proxy $(PASS0_SOURCEDIR)\$(<F:.idl=_p.c) \
  2740. -dlldata $(PASS0_SOURCEDIR)\$(DLLDATA_NAME) \
  2741. -iid $(MIDL_UUIDDIR)\$(<F:.idl=_i.c) \
  2742. $(MIDL_TLBSWITCH) \
  2743. -header $@ \
  2744. -cpp_cmd $(MIDL_CPP) \
  2745. $(C_DEFINES) \
  2746. $(MIDL_FLAGS) \
  2747. $(MIDL_OPTIMIZATION) \
  2748. $<
  2749. {..\}.idl{$(PASS0_HEADERDIR)}.h:
  2750. $(MIDL) \
  2751. $(PACKING) \
  2752. $(INCPATH0) \
  2753. -char unsigned \
  2754. -ms_ext -c_ext \
  2755. -proxy $(PASS0_SOURCEDIR)\$(<F:.idl=_p.c) \
  2756. -dlldata $(PASS0_SOURCEDIR)\$(DLLDATA_NAME) \
  2757. -iid $(MIDL_UUIDDIR)\$(<F:.idl=_i.c) \
  2758. $(MIDL_TLBSWITCH) \
  2759. -header $@ \
  2760. -cpp_cmd $(MIDL_CPP) \
  2761. $(C_DEFINES) \
  2762. $(MIDL_FLAGS) \
  2763. $(MIDL_OPTIMIZATION) \
  2764. $<
  2765. {$(O)}.idl{$(PASS0_HEADERDIR)}.h:
  2766. $(MIDL) \
  2767. $(PACKING) \
  2768. $(INCPATH0) \
  2769. -char unsigned \
  2770. -ms_ext -c_ext \
  2771. -proxy $(PASS0_SOURCEDIR)\$(<F:.idl=_p.c) \
  2772. -dlldata $(PASS0_SOURCEDIR)\$(DLLDATA_NAME) \
  2773. -iid $(MIDL_UUIDDIR)\$(<F:.idl=_i.c) \
  2774. $(MIDL_TLBSWITCH) \
  2775. -header $@ \
  2776. -cpp_cmd $(MIDL_CPP) \
  2777. $(C_DEFINES) \
  2778. $(MIDL_FLAGS) \
  2779. $(MIDL_OPTIMIZATION) \
  2780. $<
  2781. ! ENDIF
  2782. !ELSEIF "$(IDL_TYPE)" == "RPC"
  2783. #! IF DEFINED(PASS0_SOURCEDIR) || DEFINED(MIDL_UUIDDR)
  2784. #! ERROR PASS0_SOURCEDIR and MIDL_UUIDDIR can only be used with IDL_TYPE=OLE!
  2785. #! ENDIF
  2786. ! IFNDEF PASS0_CLIENTDIR
  2787. PASS0_CLIENTDIR=$(TARGETPATH)
  2788. ! ENDIF
  2789. ! IFNDEF PASS0_SERVERDIR
  2790. PASS0_SERVERDIR=$(PASS0_CLIENTDIR)
  2791. ! ENDIF
  2792. ! IFNDEF NO_PASS0_RULES
  2793. .idl{$(PASS0_HEADERDIR)}.h:
  2794. $(MIDL) \
  2795. $(PACKING) \
  2796. $(INCPATH0) \
  2797. -char unsigned \
  2798. -ms_ext -c_ext \
  2799. -cstub $(PASS0_CLIENTDIR)\$(<F:.idl=_c.c) \
  2800. -sstub $(PASS0_SERVERDIR)\$(<F:.idl=_s.c) \
  2801. $(MIDL_TLBSWITCH) \
  2802. -header $@ \
  2803. -cpp_cmd $(MIDL_CPP) \
  2804. $(C_DEFINES) \
  2805. $(MIDL_FLAGS) \
  2806. $(MIDL_OPTIMIZATION) \
  2807. $<
  2808. {..\}.idl{$(PASS0_HEADERDIR)}.h:
  2809. $(MIDL) \
  2810. $(PACKING) \
  2811. $(INCPATH0) \
  2812. -char unsigned \
  2813. -ms_ext -c_ext \
  2814. -cstub $(PASS0_CLIENTDIR)\$(<F:.idl=_c.c) \
  2815. -sstub $(PASS0_SERVERDIR)\$(<F:.idl=_s.c) \
  2816. $(MIDL_TLBSWITCH) \
  2817. -header $@ \
  2818. -cpp_cmd $(MIDL_CPP) \
  2819. $(C_DEFINES) \
  2820. $(MIDL_FLAGS) \
  2821. $(MIDL_OPTIMIZATION) \
  2822. $<
  2823. {$(O)}.idl{$(PASS0_HEADERDIR)}.h:
  2824. $(MIDL) \
  2825. $(PACKING) \
  2826. $(INCPATH0) \
  2827. -char unsigned \
  2828. -ms_ext -c_ext \
  2829. -cstub $(PASS0_CLIENTDIR)\$(<F:.idl=_c.c) \
  2830. -sstub $(PASS0_SERVERDIR)\$(<F:.idl=_s.c) \
  2831. $(MIDL_TLBSWITCH) \
  2832. -header $@ \
  2833. -cpp_cmd $(MIDL_CPP) \
  2834. $(C_DEFINES) \
  2835. $(MIDL_FLAGS) \
  2836. $(MIDL_OPTIMIZATION) \
  2837. $<
  2838. ! ENDIF
  2839. !ELSE
  2840. ! ERROR Invalid IDL_TYPE value. Supported values: OLE and RPC.
  2841. !ENDIF # IDL_TYPE
  2842. CPPXX = $(C_PREPROCESSOR_FLAGS:/Tc=)
  2843. CPPXX = $(CPPXX:-Tc=)
  2844. !IFNDEF NO_PASS0_RULES
  2845. ! IFNDEF MC_SOURCEDIR
  2846. ! IFDEF PASS0_SOURCEDIR
  2847. MC_SOURCEDIR=$(PASS0_SOURCEDIR)
  2848. ! ELSE
  2849. MC_SOURCEDIR=$(PASS0_CLIENTDIR)
  2850. ! ENDIF
  2851. ! ENDIF
  2852. .mc{$(PASS0_HEADERDIR)}.h:
  2853. $(MC) -h $(PASS0_HEADERDIR) -r $(MC_SOURCEDIR) $(MC_FLAGS) $<
  2854. .mc{$(MC_SOURCEDIR)}.rc:
  2855. $(MC) -h $(PASS0_HEADERDIR) -r $(MC_SOURCEDIR) $(MC_FLAGS) $<
  2856. {..\}.mc{$(PASS0_HEADERDIR)}.h:
  2857. $(MC) -h $(PASS0_HEADERDIR) -r $(MC_SOURCEDIR) $(MC_FLAGS) $<
  2858. {..\}.mc{$(MC_SOURCEDIR)}.rc:
  2859. $(MC) -h $(PASS0_HEADERDIR) -r $(MC_SOURCEDIR) $(MC_FLAGS) $<
  2860. {$(O)}.mc{$(PASS0_HEADERDIR)}.h:
  2861. $(MC) -h $(PASS0_HEADERDIR) -r $(MC_SOURCEDIR) $(MC_FLAGS) $<
  2862. {$(O)}.mc{$(MC_SOURCEDIR)}.rc:
  2863. $(MC) -h $(PASS0_HEADERDIR) -r $(MC_SOURCEDIR) $(MC_FLAGS) $<
  2864. # ManagedObjectFormat files
  2865. # First preprocess MOF via the C pre processor
  2866. # Next separate MOF into MOF and MFL, then concatenate them and
  2867. # finally compile into binary form
  2868. {..\}.mof{$(O)}.mof:
  2869. @type <<$(ECHO_RSP)
  2870. $(ECHO_MSG) /EP $<
  2871. <<NOKEEP
  2872. @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $@
  2873. $(CPPXX: =
  2874. )
  2875. <<NOKEEP
  2876. {}.mof{$(O)}.mof:
  2877. @type <<$(ECHO_RSP)
  2878. $(ECHO_MSG) /EP $<
  2879. <<NOKEEP
  2880. @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $@
  2881. $(CPPXX: =
  2882. )
  2883. <<NOKEEP
  2884. {$(O)}.mof{$(O)}.bmf:
  2885. $(MOFCOMP) -N:root\wmi -Amendment:ms_409 -MFL:$(O)\MFL.MFL -MOF:$(O)\MOF.MOF $<
  2886. wmimofck -y$(O)\MOF.MOF -z$(O)\MFL.MFL $(O)\MOFMFL.MOF
  2887. $(MOFCOMP) -WMI -B:$@ $(O)\MOFMFL.MOF
  2888. !ifdef USE_MIDL_FOR_MKTYPLIB
  2889. MIDL_MKTYPLIB_FLAGS = \
  2890. $(PACKING) \
  2891. $(INCPATH0) \
  2892. -char unsigned \
  2893. -ms_ext \
  2894. -c_ext \
  2895. $(C_DEFINES) -D__MKTYPLIB__ \
  2896. $(MIDL_FLAGS) \
  2897. $(MIDL_OPTIMIZATION) \
  2898. $(MKTYPLIB_FLAGS:-h =-header ) \
  2899. -tlb $@ \
  2900. -cpp_cmd $(MIDL_CPP) \
  2901. -mktyplib203
  2902. .odl{$(O)\}.tlb:
  2903. $(MIDL) $(MIDL_MKTYPLIB_FLAGS) $<
  2904. {..\}.odl{$(O)\}.tlb:
  2905. $(MIDL) $(MIDL_MKTYPLIB_FLAGS) $<
  2906. .tdl{$(O)\}.tlb:
  2907. $(MIDL) $(MIDL_MKTYPLIB_FLAGS) $<
  2908. {..\}.tdl{$(O)\}.tlb:
  2909. $(MIDL) $(MIDL_MKTYPLIB_FLAGS) $<
  2910. !else
  2911. .odl{$(O)\}.tlb:
  2912. @echo $(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $<
  2913. @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $(O)\MyTypLib.TMP
  2914. $(CPPXX: =
  2915. )
  2916. -D__MKTYPLIB__
  2917. <<NOKEEP
  2918. @$(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $(O)\MyTypLib.TMP
  2919. {..\}.odl{$(O)\}.tlb:
  2920. @echo $(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $<
  2921. @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $(O)\MyTypLib.TMP
  2922. $(CPPXX: =
  2923. )
  2924. -D__MKTYPLIB__
  2925. <<NOKEEP
  2926. @$(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $(O)\MyTypLib.TMP
  2927. .tdl{$(O)\}.tlb:
  2928. @echo $(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $<
  2929. @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $(O)\MyTypLib.TMP
  2930. $(CPPXX: =
  2931. )
  2932. -D__MKTYPLIB__
  2933. <<NOKEEP
  2934. @$(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $(O)\MyTypLib.TMP
  2935. {..\}.tdl{$(O)\}.tlb:
  2936. @echo $(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $<
  2937. @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $(O)\MyTypLib.TMP
  2938. $(CPPXX: =
  2939. )
  2940. -D__MKTYPLIB__
  2941. <<NOKEEP
  2942. @$(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $(O)\MyTypLib.TMP
  2943. !endif
  2944. # OSSINFO must be set in the *environment* for the ASN compiler to find its
  2945. # configuration file, $(OSSINFO)\ossinfo.
  2946. ! ifndef OSSINFO
  2947. OSSINFO=$(SDK_LIB_DEST)
  2948. ! endif
  2949. ! ifndef ASNDEFAULTFILE
  2950. ASNDEFAULTFILE=$(OSSINFO)\asn1dflt.z4
  2951. ! endif
  2952. ! ifndef ASNSYNTAX
  2953. ASNSYNTAX=-1990
  2954. ! endif
  2955. ASNFLAGS=$(ASNDEFAULTFILE) $(ASNSYNTAX) $(ASNFLAGS)
  2956. # if ASNDBG is explicitly set, let that control whether the voluminous ASN
  2957. # symbols are supressed. Otherwise, suppress the symbols for free builds.
  2958. ! ifdef ASNDBG
  2959. ! if $(ASNDBG) == 0
  2960. ASNFLAGS=-minimize $(ASNFLAGS)
  2961. ! endif
  2962. ! elseif $(FREEBUILD)
  2963. ASNFLAGS=-minimize $(ASNFLAGS)
  2964. ! endif
  2965. {}.asn{$(PASS0_HEADERDIR)}.h:
  2966. $(ASN) $(ASNFLAGS) -out $(PASS0_HEADERDIR)\$(@B) $<
  2967. !ENDIF
  2968. #
  2969. # Default language ID to US English (0x0409)
  2970. #
  2971. !IFDEF RCCODEPAGE
  2972. RCOPTIONS=$(RCOPTIONS) -c $(RCCODEPAGE)
  2973. !ENDIF
  2974. !IFNDEF RCNOFONTMAP
  2975. RCOPTIONS=-z "MS Sans Serif,Helv/MS Shell Dlg" $(RCOPTIONS)
  2976. !ENDIF
  2977. SXS_RC_MANIFEST_DEFINES=$(SXS_MANIFEST_DEFINES)
  2978. SXS_RC_MANIFEST_DEFINES=$(SXS_RC_MANIFEST_DEFINES:"\"=""")
  2979. SXS_RC_MANIFEST_DEFINES=$(SXS_RC_MANIFEST_DEFINES:\""=""")
  2980. RCOPTIONS=$(SXS_RC_MANIFEST_DEFINES) $(RCOPTIONS)
  2981. !ifdef RCLANGUAGE
  2982. RCOPTIONS=-l $(RCLANGUAGE) $(RCOPTIONS)
  2983. !else
  2984. RCOPTIONS=-l 409 $(RCOPTIONS)
  2985. !endif
  2986. RC_COMPILER=rc $(RCOPTIONS)
  2987. INCPATHRC = $(INCPATH0: =)
  2988. INCPATHRC = $(INCPATHRC:-I=;)
  2989. INCPATHRC = $(INCPATHRC:/I=;)
  2990. CDEFINERC = $(CDEFINES: = )
  2991. CDEFINERC = $(CDEFINERC: = )
  2992. !if defined(RC_FORCE_INCLUDE_FILES)
  2993. # Concatenate the FORCE_INCLUDES files in front of the .rc file.
  2994. # We put nul in front because there is an extra leading semicolon which produces
  2995. # an extra leading plus sign.
  2996. RC_TEMP1=$(@R).rc_temp1
  2997. RC_FORCE_INCLUDE_FILES_CMD=copy nul$(RC_FORCE_INCLUDE_FILES:;=+)+$< $(RC_TEMP1)
  2998. INCPATHRC=$(INCPATHRC);..
  2999. !else
  3000. RC_TEMP1=$<
  3001. RC_FORCE_INCLUDE_FILES_CMD=
  3002. !endif
  3003. !if defined(RC_FORCE_INCLUDE_STRING)
  3004. RC_TEMP2=$(@R).rc_temp2
  3005. INCPATHRC=$(INCPATHRC);..
  3006. !else
  3007. RC_TEMP2=$(RC_TEMP1)
  3008. !endif
  3009. RC_TEMP=$(RC_TEMP2)
  3010. !if defined(SXS_MANIFEST_IN_RESOURCES)
  3011. MAKE_MANIFEST_CMD=nmake -nologo $(SXS_MANIFEST_OBJ1)
  3012. !else
  3013. MAKE_MANIFEST_CMD=
  3014. !endif
  3015. !IF $(MPPC)
  3016. {$(O)\}.rc{$(O)\}.res:
  3017. $(RC_COMPILER) -r -m -fo $@ $(RC_DEFINES) $(RCXBANG) $(INCPATH0) $<
  3018. !ELSE
  3019. {$(O)\}.rc{$(O)\}.res:
  3020. $(TYPE) <<$(ECHO_RSP)
  3021. $(RC_COMPILER) -r -fo $@ $(CDEFINES) $(INCPATH0) $<
  3022. <<NOKEEP
  3023. $(NOECHO)$(MAKE_MANIFEST_CMD)
  3024. $(NOECHO)$(RC_FORCE_INCLUDE_FILES_CMD)
  3025. ! IF defined(RC_FORCE_INCLUDE_STRING)
  3026. $(NOECHO)copy << + $(RC_TEMP1) $(RC_TEMP2)
  3027. $(RC_FORCE_INCLUDE_STRING)
  3028. <<NOKEEP
  3029. ! endif
  3030. $(NOECHO)set include=$(INCPATHRC);$(INCLUDE)
  3031. $(NOECHO)$(RC_COMPILER) -r -fo $@ $(CDEFINERC) $(RC_TEMP)
  3032. $(NOECHO)set include=$(INCLUDE)
  3033. !ENDIF
  3034. !IF $(MPPC)
  3035. {..\}.rc{$(O)\}.res:
  3036. $(RC_COMPILER) -r -m -fo $@ $(RC_DEFINES) $(RCXBANG) $(INCPATH0) $<
  3037. !ELSE
  3038. {..\}.rc{$(O)\}.res:
  3039. $(TYPE) <<$(ECHO_RSP)
  3040. $(RC_COMPILER) -r -fo $@ $(CDEFINES) $(INCPATH0) $<
  3041. <<NOKEEP
  3042. $(NOECHO)$(MAKE_MANIFEST_CMD)
  3043. $(NOECHO)$(RC_FORCE_INCLUDE_FILES_CMD)
  3044. ! if defined(RC_FORCE_INCLUDE_STRING)
  3045. $(NOECHO)copy << + $(RC_TEMP1) $(RC_TEMP2)
  3046. $(RC_FORCE_INCLUDE_STRING)
  3047. <<NOKEEP
  3048. ! endif
  3049. $(NOECHO)set include=$(INCPATHRC);$(INCLUDE)
  3050. $(NOECHO)$(RC_COMPILER) -r -fo $@ $(CDEFINERC) $(RC_TEMP)
  3051. $(NOECHO)set include=$(INCLUDE)
  3052. !ENDIF
  3053. !IF $(MPPC)
  3054. {}.rc{$(O)\}.res:
  3055. $(RC_COMPILER) -r -m -fo $@ $(RC_DEFINES) $(RCXBANG) $(INCPATH0) $<
  3056. !ELSE
  3057. {}.rc{$(O)\}.res:
  3058. $(TYPE) <<$(ECHO_RSP)
  3059. $(RC_COMPILER) -r -fo $@ $(CDEFINES) $(INCPATH0) $<
  3060. <<NOKEEP
  3061. $(NOECHO)$(MAKE_MANIFEST_CMD)
  3062. $(NOECHO)$(RC_FORCE_INCLUDE_FILES_CMD)
  3063. ! if defined(RC_FORCE_INCLUDE_STRING)
  3064. $(NOECHO)copy << + $(RC_TEMP1) $(RC_TEMP2)
  3065. $(RC_FORCE_INCLUDE_STRING)
  3066. <<NOKEEP
  3067. ! endif
  3068. $(NOECHO)set include=$(INCPATHRC);$(INCLUDE)
  3069. $(NOECHO)$(RC_COMPILER) -r -fo $@ $(CDEFINERC) $(RC_TEMP)
  3070. $(NOECHO)set include=$(INCLUDE)
  3071. !ENDIF
  3072. !IF $(MPPC)
  3073. #
  3074. # The definitions for the resource compiler are the same as the definitions
  3075. # for the C compiler except we need to remove INC_OLE2 because the resource
  3076. # compiler doesn't understand the pragma's that the VC guys used to rename
  3077. # the macos include files. Thus, the resource compiler can't parse the ole
  3078. # headers
  3079. #
  3080. RC_DEFINES=$(C_DEFINES:INC_OLE2=NO_OLE)
  3081. #
  3082. # Setup for the mac resource compiler
  3083. #
  3084. # Macintosh-specific resourse (.r) to .rsc rule
  3085. MRC_COMPILER=mrc -l 0x409
  3086. .SUFFIXES: .r
  3087. {..\}.r{$(_OBJ_DIR)\$(TARGET_DIRECTORY)\}.rsc:
  3088. $(MRC_COMPILER) -o $(@R).rsc $(RC_DEFINES) $(INCPATH0) $<
  3089. .r{$(_OBJ_DIR)\$(TARGET_DIRECTORY)\}.rsc:
  3090. $(MRC_COMPILER) -o $(@R).rsc $(RC_DEFINES) $(INCPATH0) $<
  3091. !ENDIF
  3092. {..\}.rc.rcpp:
  3093. set include=$(INCPATHRC);$(INCLUDE)
  3094. $(RC_COMPILER) -r -p -fo $(@R).tmp $(CDEFINERC) $<
  3095. @set include=$(INCLUDE)
  3096. {}.rc.rcpp:
  3097. set include=$(INCPATHRC);$(INCLUDE)
  3098. $(RC_COMPILER) -r -p -fo $(@R).tmp $(CDEFINERC) $<
  3099. @set include=$(INCLUDE)
  3100. .thk{$(O)\}.asm:
  3101. thunk -o $@ $<
  3102. JVC = jvc /nologo
  3103. !ifndef JAVA_DEBUG_FLAGS
  3104. !if $(FREEBUILD)
  3105. JAVA_DEBUG_FLAGS = /O
  3106. !else
  3107. JAVA_DEBUG_FLAGS = /g
  3108. !endif
  3109. !endif
  3110. !ifndef JAVA_WARNING_FLAGS
  3111. JAVA_WARNING_FLAGS = /w4
  3112. !endif
  3113. JAVA_BASE_CLASS = \
  3114. $(SDK_PATH)\classes\afc.zip; \
  3115. $(SDK_PATH)\classes\classes.zip
  3116. JAVA_CLASS_PATH = $(JAVA_BASE_CLASS); $(MAKEDIR); $(USER_CLASS_PATH)
  3117. JAVA_CLASS_PATH = $(JAVA_CLASS_PATH: =)
  3118. JVC_FLAGS = /cp $(JAVA_CLASS_PATH) $(JAVA_DEBUG_FLAGS) $(JAVA_WARNING_FLAGS) /d $(O)
  3119. {$(MAKEDIR)}.java{$(O)\}.class:
  3120. $(JVC) $(JVC_FLAGS) $<
  3121. #
  3122. # The DDK must support using VC 5 which does not support the /FC switch
  3123. # allow disabling of it
  3124. #
  3125. !ifdef DDK_VC5_COMPILE
  3126. USE_FC =
  3127. !else
  3128. USE_FC = /FC
  3129. !endif
  3130. ECHO_RSP = $(O)\echo.msg
  3131. CL_RSP = $(O)\cl.rsp
  3132. CLCOD_RSP = $(O)\clcod.rsp
  3133. LINK_RSP = $(O)\lnk.rsp
  3134. {$(O)\}.cxx{$(O)\}.obj:
  3135. @type <<$(ECHO_RSP)
  3136. $(ECHO_CXX_MSG)
  3137. <<NOKEEP
  3138. @$(CXX_COMPILER_NAME) @<<$(CL_RSP) -Fo"$(MAKEDIR)\$(O)/" $(USE_FC)
  3139. $(CXX_COMPILER_FLAGS: =
  3140. )
  3141. $<
  3142. <<NOKEEP
  3143. {..\}.cxx{$(O)\}.obj::
  3144. @type <<$(ECHO_RSP)
  3145. $(ECHO_CXX_MSG)
  3146. <<NOKEEP
  3147. @$(CXX_COMPILER_NAME) @<<$(CL_RSP) -Fo"$(MAKEDIR)\$(O)/" $(USE_FC)
  3148. $(CXX_COMPILER_FLAGS: =
  3149. )
  3150. $<
  3151. <<NOKEEP
  3152. {..\$(TARGET_DIRECTORY)\}.cxx{$(O)\}.obj::
  3153. @type <<$(ECHO_RSP)
  3154. $(ECHO_CXX_MSG)
  3155. <<NOKEEP
  3156. @$(CXX_COMPILER_NAME) @<<$(CL_RSP) -Fo"$(MAKEDIR)\$(O)/" $(USE_FC)
  3157. $(CXX_COMPILER_FLAGS: =
  3158. )
  3159. $<
  3160. <<NOKEEP
  3161. {$(O)\}.cpp{$(O)\}.obj::
  3162. @type <<$(ECHO_RSP)
  3163. $(ECHO_CXX_MSG)
  3164. <<NOKEEP
  3165. @$(CXX_COMPILER_NAME) @<<$(CL_RSP) -Fo"$(MAKEDIR)\$(O)/" $(USE_FC)
  3166. $(CXX_COMPILER_FLAGS: =
  3167. )
  3168. $<
  3169. <<NOKEEP
  3170. {..\}.cpp{$(O)\}.obj::
  3171. @type <<$(ECHO_RSP)
  3172. $(ECHO_CXX_MSG)
  3173. <<NOKEEP
  3174. @$(CXX_COMPILER_NAME) @<<$(CL_RSP) -Fo"$(MAKEDIR)\$(O)/" $(USE_FC)
  3175. $(CXX_COMPILER_FLAGS: =
  3176. )
  3177. $<
  3178. <<NOKEEP
  3179. {..\$(TARGET_DIRECTORY)\}.cpp{$(O)\}.obj::
  3180. @type <<$(ECHO_RSP)
  3181. $(ECHO_CXX_MSG)
  3182. <<NOKEEP
  3183. @$(CXX_COMPILER_NAME) @<<$(CL_RSP) -Fo"$(MAKEDIR)\$(O)/" $(USE_FC)
  3184. $(CXX_COMPILER_FLAGS: =
  3185. )
  3186. $<
  3187. <<NOKEEP
  3188. {}.cxx{$(O)\}.obj::
  3189. @type <<$(ECHO_RSP)
  3190. $(ECHO_CXX_MSG)
  3191. <<NOKEEP
  3192. @$(CXX_COMPILER_NAME) @<<$(CL_RSP) -Fo"$(MAKEDIR)\$(O)/" $(USE_FC)
  3193. $(CXX_COMPILER_FLAGS: =
  3194. )
  3195. $<
  3196. <<NOKEEP
  3197. {$(TARGET_DIRECTORY)\}.cxx{$(O)\}.obj::
  3198. @type <<$(ECHO_RSP)
  3199. $(ECHO_CXX_MSG)
  3200. <<NOKEEP
  3201. @$(CXX_COMPILER_NAME) @<<$(CL_RSP) -Fo"$(MAKEDIR)\$(O)/" $(USE_FC)
  3202. $(CXX_COMPILER_FLAGS: =
  3203. )
  3204. $<
  3205. <<NOKEEP
  3206. {}.cpp{$(O)\}.obj::
  3207. @type <<$(ECHO_RSP)
  3208. $(ECHO_CXX_MSG)
  3209. <<NOKEEP
  3210. @$(CXX_COMPILER_NAME) @<<$(CL_RSP) -Fo"$(MAKEDIR)\$(O)/" $(USE_FC)
  3211. $(CXX_COMPILER_FLAGS: =
  3212. )
  3213. $<
  3214. <<NOKEEP
  3215. {$(TARGET_DIRECTORY)\}.cpp{$(O)\}.obj::
  3216. @type <<$(ECHO_RSP)
  3217. $(ECHO_CXX_MSG)
  3218. <<NOKEEP
  3219. @$(CXX_COMPILER_NAME) @<<$(CL_RSP) -Fo"$(MAKEDIR)\$(O)/" $(USE_FC)
  3220. $(CXX_COMPILER_FLAGS: =
  3221. )
  3222. $<
  3223. <<NOKEEP
  3224. {..\}.cxx{}.cod:
  3225. $(CXX_COMPILER_NAME) @<<$(CLCOD_RSP) /Fc $(USE_FC)
  3226. $(CXX_COMPILER_FLAGS: =
  3227. )
  3228. $<
  3229. <<NOKEEP
  3230. {..\}.cxx{}.pp:
  3231. $(CXX_COMPILER_NAME) @<<$(CL_RSP) /E $(USE_FC) $< > $@
  3232. $(CXX_COMPILER_FLAGS: =
  3233. )
  3234. <<NOKEEP
  3235. {..\}.cpp{}.cod:
  3236. $(CXX_COMPILER_NAME) @<<$(CLCOD_RSP) /Fc $(USE_FC)
  3237. $(CXX_COMPILER_FLAGS: =
  3238. )
  3239. $<
  3240. <<NOKEEP
  3241. {..\}.cpp{}.pp:
  3242. $(CXX_COMPILER_NAME) @<<$(CL_RSP) /E $(USE_FC) $< > $@
  3243. $(CXX_COMPILER_FLAGS: =
  3244. )
  3245. <<NOKEEP
  3246. {}.cxx{}.cod:
  3247. $(CXX_COMPILER_NAME) @<<$(CLCOD_RSP) /Fc $(USE_FC) $<
  3248. $(CXX_COMPILER_FLAGS: =
  3249. )
  3250. <<NOKEEP
  3251. {}.cxx{}.pp:
  3252. $(CXX_COMPILER_NAME) @<<$(CL_RSP) /E $(USE_FC) $< > $@
  3253. $(CXX_COMPILER_FLAGS: =
  3254. )
  3255. <<NOKEEP
  3256. {}.cpp{}.cod:
  3257. $(CXX_COMPILER_NAME) @<<$(CLCOD_RSP) /Fc $(USE_FC) $<
  3258. $(CXX_COMPILER_FLAGS: =
  3259. )
  3260. <<NOKEEP
  3261. {}.cpp{}.pp:
  3262. $(CXX_COMPILER_NAME) @<<$(CL_RSP) /E $(USE_FC) $< > $@
  3263. $(CXX_COMPILER_FLAGS: =
  3264. )
  3265. <<NOKEEP
  3266. # Expand spaces to newlines, replace double # signs with spaces.
  3267. EX_C_COMPILER_FLAGS=$(C_COMPILER_FLAGS: =^
  3268. )
  3269. EX_C_COMPILER_FLAGS=$(EX_C_COMPILER_FLAGS:^#^#= )
  3270. {..\}.c{$(O)\}.obj::
  3271. @type <<$(ECHO_RSP)
  3272. $(ECHO_MSG)
  3273. <<NOKEEP
  3274. @$(C_COMPILER_NAME) @<<$(CL_RSP) -Fo"$(MAKEDIR)\$(O)/" $(USE_FC) $(USECXX_FLAG)
  3275. $(EX_C_COMPILER_FLAGS)
  3276. $<
  3277. <<NOKEEP
  3278. {..\$(TARGET_DIRECTORY)\}.c{$(O)\}.obj::
  3279. @type <<$(ECHO_RSP)
  3280. $(ECHO_MSG)
  3281. <<NOKEEP
  3282. @$(C_COMPILER_NAME) @<<$(CL_RSP) -Fo"$(MAKEDIR)\$(O)/" $(USE_FC) $(USECXX_FLAG)
  3283. $(EX_C_COMPILER_FLAGS)
  3284. $<
  3285. <<NOKEEP
  3286. {$(O)\}.c{$(O)\}.obj::
  3287. @type <<$(ECHO_RSP)
  3288. $(ECHO_MSG)
  3289. <<NOKEEP
  3290. @$(C_COMPILER_NAME) @<<$(CL_RSP) -Fo"$(MAKEDIR)\$(O)/" $(USE_FC)
  3291. $(EX_C_COMPILER_FLAGS)
  3292. $<
  3293. <<NOKEEP
  3294. {}.c{$(O)\}.obj::
  3295. @type <<$(ECHO_RSP)
  3296. $(ECHO_MSG)
  3297. <<NOKEEP
  3298. @$(C_COMPILER_NAME) @<<$(CL_RSP) -Fo"$(MAKEDIR)\$(O)/" $(USE_FC) $(USECXX_FLAG)
  3299. $(EX_C_COMPILER_FLAGS)
  3300. $<
  3301. <<NOKEEP
  3302. {$(TARGET_DIRECTORY)\}.c{$(O)\}.obj::
  3303. @type <<$(ECHO_RSP)
  3304. $(ECHO_MSG)
  3305. <<NOKEEP
  3306. @$(C_COMPILER_NAME) @<<$(CL_RSP) -Fo"$(MAKEDIR)\$(O)/" $(USE_FC) $(USECXX_FLAG)
  3307. $(EX_C_COMPILER_FLAGS)
  3308. $<
  3309. <<NOKEEP
  3310. {..\}.c{}.cod:
  3311. $(C_COMPILER_NAME) @<<$(CLCOD_RSP) /Fc $(USE_FC) $(USECXX_FLAG) $<
  3312. $(EX_C_COMPILER_FLAGS:/GL=/wd4652)
  3313. <<NOKEEP
  3314. {$(O)\}.c{}.cod:
  3315. $(C_COMPILER_NAME) @<<$(CLCOD_RSP) /Fc $(USE_FC) $(USECXX_FLAG) $<
  3316. $(EX_C_COMPILER_FLAGS:/GL=/wd4652)
  3317. <<NOKEEP
  3318. {..\$(TARGET_DIRECTORY)\}.c{}.cod:
  3319. $(C_COMPILER_NAME) @<<$(CLCOD_RSP) /Fc $(USE_FC) $(USECXX_FLAG) $<
  3320. $(EX_C_COMPILER_FLAGS:/GL=/wd4652)
  3321. <<NOKEEP
  3322. {$(O)\}.c{}.pp:
  3323. $(C_COMPILER_NAME) @<<$(CL_RSP) /E $(USE_FC) $(USECXX_FLAG) $< > $@
  3324. $(EX_C_COMPILER_FLAGS)
  3325. <<NOKEEP
  3326. {..\}.c{}.pp:
  3327. $(C_COMPILER_NAME) @<<$(CL_RSP) /E $(USE_FC) $(USECXX_FLAG) $< > $@
  3328. $(EX_C_COMPILER_FLAGS)
  3329. <<NOKEEP
  3330. {..\$(TARGET_DIRECTORY)\}.c{}.pp:
  3331. $(C_COMPILER_NAME) @<<$(CL_RSP) /E $(USE_FC) $(USECXX_FLAG) $< > $@
  3332. $(EX_C_COMPILER_FLAGS)
  3333. <<NOKEEP
  3334. {}.c{}.cod:
  3335. $(C_COMPILER_NAME) @<<$(CLCOD_RSP) /Fc $(USE_FC) $(USECXX_FLAG) $<
  3336. $(EX_C_COMPILER_FLAGS:/GL=/wd4652)
  3337. <<NOKEEP
  3338. {$(TARGET_DIRECTORY)\}.c{}.cod:
  3339. $(C_COMPILER_NAME) @<<$(CLCOD_RSP) /Fc $(USE_FC) $(USECXX_FLAG) $<
  3340. $(EX_C_COMPILER_FLAGS:/GL=/wd4652)
  3341. <<NOKEEP
  3342. {}.c{}.pp:
  3343. $(C_COMPILER_NAME) @<<$(CL_RSP) /E $(USE_FC) $(USECXX_FLAG) $< > $@
  3344. $(EX_C_COMPILER_FLAGS)
  3345. <<NOKEEP
  3346. {$(TARGET_DIRECTORY)\}.c{}.pp:
  3347. $(C_COMPILER_NAME) @<<$(CL_RSP) /E $(USE_FC) $(USECXX_FLAG) $< > $@
  3348. $(EX_C_COMPILER_FLAGS)
  3349. <<NOKEEP
  3350. {}.c{$(TARGET_DIRECTORY)\}.pp:
  3351. $(C_COMPILER_NAME) @<<$(CL_RSP) /E $(USE_FC) $(USECXX_FLAG) $< > $@
  3352. $(EX_C_COMPILER_FLAGS)
  3353. <<NOKEEP
  3354. #
  3355. # C# compiler rules
  3356. #
  3357. EX_MANAGED_COMPILER_FLAGS=$(MANAGED_STD_FLAGS)
  3358. {..\}.cs{$O\}.dll::
  3359. @type <<$(ECHO_RSP)
  3360. $(ECHO_MSG)
  3361. @$(CS_COMPILER_NAME) @<<$(CS_RSP)
  3362. $(EX_MANAGED_COMPILER_FLAGS)
  3363. $<
  3364. <<NOKEEP
  3365. {..\}.vb{$O\}.dll::
  3366. @type <<$(ECHO_RSP)
  3367. $(ECHO_MSG)
  3368. <<NOKEEP
  3369. @$(VB_NET_COMPILER_NAME) @<<$(VB_RSP)
  3370. $(EX_MANAGED_COMPILER_FLAGS)
  3371. $<
  3372. <<NOKEEP
  3373. #
  3374. # resgen rules
  3375. #
  3376. {}.resz{$(O)}.resources:
  3377. resxgen.exe $< $*.resx
  3378. resgen.exe $*.resx $@
  3379. {}.resx{$(O)}.resources:
  3380. resgen.exe $< $@
  3381. {}.txt{$(O)}.resources:
  3382. resgen.exe $< $@
  3383. #
  3384. # SDL proxy generation rules
  3385. #
  3386. .sdl.cs::
  3387. webserviceutil /c:proxy /path:$<
  3388. !if "$(NTNOFUZZYLOOKUP)"=="1"
  3389. LIBRARY_OBJS=
  3390. !else
  3391. LIBRARY_OBJS = $(LIBRARY_OBJS) $(HEADEROBJNAME)
  3392. !endif
  3393. !ifdef USE_INCREMENTAL_LINKING
  3394. IMPLIB_DEPEND =
  3395. !else
  3396. IMPLIB_DEPEND = $(LIBRARY_OBJS)
  3397. !endif
  3398. #
  3399. # inference rules for preprocessing manifests
  3400. # It would be nice to go from .manifest to .manifest.obj, but nmake doesn't work that way.
  3401. # There is some precedent for going from .src to .manifest, but I'd rather generated files
  3402. # end in obj. But we can't go from .manifest to .manifestobj either, because of the case
  3403. # of manifests not in resources.
  3404. #
  3405. # .manifest-src is needed only for the unusual case of multiple manifests resources,
  3406. # when you write the .rc file lines by hand instead of us doing it for you, and
  3407. # then the .rc is not pushed into the objdir and it picks up the unpreprocessed one.
  3408. # For example: \nt\base\win32\fusion\tests\sxstest\testdata\Hello\ExeMultiRes.
  3409. #
  3410. # .man is for fitting in 8.3
  3411. #
  3412. .SUFFIXES: .manifest-src .manifest .man
  3413. # This string is needed in at least four places in the tree, so factor it to here.
  3414. SYSTEM_COMPATIBLE_ASSEMBLY_NAME=Microsoft.Windows.SystemCompatible
  3415. DEFINE_SYSTEM_COMPATIBLE_ASSEMBLY_NAME=\
  3416. -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME="\"$(SYSTEM_COMPATIBLE_ASSEMBLY_NAME)\"" \
  3417. -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L"\"$(SYSTEM_COMPATIBLE_ASSEMBLY_NAME)\""
  3418. SYSTEM_COMPATIBLE_ASSEMBLY_VERSION=5.2
  3419. SYSTEM_COMPATIBLE_ASSEMBLY_VERSION_PART_3=0
  3420. SYSTEM_COMPATIBLE_ASSEMBLY_VERSION_PART_4=0
  3421. SXS_MANIFEST_DEFINES= \
  3422. -DSXS_ASSEMBLY_NAME="\"$(SXS_ASSEMBLY_NAME)\"" \
  3423. -DSXS_ASSEMBLY_VERSION="\"$(SXS_ASSEMBLY_VERSION)\"" \
  3424. -DSXS_ASSEMBLY_LANGUAGE="\"$(SXS_ASSEMBLY_LANGUAGE)\"" \
  3425. -DSXS_PROCESSOR_ARCHITECTURE="\"$(SXS_PROCESSOR_ARCHITECTURE)\"" \
  3426. -DSXS_TARGET="\"$(TARGETNAME).$(TARGETEXT:lib=dll)\"" \
  3427. $(DEFINE_SYSTEM_COMPATIBLE_ASSEMBLY_NAME) \
  3428. $(SXS_MANIFEST_DEFINES)
  3429. #MANIFEST_PREPROCESSOR_NAME=$(C_PREPROCESSOR_NAME)
  3430. # $(TARGET_CPP) does not include -FIwarning.h.
  3431. # Otherwise we have to filter the data through, like Perl:
  3432. # while (<>) {
  3433. # if (!/^#pragma.+/ && !/^$/) {
  3434. # print;
  3435. # }
  3436. #}
  3437. !ifndef MANIFEST_PREPROCESSOR_NAME
  3438. MANIFEST_PREPROCESSOR_NAME=preprocessor.exe
  3439. !endif
  3440. !ifndef MANIFEST_VALIDATOR_SCHEMA
  3441. MANIFEST_VALIDATOR_SCHEMA=$(NTMAKEENV)\appschema.xml
  3442. !endif
  3443. !ifndef MANIFEST_VALIDATOR_NAME
  3444. MANIFEST_VALIDATOR_NAME=FusionManifestValidator /b /s:$(MANIFEST_VALIDATOR_SCHEMA)
  3445. !endif
  3446. #
  3447. # .manifest-src -> .man
  3448. #
  3449. {}.manifest-src{$(O)}.man:
  3450. $(MANIFEST_PREPROCESSOR_NAME) -o $@ -i $< $(SXS_MANIFEST_DEFINES)
  3451. $(MANIFEST_VALIDATOR_NAME) /m:$@
  3452. {..}.manifest-src{$(O)}.man:
  3453. $(MANIFEST_PREPROCESSOR_NAME) -o $@ -i $< $(SXS_MANIFEST_DEFINES)
  3454. $(MANIFEST_VALIDATOR_NAME) /m:$@
  3455. {..\..}.manifest-src{$(O)}.man:
  3456. $(MANIFEST_PREPROCESSOR_NAME) -o $@ -i $< $(SXS_MANIFEST_DEFINES)
  3457. $(MANIFEST_VALIDATOR_NAME) /m:$@
  3458. #
  3459. # .manifest-src -> .manifest
  3460. #
  3461. {}.manifest-src{$(O)}.manifest:
  3462. $(MANIFEST_PREPROCESSOR_NAME) -o $@ -i $< $(SXS_MANIFEST_DEFINES)
  3463. $(MANIFEST_VALIDATOR_NAME) /m:$@
  3464. {..}.manifest-src{$(O)}.manifest:
  3465. $(MANIFEST_PREPROCESSOR_NAME) -o $@ -i $< $(SXS_MANIFEST_DEFINES)
  3466. $(MANIFEST_VALIDATOR_NAME) /m:$@
  3467. {..\..}.manifest-src{$(O)}.manifest:
  3468. $(MANIFEST_PREPROCESSOR_NAME) -o $@ -i $< $(SXS_MANIFEST_DEFINES)
  3469. $(MANIFEST_VALIDATOR_NAME) /m:$@
  3470. #
  3471. # .manifest -> .man
  3472. #
  3473. {}.manifest{$(O)}.man:
  3474. $(MANIFEST_PREPROCESSOR_NAME) -o $@ -i $< $(SXS_MANIFEST_DEFINES)
  3475. $(MANIFEST_VALIDATOR_NAME) /m:$@
  3476. {..}.manifest{$(O)}.man:
  3477. $(MANIFEST_PREPROCESSOR_NAME) -o $@ -i $< $(SXS_MANIFEST_DEFINES)
  3478. $(MANIFEST_VALIDATOR_NAME) /m:$@
  3479. {..\..}.manifest{$(O)}.man:
  3480. $(MANIFEST_PREPROCESSOR_NAME) -o $@ -i $< $(SXS_MANIFEST_DEFINES)
  3481. $(MANIFEST_VALIDATOR_NAME) /m:$@
  3482. {$(SXS_MANIFEST_SOURCE)}.manifest{$(O)}.man:
  3483. $(MANIFEST_PREPROCESSOR_NAME) -o $@ -i $< $(SXS_MANIFEST_DEFINES)
  3484. $(MANIFEST_VALIDATOR_NAME) /m:$@
  3485. #
  3486. # .manifest -> .manifest
  3487. #
  3488. {}.manifest{$(O)}.manifest:
  3489. $(MANIFEST_PREPROCESSOR_NAME) -o $@ -i $< $(SXS_MANIFEST_DEFINES)
  3490. $(MANIFEST_VALIDATOR_NAME) /m:$@
  3491. {..}.manifest{$(O)}.manifest:
  3492. $(MANIFEST_PREPROCESSOR_NAME) -o $@ -i $< $(SXS_MANIFEST_DEFINES)
  3493. $(MANIFEST_VALIDATOR_NAME) /m:$@
  3494. {..\..}.manifest{$(O)}.manifest:
  3495. $(MANIFEST_PREPROCESSOR_NAME) -o $@ -i $< $(SXS_MANIFEST_DEFINES)
  3496. $(MANIFEST_VALIDATOR_NAME) /m:$@
  3497. {$(SXS_MANIFEST_SOURCE)}.manifest{$(O)}.manifest:
  3498. $(MANIFEST_PREPROCESSOR_NAME) -o $@ -i $< $(SXS_MANIFEST_DEFINES)
  3499. $(MANIFEST_VALIDATOR_NAME) /m:$@
  3500. #
  3501. # Standard inference rule for generating machine specific def files.
  3502. #
  3503. .SUFFIXES: .def .src
  3504. {..\}.src{$(O)}.def:
  3505. @type <<$(ECHO_RSP)
  3506. $(ECHO_MSG) /EP $<
  3507. <<NOKEEP
  3508. @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $@
  3509. $(CPPXX: =
  3510. )
  3511. <<NOKEEP
  3512. {}.src{$(O)}.def:
  3513. @type <<$(ECHO_RSP)
  3514. $(ECHO_MSG) /EP $<
  3515. <<NOKEEP
  3516. @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $@
  3517. $(CPPXX: =
  3518. )
  3519. <<NOKEEP
  3520. {..\}.def{$(O)}.def:
  3521. @type <<$(ECHO_RSP)
  3522. $(ECHO_MSG) /EP $<
  3523. <<NOKEEP
  3524. @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $@
  3525. $(CPPXX: =
  3526. )
  3527. <<NOKEEP
  3528. {}.def{$(O)}.def:
  3529. @type <<$(ECHO_RSP)
  3530. $(ECHO_MSG) /EP $<
  3531. <<NOKEEP
  3532. @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $@
  3533. $(CPPXX: =
  3534. )
  3535. <<NOKEEP
  3536. # one more level down for HALS
  3537. {..\..\}.src{$(O)}.def:
  3538. @type <<$(ECHO_RSP)
  3539. $(ECHO_MSG) /EP $<
  3540. <<NOKEEP
  3541. @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $@
  3542. $(CPPXX: =
  3543. )
  3544. <<NOKEEP
  3545. !ifdef NO_BROWSER_FILE
  3546. BROWSERFILE=
  3547. !else
  3548. ! ifdef BROWSER_INFO
  3549. ! ifndef BROWSERFILE
  3550. ! if "$(TARGETNAME)" == ""
  3551. BROWSERFILE=
  3552. ! else
  3553. BROWSERFILE=$(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).bsc
  3554. ! endif
  3555. ! endif
  3556. ! else
  3557. BROWSERFILE=
  3558. ! endif
  3559. !endif
  3560. !if defined (USE_LINT) && ("$(LINT_TYPE)" != "all")
  3561. {}.cxx{$(O)\}.lob:
  3562. ! if "$(LINT_TYPE)" != "lob"
  3563. @echo done >$@
  3564. ! endif
  3565. $(LINT_CMD) $<
  3566. {$(TARGET_DIRECTORY)\}.cxx{$(O)\}.lob:
  3567. ! if "$(LINT_TYPE)" != "lob"
  3568. @echo done >$@
  3569. ! endif
  3570. $(LINT_CMD) $<
  3571. {..\}.cxx{$(O)\}.lob:
  3572. ! if "$(LINT_TYPE)" != "lob"
  3573. @echo done >$@
  3574. ! endif
  3575. $(LINT_CMD) $<
  3576. {..\$(TARGET_DIRECTORY)\}.cxx{$(O)\}.lob:
  3577. ! if "$(LINT_TYPE)" != "lob"
  3578. @echo done >$@
  3579. ! endif
  3580. $(LINT_CMD) $<
  3581. {}.cpp{$(O)\}.lob:
  3582. ! if "$(LINT_TYPE)" != "lob"
  3583. @echo done >$@
  3584. ! endif
  3585. $(LINT_CMD) $<
  3586. {$(TARGET_DIRECTORY)\}.cpp{$(O)\}.lob:
  3587. ! if "$(LINT_TYPE)" != "lob"
  3588. @echo done >$@
  3589. ! endif
  3590. $(LINT_CMD) $<
  3591. {..\}.cpp{$(O)\}.lob:
  3592. ! if "$(LINT_TYPE)" != "lob"
  3593. @echo done >$@
  3594. ! endif
  3595. $(LINT_CMD) $<
  3596. {..\$(TARGET_DIRECTORY)\}.cpp{$(O)\}.lob:
  3597. ! if "$(LINT_TYPE)" != "lob"
  3598. @echo done >$@
  3599. ! endif
  3600. $(LINT_CMD) $<
  3601. {}.c{$(O)\}.lob:
  3602. ! if "$(LINT_TYPE)" != "lob"
  3603. @echo done >$@
  3604. ! endif
  3605. $(LINT_CMD) $<
  3606. {$(TARGET_DIRECTORY)\}.c{$(O)\}.lob:
  3607. ! if "$(LINT_TYPE)" != "lob"
  3608. @echo done >$@
  3609. ! endif
  3610. $(LINT_CMD) $<
  3611. {..\}.c{$(O)\}.lob:
  3612. ! if "$(LINT_TYPE)" != "lob"
  3613. @echo done >$@
  3614. ! endif
  3615. $(LINT_CMD) $<
  3616. {..\$(TARGET_DIRECTORY)\}.c{$(O)\}.lob:
  3617. ! if "$(LINT_TYPE)" != "lob"
  3618. @echo done >$@
  3619. !endif
  3620. $(LINT_CMD) $<
  3621. !endif
  3622. #
  3623. # Standard inference rule for User Mode object files that produce User Mode
  3624. # image files
  3625. #
  3626. {$(O)\}.obj{$(O)\}$(UMAPPLEXT):
  3627. $(LINKER) @<<
  3628. $(LINKER_FLAGS: =
  3629. )
  3630. $(LINKER_STACKSIZE)
  3631. $(TSLINKER_FLAG)
  3632. $(ORDER: =
  3633. )
  3634. $(LINKGPSIZE: =
  3635. )
  3636. $(LINKER_OPTIDATA)
  3637. -base:$(UMBASE)
  3638. -subsystem:$(SUBSYSTEM)
  3639. $(UMENTRY)
  3640. $(HEADEROBJNAME: =
  3641. )
  3642. $(UMRES: =
  3643. )
  3644. $<
  3645. $(UMOBJS: =
  3646. )
  3647. $(UMLIBS: =
  3648. )
  3649. $(CRTLIBS: =
  3650. )
  3651. $(LINKLIBS: =
  3652. )
  3653. $(BO_LIB)
  3654. <<NOKEEP
  3655. $(POST_BUILD_CMD)
  3656. $(SCP_CMD)
  3657. $(SIGNCODE_CMD)
  3658. $(MAPSYM_CMD)
  3659. $(COMPRESS_CMD)
  3660. $(MAKE_PLACEFILE_CMD)
  3661. $(BINPLACE_CMD)
  3662. #
  3663. # Standard list of targets: all, clean and loc. all is the default target.
  3664. #
  3665. !IFNDEF PASS0ONLY
  3666. all: $(_OBJ_DIR)\_objects.mac \
  3667. $(NTTARGETFILE0) \
  3668. $(WPP_TARGETS) \
  3669. $(PASS0_OBJECTS) \
  3670. PASS0_Pub \
  3671. PASS0_Binp \
  3672. $(PRECOMPILED_TARGET) \
  3673. $(HEADEROBJNAME) \
  3674. build_objects \
  3675. $(SXS_MANIFEST_OBJ1) \
  3676. $(SXS_MANIFEST_OBJ2) \
  3677. $(TARGETLOBFILES1) \
  3678. $(TARGETLIBFILES) \
  3679. $(NTTARGETFILE1) \
  3680. $(TARGETEXEFILES) \
  3681. !if "$(BROWSERFILE)" != ""
  3682. $(BROWSERFILE) \
  3683. !endif
  3684. $(TARGETLOBFILES2) \
  3685. PASS1_Pub \
  3686. PASS1_Binp \
  3687. build_umobjects \
  3688. $(UMEXEFILES) \
  3689. !ifdef MANAGED_COVERAGE
  3690. MANAGED_CODECOVER \
  3691. !endif
  3692. $(NTTARGETFILES) \
  3693. PASS2_Pub \
  3694. PASS2_Binp \
  3695. ! if !$(MISCFILES_DURING_LINK) || !defined(NOLINK)
  3696. ! if "$(MISCFILES: =)" != "" || defined(SXS_MISCFILES)
  3697. $(MISCFILES) \
  3698. $(SXS_MISCFILES) \
  3699. ! ifdef _NTTREE
  3700. binplace_miscfiles \
  3701. ! endif
  3702. ! endif
  3703. ! endif
  3704. !ifdef SXS_LOG_CMD
  3705. sxs_log_cmd \
  3706. !endif
  3707. BINARY_Pub \
  3708. LastStep
  3709. ! if "$(BUILDMSG)" != ""
  3710. @echo.
  3711. @echo $(BUILDMSG)
  3712. ! endif
  3713. LastStep:
  3714. !ifdef SXS_LOG_CMD
  3715. sxs_log_cmd:
  3716. $(SXS_LOG_CMD)
  3717. !endif
  3718. binplace_miscfiles: $(MISCFILES) $(SXS_MISCFILES)
  3719. !ifndef NO_BINPLACE
  3720. $(MAKE_PLACEFILE_CMD)
  3721. $(BINPLACE_TOOL) $(BINPLACE_FLAGS) $(BINPLACE_LC_MISCFLAGS) @<<
  3722. $**
  3723. <<NOKEEP
  3724. !endif
  3725. build_objects: $(TARGETOBJFILES)
  3726. build_umobjects: $(UMOBJFILES)
  3727. !ELSE # PASS0ONLY
  3728. all: $(NTTARGETFILE0) \
  3729. $(WPP_TARGETS) \
  3730. $(PASS0_OBJECTS) \
  3731. PASS0_Pub \
  3732. PASS0_Binp
  3733. ! IF "$(BUILDMSG)" != ""
  3734. @echo.
  3735. @echo $(BUILDMSG)
  3736. ! ENDIF
  3737. !ENDIF # PASS0ONLY
  3738. update:
  3739. @echo Updating library.
  3740. $(_OBJ_DIR)\_objects.mac: $(SOURCES_USED)
  3741. @echo Rebuilding $(_OBJ_DIR)\_objects.mac from $(SOURCES_USED).
  3742. @build -OZf >nul 2>&1
  3743. @echo $(_OBJ_DIR)\_objects.mac was rebuilt, please reinvoke NMAKE
  3744. @md \ >nul 2>nul
  3745. !ifdef NO_BINPLACE
  3746. PASS0_BINP:
  3747. PASS1_BINP:
  3748. PASS2_BINP:
  3749. !else
  3750. PASS0_BINP:
  3751. !if defined(PASS0_BINPLACE) && "$(BUILD_PASS)" != "PASS1" && "$(BUILD_PASS)" != "PASS2"
  3752. $(BINPLACE_TOOL) @<<
  3753. $(BINPLACE_FLAGS)
  3754. $(PASS0_BINPLACE)
  3755. <<NOKEEP
  3756. !endif
  3757. PASS1_BINP:
  3758. !if defined(PASS1_BINPLACE) && "$(BUILD_PASS)" != "PASS0" && "$(BUILD_PASS)" != "PASS2"
  3759. $(BINPLACE_TOOL) @<<
  3760. $(BINPLACE_FLAGS)
  3761. $(PASS1_BINPLACE)
  3762. <<NOKEEP
  3763. !endif
  3764. PASS2_BINP:
  3765. !if defined(PASS2_BINPLACE) && "$(BUILD_PASS)" != "PASS0" && "$(BUILD_PASS)" != "PASS1"
  3766. $(BINPLACE_TOOL) @<<
  3767. $(BINPLACE_FLAGS)
  3768. $(PASS2_BINPLACE)
  3769. <<NOKEEP
  3770. !endif
  3771. !endif
  3772. PASS0_Pub:
  3773. !if defined(PASS0_PUBLISH) && "$(BUILD_PASS)" != "PASS1" && "$(BUILD_PASS)" != "PASS2"
  3774. $(PUBLISH_CMD) -F <<
  3775. $(PASS0_PUBLISH:}=}
  3776. )
  3777. <<NOKEEP
  3778. !endif
  3779. PASS1_Pub:
  3780. !if defined(PASS1_PUBLISH) && "$(BUILD_PASS)" != "PASS0" && "$(BUILD_PASS)" != "PASS2" && !defined(NOLIB)
  3781. $(PUBLISH_CMD) -F <<
  3782. $(PASS1_PUBLISH:}=}
  3783. )
  3784. <<NOKEEP
  3785. !endif
  3786. PASS2_Pub:
  3787. !if defined(PASS2_PUBLISH) && "$(BUILD_PASS)" != "PASS0" && "$(BUILD_PASS)" != "PASS1"
  3788. $(PUBLISH_CMD) -F <<
  3789. $(PASS2_PUBLISH:}=}
  3790. )
  3791. <<NOKEEP
  3792. !endif
  3793. #
  3794. # Binary drop runs only during the link phase
  3795. #
  3796. BINARY_Pub:
  3797. !ifdef BINARY_PUBLISH
  3798. ! if "$(BINPUBLISH)" == "1"
  3799. $(BINDROP_CMD) -F <<
  3800. $(BINARY_PUBLISH:}=}
  3801. )
  3802. <<NOKEEP
  3803. ! else
  3804. @echo BINARY_PUBLISH_PROJECTS in environment doesn't contain $(_PROJECT_) -
  3805. @echo binaries will not be published.
  3806. ! endif
  3807. !else if defined(BINARY_PUBLISH_FILES)
  3808. ! if "$(BINPUBLISH)" == "1"
  3809. @cmd /v:on /c make_publish_spec.cmd $(BINARY_PUBLISH_ROOT) $(O) $(BINARY_PUBLISH_FILES) | $(BINDROP_CMD) -I
  3810. ! else
  3811. @echo BINARY_PUBLISH_PROJECTS in environment doesn't contain $(_PROJECT_) -
  3812. @echo binaries will not be published.
  3813. ! endif
  3814. !endif
  3815. !IF DEFINED(NTTARGETFILES) || DEFINED(NTTARGETFILE0) || DEFINED(NTTARGETFILE1) || DEFINED(USE_MAKEFILE_INC)
  3816. ! INCLUDE .\makefile.inc
  3817. !ENDIF
  3818. !IF "$(PRECOMPILED_INCLUDE)" != ""
  3819. ! ifdef PRECOMPILED_SOURCEFILE
  3820. $(PRECOMPILED_TARGET) $(HEADEROBJNAME): $(PRECOMPILED_INCLUDE)
  3821. @type <<
  3822. $(ECHO_PRECOMPILED_MSG1)
  3823. <<NOKEEP
  3824. @$(C_COMPILER_NAME) @<< $(PRECOMPILED_FLAG) $(PRECOMPILED_SOURCEFILE)
  3825. $(EX_C_COMPILER_FLAGS)
  3826. /Yl$(TARGETNAME) /Yc$(?F) $(HEADERFILE) $(HEADEROBJ)
  3827. <<NOKEEP
  3828. ! else
  3829. $(PRECOMPILED_TARGET) $(HEADEROBJNAME): $(PRECOMPILED_INCLUDE)
  3830. @type <<$(O)\pch_hdr.src
  3831. $(ECHO_PRECOMPILED_MSG2)
  3832. #include "$(?F)"
  3833. <<NOKEEP
  3834. @$(C_COMPILER_NAME) @<< $(PRECOMPILED_FLAG)<<$(O)\pch_hdr.src
  3835. $(EX_C_COMPILER_FLAGS)
  3836. /Yl$(TARGETNAME) /Yc$(?F) $(HEADERFILE) $(HEADEROBJ)
  3837. <<NOKEEP
  3838. #include "$(?F)"
  3839. <<NOKEEP
  3840. ! endif
  3841. !ENDIF
  3842. !IFNDEF NOLINK
  3843. ! IF "$(UMTEST)" != "" || "$(UMAPPL)" != ""
  3844. $(UMEXEFILES): $(UMLIBS) $(CRTLIBS) $(LINKLIBS)
  3845. ! ENDIF
  3846. !ENDIF
  3847. !if "$(BROWSERFILE)" != ""
  3848. ! ifndef BSCMAKE_FLAGS
  3849. BSCMAKE_FLAGS = -nologo
  3850. ! endif
  3851. $(BROWSERFILE) : \
  3852. ! if "$(OBJECTS)" != "" || "$(OTHER_SBR_FILES)" != ""
  3853. $(O)\*.sbr $(OTHER_SBR_FILES)
  3854. -bscmake $(BSCMAKE_FLAGS) -o "$(BROWSERFILE)" @<<$(O)\bscmake.rsp
  3855. $(**: =
  3856. )
  3857. <<NOKEEP
  3858. ! endif
  3859. !endif
  3860. #
  3861. # These dependencies produce the target binaries from the object files.
  3862. # These will trigger the sources to object inference rules to generate the
  3863. # object files.
  3864. #
  3865. !IF "$(TARGET)" != ""
  3866. ! IF "$(TARGETTYPE)"=="PROGLIB"
  3867. $(TARGET:.exe=.lib) $(TARGET:.exe=.exp): \
  3868. ! if "$(BUILD_PASS)" != "PASS2"
  3869. $(IMPLIB_DEPEND) \
  3870. ! endif
  3871. $(DLLDEF)
  3872. -$(LIB_NAME) -out:$(@R).lib @<<
  3873. $(LIBRARIAN_FLAGS: =
  3874. )
  3875. -def:$(DLLDEF)
  3876. $(LIBRARY_OBJS: =
  3877. )
  3878. <<NOKEEP
  3879. $(LINT_CMD2)
  3880. $(TARGET): $(OBJECTS) $(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).exp $(UMRES) $(BO_LIB) $(UMLIBS) $(CRTLIBS) $(MACHINE_TARGETLIBS) $(LINKLIBS)
  3881. $(LINKER) @<<
  3882. $(LINKER_FLAGS: =
  3883. )
  3884. $(LINKER_STACKSIZE)
  3885. $(TSLINKER_FLAG)
  3886. $(ORDER: =
  3887. )
  3888. $(LINKGPSIZE: =
  3889. )
  3890. $(HEADEROBJNAME: =
  3891. )
  3892. $(LINKER_OPTIDATA)
  3893. -subsystem:$(SUBSYSTEM)
  3894. -base:$(UMBASE)
  3895. $(UMENTRY: =
  3896. )
  3897. $(**: =
  3898. )
  3899. <<NOKEEP
  3900. $(POST_BUILD_CMD)
  3901. $(SCP_CMD)
  3902. $(SIGNCODE_CMD)
  3903. $(MAPSYM_CMD)
  3904. $(COMPRESS_CMD)
  3905. $(MAKE_PLACEFILE_CMD)
  3906. $(BINPLACE_CMD)
  3907. ! ELSEIF "$(TARGETTYPE)"=="PROGRAM"
  3908. ! if (!defined(MANAGED_CODE) && !defined(MANAGED_VB))
  3909. $(TARGET): $(UMRES) $(OBJECTS) $(BO_LIB) $(CRTLIBS) $(UMLIBS) $(MACHINE_TARGETLIBS) $(LINKLIBS)
  3910. $(LINKER) @<<
  3911. $(LINKER_FLAGS: =
  3912. )
  3913. $(LINKER_STACKSIZE)
  3914. $(TSLINKER_FLAG)
  3915. -subsystem:$(SUBSYSTEM)
  3916. -base:$(UMBASE)
  3917. $(ORDER: =
  3918. )
  3919. $(LINKGPSIZE: =
  3920. )
  3921. $(UMENTRY: =
  3922. )
  3923. $(LINKER_OPTIDATA)
  3924. $(HEADEROBJNAME: =
  3925. )
  3926. $(**: =
  3927. )
  3928. <<NOKEEP
  3929. $(POST_BUILD_CMD)
  3930. $(SCP_CMD)
  3931. $(SIGNCODE_CMD)
  3932. $(MAPSYM_CMD)
  3933. $(COMPRESS_CMD)
  3934. $(MAKE_PLACEFILE_CMD)
  3935. $(BINPLACE_CMD)
  3936. $(LINT_CMD2)
  3937. ! ELSE # MANAGED_CODE or MANAGED_VB is set
  3938. $(TARGET) : $(SOURCES)
  3939. @type <<
  3940. $(MANAGED_CODE_BUILD_CMD)
  3941. <<NOKEEP
  3942. @$(MANAGED_CODE_BUILD_TOOL) @<<
  3943. $(MANAGED_CODE_BUILD_SWITCHES)
  3944. $(SOURCES)
  3945. <<NOKEEP
  3946. $(BINPLACE_CMD)
  3947. ! ENDIF # MANAGED_CODE || MANAGED_VB
  3948. ! ELSEIF "$(TARGETTYPE)"=="DYNLINK"
  3949. ! ifdef NO_DLL_EXPORTS
  3950. DYNLINK_EXP=
  3951. ! elseif (!defined(MANAGED_CODE) && !defined(MANAGED_VB))
  3952. $(DYNLINK_LIB) $(DYNLINK_EXP) : \
  3953. ! if "$(BUILD_PASS)" != "PASS2"
  3954. $(IMPLIB_DEPEND) $(DLLLIBOBJECTS) \
  3955. ! endif
  3956. $(DLLDEF)
  3957. -$(LIB_NAME) -out:$(DYNLINK_LIB) @<<
  3958. $(LIBRARIAN_FLAGS: =
  3959. )
  3960. -def:$(DLLDEF)
  3961. $(LIBRARY_OBJS: =
  3962. )
  3963. <<NOKEEP
  3964. ! IF "$(DLLLIBOBJECTS)" != " "
  3965. -$(LIB_NAME) -out:$(DYNLINK_LIB) @<<
  3966. $(LIBRARIAN_FLAGS: =
  3967. )
  3968. $(@R).lib
  3969. $(DLLLIBOBJECTS)
  3970. <<NOKEEP
  3971. ! ENDIF
  3972. $(LINT_CMD2)
  3973. ! endif # NO_DLL_EXPORTS
  3974. ! IF "$(MAKEDLL)" != ""
  3975. ! if (!defined(MANAGED_CODE) && !defined(MANAGED_VB))
  3976. $(TARGET): $(DYNLINK_EXP) $(OBJECTS) $(BO_LIB) $(LINKLIBS) $(CRTLIBS) $(MACHINE_TARGETLIBS)
  3977. $(LINKER) @<<
  3978. $(LINKER_FLAGS: =
  3979. )
  3980. $(LINKER_STACKSIZE_DLL)
  3981. -dll
  3982. $(ORDER: =
  3983. )
  3984. $(LINKER_OPTIDATA)
  3985. -base:$(DLLBASE)
  3986. -subsystem:$(SUBSYSTEM)
  3987. $(DLLENTRY: =
  3988. )
  3989. $(HEADEROBJNAME: =
  3990. )
  3991. $(**: =
  3992. )
  3993. <<NOKEEP
  3994. $(POST_BUILD_CMD)
  3995. $(SCP_CMD)
  3996. $(SIGNCODE_CMD)
  3997. $(MAPSYM_CMD)
  3998. $(COMPRESS_CMD)
  3999. $(MAKE_PLACEFILE_CMD)
  4000. $(BINPLACE_CMD)
  4001. $(MAPDUMP_CMD)
  4002. ! ELSE # MANAGED_CODE || MANAGED_VB is set
  4003. $(TARGET) : $(SOURCES)
  4004. $(MANAGED_CODE_BUILD_CMD)
  4005. ! IF "$(SERVICEPROXY)" != ""
  4006. copy /y $(TARGET) $(REFERENCE_DIR)\tempproxy.dll
  4007. webserviceutil /base:$(SERVICEBASE) /command:makeSDL /assembly:$(REFERENCE_DIR)\tempproxy.dll /out:$(PROXYPATH)
  4008. del $(REFERENCE_DIR)\tempproxy.dll
  4009. ! ENDIF
  4010. $(BINPLACE_CMD)
  4011. ! ENDIF # MANAGED_CODE || MANAGED_VB
  4012. ! ENDIF # "$(MAKEDLL)" != ""
  4013. ! ELSEIF "$(TARGETTYPE)"=="LIBRARY"
  4014. $(TARGET): $(OBJECTS) $(OBJLIBFILES)
  4015. @-erase $@ >nul 2>nul
  4016. -$(LIBRARIAN) @<<
  4017. $(HEADEROBJNAME: =
  4018. )
  4019. $(OBJECTS: =
  4020. )
  4021. $(OBJLIBFILES: =
  4022. )
  4023. <<NOKEEP
  4024. $(LINT_CMD2)
  4025. ! ELSEIF "$(TARGETTYPE)"=="DRIVER" || \
  4026. "$(TARGETTYPE)"=="MINIPORT"
  4027. $(TARGET): $(OBJECTS) $(BO_LIB) $(MACHINE_TARGETLIBS) $(CRTLIBS)
  4028. $(LINKER) @<<
  4029. $(LINKER_FLAGS: =
  4030. )
  4031. $(LINKER_STACKSIZE_DLL)
  4032. $(ORDER: =
  4033. )
  4034. $(SECTION_INFO1)
  4035. $(SECTION_INFO2)
  4036. $(LINKER_OPTIDATA)
  4037. $(DRIVER_SWITCH)
  4038. -base:$(DRIVERBASE)
  4039. ! IF "$(DRIVERTYPE)" == "VXD"
  4040. -def:$(DLLDEF)
  4041. ! ELSE
  4042. $(DRIVER_ALIGN_SWITCH)
  4043. -subsystem:native$(SUBSYSTEM_NATVER)
  4044. -entry:$(DRIVER_ENTRY)$(ENTRY_SUFFIX)
  4045. !endif
  4046. -out:$(TARGET)
  4047. $(HEADEROBJNAME: =
  4048. )
  4049. $(**: =
  4050. )
  4051. <<NOKEEP
  4052. $(POST_BUILD_CMD)
  4053. $(SCP_CMD)
  4054. $(SIGNCODE_CMD)
  4055. $(MAPSYM_CMD)
  4056. $(COMPRESS_CMD)
  4057. $(MAKE_PLACEFILE_CMD)
  4058. $(BINPLACE_CMD)
  4059. $(MAPDUMP_CMD)
  4060. $(LINT_CMD2)
  4061. ! ELSEIF "$(TARGETTYPE)"=="GDI_DRIVER"
  4062. $(TARGET): $(OBJECTS) $(BO_LIB) $(MACHINE_TARGETLIBS) $(CRTLIBS) $(GDI_DRIVER_LIBS)
  4063. $(LINKER) @<<
  4064. $(LINKER_FLAGS: =
  4065. )
  4066. $(LINKER_STACKSIZE_DLL)
  4067. -dll
  4068. $(ORDER: =
  4069. )
  4070. $(SECTION_INFO1)
  4071. $(SECTION_INFO2)
  4072. $(LINKER_OPTIDATA)
  4073. $(DRIVER_SWITCH)
  4074. $(DRIVER_ALIGN_SWITCH)
  4075. -subsystem:native$(SUBSYSTEM_NATVER)
  4076. -base:$(DRIVERBASE)
  4077. -entry:$(GDI_DRIVER_ENTRY)$(GDI_ENTRY_SUFFIX)
  4078. -out:$(TARGET)
  4079. $(HEADEROBJNAME: =
  4080. )
  4081. $(**: =
  4082. )
  4083. <<NOKEEP
  4084. $(POST_BUILD_CMD)
  4085. $(SCP_CMD)
  4086. $(SIGNCODE_CMD)
  4087. $(MAPSYM_CMD)
  4088. $(COMPRESS_CMD)
  4089. $(MAKE_PLACEFILE_CMD)
  4090. $(BINPLACE_CMD)
  4091. $(MAPDUMP_CMD)
  4092. $(LINT_CMD2)
  4093. ! ELSEIF "$(TARGETTYPE)"=="EXPORT_DRIVER"
  4094. $(DYNLINK_EXP) $(DYNLINK_LIB) : \
  4095. ! if "$(BUILD_PASS)" != "PASS2"
  4096. $(BO_LIB) $(LINKLIBS) $(DLLLIBOBJECTS) \
  4097. ! endif
  4098. $(DLLDEF) $(OBJECTS)
  4099. -$(LIB_NAME) -out:$(DYNLINK_LIB) @<<
  4100. $(LIBRARIAN_FLAGS: =
  4101. )
  4102. -def:$(DLLDEF)
  4103. $(OBJECTS)
  4104. $(LINKLIBS)
  4105. <<NOKEEP
  4106. ! if "$(DLLLIBOBJECTS)" != " "
  4107. -$(LIB_NAME) -out:$(DYNLINK_LIB) @<<
  4108. $(LIBRARIAN_FLAGS: =
  4109. )
  4110. $(DYNLINK_LIB)
  4111. $(DLLLIBOBJECTS)
  4112. <<NOKEEP
  4113. ! endif
  4114. $(LINT_CMD2)
  4115. ! IF "$(MAKEDLL)" != ""
  4116. $(TARGET): $(DYNLINK_EXP) $(OBJECTS) $(BO_LIB) $(CRTLIBS) $(MACHINE_TARGETLIBS) $(LINKLIBS)
  4117. $(LINKER) @<<
  4118. $(LINKER_FLAGS: =
  4119. )
  4120. $(ORDER: =
  4121. )
  4122. $(LINKER_STACKSIZE_DLL)
  4123. $(LINKER_OPTIDATA)
  4124. $(DRIVER_SWITCH)
  4125. $(DRIVER_ALIGN_SWITCH)
  4126. -subsystem:native$(SUBSYSTEM_NATVER)
  4127. -base:$(DRIVERBASE)
  4128. -entry:$(DRIVER_ENTRY)$(ENTRY_SUFFIX)
  4129. -out:$(TARGET)
  4130. $(HEADEROBJNAME: =
  4131. )
  4132. $(**: =
  4133. )
  4134. <<NOKEEP
  4135. $(POST_BUILD_CMD)
  4136. $(SCP_CMD)
  4137. $(SIGNCODE_CMD)
  4138. $(MAPSYM_CMD)
  4139. $(COMPRESS_CMD)
  4140. $(MAKE_PLACEFILE_CMD)
  4141. $(BINPLACE_CMD)
  4142. ! ENDIF
  4143. ! ELSEIF "$(TARGETTYPE)"=="HAL"
  4144. ! IF "$(MAKEDLL)" == ""
  4145. $(TARGET) $(TARGET:.lib=.exp): $(DLLDEF) $(O)\*.obj
  4146. -$(LIB_NAME) -out:$(@R).lib @<<
  4147. $(LIBRARIAN_FLAGS: =
  4148. )
  4149. -def:$(DLLDEF)
  4150. $(O)\*.obj
  4151. <<NOKEEP
  4152. ! ELSE
  4153. $(TARGET:.dll=.lib) $(TARGET:.dll=.exp): $(DLLDEF) $(O)\*.obj
  4154. -$(LIB_NAME) -out:$(@R).lib @<<
  4155. $(LIBRARIAN_FLAGS: =
  4156. )
  4157. -def:$(DLLDEF)
  4158. $(O)\*.obj
  4159. <<NOKEEP
  4160. $(TARGET): $(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).exp $(OBJECTS) $(CRTLIBS) $(MACHINE_TARGETLIBS) $(LINKLIBS)
  4161. $(LINKER) @<<
  4162. $(LINKER_FLAGS: =
  4163. )
  4164. $(LINKER_STACKSIZE_DLL)
  4165. $(LINKER_OPTIDATA)
  4166. $(DRIVER_SWITCH)
  4167. $(HAL_ALIGN_SWITCH)
  4168. -subsystem:$(SUBSYSTEM)
  4169. -base:$(HALBASE)
  4170. -dll
  4171. -entry:HalInitSystem$(ENTRY_SUFFIX)
  4172. -out:$(TARGET)
  4173. $(**: =
  4174. )
  4175. <<NOKEEP
  4176. $(POST_BUILD_CMD)
  4177. $(SCP_CMD)
  4178. $(SIGNCODE_CMD)
  4179. $(MAKE_PLACEFILE_CMD)
  4180. $(BINPLACE_CMD)
  4181. $(MAPDUMP_CMD)
  4182. $(LINT_CMD2)
  4183. ! ENDIF
  4184. ! ENDIF
  4185. !ENDIF
  4186. !IFNDEF NOLINK
  4187. ! IF "$(NTTEST)" != ""
  4188. obj\$(TARGET_DIRECTORY)\$(NTTEST).exe: $(NTRES) obj\$(TARGET_DIRECTORY)\$(NTTEST).obj \
  4189. $(BO_LIB) $(KERNEL_LIBS) \
  4190. $(LINKLIBS)
  4191. $(LINKER) @<<
  4192. $(LINKER_FLAGS: =
  4193. )
  4194. $(LINKER_STACKSIZE)
  4195. $(ORDER: =
  4196. )
  4197. $(LINKGPSIZE: =
  4198. )
  4199. $(NTTEST_LINK_OPTIONS: =
  4200. )
  4201. $(LINKER_OPTIDATA)
  4202. $(DRIVER_SWITCH)
  4203. $(KERNEL_ALIGN_SWITCH)
  4204. -subsystem:$(SUBSYSTEM)
  4205. $(**: =
  4206. )
  4207. <<NOKEEP
  4208. $(POST_BUILD_CMD)
  4209. $(SCP_CMD)
  4210. $(SIGNCODE_CMD)
  4211. $(MAKE_PLACEFILE_CMD)
  4212. $(BINPLACE_CMD)
  4213. $(MAPDUMP_CMD)
  4214. $(LINT_CMD2)
  4215. ! ENDIF
  4216. !ENDIF
  4217. !IF DEFINED(USE_LINT) && ("$(LINT_TYPE)" == "all")
  4218. $(O)\$(LINT_OUTPUT).$(LINT_EXT): $(TARGETOBJFILES)
  4219. $(LINT_ALL_CMD) $(SOURCES)
  4220. !ENDIF
  4221. $(O)\*.res : $(MASTER_VERSION_FILE)
  4222. !if defined(SXS_MANIFEST_OBJ2)
  4223. $(SXS_MANIFEST_OBJ2) : $(SXS_MANIFEST_OBJ1)
  4224. copy $(SXS_MANIFEST_OBJ1) $(SXS_MANIFEST_OBJ2)
  4225. !endif
  4226. #
  4227. # [GorN] 3/30/2000
  4228. #
  4229. # WPP. extra rules. Can't have them before the rule to build "all"
  4230. #
  4231. !if defined(RUN_WPP) && exist(obj\_tracewpp.mac)
  4232. WPP_DEFINE_RULES=1
  4233. ! include obj\_tracewpp.mac
  4234. !endif
  4235. !ifdef MANAGED_COVERAGE
  4236. !include $(MANAGED_COVERAGE)
  4237. !endif