Win32.Mak 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. # Win32.Mak - Win32 application master NMAKE definitions file for the
  2. # Microsoft Plaform SDK for Win32 and Win64 programming samples
  3. # Copyright 1991 - 1999 Microsoft Corporation
  4. # -------------------------------------------------------------------------
  5. # This files should be included at the top of all MAKEFILEs as follows:
  6. # !include <Win32.Mak>
  7. # -------------------------------------------------------------------------
  8. #
  9. # Define APPVER = [ 4.0 | 5.0 | 5.01 | 5.02 ] prior to including win32.mak to get
  10. # build time checking for version dependencies and to mark the executable
  11. # with version information.
  12. #
  13. # Define TARGETOS = [ WIN95 | WINNT | BOTH ] prior to including win32.mak
  14. # to get some build time checking for platform dependencies.
  15. #
  16. # Define TARGETLANG = [ LANG_JAPANESE | LANG_CHINESE | LANG_KOREAN ] prior
  17. # to including win32.mak to getcompile & link flags for building
  18. # applications to run on Far-East Windows. (This is an optional parameter.
  19. # The system locale is the default.)
  20. #
  21. # Define _WIN32_IE = [ 0x0300 | 0x0400 | 0x0500 | 0x0600] prior to including win32.mak to
  22. # get compile and link flags for building applications and components to
  23. # run on Internet Explorer. (This is an optional parameter. IE 4.0 is
  24. # the default.)
  25. #
  26. # -------------------------------------------------------------------------
  27. # NMAKE Options
  28. #
  29. # Use the table below to determine the additional options for NMAKE to
  30. # generate various application debugging, profiling and performance tuning
  31. # information.
  32. #
  33. # Application Information Type Invoke NMAKE
  34. # ---------------------------- ------------
  35. # For No Debugging Info nmake nodebug=1
  36. # For Working Set Tuner Info nmake tune=1
  37. # For Call Attributed Profiling Info nmake profile=1
  38. # For COLE 32->64-bit Porting Tool nmake COLE_64=1
  39. #
  40. # Note: The three options above are mutually exclusive (you may use only
  41. # one to compile/link the application).
  42. #
  43. # Note: creating the environment variables NODEBUG, TUNE, and PROFILE is an
  44. # alternate method to setting these options via the nmake command line.
  45. #
  46. # Note: to use the COLE_64 option, you need to set your build environment
  47. # for 64-bit compilations.
  48. #
  49. # Note: TUNE and PROFILE do nothing for 64bit compilation
  50. #
  51. # Additional NMAKE Options Invoke NMAKE
  52. # ---------------------------- ------------
  53. # For No ANSI NULL Compliance nmake no_ansi=1
  54. # (ANSI NULL is defined as PVOID 0)
  55. #
  56. # =========================================================================
  57. # Build Rules Quick Start
  58. #
  59. # To build one of the following types of executables, use the specified
  60. # compiler and linker command-line options.
  61. #
  62. # ---------------------------------------------------------------------------
  63. # To build: | Compiler Options | Linker options (pick one
  64. # | | line. con = console,
  65. # | | gui = GUI, ole = GUI OLE)
  66. # ---------------------------------------------------------------------------
  67. # Single threaded | cdebug cflags cvars | ldebug guilflags guilibs
  68. # app with static | | ldebug conlflags conlibs
  69. # CRT | | ldebug guilflags olelibs
  70. # ---------------------------------------------------------------------------
  71. # Multithreaded app | cdebug cflags cvarsmt | ldebug guilflags guilibsmt
  72. # with static CRT | | ldebug conlflags conlibsmt
  73. # | | ldebug guilflags olelibsmt
  74. # ---------------------------------------------------------------------------
  75. # Single or multi- | cdebug cflags cvarsdll | ldebug guilflags guilibsdll
  76. # threaded app with | | ldebug conlflags conlibsdll
  77. # DLL version of CRT | | ldebug guilflags olelibsdll
  78. # (MSVCRT.DLL) | |
  79. # ---------------------------------------------------------------------------
  80. # DLL with static | cdebug cflags cvarsmt | ldebug dlllflags guilibsmt
  81. # CRT* | | ldebug dlllflags conlibsmt
  82. # | | ldebug dlllflags olelibsmt
  83. # ---------------------------------------------------------------------------
  84. # DLL with DLL | cdebug cflags cvarsdll | ldebug dlllflags guilibsdll
  85. # version of CRT | | ldebug dlllflags conlibsdll
  86. # (MSVCRT.DLL) | | ldebug dlllflags olelibsdll
  87. # ---------------------------------------------------------------------------
  88. #
  89. # * Always make DLLs multithreaded because a DLL has no way to know whether
  90. # the calling application has multiple threads, and has no way to prevent
  91. # multithreaded apps from loading it.
  92. #
  93. # To specify an Intel x86 build that defaults to stdcall, add scall to the
  94. # list of compiler options.
  95. #
  96. # =========================================================================
  97. !IFNDEF _WIN32_MAK_
  98. _WIN32_MAK_ = 1
  99. # -------------------------------------------------------------------------
  100. # Get CPU Type - exit if CPU environment variable is not defined
  101. # -------------------------------------------------------------------------
  102. # Win95 does not define PROCESSOR_ARCHITECTURE - default to i386
  103. !IF "$(PROCESSOR_ARCHITECTURE)" == ""
  104. CPU=i386
  105. PROCESSOR_ARCHITECTURE=x86
  106. !endif
  107. !IF !DEFINED(CPU) || "$(CPU)" == ""
  108. CPU = $(PROCESSOR_ARCHITECTURE)
  109. !ENDIF # CPU
  110. # if PROCESSOR_ARCHITECTURE was x86 or X86 change CPU to i386
  111. !IF ( "$(CPU)" == "X86" ) || ( "$(CPU)" == "x86" )
  112. CPU = i386
  113. !ENDIF # CPU == X86
  114. !IF "$(CPU)" != "i386"
  115. !IF "$(CPU)" != "ALPHA"
  116. !IF "$(CPU)" != "ALPHA64"
  117. !IF "$(CPU)" != "IA64"
  118. !IF "$(CPU)" != "AMD64"
  119. !ERROR Must specify CPU environment variable ( CPU=i386, CPU=ALPHA, CPU=IA64, CPU=ALPHA64, CPU=AMD64)
  120. !ENDIF
  121. !ENDIF
  122. !ENDIF
  123. !ENDIF
  124. !ENDIF
  125. # -------------------------------------------------------------------------
  126. # Get Target Operating System - Default to WINNT
  127. # -------------------------------------------------------------------------
  128. !IFNDEF TARGETOS
  129. TARGETOS = WINNT
  130. !ENDIF
  131. !IF "$(TARGETOS)" != "WINNT"
  132. !IF "$(TARGETOS)" != "WIN95"
  133. !IF "$(TARGETOS)" != "BOTH"
  134. !ERROR Must specify TARGETOS environment variable (BOTH, WIN95, WINNT)
  135. !ENDIF
  136. !ENDIF
  137. !ENDIF
  138. # default to APPVER of 5.0
  139. !IFNDEF APPVER
  140. APPVER = 5.0
  141. !ENDIF
  142. !IF "$(APPVER)" != "5.02"
  143. !IF "$(APPVER)" != "5.01"
  144. !IF "$(APPVER)" != "5.0"
  145. !IF "$(APPVER)" != "4.0"
  146. !ERROR Must specify APPVER environment variable (4.0, 5.0, 5.01, 5.02)
  147. !ENDIF
  148. !ENDIF
  149. !ENDIF
  150. !ENDIF
  151. !IF "$(APPVER)" =="5.0"
  152. !IFNDEF _WIN32_IE
  153. _WIN32_IE = 0x0500
  154. !ENDIF # _WIN32_IE
  155. !ENDIF # APPVER == 5.0
  156. !IF "$(APPVER)" =="5.01"
  157. !IFNDEF _WIN32_IE
  158. _WIN32_IE = 0x0600
  159. !ENDIF # _WIN32_IE
  160. !ENDIF # APPVER == 5.01
  161. !IF "$(APPVER)" =="5.02"
  162. !IFNDEF _WIN32_IE
  163. _WIN32_IE = 0x0600
  164. !ENDIF # _WIN32_IE
  165. !ENDIF # APPVER == 5.02
  166. !IFNDEF _WIN32_IE
  167. _WIN32_IE = 0x0400
  168. !ENDIF
  169. # -------------------------------------------------------------------------
  170. # Build tool declarations common to all platforms
  171. # Check to see if Cole Porter is used, otherwise use C/C++ compiler
  172. # -------------------------------------------------------------------------
  173. !IFDEF COLE_64
  174. cc = Port64
  175. link = Cole & Rem no link when using Cole
  176. implib = Rem no lib when using Cole since the Cole .Objs are text
  177. !ELSE
  178. cc = cl
  179. link = link
  180. implib = lib
  181. !ENDIF
  182. midl = midl
  183. rc = Rc
  184. hc = Start /Wait Hcrtf
  185. mc = Mc
  186. hcvars = -xn
  187. # -------------------------------------------------------------------------
  188. # Platform Dependent Compile Flags - must be specified after $(cc)
  189. #
  190. # Note: Debug switches are on by default for current release
  191. #
  192. # These switches set code generation and debugging options for the compiler.
  193. # They also set macros used for conditional compilation.
  194. #
  195. # The debugging switches allow for source level debugging with WinDebug or
  196. # Microsoft Visual C++.
  197. #
  198. # Common compiler flags:
  199. # -c - compile without linking
  200. # -W3 - Set warning level to level 3 (-W4 for 64-bit compilations)
  201. # -Zi - generate debugging information
  202. # -Od - disable all optimizations
  203. # -Ox - use maximum optimizations
  204. # -Zd - generate only public symbols and line numbers for debugging
  205. #
  206. # i386 specific compiler flags:
  207. # -Gz - stdcall (only if scall is added to makefile's compiler build rules)
  208. #
  209. # -------------------------------------------------------------------------
  210. # declarations common to all compiler options
  211. ccommon = -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo
  212. # for compatibility with old source code, map {try, except, leave, finally}
  213. # to their proper names (i.e. prefaced by "__")
  214. !IFDEF SEHMAP
  215. ccommon = $(ccommon) -FIsehmap.h
  216. !ENDIF
  217. !IF "$(TARGETLANG)" == "LANG_JAPANESE"
  218. ccommon = $(ccommon) -DJAPAN -DDBCS -DFE_IME
  219. !ENDIF
  220. !IF "$(TARGETLANG)" == "LANG_CHINESE"
  221. ccommon = $(ccommon) -DDBCS -DFE_IME
  222. !ENDIF
  223. !IF "$(TARGETLANG)" == "LANG_KOREAN"
  224. ccommon = $(ccommon) -DDBCS -DFE_IME
  225. !ENDIF
  226. # Add -GS (Buffer Security Check) for VC++ 7.0
  227. !IF "$(MSVCVER)" == "7.0"
  228. ccommon = $(ccommon) -GS
  229. !ENDIF
  230. !IF "$(CPU)" == "i386"
  231. cflags = $(ccommon) -D_X86_=1 -DWIN32 -D_WIN32 -W3
  232. scall = -Gz
  233. !ELSEIF "$(CPU)" == "ALPHA"
  234. cflags = $(ccommon) -D_ALPHA_=1 -DWIN32 -D_WIN32 -W3
  235. scall =
  236. !ELSEIF "$(CPU)" == "IA64"
  237. cflags = $(ccommon) -D_IA64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 /FIPRE64PRA.H
  238. cflags = $(cflags) -Wp64 -W4
  239. scall =
  240. !ELSEIF "$(CPU)" == "AMD64"
  241. cflags = $(ccommon) -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 /FIPRE64PRA.H
  242. cflags = $(cflags) -Wp64 -W4
  243. scall =
  244. !ELSEIF "$(CPU)" == "ALPHA64"
  245. cflags = $(ccommon) -D_AXP64_=1 -D_ALPHA64_=1 -DALPHA=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32
  246. cflags = $(cflags) -Wp64 -W4 -Ap64
  247. scall =
  248. !ENDIF
  249. !IF "$(APPVER)" == "4.0"
  250. NMAKE_WINVER = 0x0400
  251. !ELSEIF "$(APPVER)" == "5.0"
  252. NMAKE_WINVER = 0x0500
  253. !ELSEIF "$(APPVER)" == "5.01"
  254. NMAKE_WINVER = 0x0501
  255. !ELSEIF "$(APPVER)" == "5.02"
  256. NMAKE_WINVER = 0x0502
  257. !ENDIF
  258. !IF "$(TARGETOS)" == "WINNT"
  259. cflags = $(cflags) -D_WINNT -D_WIN32_WINNT=$(NMAKE_WINVER)
  260. !ENDIF
  261. !IF "$(TARGETOS)" == "WIN95"
  262. cflags = $(cflags) -D_WIN95 -D_WIN32_WINDOWS=$(NMAKE_WINVER) /D_WIN32_DCOM
  263. !ENDIF
  264. # regardless of the TARGET OS, define compile time WINVER to match APPVER macro
  265. cflags = $(cflags) -D_WIN32_IE=$(_WIN32_IE) -DWINVER=$(NMAKE_WINVER)
  266. # Set debugging options
  267. !IF "$(CPU)" != "IA64"
  268. !IFDEF NODEBUG
  269. cdebug = -Ox -DNDEBUG
  270. !ELSE IFDEF PROFILE
  271. cdebug = -Gh -Zd -Ox -DNDEBUG
  272. !ELSE IFDEF TUNE
  273. cdebug = -Gh -Zd -Ox -DNDEBUG
  274. !ELSE
  275. cdebug = -Zi -Od -DDEBUG
  276. !ENDIF
  277. !ELSE
  278. !IFDEF NODEBUG
  279. cdebug = -Ox -DNDEBUG
  280. !ELSE
  281. cdebug = -Zi -Od -DDEBUG
  282. !ENDIF
  283. !ENDIF
  284. # -------------------------------------------------------------------------
  285. # Target Module & Subsystem Dependent Compile Defined Variables - must be
  286. # specified after $(cc)
  287. #
  288. # The following table indicates the various acceptable combinations of
  289. # the C Run-Time libraries LIBC, LIBCMT, and MSVCRT respect to the creation
  290. # of a EXE and/or DLL target object. The appropriate compiler flag macros
  291. # that should be used for each combination are also listed.
  292. #
  293. # Executable Type C Runtime Lib Compiler switch
  294. # -------------------------------------------------------------
  295. # Single threaded app static CRT CVARS *
  296. # Single-threaded app DLL CRT CVARSDLL
  297. # Multi-threaded app static CRT CVARSMT *
  298. # Multi-threaded app DLL CRT CVARSDLL *
  299. #
  300. # Single threaded DLL static CRT CVARS
  301. # Single-threaded DLL DLL CRT CVARSDLL
  302. # Multi-threaded DLL static CRT CVARSMT *
  303. # Multi-threaded DLL DLL CRT CVARSDLL *
  304. #
  305. # * - Denotes the Recommended Configuration
  306. #
  307. # When building single-threaded applications you can link your executable
  308. # with either LIBC, LIBCMT, or MSVCRT, although LIBC will provide the best
  309. # performance.
  310. #
  311. # When building multi-threaded applications, either LIBCMT or MSVCRT can
  312. # be used as the C-Runtime library, as both are multi-thread safe.
  313. #
  314. # Note: Any executable which accesses a DLL linked with MSVCRT.LIB must
  315. # also link with MSVCRT.LIB instead of LIBC.LIB or LIBCMT.LIB.
  316. # When using DLLs, it is recommended that all of the modules be
  317. # linked with MSVCRT.LIB.
  318. #
  319. # Note: The macros of the form xDLL are used when linking the object with
  320. # the DLL version of the C Run-Time (that is, MSVCRT.LIB). They are
  321. # not used when the target object is itself a DLL.
  322. #
  323. # -------------------------------------------------------------------------
  324. !IFDEF NO_ANSI
  325. noansi = -DNULL=0
  326. !ENDIF
  327. # for Windows applications that use the C Run-Time libraries
  328. !IFDEF NODEBUG
  329. cvars = $(noansi) -ML
  330. cvarsmt = $(noansi) -D_MT -MT
  331. cvarsdll = $(noansi) -D_MT -D_DLL -MD
  332. !ELSE
  333. cvars = $(noansi) -MLd
  334. cvarsmt = $(noansi) -D_MT -MTd
  335. cvarsdll = $(noansi) -D_MT -D_DLL -MDd
  336. !ENDIF
  337. # for compatibility with older-style makefiles
  338. cvarsmtdll = $(cvarsdll)
  339. # for POSIX applications
  340. psxvars = -D_POSIX_
  341. # resource compiler
  342. rcflags = /r
  343. !ifdef NODEBUG
  344. rcvars = -DWIN32 -D_WIN32 -DWINVER=$(NMAKE_WINVER) $(noansi)
  345. !else
  346. rcvars = -DWIN32 -D_WIN32 -DWINVER=$(NMAKE_WINVER) -DDEBUG -D_DEBUG $(noansi)
  347. !endif
  348. !IF "$(TARGETLANG)" == "LANG_JAPANESE"
  349. rcflags = $(rcflags) /c932
  350. rcvars = $(rcvars) -DJAPAN -DDBCS -DFE_IME
  351. !ENDIF
  352. !IF "$(TARGETLANG)" == "LANG_CHINESE"
  353. rcvars = $(rcvars) -DDBCS -DFE_IME
  354. !ENDIF
  355. !IF "$(TARGETLANG)" == "LANG_KOREAN"
  356. rcvars = $(rcvars) -DDBCS -DFE_IME
  357. !ENDIF
  358. # -------------------------------------------------------------------------
  359. # Platform Dependent MIDL Flags - must be specified after midl
  360. #
  361. #
  362. # -------------------------------------------------------------------------
  363. !IF "$(TARGETOS)" == "WIN95"
  364. MIDL_OPTIMIZATION=-target NT40
  365. !ELSEIF "$(TARGETOS)" == "WINNT"
  366. !IF "$(APPVER)" == "5.0"
  367. MIDL_OPTIMIZATION=-target NT50
  368. !ELSEIF "$(APPVER)" == "5.01"
  369. MIDL_OPTIMIZATION=-target NT51
  370. !ELSEIF "$(APPVER)" == "4.0"
  371. MIDL_OPTIMIZATION=-target NT40
  372. !ENDIF
  373. !ENDIF
  374. !IF ("$(TARGETOS)" == "WINNT" ) && ("$(APPVER)" != "4.0")
  375. MIDL_OPTIMIZATION = $(MIDL_OPTIMIZATION) /robust
  376. !ENDIF
  377. # -------------------------------------------------------------------------
  378. # Platform Dependent Link Flags - must be specified after $(link)
  379. #
  380. # Note: $(DLLENTRY) should be appended to each -entry: flag on the link
  381. # line.
  382. #
  383. # Note: When creating a DLL that uses C Run-Time functions it is
  384. # recommended to include the entry point function of the name DllMain
  385. # in the DLL's source code. Also, the MAKEFILE should include the
  386. # -entry:_DllMainCRTStartup$(DLLENTRY) option for the creation of
  387. # this DLL. (The C Run-Time entry point _DllMainCRTStartup in turn
  388. # calls the DLL defined DllMain entry point.)
  389. #
  390. # -------------------------------------------------------------------------
  391. # declarations common to all linker options
  392. lflags = $(lflags) /INCREMENTAL:NO /NOLOGO
  393. # declarations for use on Intel x86 systems
  394. !IF "$(CPU)" == "i386"
  395. DLLENTRY = @12
  396. !ENDIF
  397. # declarations for use on Compaq Alpha AXP systems
  398. !IF "$(CPU)" == "ALPHA"
  399. DLLENTRY =
  400. !ENDIF
  401. # declarations for use on Intel Architecture 64-bit systems
  402. !IF "$(CPU)" == "IA64"
  403. DLLENTRY =
  404. !ENDIF
  405. # declarations for use on AMD64 systems
  406. !IF "$(CPU)" == "AMD64"
  407. DLLENTRY =
  408. !ENDIF
  409. # declarations for use on Compaq 64-bit Alpha AXP systems
  410. !IF "$(CPU)" == "ALPHA64"
  411. DLLENTRY =
  412. !ENDIF
  413. # -------------------------------------------------------------------------
  414. # Target Module Dependent Link Debug Flags - must be specified after $(link)
  415. #
  416. # These switches allow the inclusion of the necessary symbolic information
  417. # for source level debugging with WinDebug, profiling and/or performance
  418. # tuning.
  419. #
  420. # Note: Debug switches are on by default.
  421. # -------------------------------------------------------------------------
  422. !IF "$(CPU)" != "IA64"
  423. !IFDEF NODEBUG
  424. ldebug = /RELEASE
  425. !ELSE IFDEF PROFILE
  426. ldebug = /DEBUG:mapped,partial /DEBUGTYPE:coff
  427. !ELSE IFDEF TUNE
  428. ldebug = /DEBUG:mapped,partial /DEBUGTYPE:coff
  429. !ELSE
  430. ldebug = /DEBUG:full /DEBUGTYPE:cv
  431. !ENDIF
  432. !ELSE
  433. !IFDEF NODEBUG
  434. ldebug = /RELEASE
  435. !ELSE
  436. ldebug = /DEBUG:full /DEBUGTYPE:cv
  437. !ENDIF
  438. !ENDIF
  439. # for compatibility with older-style makefiles
  440. linkdebug = $(ldebug)
  441. # -------------------------------------------------------------------------
  442. # Subsystem Dependent Link Flags - must be specified after $(link)
  443. #
  444. # These switches allow for source level debugging with WinDebug for local
  445. # and global variables. They also provide the standard application type and
  446. # entry point declarations.
  447. #
  448. # Note that on x86 screensavers have a WinMain entrypoint, but on RISC
  449. # platforms it is main. This is a Win95 compatibility issue.
  450. #
  451. # -------------------------------------------------------------------------
  452. # Windows 98 needs subsystem version set to 4.10 for version 5.0 features.
  453. !IF ("$(APPVER)" == "5.0") && (("$(TARGETOS)" == "BOTH") || ("$(TARGETOS)" == "WIN95"))
  454. EXEVER = 4.10
  455. !ELSE
  456. EXEVER = $(APPVER)
  457. !ENDIF
  458. # ---------------------------------------------
  459. # for Windows applications
  460. conlflags = $(lflags) -subsystem:console,$(EXEVER)
  461. guilflags = $(lflags) -subsystem:windows,$(EXEVER)
  462. dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
  463. # For screen savers
  464. !IF "$(CPU)" == "i386"
  465. savlflags = $(lflags) -subsystem:windows,$(EXEVER) -entry:WinMainCRTStartup
  466. !ELSE
  467. savlflags = $(lflags) -subsystem:windows,$(EXEVER) -entry:mainCRTStartup
  468. !ENDIF
  469. # for POSIX applications
  470. psxlflags = $(lflags) -subsystem:posix -entry:__PosixProcessStartup
  471. # for compatibility with older-style makefiles
  472. conflags = $(conlflags)
  473. guiflags = $(guilflags)
  474. psxflags = $(psxlflags)
  475. # -------------------------------------------------------------------------
  476. # C Run-Time Target Module Dependent Link Libraries
  477. #
  478. # Note: For POSIX applications, link with $(psxlibs).
  479. # -------------------------------------------------------------------------
  480. # for POSIX applications
  481. psxlibs = libcpsx.lib psxdll.lib psxrtl.lib oldnames.lib
  482. # optional profiling and tuning libraries
  483. !IF "$(CPU)" != "IA64"
  484. !IFDEF PROFILE
  485. optlibs = cap.lib
  486. !ELSE IFDEF TUNE
  487. optlibs = wst.lib
  488. !ELSE
  489. optlibs =
  490. !ENDIF
  491. !ELSE
  492. optlibs =
  493. !ENDIF
  494. # if building for basic Windows 95, use WinSock1, else use WinSock2
  495. !IF "$(TARGETOS)" == "WIN95"
  496. !IF "$(APPVER)" == "4.0"
  497. winsocklibs = wsock32.lib
  498. !ELSE
  499. winsocklibs = ws2_32.lib mswsock.lib
  500. !ENDIF
  501. !ELSE
  502. winsocklibs = ws2_32.lib mswsock.lib
  503. !ENDIF
  504. # basic subsystem specific libraries, less the C Run-Time
  505. baselibs = kernel32.lib $(optlibs) $(winsocklibs) advapi32.lib
  506. winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
  507. # for Windows applications that use the C Run-Time libraries
  508. conlibs = $(baselibs)
  509. guilibs = $(winlibs)
  510. # for OLE applications
  511. olelibs = ole32.lib uuid.lib oleaut32.lib $(guilibs)
  512. #for backwards compatibility
  513. conlibsmt = $(conlibs)
  514. conlibsdll = $(conlibs)
  515. guilibsmt = $(guilibs)
  516. guilibsdll = $(guilibs)
  517. olelibsmt = $(olelibs)
  518. olelibsdll = $(olelibs)
  519. # for backward compatibility
  520. ole2libs = $(olelibs)
  521. ole2libsmt = $(olelibsmt)
  522. ole2libsdll = $(olelibsdll)
  523. # Visual Basic
  524. bc = vb6
  525. bc_exe = /Make
  526. bc_dll = /Makedll
  527. # Set the Output Directory
  528. !IF ("$(APPVER)" == "5.02") && ("$(CPU)" == "IA64")
  529. OUTDIR=SRV2003_64
  530. !ELSEIF "$(CPU)" == "IA64"
  531. OUTDIR=XP64
  532. !ELSEIF "$(CPU)" == "AMD64"
  533. OUTDIR=XP_AMD64
  534. !ELSE
  535. !IF "$(TARGETOS)" == "WIN95"
  536. OUTDIR=WinMe
  537. !ELSEIF "$(TARGETOS)" == "WINNT"
  538. !IF "$(APPVER)" == "5.0"
  539. OUTDIR=WIN2000
  540. !ELSEIF "$(APPVER)" == "5.01"
  541. OUTDIR=XP32
  542. !ELSEIF "$(APPVER)" == "5.02"
  543. OUTDIR=SRV2003
  544. !ELSEIF "$(APPVER)" == "4.0"
  545. OUTDIR=NT4
  546. !ENDIF
  547. !ELSE
  548. #TARGETOS == BOTH
  549. OUTDIR=$(TARGETOS)
  550. !ENDIF
  551. !ENDIF
  552. #set Prerelease Out directories
  553. !IF "$(SDKPRERELEASE)" == "1"
  554. OUTDIR=PRE_$(OUTDIR)
  555. !ENDIF
  556. #Set DEBUG
  557. !IF "$(NODEBUG)" == ""
  558. OUTDIR=$(OUTDIR)_DEBUG
  559. !ELSE
  560. OUTDIR=$(OUTDIR)_RETAIL
  561. !ENDIF
  562. !IF "$(OS)" == "Windows_NT"
  563. CLEANUP=if exist $(OUTDIR)/$(NULL) rd /s /q $(OUTDIR)
  564. !ELSE
  565. CLEANUP=deltree /y $(OUTDIR)
  566. !ENDIF
  567. VC6MSG=This sample only compiles with Microsoft Visual C++ 6.0. \
  568. To compile this run vcvars32.bat for Visual C++ 6.0, and setenv.bat in $(MSSDK).
  569. WIN64MSG=This sample is currently not supported on the 64 bit platform.
  570. #ENDIF _WIN32_MAK_
  571. !ENDIF