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.

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