Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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