📄 win32.mak
字号:
# =========================================================================
# WIN32.MAK - Win32 application master NMAKE definitions file for the
# Microsoft Plaform SDK for Win32 programming samples
# Copyright 1991 - 1998 Microsoft Corporation
# -------------------------------------------------------------------------
# This files should be included at the top of all MAKEFILEs as follows:
# !include <win32.mak>
# -------------------------------------------------------------------------
#
# Define APPVER = [ 4.0 | 5.0 ] prior to including win32.mak to get
# build time checking for version dependencies and to mark the executable
# with version information.
#
# Define TARGETOS = [ WIN95 | WINNT | BOTH ] prior to including win32.mak
# to get some build time checking for platform dependencies.
#
# Define TARGETLANG = [ LANG_JAPANESE | LANG_CHINESE | LANG_KOREAN ] prior
# to including win32.mak to getcompile & link flags for building
# applications to run on Far-East Windows. (This is an optional parameter.
# The system locale is the default.)
#
# Define _WIN32_IE = [ 0x0300 | 0x0400 ] prior to including win32.mak to
# get compile and link flags for building applications and components to
# run on Internet Explorer. (This is an optional parameter. IE 4.0 is
# the default.)
#
# -------------------------------------------------------------------------
# NMAKE Options
#
# Use the table below to determine the additional options for NMAKE to
# generate various application debugging, profiling and performance tuning
# information.
#
# Application Information Type Invoke NMAKE
# ---------------------------- ------------
# For No Debugging Info nmake nodebug=1
# For Working Set Tuner Info nmake tune=1
# For Call Attributed Profiling Info nmake profile=1
#
# Note: The three options above are mutually exclusive (you may use only
# one to compile/link the application).
#
# Note: creating the environment variables NODEBUG, TUNE, and PROFILE is an
# alternate method to setting these options via the nmake command line.
#
# Additional NMAKE Options Invoke NMAKE
# ---------------------------- ------------
# For No ANSI NULL Compliance nmake no_ansi=1
# (ANSI NULL is defined as PVOID 0)
#
# =========================================================================
!IFNDEF _WIN32_MAK_
_WIN32_MAK_ = 1
# -------------------------------------------------------------------------
# Get CPU Type - exit if CPU environment variable is not defined
# -------------------------------------------------------------------------
# Win95 does not define PROCESSOR_ARCHITECTURE - default to i386
!IF "$(PROCESSOR_ARCHITECTURE)" == ""
CPU=i386
PROCESSOR_ARCHITECTURE=x86
!endif
!IF !DEFINED(CPU) || "$(CPU)" == ""
CPU = $(PROCESSOR_ARCHITECTURE)
!ENDIF # CPU
# if PROCESSOR_ARCHITECTURE was x86 or X86 change CPU to i386
!IF ( "$(CPU)" == "X86" ) || ( "$(CPU)" == "x86" )
CPU = i386
!ENDIF # CPU == X86
!IF "$(CPU)" != "i386"
!IF "$(CPU)" != "ALPHA"
!ERROR Must specify CPU environment variable ( CPU=i386, CPU=ALPHA)
!ENDIF
!ENDIF
# -------------------------------------------------------------------------
# Get Target Operating System - Default to WINNT
# -------------------------------------------------------------------------
!IFNDEF TARGETOS
TARGETOS = WINNT
!ENDIF
!IF "$(TARGETOS)" != "WINNT"
!IF "$(TARGETOS)" != "WIN95"
!IF "$(TARGETOS)" != "BOTH"
!ERROR Must specify TARGETOS environment variable (BOTH, WIN95, WINNT)
!ENDIF
!ENDIF
!ENDIF
# default to APPVER of 4.0
!IFNDEF APPVER
APPVER = 4.0
!ENDIF
!IF "$(APPVER)" != "5.0"
!IF "$(APPVER)" != "4.0"
!ERROR Must specify APPVER environment variable (4.0, 5.0)
!ENDIF
!ENDIF
!IF "$(APPVER)" =="5.0"
!IFNDEF _WIN32_IE
_WIN32_IE = 0x0400
!ENDIF # _WIN32_IE
!ENDIF # APPVER == 5.0
!IFNDEF _WIN32_IE
_WIN32_IE = 0x0300
!ENDIF
# binary declarations common to all platforms
cc = cl
rc = rc
link = link
implib = lib
hc = hcrtf -xn
# for compatibility with older-style makefiles
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
cvtres = REM !!! CVTRES is no longer necessary - please remove !!!
# -------------------------------------------------------------------------
# Platform Dependent Compile Flags - must be specified after $(cc)
#
# Note: Debug switches are on by default for current release
#
# These switches allow for source level debugging with WinDebug for local
# and global variables.
#
# Both compilers now use the same front end - you must still define either
# _X86_ or _ALPHA_. These have replaced the i386 and ALPHA definitions
# which are not ANSI compliant.
#
# Common compiler flags:
# -c - compile without linking
# -W3 - Set warning level to level 3
# -Zi - generate debugging information
# -Od - disable all optimizations
# -Ox - use maximum optimizations
# -Zd - generate only public symbols and line numbers for debugging
#
# i386 specific compiler flags:
# -Gz - stdcall
#
# -------------------------------------------------------------------------
# declarations common to all compiler options
ccommon = -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo
# for compatibility with old source code, map {try, except, leave, finally}
# to their proper names (i.e. prefaced by "__")
!IFDEF SEHMAP
ccommon = $(ccommon) -FIsehmap.h
!ENDIF
!IF "$(TARGETLANG)" == "LANG_JAPANESE"
ccommon = $(ccommon) -DJAPAN -DDBCS -DFE_IME
!ENDIF
!IF "$(TARGETLANG)" == "LANG_CHINESE"
ccommon = $(ccommon) -DDBCS -DFE_IME
!ENDIF
!IF "$(TARGETLANG)" == "LANG_KOREAN"
ccommon = $(ccommon) -DDBCS -DFE_IME
!ENDIF
!IF "$(CPU)" == "i386"
cflags = $(ccommon) -D_X86_=1
scall = -Gz
!ELSE
!IF "$(CPU)" == "ALPHA"
cflags = $(ccommon) -D_ALPHA_=1
scall =
!ENDIF
!ENDIF
!IF "$(APPVER)" == "4.0"
NMAKE_WINVER = 0x0400
! IFNDEF _WIN32_IE
_WIN32_IE = 0x0300
! ENDIF
!ELSEIF "$(APPVER)" == "5.0"
NMAKE_WINVER = 0x0500
! IFNDEF _WIN32_IE
_WIN32_IE = 0x0400
! ENDIF
!ENDIF
!IF "$(TARGETOS)" == "WINNT"
cflags = $(cflags) -D_WINNT -D_WIN32_WINNT=$(NMAKE_WINVER)
!ENDIF
!IF "$(TARGETOS)" == "WIN95"
cflags = $(cflags) -D_WIN95 -D_WIN32_WINDOWS=$(NMAKE_WINVER)
!ENDIF
# regardless of the TARGET OS, define compile time WINVER to match APPVER macro
cflags = $(cflags) -D_WIN32_IE=$(_WIN32_IE) -DWINVER=$(NMAKE_WINVER)
!IFDEF NODEBUG
cdebug = -Ox
!ELSE
!IFDEF PROFILE
cdebug = -Gh -Zd -Ox
!ELSE
!IFDEF TUNE
cdebug = -Gh -Zd -Ox
!ELSE
cdebug = -Z7 -Od
!ENDIF
!ENDIF
!ENDIF
# -------------------------------------------------------------------------
# Target Module & Subsystem Dependent Compile Defined Variables - must be
# specified after $(cc)
#
# The following table indicates the various acceptable combinations of
# the C Run-Time libraries LIBC, LIBCMT, and CRTDLL respect to the creation
# of a EXE and/or DLL target object. The appropriate compiler flag macros
# that should be used for each combination are also listed.
#
# Link EXE Create Exe Link DLL Create DLL
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -