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

  1. # =========================================================================
  2. # WIN32.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 <win32.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. !IFNDEF _WIN32_MAK_
  37. _WIN32_MAK_ = 1
  38.  
  39. # -------------------------------------------------------------------------
  40. # Get CPU Type - exit if CPU environment variable is not defined
  41. # -------------------------------------------------------------------------
  42.  
  43. !IF "$(CPU)" == ""
  44. CPU = i386
  45. !ENDIF
  46.  
  47. # Intel i386, i486, and Pentium systems
  48. !IF "$(CPU)" == "i386"
  49. CPUTYPE = 1
  50. !ENDIF
  51.  
  52. # MIPS R4x000 systems
  53. !IF "$(CPU)" == "MIPS"
  54. CPUTYPE = 2
  55. !ENDIF
  56.  
  57. # Digital Alpha AXP systems
  58. !IF "$(CPU)" == "ALPHA"
  59. CPUTYPE = 3
  60. !ENDIF
  61.  
  62. # PPC systems
  63. !IF "$(CPU)" == "PPC"
  64. CPUTYPE = 4
  65. !ENDIF
  66.  
  67. !IFNDEF CPUTYPE
  68. !ERROR  Must specify CPU environment variable ( CPU=i386, CPU=MIPS, CPU=ALPHA, CPU=PPC)
  69. !ENDIF
  70.  
  71. # -------------------------------------------------------------------------
  72. # Get Target Operating System - Default to both
  73. # -------------------------------------------------------------------------
  74. !IFNDEF TARGETOS
  75. TARGETOS = BOTH
  76. !ENDIF
  77.  
  78. !IF "$(TARGETOS)" != "WINNT"
  79. !IF "$(TARGETOS)" != "WIN95"
  80. !IF "$(TARGETOS)" != "BOTH"
  81. !ERROR Must specify TARGETOS environment variable (BOTH, WIN95, WINNT)
  82. !ENDIF
  83. !ENDIF
  84. !ENDIF
  85.  
  86. # -------------------------------------------------------------------------
  87. # Set Default WINVER - depends on TARGETOS
  88. #
  89. # Defaults to 4.0 for all applications except NT specific.
  90. # -------------------------------------------------------------------------
  91.  
  92. !IFNDEF APPVER
  93. !IF "$(TARGETOS)" == "WINNT"
  94. APPVER = 3.10
  95. !ELSE
  96. APPVER = 4.0
  97. !ENDIF
  98. !ENDIF
  99.     
  100. !IF "$(APPVER)" != "4.0"
  101. !IF "$(APPVER)" != "3.10"
  102. !ERROR Must specify APPVER environment variable (4.0, 3.10)
  103. !ENDIF
  104. !ENDIF
  105.  
  106. # binary declarations common to all platforms
  107. cc     = cl
  108. rc     = rc
  109. link   = link
  110. implib = lib
  111.  
  112. !IF "$(TARGETOS)" == "WIN95"
  113. hc = hcw
  114. !ELSE
  115. hc = hc
  116. !ENDIF
  117.  
  118. # for compatibility with older-style makefiles
  119. cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
  120. cvtres = REM !!! CVTRES is no longer necessary - please remove !!!
  121.  
  122.  
  123. # -------------------------------------------------------------------------
  124. # Platform Dependent Compile Flags - must be specified after $(cc)
  125. #
  126. # Note: Debug switches are on by default for current release
  127. #
  128. # These switches allow for source level debugging with WinDebug for local
  129. # and global variables.
  130. #
  131. # Both compilers now use the same front end - you must still define either
  132. # _X86_, _MIPS_, _PPC_ or _ALPHA_.  These have replaced the i386, MIPS, and ALPHA
  133. # definitions which are not ANSI compliant.
  134. #
  135. # Common compiler flags:
  136. #   -c   - compile without linking
  137. #   -W3  - Set warning level to level 3
  138. #   -Zi  - generate debugging information
  139. #   -Od  - disable all optimizations
  140. #   -Ox  - use maximum optimizations
  141. #   -Zd  - generate only public symbols and line numbers for debugging
  142. #
  143. # i386 specific compiler flags:
  144. #   -Gz  - stdcall
  145. #
  146. # MS MIPS specific compiler flags:
  147. #   none.
  148. #
  149. # -------------------------------------------------------------------------
  150.  
  151. # declarations common to all compiler options
  152. ccommon = -c -W3 -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo
  153.  
  154. !IF "$(CPU)" == "i386"
  155. cflags = $(ccommon) -D_X86_=1
  156. scall  = -Gz
  157. !ELSE
  158. !IF "$(CPU)" == "MIPS"
  159. cflags = $(ccommon) -D_MIPS_=1
  160. !ELSE
  161. !IF "$(CPU)" == "PPC"
  162. cflags = $(ccommon) -D_PPC_=1
  163. !ELSE
  164. !IF "$(CPU)" == "ALPHA"
  165. cflags = $(ccommon) -D_ALPHA_=1
  166. !ENDIF
  167. !ENDIF
  168. !ENDIF
  169. scall  =
  170. !ENDIF
  171.  
  172. !IF "$(TARGETOS)" == "WINNT"
  173. INCLUDE = $(MSTOOLS)\h\winnt;$(INCLUDE)
  174. LIB = $(MSTOOLS)\lib\winnt;$(LIB)
  175. cflags = $(cflags) -D_WINNT
  176. !ELSE
  177. !IF "$(TARGETOS)" == "WIN95"
  178. INCLUDE = $(MSTOOLS)\h\win95;$(INCLUDE)
  179. LIB = $(MSTOOLS)\lib\win95;$(LIB)
  180. cflags = $(cflags) -D_WIN95
  181. !ENDIF
  182. !ENDIF
  183.  
  184. cflags4 = $(cflags) -DWINVER=0x0400
  185. !IF "$(APPVER)" == "4.0"
  186. cflags = $(cflags) -DWINVER=0x0400
  187. !ELSE
  188. cflags = $(cflags) -DWINVER=0x030A
  189. !ENDIF
  190.  
  191. !IFDEF NODEBUG
  192. cdebug = -Ox
  193. !ELSE
  194. !IFDEF PROFILE
  195. !IF "$(CPU)" == "MIPS"
  196. cdebug = -Gh -Zd -Od
  197. !ELSE
  198. cdebug = -Gh -Zd -Ox
  199. !ENDIF
  200. !ELSE
  201. !IFDEF TUNE
  202. cdebug = -Gh -Zd -Ox
  203. !ELSE
  204. cdebug = -Z7 -Od
  205. !ENDIF
  206. !ENDIF
  207. !ENDIF
  208.  
  209. # -------------------------------------------------------------------------
  210. # Target Module & Subsystem Dependent Compile Defined Variables - must be
  211. #   specified after $(cc)
  212. #
  213. # The following table indicates the various acceptable combinations of
  214. # the C Run-Time libraries LIBC, LIBCMT, and CRTDLL respect to the creation
  215. # of a EXE and/or DLL target object.  The appropriate compiler flag macros
  216. # that should be used for each combination are also listed.
  217. #
  218. #  Link EXE    Create Exe    Link DLL    Create DLL
  219. #    with        Using         with         Using
  220. # ----------------------------------------------------
  221. #  LIBC        CVARS          None        None      *
  222. #  LIBC        CVARS          LIBC        CVARS
  223. #  LIBC        CVARS          LIBCMT      CVARSMT
  224. #  LIBCMT      CVARSMT        None        None      *
  225. #  LIBCMT      CVARSMT        LIBC        CVARS
  226. #  LIBCMT      CVARSMT        LIBCMT      CVARSMT
  227. #  CRTDLL      CVARSDLL       None        None      *
  228. #  CRTDLL      CVARSDLL       LIBC        CVARS
  229. #  CRTDLL      CVARSDLL       LIBCMT      CVARSMT
  230. #  CRTDLL      CVARSDLL       CRTDLL      CVARSDLL  *
  231. #
  232. # * - Denotes the Recommended Configuration
  233. #
  234. # When building single-threaded applications you can link your executable
  235. # with either LIBC, LIBCMT, or CRTDLL, although LIBC will provide the best
  236. # performance.
  237. #
  238. # When building multi-threaded applications, either LIBCMT or CRTDLL can
  239. # be used as the C-Runtime library, as both are multi-thread safe.
  240. #
  241. # Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
  242. #       also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
  243. #       When using DLLs, it is recommended that all of the modules be
  244. #       linked with CRTDLL.LIB.
  245. #
  246. # Note: The macros of the form xDLL are used when linking the object with
  247. #       the DLL version of the C Run-Time (that is, CRTDLL.LIB).  They are
  248. #       not used when the target object is itself a DLL.
  249. #
  250. # -------------------------------------------------------------------------
  251.  
  252. !IFDEF NO_ANSI
  253. noansi = -DNULL=0
  254. !ENDIF
  255.  
  256. # for Windows applications that use the C Run-Time libraries
  257. cvars      = -DWIN32 $(noansi) -D_WIN32
  258. cvarsmt    = $(cvars) -D_MT
  259. cvarsdll   = $(cvarsmt) -D_DLL
  260.  
  261. # for compatibility with older-style makefiles
  262. cvarsmtdll   = $(cvarsmt) -D_DLL
  263.  
  264. # for POSIX applications
  265. psxvars    = -D_POSIX_
  266.  
  267. # resource compiler
  268. rcflags = /r
  269. rcvars = -DWIN32 -D_WIN32 $(noansi)
  270.  
  271. !IF "$(APPVER)" == "4.0"
  272. rcvars = $(rcvars) -DWINVER=0x0400
  273. !else
  274. rcvars = $(rcvars) -DWINVER=0x030A
  275. !ENDIF
  276.  
  277. # -------------------------------------------------------------------------
  278. # Platform Dependent Link Flags - must be specified after $(link)
  279. #
  280. # Note: $(DLLENTRY) should be appended to each -entry: flag on the link
  281. #       line.
  282. #
  283. # Note: When creating a DLL that uses C Run-Time functions it is
  284. #       recommended to include the entry point function of the name DllMain
  285. #       in the DLL's source code.  Also, the MAKEFILE should include the
  286. #       -entry:_DllMainCRTStartup$(DLLENTRY) option for the creation of
  287. #       this DLL.  (The C Run-Time entry point _DllMainCRTStartup in turn
  288. #       calls the DLL defined DllMain entry point.)
  289. #
  290. # -------------------------------------------------------------------------
  291.  
  292. # declarations common to all linker options
  293. lcommon = /NODEFAULTLIB /INCREMENTAL:NO /PDB:NONE /RELEASE /NOLOGO
  294.  
  295. # declarations for use on Intel i386, i486, and Pentium systems
  296. !IF "$(CPU)" == "i386"
  297. DLLENTRY = @12
  298. lflags   = $(lcommon) -align:0x1000
  299. !ENDIF
  300.  
  301. # declarations for use on self hosted MIPS R4x000 systems
  302. !IF "$(CPU)" == "MIPS"
  303. DLLENTRY =
  304. lflags   = $(lcommon)
  305. !ENDIF
  306.  
  307. # declarations for use on self hosted PowerPC systems
  308. !IF "$(CPU)" == "PPC"
  309. DLLENTRY =
  310. lflags   = $(lcommon)
  311. !ENDIF
  312.  
  313. # declarations for use on self hosted Digital Alpha AXP systems
  314. !IF "$(CPU)" == "ALPHA"
  315. DLLENTRY =
  316. lflags   = $(lcommon)
  317. !ENDIF
  318.  
  319. # -------------------------------------------------------------------------
  320. # Target Module Dependent Link Debug Flags - must be specified after $(link)
  321. #
  322. # These switches allow the inclusion of the necessary symbolic information
  323. # for source level debugging with WinDebug, profiling and/or performance
  324. # tuning.
  325. #
  326. # Note: Debug switches are on by default.
  327. # -------------------------------------------------------------------------
  328.  
  329. !IFDEF NODEBUG
  330. ldebug = /RELEASE
  331. !ELSE
  332. !IFDEF PROFILE
  333. ldebug = -debug:mapped,partial -debugtype:coff
  334. !ELSE
  335. !IFDEF TUNE
  336. ldebug = -debug:mapped,partial -debugtype:coff
  337. !ELSE
  338. ldebug = -debug:full -debugtype:cv
  339. !ENDIF
  340. !ENDIF
  341. !ENDIF
  342.  
  343. # for compatibility with older-style makefiles
  344. linkdebug = $(ldebug)
  345.  
  346. # -------------------------------------------------------------------------
  347. # Subsystem Dependent Link Flags - must be specified after $(link)
  348. #
  349. # These switches allow for source level debugging with WinDebug for local
  350. # and global variables.  They also provide the standard application type and
  351. # entry point declarations.
  352. # -------------------------------------------------------------------------
  353.  
  354. # for Windows applications that use the C Run-Time libraries
  355. conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
  356. guilflags = $(lflags) -subsystem:windows,$(APPVER) -entry:WinMainCRTStartup
  357. dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
  358.  
  359. # for Windows applications which require 4.0 level API support
  360. guilflags4 = $(lflags) -subsystem:windows,4 -entry:WinMainCRTStartup
  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
  417. libcmt = libcmt.lib oldnames.lib
  418. #libcdll = msvcrt.lib oldnames.lib    # linker can't find these .lib files !!!
  419. #libcdll = crtdll.lib                # this works on 95 but not 3.1
  420. #libcdll = crtdll35.lib                # this doesn't work
  421. libcdll = msvcrt.lib
  422.  
  423. # for POSIX applications
  424. psxlibs    = libcpsx.lib psxdll.lib psxrtl.lib oldnames.lib
  425.  
  426. !ENDIF
  427.  
  428. # optional profiling and tuning libraries
  429. !IFDEF PROFILE
  430. optlibs = cap.lib
  431. !ELSE
  432. !IFDEF TUNE
  433. optlibs = wst.lib
  434. !ELSE
  435. optlibs =
  436. !ENDIF
  437. !ENDIF
  438.  
  439. # The PPC compiler currently requires a library for 64-bit integers.
  440. !IF "$(CPU)" == "PPC"
  441. int64lib = int64.lib
  442. !ELSE
  443. int64lib =
  444. !ENDIF
  445.  
  446.  
  447. # basic subsystem specific libraries, less the C Run-Time
  448. baselibs   = kernel32.lib $(optlibs) advapi32.lib
  449. winlibs    = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
  450.  
  451. # for Windows applications that use the C Run-Time libraries
  452. conlibs    = $(libc) $(baselibs)
  453. conlibsmt  = $(libcmt) $(baselibs)
  454. conlibsdll = $(libcdll) $(baselibs)
  455. guilibs    = $(libc) $(winlibs)
  456. guilibsmt  = $(libcmt) $(winlibs)
  457. guilibsdll = $(libcdll) $(winlibs)
  458.  
  459. # for OLE applications
  460. olelibs      = ole32.lib uuid.lib oleaut32.lib $(guilibs)
  461. olelibsmt    = ole32.lib uuid.lib oleaut32.lib $(guilibsmt)
  462. olelibsdll   = ole32.lib uuid.lib oleaut32.lib $(guilibsdll)
  463.  
  464. # for backward compatibility
  465. ole2libs    = $(olelibs)
  466. ole2libsmt  = $(olelibsmt)
  467. ole2libsdll = $(olelibsdll)
  468.  
  469. #ENDIF _WIN32_MAK_
  470. !ENDIF 
  471.