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.

408 lines
13 KiB

  1. # =========================================================================
  2. # NTWIN32.MAK - Win32 application master NMAKE definitions file for the
  3. # Microsoft Win32 SDK for Windows NT programming samples
  4. # -------------------------------------------------------------------------
  5. # This files should be included at the top of all MAKEFILEs as follows:
  6. # !include <ntwin32.mak>
  7. # -------------------------------------------------------------------------
  8. # NMAKE Options
  9. #
  10. # Use the table below to determine the additional options for NMAKE to
  11. # generate various application debugging, profiling and performance tuning
  12. # information.
  13. #
  14. # Application Information Type Invoke NMAKE
  15. # ---------------------------- ------------
  16. # For No Debugging Info nmake nodebug=1
  17. # For Working Set Tuner Info nmake tune=1
  18. # For Call Attributed Profiling Info nmake profile=1
  19. #
  20. # Note: Working Set Tuner and Call Attributed Profiling is for available
  21. # for the Intel x86 and Pentium systems.
  22. #
  23. # Note: The three options above are mutually exclusive (you may use only
  24. # one to compile/link the application).
  25. #
  26. # Note: creating the environment variables NODEBUG, TUNE, and PROFILE is an
  27. # alternate method to setting these options via the nmake command line.
  28. #
  29. # Additional NMAKE Options Invoke NMAKE
  30. # ---------------------------- ------------
  31. # For No ANSI NULL Compliance nmake no_ansi=1
  32. # (ANSI NULL is defined as PVOID 0)
  33. #
  34. # =========================================================================
  35. # -------------------------------------------------------------------------
  36. # Get CPU Type - exit if CPU environment variable is not defined
  37. # -------------------------------------------------------------------------
  38. # Intel i386, i486, and Pentium systems
  39. !IF "$(CPU)" == "i386"
  40. CPUTYPE = 1
  41. !ENDIF
  42. # MIPS R4x000 systems
  43. !IF "$(CPU)" == "MIPS"
  44. CPUTYPE = 2
  45. !ENDIF
  46. # Digital Alpha AXP systems
  47. !IF "$(CPU)" == "ALPHA"
  48. CPUTYPE = 3
  49. !ENDIF
  50. !IFNDEF CPUTYPE
  51. !ERROR Must specify CPU environment variable ( CPU=i386, CPU=MIPS, CPU=ALPHA)
  52. !ENDIF
  53. # -------------------------------------------------------------------------
  54. # Platform Dependent Binaries Declarations
  55. #
  56. # If you are using the old MIPS compiler then define the following:
  57. # cc = cc
  58. # cvtobj = mip2coff
  59. # -------------------------------------------------------------------------
  60. # binary declarations for use on Intel i386, i486, and Pentium systems
  61. !IF "$(CPU)" == "i386"
  62. cc = cl
  63. # for compatibility with older-style makefiles
  64. cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
  65. cvtres = REM !!! CVTRES is no longer necessary - please remove !!!
  66. !ENDIF
  67. # binary declarations for use on self hosted MIPS R4x000 systems
  68. !IF "$(CPU)" == "MIPS"
  69. cc = cl
  70. # for compatibility with older-style makefiles
  71. cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
  72. cvtres = REM !!! CVTRES is no longer necessary - please remove !!!
  73. !ENDIF
  74. # binary declarations for use on self hosted Digital Alpha AXP systems
  75. !IF "$(CPU)" == "ALPHA"
  76. cc = claxp
  77. # for compatibility with older-style makefiles
  78. cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
  79. cvtres = REM !!! CVTRES is no longer necessary - please remove !!!
  80. !ENDIF
  81. # binary declarations common to all platforms
  82. rc = rc
  83. hc = hc
  84. link = link
  85. implib = lib
  86. # -------------------------------------------------------------------------
  87. # Platform Dependent Compile Flags - must be specified after $(cc)
  88. #
  89. # Note: Debug switches are on by default for current release
  90. #
  91. # These switches allow for source level debugging with WinDebug for local
  92. # and global variables.
  93. #
  94. # Both compilers now use the same front end - you must still define either
  95. # _X86_, _MIPS_, or _ALPHA_. These have replaced the i386, MIPS, and ALPHA
  96. # definitions which are not ANSI compliant.
  97. #
  98. # Common compiler flags:
  99. # -c - compile without linking
  100. # -W3 - Set warning level to level 3
  101. # -Zi - generate debugging information
  102. # -Od - disable all optimizations
  103. # -Ox - use maximum optimizations
  104. # -Zd - generate only public symbols and line numbers for debugging
  105. #
  106. # i386 specific compiler flags:
  107. # -Gz - stdcall
  108. #
  109. # MS MIPS specific compiler flags:
  110. # none.
  111. #
  112. # *** OLD MIPS ONLY ***
  113. #
  114. # The following definitions are for the old MIPS compiler:
  115. #
  116. # OLD MIPS compiler flags:
  117. # -c - compile without linking
  118. # -std - produce warnings for non-ANSI standard source code
  119. # -g2 - produce a symbol table for debugging
  120. # -O - invoke the global optimizer
  121. # -EL - produce object modules targeted for
  122. # "little-endian" byte ordering
  123. #
  124. # If you are using the old MIPS compiler then define the following:
  125. #
  126. # # OLD MIPS Complile Flags
  127. # !IF 0
  128. # !IF "$(CPU)" == "MIPS"
  129. # cflags = -c -std -o $(*B).obj -EL -DMIPS=1 -D_MIPS_=1
  130. # !IFDEF NODEBUG
  131. # cdebug =
  132. # !ELSE
  133. # cdebug = -g2
  134. # !ENDIF
  135. # !ENDIF
  136. # !ENDIF
  137. #
  138. # -------------------------------------------------------------------------
  139. # declarations common to all compiler options
  140. ccommon = -c -W3
  141. !IF "$(CPU)" == "i386"
  142. cflags = $(ccommon) -D_X86_=1
  143. scall = -Gz
  144. !ELSE
  145. !IF "$(CPU)" == "MIPS"
  146. cflags = $(ccommon) -D_MIPS_=1
  147. !ELSE
  148. !IF "$(CPU)" == "ALPHA"
  149. cflags = $(ccommon) -D_ALPHA_=1
  150. !ENDIF
  151. !ENDIF
  152. scall =
  153. !ENDIF
  154. !IF "$(CPU)" == "i386"
  155. !IFDEF NODEBUG
  156. cdebug = -Ox
  157. !ELSE
  158. !IFDEF PROFILE
  159. cdebug = -Gh -Zd -Ox
  160. !ELSE
  161. !IFDEF TUNE
  162. cdebug = -Gh -Zd -Ox
  163. !ELSE
  164. cdebug = -Z7 -Od
  165. !ENDIF
  166. !ENDIF
  167. !ENDIF
  168. !ELSE
  169. !IFDEF NODEBUG
  170. cdebug = -Ox
  171. !ELSE
  172. cdebug = -Z7 -Od
  173. !ENDIF
  174. !ENDIF
  175. # -------------------------------------------------------------------------
  176. # Target Module & Subsystem Dependent Compile Defined Variables - must be
  177. # specified after $(cc)
  178. #
  179. # The following table indicates the various acceptable combinations of
  180. # the C Run-Time libraries LIBC, LIBCMT, and CRTDLL respect to the creation
  181. # of a EXE and/or DLL target object. The appropriate compiler flag macros
  182. # that should be used for each combination are also listed.
  183. #
  184. # Link EXE Create Exe Link DLL Create DLL
  185. # with Using with Using
  186. # ----------------------------------------------------
  187. # LIBC CVARS None None *
  188. # LIBC CVARS LIBC CVARS
  189. # LIBC CVARS LIBCMT CVARSMT
  190. # LIBCMT CVARSMT None None *
  191. # LIBCMT CVARSMT LIBC CVARS
  192. # LIBCMT CVARSMT LIBCMT CVARSMT
  193. # CRTDLL CVARSDLL None None *
  194. # CRTDLL CVARSDLL LIBC CVARS
  195. # CRTDLL CVARSDLL LIBCMT CVARSMT
  196. # CRTDLL CVARSDLL CRTDLL CVARSDLL *
  197. #
  198. # * - Denotes the Recommended Configuration
  199. #
  200. # When building single-threaded applications you can link your executable
  201. # with either LIBC, LIBCMT, or CRTDLL, although LIBC will provide the best
  202. # performance.
  203. #
  204. # When building multi-threaded applications, either LIBCMT or CRTDLL can
  205. # be used as the C-Runtime library, as both are multi-thread safe.
  206. #
  207. # Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
  208. # also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
  209. # When using DLLs, it is recommended that all of the modules be
  210. # linked with CRTDLL.LIB.
  211. #
  212. # Note: The macros of the form xDLL are used when linking the object with
  213. # the DLL version of the C Run-Time (that is, CRTDLL.LIB). They are
  214. # not used when the target object is itself a DLL.
  215. #
  216. # -------------------------------------------------------------------------
  217. !IFDEF NO_ANSI
  218. noansi = -DNULL=0
  219. !ENDIF
  220. # for Windows applications that use the C Run-Time libraries
  221. cvars = -DWIN32 $(noansi)
  222. cvarsmt = $(cvars) -D_MT
  223. cvarsdll = $(cvarsmt) -D_DLL
  224. # for compatibility with older-style makefiles
  225. cvarsmtdll = $(cvarsmt) -D_DLL
  226. # for POSIX applications
  227. psxvars = -D_POSIX_
  228. # resource compiler
  229. rcvars = -DWIN32 $(noansi)
  230. # -------------------------------------------------------------------------
  231. # Platform Dependent Link Flags - must be specified after $(link)
  232. #
  233. # Note: $(DLLENTRY) should be appended to each -entry: flag on the link
  234. # line.
  235. #
  236. # Note: When creating a DLL that uses C Run-Time functions it is
  237. # recommended to include the entry point function of the name DllMain
  238. # in the DLL's source code. Also, the MAKEFILE should include the
  239. # -entry:_DllMainCRTStartup$(DLLENTRY) option for the creation of
  240. # this DLL. (The C Run-Time entry point _DllMainCRTStartup in turn
  241. # calls the DLL defined DllMain entry point.)
  242. #
  243. # -------------------------------------------------------------------------
  244. # declarations common to all linker options
  245. lcommon = /NODEFAULTLIB /INCREMENTAL:NO /PDB:NONE
  246. # declarations for use on Intel i386, i486, and Pentium systems
  247. !IF "$(CPU)" == "i386"
  248. DLLENTRY = @12
  249. lflags = $(lcommon) -align:0x1000
  250. !ENDIF
  251. # declarations for use on self hosted MIPS R4x000 systems
  252. !IF "$(CPU)" == "MIPS"
  253. DLLENTRY =
  254. lflags = $(lcommon)
  255. !ENDIF
  256. # declarations for use on self hosted Digital Alpha AXP systems
  257. !IF "$(CPU)" == "ALPHA"
  258. DLLENTRY =
  259. lflags = $(lcommon)
  260. !ENDIF
  261. # -------------------------------------------------------------------------
  262. # Target Module Dependent Link Debug Flags - must be specified after $(link)
  263. #
  264. # These switches allow the inclusion of the necessary symbolic information
  265. # for source level debugging with WinDebug, profiling and/or performance
  266. # tuning.
  267. #
  268. # Note: Debug switches are on by default.
  269. # -------------------------------------------------------------------------
  270. !IF "$(CPU)" == "i386"
  271. !IFDEF NODEBUG
  272. ldebug =
  273. !ELSE
  274. !IFDEF PROFILE
  275. ldebug = -debug:mapped,partial -debugtype:coff
  276. !ELSE
  277. !IFDEF TUNE
  278. ldebug = -debug:mapped,partial -debugtype:coff
  279. !ELSE
  280. ldebug = -debug:full -debugtype:cv
  281. !ENDIF
  282. !ENDIF
  283. !ENDIF
  284. !ELSE
  285. !IFDEF NODEBUG
  286. ldebug =
  287. !ELSE
  288. ldebug = -debug:full -debugtype:cv
  289. !ENDIF
  290. !ENDIF
  291. # for compatibility with older-style makefiles
  292. linkdebug = $(ldebug)
  293. # -------------------------------------------------------------------------
  294. # Subsystem Dependent Link Flags - must be specified after $(link)
  295. #
  296. # These switches allow for source level debugging with WinDebug for local
  297. # and global variables. They also provide the standard application type and
  298. # entry point declarations.
  299. # -------------------------------------------------------------------------
  300. # for Windows applications that use the C Run-Time libraries
  301. conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
  302. guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
  303. # for POSIX applications
  304. psxlflags = $(lflags) -subsystem:posix -entry:__PosixProcessStartup
  305. # for compatibility with older-style makefiles
  306. conflags = $(conlflags)
  307. guiflags = $(guilflags)
  308. psxflags = $(psxlflags)
  309. # -------------------------------------------------------------------------
  310. # C Run-Time Target Module Dependent Link Libraries
  311. #
  312. # Below is a table which describes which libraries to use depending on the
  313. # target module type, although the table specifically refers to Graphical
  314. # User Interface apps, the exact same dependencies apply to Console apps.
  315. # That is, you could replace all occurrences of 'GUI' with 'CON' in the
  316. # following:
  317. #
  318. # Desired CRT Libraries Desired CRT Libraries
  319. # Library to link Library to link
  320. # for EXE with EXE for DLL with DLL
  321. # ----------------------------------------------------
  322. # LIBC GUILIBS None None *
  323. # LIBC GUILIBS LIBC GUILIBS
  324. # LIBC GUILIBS LIBCMT GUILIBSMT
  325. # LIBCMT GUILIBSMT None None *
  326. # LIBCMT GUILIBSMT LIBC GUILIBS
  327. # LIBCMT GUILIBSMT LIBCMT GUILIBSMT
  328. # CRTDLL GUILIBSDLL None None *
  329. # CRTDLL GUILIBSDLL LIBC GUILIBS
  330. # CRTDLL GUILIBSDLL LIBCMT GUILIBSMT
  331. # CRTDLL GUILIBSDLL CRTDLL GUILIBSDLL *
  332. #
  333. # * - Recommended Configurations.
  334. #
  335. # Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
  336. # also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
  337. #
  338. # Note: For POSIX applications, link with $(psxlibs).
  339. #
  340. # -------------------------------------------------------------------------
  341. # optional profiling and tuning libraries
  342. !IF "$(CPU)" == "i386"
  343. !IFDEF PROFILE
  344. optlibs = cap.lib
  345. !ELSE
  346. !IFDEF TUNE
  347. optlibs = wst.lib
  348. !ELSE
  349. optlibs =
  350. !ENDIF
  351. !ENDIF
  352. !ELSE
  353. optlibs =
  354. !ENDIF
  355. # basic subsystem specific libraries, less the C Run-Time
  356. baselibs = kernel32.lib $(optlibs) advapi32.lib
  357. winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
  358. # for Windows applications that use the C Run-Time libraries
  359. conlibs = libc.lib $(baselibs)
  360. conlibsmt = libcmt.lib $(baselibs)
  361. conlibsdll = crtdll.lib $(baselibs)
  362. guilibs = libc.lib $(winlibs)
  363. guilibsmt = libcmt.lib $(winlibs)
  364. guilibsdll = crtdll.lib $(winlibs)
  365. # for OLE2 applications
  366. ole2libs = ole32.lib uuid.lib oleaut32.lib $(guilibs)
  367. ole2libsmt = ole32.lib uuid.lib oleaut32.lib $(guilibsmt)
  368. ole2libsdll = ole32.lib uuid.lib oleaut32.lib $(guilibsdll)
  369. # for POSIX applications
  370. psxlibs = libcpsx.lib psxdll.lib psxrtl.lib