home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 August / PCWorld_2000-08_cd.bin / Software / TemaCD / xbasic / xbpro.exe / xb / xxx / win32mak.400 < prev    next >
Text File  |  1995-07-10  |  15KB  |  468 lines

  1. # =========================================================================
  2. # WIN32.MAK - Win32 application master NMAKE definitions file for the
  3. #               Microsoft Win32 SDK for Windows programming samples
  4. # -------------------------------------------------------------------------
  5. # This files should be included at the top of all MAKEFILEs as follows:
  6. #  !include <win32.mak>
  7. # -------------------------------------------------------------------------
  8. #
  9. # Define APPVER = [ 3.50 | 3.51 | 4.0 ] 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. # -------------------------------------------------------------------------
  17. # NMAKE Options
  18. #
  19. # Use the table below to determine the additional options for NMAKE to
  20. # generate various application debugging, profiling and performance tuning
  21. # information.
  22. #
  23. # Application Information Type         Invoke NMAKE
  24. # ----------------------------         ------------
  25. # For No Debugging Info                nmake nodebug=1
  26. # For Working Set Tuner Info           nmake tune=1
  27. # For Call Attributed Profiling Info   nmake profile=1
  28. #
  29. # Note: The three options above are mutually exclusive (you may use only
  30. #       one to compile/link the application).
  31. #
  32. # Note: creating the environment variables NODEBUG, TUNE, and PROFILE is an
  33. #       alternate method to setting these options via the nmake command line.
  34. #
  35. # Additional NMAKE Options             Invoke NMAKE
  36. # ----------------------------         ------------
  37. # For No ANSI NULL Compliance          nmake no_ansi=1
  38. # (ANSI NULL is defined as PVOID 0)
  39. #
  40. # =========================================================================
  41.  
  42. !IFNDEF _WIN32_MAK_
  43. _WIN32_MAK_ = 1
  44.  
  45. # -------------------------------------------------------------------------
  46. # Get CPU Type - exit if CPU environment variable is not defined
  47. # -------------------------------------------------------------------------
  48.  
  49. !IF "$(CPU)" == ""
  50. CPU = i386
  51. !ENDIF
  52.  
  53. !IF "$(CPU)" != "i386"
  54. !IF "$(CPU)" != "MIPS"
  55. !IF "$(CPU)" != "ALPHA"
  56. !IF "$(CPU)" != "PPC"
  57. !ERROR  Must specify CPU environment variable ( CPU=i386, CPU=MIPS, CPU=ALPHA, CPU=PPC)
  58. !ENDIF
  59. !ENDIF
  60. !ENDIF
  61. !ENDIF
  62.  
  63.  
  64. # -------------------------------------------------------------------------
  65. # Get Target Operating System - Default to both
  66. # -------------------------------------------------------------------------
  67. !IFNDEF TARGETOS
  68. TARGETOS = BOTH
  69. !ENDIF
  70.  
  71. !IF "$(TARGETOS)" != "WINNT"
  72. !IF "$(TARGETOS)" != "WIN95"
  73. !IF "$(TARGETOS)" != "BOTH"
  74. !ERROR Must specify TARGETOS environment variable (BOTH, WIN95, WINNT)
  75. !ENDIF
  76. !ENDIF
  77. !ENDIF
  78.  
  79. # -------------------------------------------------------------------------
  80. # Set Default WINVER - depends on TARGETOS
  81. #
  82. # Defaults to 4.0 for all applications except NT specific.
  83. # -------------------------------------------------------------------------
  84.  
  85. !IFNDEF APPVER
  86. !IF "$(TARGETOS)" == "WINNT"
  87. APPVER = 3.50
  88. !ELSE
  89. APPVER = 4.0
  90. !ENDIF
  91. !ENDIF
  92.     
  93. !IF "$(APPVER)" != "4.0"
  94. !IF "$(APPVER)" != "3.50"
  95. !IF "$(APPVER)" != "3.51"
  96. !ERROR Must specify APPVER environment variable (4.0, 3.50, 3.51)
  97. !ENDIF
  98. !ENDIF
  99. !ENDIF
  100.  
  101. # binary declarations common to all platforms
  102. cc     = cl
  103. rc     = rc
  104. link   = link
  105. implib = lib
  106. hc     = hcrtf -x
  107.  
  108. # for compatibility with older-style makefiles
  109. cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
  110. cvtres = REM !!! CVTRES is no longer necessary - please remove !!!
  111.  
  112.  
  113. # -------------------------------------------------------------------------
  114. # Platform Dependent Compile Flags - must be specified after $(cc)
  115. #
  116. # Note: Debug switches are on by default for current release
  117. #
  118. # These switches allow for source level debugging with WinDebug for local
  119. # and global variables.
  120. #
  121. # Both compilers now use the same front end - you must still define either
  122. # _X86_, _MIPS_, _PPC_ or _ALPHA_.  These have replaced the i386, MIPS, and ALPHA
  123. # definitions which are not ANSI compliant.
  124. #
  125. # Common compiler flags:
  126. #   -c   - compile without linking
  127. #   -W3  - Set warning level to level 3
  128. #   -Zi  - generate debugging information
  129. #   -Od  - disable all optimizations
  130. #   -Ox  - use maximum optimizations
  131. #   -Zd  - generate only public symbols and line numbers for debugging
  132. #
  133. # i386 specific compiler flags:
  134. #   -Gz  - stdcall
  135. #
  136. # MS MIPS specific compiler flags:
  137. #   none.
  138. #
  139. # -------------------------------------------------------------------------
  140.  
  141. # declarations common to all compiler options
  142. ccommon = -c -W3 -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo
  143.  
  144. !IF "$(CPU)" == "i386"
  145. cflags = $(ccommon) -D_X86_=1
  146. scall  = -Gz
  147. !ELSE
  148. !IF "$(CPU)" == "MIPS"
  149. cflags = $(ccommon) -D_MIPS_=1
  150. !ELSE
  151. !IF "$(CPU)" == "PPC"
  152. cflags = $(ccommon) -D_PPC_=1
  153. !ELSE
  154. !IF "$(CPU)" == "ALPHA"
  155. cflags = $(ccommon) -D_ALPHA_=1
  156. !ENDIF
  157. !ENDIF
  158. !ENDIF
  159. scall  =
  160. !ENDIF
  161.  
  162. !IF "$(TARGETOS)" == "WINNT"
  163. INCLUDE = $(MSTOOLS)\h\winnt;$(INCLUDE)
  164. LIB = $(MSTOOLS)\lib\winnt;$(LIB)
  165. cflags = $(cflags) -D_WINNT
  166. !ELSE
  167. !IF "$(TARGETOS)" == "WIN95"
  168. INCLUDE = $(MSTOOLS)\h\win95;$(INCLUDE)
  169. LIB = $(MSTOOLS)\lib\win95;$(LIB)
  170. cflags = $(cflags) -D_WIN95
  171. !ENDIF
  172. !ENDIF
  173.  
  174. !IF "$(APPVER)" == "4.0"
  175. cflags = $(cflags) -DWINVER=0x0400
  176. !ELSE
  177. !IF "$(APPVER)" == "3.51"
  178. cflags = $(cflags) -DWINVER=0x0400
  179. !ELSE
  180. cflags = $(cflags) -DWINVER=0x030A
  181. !ENDIF
  182. !ENDIF
  183.  
  184. !IFDEF NODEBUG
  185. cdebug = -Ox
  186. !ELSE
  187. !IFDEF PROFILE
  188. !IF "$(CPU)" == "MIPS"
  189. cdebug = -Gh -Zd -Od
  190. !ELSE
  191. cdebug = -Gh -Zd -Ox
  192. !ENDIF
  193. !ELSE
  194. !IFDEF TUNE
  195. cdebug = -Gh -Zd -Ox
  196. !ELSE
  197. cdebug = -Z7 -Od
  198. !ENDIF
  199. !ENDIF
  200. !ENDIF
  201.  
  202. # -------------------------------------------------------------------------
  203. # Target Module & Subsystem Dependent Compile Defined Variables - must be
  204. #   specified after $(cc)
  205. #
  206. # The following table indicates the various acceptable combinations of
  207. # the C Run-Time libraries LIBC, LIBCMT, and CRTDLL respect to the creation
  208. # of a EXE and/or DLL target object.  The appropriate compiler flag macros
  209. # that should be used for each combination are also listed.
  210. #
  211. #  Link EXE    Create Exe    Link DLL    Create DLL
  212. #    with        Using         with         Using
  213. # ----------------------------------------------------
  214. #  LIBC        CVARS          None        None      *
  215. #  LIBC        CVARS          LIBC        CVARS
  216. #  LIBC        CVARS          LIBCMT      CVARSMT
  217. #  LIBCMT      CVARSMT        None        None      *
  218. #  LIBCMT      CVARSMT        LIBC        CVARS
  219. #  LIBCMT      CVARSMT        LIBCMT      CVARSMT
  220. #  CRTDLL      CVARSDLL       None        None      *
  221. #  CRTDLL      CVARSDLL       LIBC        CVARS
  222. #  CRTDLL      CVARSDLL       LIBCMT      CVARSMT
  223. #  CRTDLL      CVARSDLL       CRTDLL      CVARSDLL  *
  224. #
  225. # * - Denotes the Recommended Configuration
  226. #
  227. # When building single-threaded applications you can link your executable
  228. # with either LIBC, LIBCMT, or CRTDLL, although LIBC will provide the best
  229. # performance.
  230. #
  231. # When building multi-threaded applications, either LIBCMT or CRTDLL can
  232. # be used as the C-Runtime library, as both are multi-thread safe.
  233. #
  234. # Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
  235. #       also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
  236. #       When using DLLs, it is recommended that all of the modules be
  237. #       linked with CRTDLL.LIB.
  238. #
  239. # Note: The macros of the form xDLL are used when linking the object with
  240. #       the DLL version of the C Run-Time (that is, CRTDLL.LIB).  They are
  241. #       not used when the target object is itself a DLL.
  242. #
  243. # -------------------------------------------------------------------------
  244.  
  245. !IFDEF NO_ANSI
  246. noansi = -DNULL=0
  247. !ENDIF
  248.  
  249. # for Windows applications that use the C Run-Time libraries
  250. cvars      = -DWIN32 $(noansi) -D_WIN32
  251. cvarsmt    = $(cvars) -D_MT
  252. cvarsdll   = $(cvarsmt) -D_DLL
  253.  
  254. # for compatibility with older-style makefiles
  255. cvarsmtdll   = $(cvarsmt) -D_DLL
  256.  
  257. # for POSIX applications
  258. psxvars    = -D_POSIX_
  259.  
  260. # resource compiler
  261. rcflags = /r
  262. rcvars = -DWIN32 -D_WIN32 $(noansi)
  263.  
  264. !IF "$(APPVER)" == "4.0"
  265. rcvars = $(rcvars) -DWINVER=0x0400
  266. !else
  267. rcvars = $(rcvars) -DWINVER=0x030A
  268. !ENDIF
  269.  
  270. # -------------------------------------------------------------------------
  271. # Platform Dependent Link Flags - must be specified after $(link)
  272. #
  273. # Note: $(DLLENTRY) should be appended to each -entry: flag on the link
  274. #       line.
  275. #
  276. # Note: When creating a DLL that uses C Run-Time functions it is
  277. #       recommended to include the entry point function of the name DllMain
  278. #       in the DLL's source code.  Also, the MAKEFILE should include the
  279. #       -entry:_DllMainCRTStartup$(DLLENTRY) option for the creation of
  280. #       this DLL.  (The C Run-Time entry point _DllMainCRTStartup in turn
  281. #       calls the DLL defined DllMain entry point.)
  282. #
  283. # -------------------------------------------------------------------------
  284.  
  285. # declarations common to all linker options
  286. lcommon = /NODEFAULTLIB /INCREMENTAL:NO /PDB:NONE /RELEASE /NOLOGO
  287.  
  288. # declarations for use on Intel i386, i486, and Pentium systems
  289. !IF "$(CPU)" == "i386"
  290. DLLENTRY = @12
  291. lflags   = $(lcommon) -align:0x1000
  292. !ENDIF
  293.  
  294. # declarations for use on self hosted MIPS R4x000 systems
  295. !IF "$(CPU)" == "MIPS"
  296. DLLENTRY =
  297. lflags   = $(lcommon)
  298. !ENDIF
  299.  
  300. # declarations for use on self hosted PowerPC systems
  301. !IF "$(CPU)" == "PPC"
  302. DLLENTRY =
  303. lflags   = $(lcommon)
  304. !ENDIF
  305.  
  306. # declarations for use on self hosted Digital Alpha AXP systems
  307. !IF "$(CPU)" == "ALPHA"
  308. DLLENTRY =
  309. lflags   = $(lcommon)
  310. !ENDIF
  311.  
  312. # -------------------------------------------------------------------------
  313. # Target Module Dependent Link Debug Flags - must be specified after $(link)
  314. #
  315. # These switches allow the inclusion of the necessary symbolic information
  316. # for source level debugging with WinDebug, profiling and/or performance
  317. # tuning.
  318. #
  319. # Note: Debug switches are on by default.
  320. # -------------------------------------------------------------------------
  321.  
  322. !IFDEF NODEBUG
  323. ldebug = /RELEASE
  324. !ELSE
  325. !IFDEF PROFILE
  326. ldebug = -debug:mapped,partial -debugtype:coff
  327. !ELSE
  328. !IFDEF TUNE
  329. ldebug = -debug:mapped,partial -debugtype:coff
  330. !ELSE
  331. ldebug = -debug:full -debugtype:cv
  332. !ENDIF
  333. !ENDIF
  334. !ENDIF
  335.  
  336. # for compatibility with older-style makefiles
  337. linkdebug = $(ldebug)
  338.  
  339. # -------------------------------------------------------------------------
  340. # Subsystem Dependent Link Flags - must be specified after $(link)
  341. #
  342. # These switches allow for source level debugging with WinDebug for local
  343. # and global variables.  They also provide the standard application type and
  344. # entry point declarations.
  345. #
  346. # Note that on x86 screensavers have a WinMain entrypoint, but on RISC
  347. # platforms it is main.  This is a Win95 compatibility issue.
  348. #
  349. # -------------------------------------------------------------------------
  350.  
  351. # for Windows applications that use the C Run-Time libraries
  352. conlflags = $(lflags) -subsystem:console,$(APPVER) -entry:mainCRTStartup
  353. guilflags = $(lflags) -subsystem:windows,$(APPVER) -entry:WinMainCRTStartup
  354. dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
  355.  
  356. !IF "$(CPU)" == "i386"
  357. savlflags = $(lflags) -subsystem:windows,$(APPVER) -entry:WinMainCRTStartup
  358. !ELSE
  359. savlflags = $(lflags) -subsystem:windows,$(APPVER) -entry:mainCRTStartup
  360. !ENDIF
  361.  
  362. # for POSIX applications
  363. psxlflags = $(lflags) -subsystem:posix -entry:__PosixProcessStartup
  364.  
  365. # for compatibility with older-style makefiles
  366. conflags  = $(conlflags)
  367. guiflags  = $(guilflags)
  368. psxflags  = $(psxlflags)
  369.  
  370. # -------------------------------------------------------------------------
  371. # C Run-Time Target Module Dependent Link Libraries
  372. #
  373. # Below is a table which describes which libraries to use depending on the
  374. # target module type, although the table specifically refers to Graphical
  375. # User Interface apps, the exact same dependencies apply to Console apps.
  376. # That is, you could replace all occurrences of 'GUI' with 'CON' in the
  377. # following:
  378. #
  379. # Desired CRT  Libraries   Desired CRT  Libraries
  380. #   Library     to link      Library     to link
  381. #   for EXE     with EXE     for DLL     with DLL
  382. # ----------------------------------------------------
  383. #   LIBC       GUILIBS       None       None       *
  384. #   LIBC       GUILIBS       LIBC       GUILIBS
  385. #   LIBC       GUILIBS       LIBCMT     GUILIBSMT
  386. #   LIBCMT     GUILIBSMT     None       None       *
  387. #   LIBCMT     GUILIBSMT     LIBC       GUILIBS
  388. #   LIBCMT     GUILIBSMT     LIBCMT     GUILIBSMT
  389. #   CRTDLL     GUILIBSDLL    None       None       *
  390. #   CRTDLL     GUILIBSDLL    LIBC       GUILIBS
  391. #   CRTDLL     GUILIBSDLL    LIBCMT     GUILIBSMT
  392. #   CRTDLL     GUILIBSDLL    CRTDLL     GUILIBSDLL *
  393. #
  394. # * - Recommended Configurations.
  395. #
  396. # Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
  397. #       also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
  398. #
  399. # Note: For POSIX applications, link with $(psxlibs).
  400. #
  401. # -------------------------------------------------------------------------
  402.  
  403. # These CRT Libraries assume the use of Microsoft Visual C++ 2.0 on
  404. # x86 and MIPS platforms.  If you are using another Compiler product,
  405. # change the libc* variable to correspond to your import library names.
  406.  
  407. !IF "$(CPU)" == "PPC"
  408. libc = libc.lib
  409. libcmt = libcmt.lib
  410. libcdll = crtdll.lib
  411.  
  412. # for POSIX applications
  413. psxlibs    = libcpsx.lib psxdll.lib psxrtl.lib
  414.  
  415. !ELSE
  416. libc = libc.lib #oldnames.lib        # linker can't find oldnames.lib
  417. libcmt = libcmt.lib #oldnames.lib    # linker can't find oldnames.lib
  418. libcdll = msvcrt.lib #oldnames.lib    # linker can't find oldnames.lib
  419.  
  420. # for POSIX applications
  421. psxlibs    = libcpsx.lib psxdll.lib psxrtl.lib #oldnames.lib
  422.  
  423. !ENDIF
  424.  
  425. # optional profiling and tuning libraries
  426. !IFDEF PROFILE
  427. optlibs =  cap.lib
  428. !ELSE
  429. !IFDEF TUNE
  430. optlibs = wst.lib
  431. !ELSE
  432. optlibs =
  433. !ENDIF
  434. !ENDIF
  435.  
  436. # The PPC compiler currently requires a library for 64-bit integers.
  437. !IF "$(CPU)" == "PPC"
  438. int64lib = int64.lib
  439. !ELSE
  440. int64lib =
  441. !ENDIF
  442.  
  443.  
  444. # basic subsystem specific libraries, less the C Run-Time
  445. baselibs   = kernel32.lib $(optlibs) advapi32.lib
  446. winlibs    = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
  447.  
  448. # for Windows applications that use the C Run-Time libraries
  449. conlibs    = $(libc) $(baselibs)
  450. conlibsmt  = $(libcmt) $(baselibs)
  451. conlibsdll = $(libcdll) $(baselibs)
  452. guilibs    = $(libc) $(winlibs)
  453. guilibsmt  = $(libcmt) $(winlibs)
  454. guilibsdll = $(libcdll) $(winlibs)
  455.  
  456. # for OLE applications
  457. olelibs      = ole32.lib uuid.lib oleaut32.lib $(guilibs)
  458. olelibsmt    = ole32.lib uuid.lib oleaut32.lib $(guilibsmt)
  459. olelibsdll   = ole32.lib uuid.lib oleaut32.lib $(guilibsdll)
  460.  
  461. # for backward compatibility
  462. ole2libs    = $(olelibs)
  463. ole2libsmt  = $(olelibsmt)
  464. ole2libsdll = $(olelibsdll)
  465.  
  466. #ENDIF _WIN32_MAK_
  467. !ENDIF 
  468.