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