# ==++==
#
#   
#    Copyright (c) 2002 Microsoft Corporation.  All rights reserved.
#   
#    The use and distribution terms for this software are contained in the file
#    named license.txt, which can be found in the root of this distribution.
#    By using this software in any fashion, you are agreeing to be bound by the
#    terms of this license.
#   
#    You must not remove this notice, or any other, from this software.
#   
#
# ==--==
################################################################################
#
#Module Name:
#
#    makefile.def
#
#Abstract:
#
#    This is the standard makefile for the components of the NT project.
#    It includes the following files:
#
#        .\sources.      - developer supplies this file.  It defines the
#                          required TARGETNAME, TARGETPATH, TARGETTYPE and
#                          SOURCES as well as optional macros that control
#                          the behavior of the compiler and linker:
#
#        $(_OBJ_DIR)\_objects.mac  - built by BUILD.EXE from .\sources.
#
#
#Targets:
#
#    all       - Builds all targets in this make file
#
#    clean     - Erase all targets that can be produced by this make
#                file, ignoring errors.  Also rebuilds the depend target.
#
#    depend    - Rebuilts source file dependencies, using BUILD.EXE tool
#
#
#Useful Variables Set:
#
#    CPUTYPE={I386|AXP64|ALPHA|PPC|IA64}
#
#Optional Controls Variables (partial list), these are environment variables,
#remember they can be set with env=value on the command line as well:
#
#NOTE:  xxx_... is {MSC|386|axp64|alpha|PPC|ia64} where MSC_ applies to the C8 compiler
#       independent of the cpu type.  Specific cpu_ will take precedence
#       over the equivalent MSC_ variable.
#
#EXAMPLE:  To compile with codeview symbols for windbg:
#
#          set NTDEBUG=ntsd
#          set NTDEBUGTYPE=windbg
#          set MSC_OPTIMIZATION=/Od
#
#
#    nttest=filename
#
#    umtest=filename
#
#    umappl=filename
#
#    NT_UP
#            Define as 0 in environment to turn on MP.
#            If undefined or equal to 1, you get UP.
#
#    xxx_warning_level
#
#    xxx_optimization
#
#    xxx_STDCALL = 1 use _stdcall calling convention
#                  0 use _cdecl calling convention
#
#    ntdebug
#
#    browser_info
#
#    xxx_cppflags
#
#    ntcppflags
#
#    NT_INST - set to turn on instrumentation
#
#    BASEDIR - \nt or \ntrel (default \nt)
#
#    PRECOMPILED_CXX=1 - do precompiled headers for CXX instead of C files
#                        note: precompiled headers can not be used on both
#                        c and cxx files in a single directory.
################################################################################


# A couple of overrides

!ifndef SDK_INC_PATH
SDK_INC_PATH = $(BASEDIR)\public\sdk\inc
!endif

!ifndef SDK_LIB_PATH_HYDRA
SDK_LIB_PATH_HYDRA = $(BASEDIR)\public\sdk\lib\HYDRA\*
!endif

!ifndef SDK_LIB_PATH
SDK_LIB_PATH = $(BASEDIR)\public\sdk\lib\*
!endif

!ifndef DDK_LIB_PATH
DDK_LIB_PATH = $(BASEDIR)\public\sdk\lib\*
!endif

!ifndef CRT_INC_PATH
CRT_INC_PATH = $(BASEDIR)\public\sdk\inc\crt
!endif

!ifndef CRT_LIB_PATH
CRT_LIB_PATH = $(BASEDIR)\public\sdk\lib\*
!endif

!ifndef OAK_INC_PATH
OAK_INC_PATH = $(BASEDIR)\public\oak\inc
!endif

!ifndef MASTER_VERSION_FILE
MASTER_VERSION_FILE = $(BASEDIR)\public\sdk\inc\ntverp.h
DEFAULT_VERSION_FILE=1
!endif

#
# Select build target and set platform specific variables.
#

!INCLUDE makefile.plt


#
# Environment overrides
#

!INCLUDE makefile.env

#
#  IDL/RDL/TDL build rules.
#

!ifdef IDL_RULES
IDL_OUT_DIR =.
IDL_HDR_OUT_DIR =.
RDL_OUT_DIR =.
RDL_HDR_OUT_DIR =.

! ifndef MIDL_INCS
MIDL_INCS = $(_OBJ_DIR)\$(TARGET_DIRECTORY)
! endif

! ifndef MC_OUT_DIR
MC_OUT_DIR = $(_OBJ_DIR)\$(TARGET_DIRECTORY)
! endif
!endif

!ifndef LANGUAGE
LANGUAGE=usa
!endif

# define a simple macro that can be used for the object subdir in makefile.inc/sources files

O = $(_OBJ_DIR)\$(TARGET_DIRECTORY)

#
# Include the developer supplied file that defines the TARGETNAME, TARGETPATH,
# TARGETTYPE and SOURCES macros.  Make sure it defines them.
#

SUBSYSTEM_VERSION_CURRENT=4.10

!INCLUDE .\sources.
SOURCES_USED=$(SOURCES_USED) .\sources

!if defined(PREFIX_BUILD) || (defined(PLATFORM_UNIX) && "$(FEATURE_PRECOMPILED_HEADERS)" != "1")
PRECOMPILED_INCLUDE =
PRECOMPILED_CXX =
PRECOMPILED_SOURCEFILE	=
!endif

!IF EXIST(.\$(TARGET_DIRECTORY)\sources.)
! INCLUDE .\$(TARGET_DIRECTORY)\sources.
SOURCES_USED=$(SOURCES_USED) .\$(TARGET_DIRECTORY)\sources.
!ENDIF

#
# Attempt to include the sources file from the parent target subdirectory.
#

!IF EXIST(..\$(TARGET_DIRECTORY)\sources.)
! INCLUDE ..\$(TARGET_DIRECTORY)\sources.
SOURCES_USED=$(SOURCES_USED) ..\$(TARGET_DIRECTORY)\sources.
!ENDIF

!if defined(LOCALIZED_RESOURCES) && !defined(RCCODEPAGE)
! if "$(LANGUAGE)" == "JPN" || "$(LANGUAGE)" == "jpn"
RCCODEPAGE=932
! elseif "$(LANGUAGE)" == "KOR" || "$(LANGUAGE)" == "kor"
RCCODEPAGE=949
! elseif "$(LANGUAGE)" == "CHS" || "$(LANGUAGE)" == "chs"
RCCODEPAGE=936
! elseif "$(LANGUAGE)" == "CHP" || "$(LANGUAGE)" == "chp"
RCCODEPAGE=936
! elseif "$(LANGUAGE)" == "CHT" || "$(LANGUAGE)" == "cht"
RCCODEPAGE=950
! endif
!endif

#
# Attempt to include the sources file from the target subdirectory.
#

#
# Set far east specific defines based on the project
#
DO_FE_SB=0

!if "$(ALT_PROJECT)" == "FE"  || \
    "$(ALT_PROJECT)" == "CHT" || \
    "$(ALT_PROJECT)" == "CHS" || \
    "$(ALT_PROJECT)" == "CHP" || \
    "$(ALT_PROJECT)" == "JPN" || \
    "$(ALT_PROJECT)" == "KOR" || \
    "$(ALT_PROJECT)" == "NEC_98"
C_DEFINES=$(C_DEFINES) -DDBCS -DKKBUGFIX
ASM_DEFINES=$(ASM_DEFINES) -DDBCS -DKKBUGFIX
DO_FE_SB=1
!endif

!if "$(ALT_PROJECT)" == "CHT"
C_DEFINES=$(C_DEFINES) -DTAIWAN
ASM_DEFINES=$(ASM_DEFINES) -DTAIWAN
!elseif "$(ALT_PROJECT)" == "CHS" || "$(ALT_PROJECT)" == "CHP"
C_DEFINES=$(C_DEFINES) -DPRC
ASM_DEFINES=$(ASM_DEFINES) -DPRC
!elseif "$(ALT_PROJECT)" == "JPN" || "$(ALT_PROJECT)" == "NEC_98"
C_DEFINES=$(C_DEFINES) -DJAPAN
ASM_DEFINES=$(ASM_DEFINES) -DJAPAN
!elseif "$(ALT_PROJECT)" == "KOR"
C_DEFINES=$(C_DEFINES) -DKOREA
ASM_DEFINES=$(ASM_DEFINES) -DKOREA
!elseif "$(ALT_PROJECT)" != ""
C_DEFINES=$(C_DEFINES) -D_$(ALT_PROJECT)_
!endif

!if "$(ALT_PROJECT)" == "NEC_98"
C_DEFINES=$(C_DEFINES) -DNEC_98
ASM_DEFINES=$(ASM_DEFINES) -DNEC_98
BINPLACE_PLACEFILE=$(BASEDIR)\public\sdk\lib\intl\placefil.n98
!endif

!IF "$(ALT_PROJECT)" == "HYDRA"
ASM_DEFINES=$(ASM_DEFINES) -D_HYDRA_
HYDRA=1
!ENDIF

!IF ("$(NO_W32_SB)" == "" && "$(W32_SB)" == "1")
DO_FE_SB=1
! ENDIF

!IF "$(DO_FE_SB)" == "1"
C_DEFINES=$(C_DEFINES) -DFE_SB -DFE_IME
ASM_DEFINES=$(ASM_DEFINES) -DFE_SB
!ENDIF

!IF "$(ALT_PROJECT)" == "DS"
# Nothing, just -D_DS_ from above
!ENDIF

!IF "$(DSLIBRARY)" == ""
DSLIBRARY=$(BASEDIR)\public\sdk\lib
!ENDIF

!ifdef RESOURCE_ONLY_DLL
# Resource only DLL's have no exports, no entrypoint, no code, no data, no debug symbolic.
NTDEBUGTYPE=
NTDEBUG=retail
!undef DLLENTRY
LINK_NO_RELEASE=1
MAKEDLL=1
TARGETLIBS=
LINKLIBS=
USE_NOLIBS=1
NO_NTDLL=1
!endif

!ifdef DEFAULT_VERSION_FILE
# ! if "$(C_DEFINES)" != "$(C_DEFINES:DNASHVILLE=)"
# MASTER_VERSION_FILE=$(MASTER_VERSION_FILE) $(SDK_INC_PATH)\ieverp.h
# ! endif
!endif

!IFNDEF TARGETPATH
! ERROR Your .\sources. file must define the TARGETPATH= macro
!ENDIF

!if "$(TARGETPATH)" == "obj" || "$(TARGETPATH)" == "OBJ"
TARGETPATH=$(_OBJ_DIR)
!endif

!ifdef TARGETPATHLIB
! if ("$(TARGETTYPE)" == "DYNLINK") || ("$(TARGETTYPE)" == "EXPORT_DRIVER")
!  if "$(MAKEDLL)" == ""
# Pass 1 of a two pass build.  Make sure TargetPath is the same as targetpathlib.
NO_BROWSER_FILE=1
TARGETPATH=$(TARGETPATHLIB)
!  endif
! endif
!else
TARGETPATHLIB=$(TARGETPATH)
!endif

!IFNDEF TARGETTYPE
! ERROR Your .\sources. file must define the TARGETTYPE= macro
!ENDIF

!IFNDEF TARGETNAME
! IF "$(TARGETTYPE)" != "NOTARGET"
!  ERROR Your .\sources. file must define the TARGETNAME= macro
! ELSE
TARGETNAME=
! ENDIF
!ENDIF

!ifdef PLATFORM_UNIX
! ifndef TARGETLIBNAME
!  if "$(MAKEDLL)" == "1"
!  error Your sources file must define the TARGETLIBNAME= macro to create a shared library
!  else
TARGETLIBNAME=
TARGETPRE=
!  endif
! else
!  if "$(TARGETTYPE)" == "DYNLINK"
TARGETPRE=lib
!  endif
! endif
!endif

!IFNDEF SOURCES
! ERROR Your .\sources. file must define the SOURCES= macro
!ENDIF

!if ("$(BUILD_ALT_DIR)" != "" && "$(BUILD_ALT_DIR)" != "d")
! if ("$(UMAPPL:*=X)" != "$(UMAPPL)")
!  error Can't use multiple UMAPPL with Alternate Directories (other than "d")
! elseif ("$(UMTEST:*=X)" != "$(UMTEST)")
!  error Can't use multiple UMTEST with Alternate Directories (other than "d")
! endif
!endif

!ifndef COFFBASE_TXT_FILE
COFFBASE_TXT_FILE = $(BASEDIR)\public\sdk\lib\coffbase.txt
!endif

!ifndef PERL
PERL=perl
!endif

!IFNDEF UMBASE
! IFDEF COFFBASE
UMBASE=@$(COFFBASE_TXT_FILE),$(COFFBASE)
! ELSE
UMBASE=@$(COFFBASE_TXT_FILE),usermode
! ENDIF
!ENDIF

LINKLIBS=$(LINKLIBS) $(PERFLIBS)

!if defined(USE_ATL)
ATL_INCLUDES=$(SDK_INC_PATH)\atl21
ATL_LIBS=$(SDK_LIB_PATH)\atl.lib
ATL_FLAGS=
!elseif defined(USE_STATIC_ATL)
ATL_INCLUDES=$(SDK_INC_PATH)\atl21
ATL_LIBS=
ATL_FLAGS=/D_ATL_STATIC_REGISTRY
!endif

!IF DEFINED(USE_MFC) || DEFINED(USE_MFCUNICODE)

# MFC needs NT4/Win95 values.  Override at your own risk.
!ifndef WIN32_WINNT_VERSION
WIN32_WINNT_VERSION=0x0400
!endif
!ifndef WIN32_IE_VERSION
!  if defined(VC60)
WIN32_IE_VERSION=0x0400
!  else
WIN32_IE_VERSION=0x0300
!  endif
!endif
!ifndef WIN32_WIN95_VERSION
WIN32_WIN95_VERSION=0x0400
!endif

#---------------------------------------------------------#
# this set of defines establishes the "correct" build     #
# environment for an app that needs to use MFC.  the      #
# app's sources file only needs to specify USE_MFC=1      #
# and this makefile will set the enviroment up correctly. #
#---------------------------------------------------------#

! ifndef UMENTRY
!  ifdef USE_MFC30
UMENTRY=winmain
!  else
!   ifdef USE_MFCUNICODE
UMENTRY=wwinmain
!   else
UMENTRY=winmain
!   endif
!  endif
! endif

! if "$(TARGETTYPE)" == "DYNLINK"
!  ifndef DLLENTRY
DLLENTRY=_DllMainCRTStartup
!  endif
! endif

! ifndef UMTYPE
UMTYPE=windows
! endif

UMENTRYABS=

# Allow other MFC's.
#  To do so, you need to:
#    1. Define MFC_INCLUDES to point to your MFC headers.
#    2. Define MFC_LIBS to point to your MFC libraries (specifically, the dll
#       library)
#    3. Define USE_=1 if you don't want to link with the NT CRT DLL.
#
#  Note:
#     There is only one type of build (_AFXDLL or MFC in a DLL linking to the
#     CRT in a dll).
#     You should disable the alternate MFC's if compiling for RISC platforms.
#     You need to handle specifying the correct libs for Check/Free and
#     Ansi/Unicode.

! if !defined(USE_MSVCRT) && !defined(USE_NOLIBS) && !defined(USE_MSVCRT40) && !defined(USE_MSVCRT20)
!  if defined(USE_STATIC_MFC)
USE_LIBCMT=1
!  else
USE_CRTDLL=1
!  endif
! endif

MFC_FLAGS=$(MFC_FLAGS) -D_AFX_NOFORCE_LIBS

! ifdef DEBUG_CRTS
MFC_FLAGS=$(MFC_FLAGS) -D_AFX_ENABLE_INLINES
! endif

! IFDEF USE_MFCUNICODE
UNICODE=1
MFC_FLAGS=$(MFC_FLAGS) -DUNICODE -D_UNICODE
! ENDIF

! ifdef USE_MFC30

DCRT=
MFC_FLAGS=$(MFC_FLAGS) -D_AFXDLL

!  ifndef MFC_INCLUDES    # Allow MFC_INCLUDES override for MSN
MFC_INCLUDES=$(SDK_INC_PATH)\mfc30
!   ifdef MFC_LANGUAGE
MFC_INCLUDES=$(SDK_INC_PATH)\mfc30\l.$(MFC_LANGUAGE);$(MFC_INCLUDES)
!   endif
!  endif

!  if $(FREEBUILD)
MFC_FLAGS = $(MFC_FLAGS) -DNDEBUG
!  else
MFC_FLAGS = $(MFC_FLAGS) -D_DEBUG
!  endif

!  ifndef MFC_LIBS
!   if $(FREEBUILD)
!    ifdef USE_MFCUNICODE
MFC_LIBS=$(SDK_LIB_PATH)\cfm30u.lib  $(SDK_LIB_PATH)\cfmo30u.lib
!    else
MFC_LIBS=$(SDK_LIB_PATH)\cfm30.lib  $(SDK_LIB_PATH)\cfmo30.lib
!    endif
!   else
!    ifdef USE_MFCUNICODE
MFC_LIBS=$(SDK_LIB_PATH)\cfm30ud.lib $(SDK_LIB_PATH)\cfmo30ud.lib
!    else
MFC_LIBS=$(SDK_LIB_PATH)\cfm30d.lib $(SDK_LIB_PATH)\cfmo30d.lib
!    endif
!   endif
!  endif

! else

# Assume Latest MFC (4.0 for now)

!  ifndef USE_STATIC_MFC
MFC_FLAGS=$(MFC_FLAGS) -D_AFXDLL
LINKER_FLAGS = $(LINKER_FLAGS) /include:__afxForceSTDAFX
!  endif
!  ifdef MFC_USRDLL
MFC_FLAGS=$(MFC_FLAGS) -D_USRDLL
LINKER_FLAGS = $(LINKER_FLAGS) /include:__afxForceUSRDLL
!  endif

# MFC 4 uses Native EH only

USE_NATIVE_EH=1
USE_RTTI=1

# UNICODE must use the UNICODE entrypoint

!  ifdef USE_MFCUNICODE
!   if "$(UMENTRY)" == "winmain"
UMENTRY = wwinmain
!   else if "$(UMENTRY)" == "main"
UMENTRY = wmain
!   endif
!  endif

!  ifndef MFC_VER
MFC_VER=42
!  else if "$(MFC_VER)" == "40"
!undef USE_MSVCRT
!undef USE_CRTDLL
USE_MSVCRT40=1
!  endif

!  ifndef MFC_INCLUDES    # Allow MFC_INCLUDES override for MSN
MFC_INCLUDES=$(SDK_INC_PATH)\mfc$(MFC_VER)
!   ifdef MFC_LANGUAGE
MFC_INCLUDES=$(SDK_INC_PATH)\mfc$(MFC_VER)\l.$(MFC_LANGUAGE);$(MFC_INCLUDES)
!   endif
!  endif

!  ifndef MFC_LIBS
!   ifdef USE_STATIC_MFC

!    ifdef DEBUG_CRTS
!     ifdef USE_MFCUNICODE
MFC_STATIC_LIB =
MFC_LIBS=$(SDK_LIB_PATH)\uafxcwd.lib
!     else
MFC_STATIC_LIB =
MFC_LIBS=$(SDK_LIB_PATH)\nafxcwd.lib
!     endif
!    else
!     ifdef USE_MFCUNICODE
MFC_STATIC_LIB =
MFC_LIBS=$(SDK_LIB_PATH)\uafxcw.lib
!     else
MFC_STATIC_LIB =
MFC_LIBS=$(SDK_LIB_PATH)\nafxcw.lib
!     endif
!    endif

!   else                # USE_STATIC_MFC

!    ifdef DEBUG_CRTS
!     ifdef USE_MFCUNICODE
MFC_STATIC_LIB = $(SDK_LIB_PATH)\mfcs$(MFC_VER)ud.lib
MFC_LIBS=$(SDK_LIB_PATH)\mfc$(MFC_VER)ud.lib  \
         $(SDK_LIB_PATH)\mfcd$(MFC_VER)ud.lib \
         $(SDK_LIB_PATH)\mfcn$(MFC_VER)ud.lib \
         $(SDK_LIB_PATH)\mfco$(MFC_VER)ud.lib
!     else
MFC_STATIC_LIB = $(SDK_LIB_PATH)\mfcs$(MFC_VER)d.lib
MFC_LIBS=$(SDK_LIB_PATH)\mfc$(MFC_VER)d.lib  \
         $(SDK_LIB_PATH)\mfcd$(MFC_VER)d.lib \
         $(SDK_LIB_PATH)\mfcn$(MFC_VER)d.lib \
         $(SDK_LIB_PATH)\mfco$(MFC_VER)d.lib
!     endif
!    else
!     ifdef USE_MFCUNICODE
MFC_STATIC_LIB = $(SDK_LIB_PATH)\mfcs$(MFC_VER)u.lib
MFC_LIBS=$(SDK_LIB_PATH)\mfc$(MFC_VER)u.lib
!     else
MFC_STATIC_LIB = $(SDK_LIB_PATH)\mfcs$(MFC_VER).lib
MFC_LIBS=$(SDK_LIB_PATH)\mfc$(MFC_VER).lib
!     endif
!    endif
MFC_LIBS=$(MFC_STATIC_LIB) $(MFC_LIBS)

!   endif               # USE_STATIC_MFC
!  endif                # MFC_LIBS
! endif                 # MFC 3/4

!endif # DEFINED(USE_MFC) || DEFINED(USE_MFCUNICODE)

!IFNDEF UMTYPE
UMTYPE=nt
!ENDIF

!ifdef USE_MFC30
LIBC_DEFINES=
!else
! ifdef DEBUG_CRTS
DCRT=d
LIBC_DEFINES = -D_DEBUG
! else
DCRT=
LIBC_DEFINES = -DNDEBUG
! endif
!endif

# For all but X86, MSVCRT20==MSVCRT40==CRTDLL==MSVCRT
!if "$(TARGET_DIRECTORY)" != "i386"
! if defined(USE_MSVCRT20)
USE_MSVCRT=1
!  undef USE_MSVCRT20
! elseif defined(USE_MSVCRT40)
USE_MSVCRT=1
!  undef USE_MSVCRT40
! elseif defined(USE_CRTDLL)
USE_MSVCRT=1
!  undef USE_CRTDLL
! endif
!endif

!if defined(USE_CRTDLL) || defined(USE_MSVCRT)

! if !$(MPPC)
LIBC_LIB=$(CRT_LIB_PATH)\msvcrt$(DCRT).lib
!  if defined(USE_IOSTREAM)
LIBC_LIB=$(LIBC_LIB) $(CRT_LIB_PATH)\msvcirt$(DCRT).lib
!  endif
!  if defined(USE_STL)
LIBC_LIB=$(LIBC_LIB) $(CRT_LIB_PATH)\msvcprt$(DCRT).lib
!  endif
LIBC_DEFINES=$(LIBC_DEFINES) -D_DLL=1 -D_MT=1
! endif

!elseif defined(USE_IERT)

LIBC_LIB=$(CRT_LIB_PATH)\iert.lib
LIBC_DEFINES=$(LIBC_DEFINES) -D_MT=1

!elseif defined(USE_LIBCMT)

LIBC_LIB=$(CRT_LIB_PATH)\libcmt$(DCRT).lib
! if defined(USE_IOSTREAM)
LIBC_LIB=$(LIBC_LIB) $(CRT_LIB_PATH)\libcimt$(DCRT).lib
! endif
! if defined(USE_STL)
LIBC_LIB=$(LIBC_LIB) $(CRT_LIB_PATH)\libcpmt$(DCRT).lib
! endif
LIBC_DEFINES=$(LIBC_DEFINES) -D_MT=1

!elseif defined(USE_LIBCNTPR)

LIBC_LIB=$(CRT_LIB_PATH)\libcntpr.lib

!elseif (defined(USE_NTDLL) || \
       "$(TARGETTYPE)" == "DRIVER" || \
       "$(TARGETTYPE)" == "EXPORT_DRIVER" || \
       defined(USE_SYSDLL) )

LIBC_DEFINES=$(LIBC_DEFINES) -D_DLL=1
LIBC_LIB=

!elseif defined(USE_NOLIBS) || \
       "$(TARGETTYPE)" == "HAL" || \
       "$(TARGETTYPE)" == "GDI_DRIVER"

NO_NTDLL=1
LIBC_LIB=

!elseif defined(USE_MSVCRT20)

LIBC_LIB=$(CRT_LIB_PATH)\msvcrt2$(DCRT).lib
LIBC_DEFINES=$(LIBC_DEFINES) -D_DLL=1 -D_MT=1

!elseif defined(USE_MSVCRT40)

LIBC_LIB=$(CRT_LIB_PATH)\msvcrt4$(DCRT).lib
LIBC_DEFINES=$(LIBC_DEFINES) -D_DLL=1 -D_MT=1

!else

LIBC_LIB=$(CRT_LIB_PATH)\libc$(DCRT).lib
! if defined(USE_IOSTREAM)
LIBC_LIB=$(LIBC_LIB) $(CRT_LIB_PATH)\libci$(DCRT).lib
! endif
! if defined(USE_STL)
LIBC_LIB=$(LIBC_LIB) $(CRT_LIB_PATH)\libcp$(DCRT).lib
! endif

!endif

!if defined(USE_VCCOM)
LIBC_LIB = $(LIBC_LIB) $(SDK_LIB_PATH)\vccomsup.lib
!endif

!IFNDEF GPSIZE
GPSIZE= 0
!ENDIF

!IFDEF CAIRO_PRODUCT
CAIRO_LIB_PATH=$(BASEDIR)\public\sdk\lib\cairo\*
!ENDIF # CAIRO_PRODUCT

!ifdef NTLIBPATH
LIBRARY_PATH = $(NTLIBPATH)\*\lib
!else
LIBRARY_PATH = $(SDK_LIB_PATH)
!endif

!if defined(USE_MFC) ||  defined(USE_MFCUNICODE)
LIBC_LIB = $(MFC_LIBS) $(LIBC_LIB)
!endif

!if defined(USE_ATL) || defined(USE_STATIC_ATL)
LIBC_LIB = $(LIBC_LIB) $(ATL_LIBS)
# Piggy back on MFC_FLAGS for now.
MFC_FLAGS = $(MFC_FLAGS) $(ATL_FLAGS)
!endif

NT_LIBS=$(LIBRARY_PATH)\ntdll.lib
GUI32_LIBS=$(LIBRARY_PATH)\gdi32.lib \
           $(LIBRARY_PATH)\user32.lib

!IFDEF CAIRO_PRODUCT
NT_LIBS=$(NT_LIBS:lib\*\ntdll.lib=lib\cairo\*\ntdll.lib)
!ENDIF

NT_CRT=$(LIBRARY_PATH)\nt.lib
WIN32_LIBS=$(LIBC_LIB) \
           $(LIBRARY_PATH)\advapi32.lib \
           $(LIBRARY_PATH)\kernel32.lib

NTSS_LIBS=$(NT_LIBS) $(NT_CRT) $(SDK_LIB_PATH)\smdll.lib

OS2_LIBS=$(NT_LIBS)  $(SDK_LIB_PATH)\os2dll.lib

POSIX_LIBS=$(NT_LIBS) $(SDK_LIB_PATH)\libcpsx.lib \
                      $(SDK_LIB_PATH)\psxdll.lib \
                      $(SDK_LIB_PATH)\psxrtl.lib


!if "$(DRIVERTYPE)" == "wdm" || "$(DRIVERTYPE)" == "WDM"
# Building a WDM driver.  Default the subsystem version to the DDK version # (currently 1.0)
! ifndef SUBSYSTEM_VERSION
SUBSYSTEM_VERSION=1.00
! endif
!endif

!ifndef SUBSYSTEM_VERSION
! ifndef EXPECTED_WINVER
SUBSYSTEM_WINVER   = ,4.00
! else
SUBSYSTEM_WINVER   = ,$(EXPECTED_WINVER)
! endif
SUBSYSTEM_CONVER   = ,4.00
SUBSYSTEM_OS2VER   =
SUBSYSTEM_POSIXVER =
SUBSYSTEM_NATVER   = ,5.00
!else
SUBSYSTEM_WINVER   = ,$(SUBSYSTEM_VERSION)
SUBSYSTEM_CONVER   = ,$(SUBSYSTEM_VERSION)
SUBSYSTEM_OS2VER   = ,$(SUBSYSTEM_VERSION)
SUBSYSTEM_POSIXVER = ,$(SUBSYSTEM_VERSION)
SUBSYSTEM_NATVER   = ,$(SUBSYSTEM_VERSION)

# Set the appropriate default WIN32_xxxxx values

! if "$(SUBSYSTEM_VERSION)" == "4.00"
!  ifndef WIN32_WINNT_VERSION
WIN32_WINNT_VERSION=0x0400
!  endif
!  ifndef WIN32_WINNT_VERSION
WIN32_WIN95_VERSION=0x0400
!  endif
!  ifndef WIN32_IE_VERSION
!    if defined(VC60)
WIN32_IE_VERSION=0x0400
!    else
WIN32_IE_VERSION=0x0300
!    endif
!  endif
! elseif "$(SUBSYSTEM_VERSION)" == "3.51"
!  ifndef WIN32_WINNT_VERSION
WIN32_WINNT_VERSION=0x0351
!  endif
!  ifndef WIN32_WIN95_VERSION
WIN32_WIN95_VERSION=0x0300
!  endif
!  ifndef WIN32_IE_VERSION
WIN32_IE_VERSION=0x0200
!  endif
!  ifndef WINVER_VERSION
WINVER_VERSION=0x0400            # Special case - WINVER was 4.00 for NT 3.51
!  endif
! elseif "$(SUBSYSTEM_VERSION)" == "3.50"
!  ifndef WIN32_WINNT_VERSION
WIN32_WINNT_VERSION=0x0350
!  endif
!  ifndef WIN32_WIN95_VERSION
WIN32_WIN95_VERSION=0x0300
!  endif
!  ifndef WIN32_IE_VERSION
WIN32_IE_VERSION=0x0100
!  endif
!  ifndef WINVER_VERSION
WINVER_VERSION=0x0400            # Special case - WINVER was 4.00 for NT 3.50
!  endif
! endif
!endif

!IF "$(UMTYPE)" == "nt"

SUBSYSTEM=native$(SUBSYSTEM_NATVER)
UMINCL=$(CRT_INC_PATH)

STD_CALL_ENTRY=1
UMENTRY=-entry:NtProcessStartup

UMLIBS=$(UMLIBS) $(NT_LIBS) $(NT_CRT)

!ELSEIF "$(UMTYPE)" == "windows"

SUBSYSTEM=windows$(SUBSYSTEM_WINVER)
UMINCL=$(CRT_INC_PATH)

! IF "$(UMENTRY)" == "winmain"
UMENTRY=-entry:WinMainCRTStartup
! ELSEIF "$(UMENTRY)" == "wwinmain"
UMENTRY=-entry:wWinMainCRTStartup
! ELSEIF "$(UMENTRY)" == "wmain"
!  ifndef PLATFORM_UNIX
UMENTRY=-entry:wmainCRTStartup
!  endif
! ELSEIF "$(UMENTRYABS)" == ""
!ifndef PLATFORM_UNIX
UMENTRY=-entry:mainCRTStartup
!endif
! ELSE
UMENTRY=-entry:$(UMENTRYABS)
! ENDIF

!ifndef PLATFORM_UNIX
UMLIBS=$(UMLIBS) $(WIN32_LIBS) $(GUI32_LIBS)
!endif

!ELSEIF "$(UMTYPE)" == "console"

SUBSYSTEM=console$(SUBSYSTEM_CONVER)
UMINCL=$(CRT_INC_PATH)

! IF "$(UMENTRY)" == "winmain"
UMENTRY=-entry:WinMainCRTStartup
! ELSEIF "$(UMENTRY)" == "wwinmain"
UMENTRY=-entry:wWinMainCRTStartup
! ELSEIF "$(UMENTRY)" == "wmain"
!  ifndef PLATFORM_UNIX
UMENTRY=-entry:wmainCRTStartup
!  endif
! ELSEIF "$(UMENTRYABS)" == ""
!ifdef PLATFORM_UNIX
UMENTRY=
!else
UMENTRY=-entry:mainCRTStartup
!endif
! ELSE
UMENTRY=-entry:$(UMENTRYABS)
! ENDIF

!if !defined(MPPC) && !defined(PLATFORM_UNIX)
UMLIBS=$(UMLIBS) $(WIN32_LIBS)
!ENDIF

!ELSEIF "$(UMTYPE)" == "ntss"

SUBSYSTEM=native$(SUBSYSTEM_NATVER)
UMINCL=$(CRT_INC_PATH)

STD_CALL_ENTRY=1
UMENTRY=-entry:NtProcessStartup

!IF !$(MPPC)
UMLIBS=$(UMLIBS) $(NTSS_LIBS)
!ENDIF

!ELSEIF "$(UMTYPE)" == "os2"

SUBSYSTEM=os2$(SUBSYSTEM_OS2VER)
UMINCL=$(SDK_INC_PATH)\os2;$(CRT_INC_PATH)

STD_CALL_ENTRY=1
UMENTRY=-entry:NtProcessStartup

UMLIBS=$(UMLIBS) $(OS2_LIBS)

!ELSEIF "$(UMTYPE)" == "posix"

SUBSYSTEM=posix$(SUBSYSTEM_POSIXVER)
UMINCL=$(SDK_INC_PATH)\posix;$(CRT_INC_PATH)

UMENTRY=-entry:__PosixProcessStartup

UMLIBS=$(UMLIBS) $(POSIX_LIBS)

!ELSE
! ERROR Invalid UMTYPE value - $(UMTYPE)
!ENDIF  # UMTYPE tests


#
# If you edit this line you need to modify $(BASEDIR)\private\sdktools\build\build.c
#

!IFDEF NTINCPATH
NTINCLUDES=$(OAK_INC_PATH);$(NTINCPATH)\$(TARGET_DIRECTORY)\inc
!ELSE
NTINCLUDES=$(OAK_INC_PATH);$(SDK_INC_PATH)
!ENDIF

!IFNDEF COMPILER_WARNINGS
COMPILER_WARNINGS=-FI$(SDK_INC_PATH)\warning.h
!ENDIF

# If you change this to 600, fix MIDL_OPTIMIZATION default below.
!ifndef WIN32_WINNT_VERSION
WIN32_WINNT_VERSION=0x0500
!endif

!ifndef WIN32_WIN95_VERSION
WIN32_WIN95_VERSION=0x0400
!endif

!ifndef WIN32_IE_VERSION
WIN32_IE_VERSION=0x0400
!endif

!ifndef WINVER_VERSION
!ifdef CHICAGO_PRODUCT
WINVER_VERSION=$(WIN32_WIN95_VERSION)
!else
WINVER_VERSION=$(WIN32_WINNT_VERSION)
!endif
!endif

!IF defined(CAIRO_PRODUCT)
WIN32_DEFINE=-DWIN32=300 -D_CAIRO_=300 -DWINNT=1 -D_WIN32_WINNT=$(WIN32_WINNT_VERSION) -D_WIN32_IE=$(WIN32_IE_VERSION) -DWINVER=$(WINVER_VERSION)
! IFNDEF NOT_UNICODE
WIN32_DEFINE=$(WIN32_DEFINE) -DUNICODE -D_UNICODE
! ENDIF
!ELSEIF defined(CHICAGO_PRODUCT)
NTINCLUDES=$(BASEDIR)\public\sdk\inc\chicago;$(BASEDIR)\public\sdk\inc\chicago\crt;$(NTINCLUDES)
NO_NTDLL=1
! IFNDEF WIN32_DEFINE
WIN32_DEFINE=-DWIN32=200 -D_CHICAGO_=200 -D_WIN32_WINDOWS=$(WIN32_WIN95_VERSION) -DWINVER=$(WINVER_VERSION)
! ENDIF
!ELSEIF $(MPPC)

! IFNDEF MAC_INCLUDES
MAC_INCLUDES=$(BASEDIR)\private\macdcom\dll\src\inc;
MAC_INCLUDES=$(MAC_INCLUDES); $(BASEDIR)\public\sdk\inc\mppc;
MAC_INCLUDES=$(MAC_INCLUDES); $(_NTDRIVE)\nt\public\sdk\inc;
MAC_INCLUDES=$(MAC_INCLUDES); $(BASEDIR)\public\sdk\inc\mppc\macos;
MAC_INCLUDES=$(MAC_INCLUDES); $(BASEDIR)\public\sdk\inc\mppc\mrc;
! ENDIF

NTINCLUDES= $(MAC_INCLUDES);$(NTINCLUDES);

NO_NTDLL=1
WIN32_DEFINE=-DPOWERMAC=1

!ELSE
WIN32_DEFINE=-DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=$(WIN32_WINNT_VERSION) -DWINVER=$(WINVER_VERSION)
CAIRO_LIB_PATH=$(BASEDIR)\public\sdk\lib
!ENDIF # defined(CAIRO_PRODUCT)

WIN32_DEFINE = $(WIN32_DEFINE) -D_WIN32_IE=$(WIN32_IE_VERSION)

INCLUDES     = $(INCLUDES: =)
NTINCLUDES   = $(NTINCLUDES: =)
UMINCL       = $(UMINCL: =)
MFC_INCLUDES = $(MFC_INCLUDES: =)
USER_INCLUDES =$(USER_INCLUDES: =)
ATL_INCLUDES = $(ATL_INCLUDES: =)

# MFC, ATL, and USER first

INCPATH0=-I$(MFC_INCLUDES:;= -I) -I$(ATL_INCLUDES:;= -I) -I$(USER_INCLUDES:;= -I)
INCPATH1=-I$(MFC_INCLUDES:;= -I) -I$(ATL_INCLUDES:;= -I) -I$(USER_INCLUDES:;= -I)

# INCLUDES if set

!ifdef INCLUDES
INCPATH0 = $(INCPATH0) -I$(INCLUDES:;= -I)
INCPATH1 = $(INCPATH1) -I$(INCLUDES:;= -I)
!endif

# Finally NT and UM

INCPATH0=$(INCPATH0) -I$(NTINCLUDES:;= -I) -I$(UMINCL:;= -I)
INCPATH1=$(INCPATH1) -I$(NTINCLUDES:;= -I) -I$(UMINCL:;= -I)

# Remove empty "-I " settings (INCL/NTINCLUDES/UMINCL/MFC_INCLUDES macros may be empty above)

INCPATH0=$(INCPATH0:-I =)
INCPATH1=$(INCPATH1:-I =)

!IFNDEF RELATIVE_DEPTH
RELATIVE_DEPTH=..\..
!ENDIF

!IFNDEF DLLENTRY
DLLENTRY=-noentry
!ELSE
! if "$(DLLENTRY:-entry:=)" == "$(DLLENTRY)"
DLLENTRY=-entry:$(DLLENTRY)
! endif
!ENDIF

!IF $(MPPC)
DLLENTRY=-noentry
!ENDIF

!IFNDEF DLLBASE
! IFDEF COFFBASE
DLLBASE=@$(COFFBASE_TXT_FILE),$(COFFBASE)
! ELSE
DLLBASE=@$(COFFBASE_TXT_FILE),$(TARGETNAME)
! ENDIF
!ENDIF

!IFNDEF DLLDEF
DLLDEF=$(@B).def
!ENDIF

!IFNDEF BOOTBASE
! IFDEF FRAZZLE
BOOTBASE=0xd0100000,0xd0104000
! ELSE
BOOTBASE=0xd0ff0000,0xd0ff4000
! ENDIF
!ENDIF

!IFNDEF DRIVERBASE
DRIVERBASE=0x10000
!ENDIF

!IFNDEF HALBASE
HALBASE=0x80010000
!ENDIF

#
# Map lower case to upper case for variables that can be specified from the
# command line.
#

!IFDEF nttest
NTTEST=$(nttest)
!ENDIF

!IFDEF makedll
MAKEDLL=$(makedll)
!ENDIF

!IFDEF umtest
UMTEST=$(umtest)
!ENDIF


#
# Include the list of object files (defined as the OBJECTS macro) that was
# built by BUILD program, using the SOURCES= macro defined in the sources.
# file.  Use macro substitution to build the supported target objects.
#

OBJECTMACFILE=$(_OBJ_DIR)\_objects.mac
!IF EXIST($(OBJECTMACFILE))
!INCLUDE $(OBJECTMACFILE)
!ENDIF

!IF $(ROTOR_X86)
OBJECTS=$(ROTOR_X86_OBJECTS)
DLLLIBOBJECTS=$(DLLLIBOBJECTS) $(ROTOR_X86_DLLLIBOBJECTS)
!ELSEIF $(386)
OBJECTS=$(386_OBJECTS)
DLLLIBOBJECTS=$(DLLLIBOBJECTS) $(386_DLLLIBOBJECTS)
!ELSEIF $(AXP64)
OBJECTS=$(AXP64_OBJECTS)
DLLLIBOBJECTS=$(DLLLIBOBJECTS) $(AXP64_DLLLIBOBJECTS)
!ELSEIF $(PPC)
OBJECTS=$(PPC_OBJECTS)
DLLLIBOBJECTS=$(DLLLIBOBJECTS) $(PPC_DLLLIBOBJECTS)
!ELSEIF $(MPPC)
OBJECTS=$(MPPC_OBJECTS)
DLLLIBOBJECTS=$(DLLLIBOBJECTS) $(MPPC_DLLLIBOBJECTS)
!ELSEIF $(SPARC)
OBJECTS=$(SPARC_OBJECTS)
DLLLIBOBJECTS=$(DLLLIBOBJECTS) $(SPARC_DLLLIBOBJECTS)
!ELSEIF $(IA64)
OBJECTS=$(IA64_OBJECTS)
DLLLIBOBJECTS=$(DLLLIBOBJECTS) $(IA64_DLLLIBOBJECTS)
!ELSE
!ERROR "Unknown platform in makefile.def! OBJECTS will not be set."
!ENDIF

!ifdef MAC_RESOURCE
MAC_RESOURCE_OBJECT=$(_OBJ_DIR)\$(TARGET_DIRECTORY)\$(MAC_RESOURCE:.r=.rsc)
OBJECTS=$(OBJECTS) $(MAC_RESOURCE_OBJECT)
!endif

#
# BUILD.EXE defines the NOLINK variable to disable the building of any
# test executables when it is recursing on a dirs. file to build components
# in subdirectories.
#

!IF "$(BUILDMSG)" != "Stop."
! IFDEF NOLINK
!  UNDEF NTTEST
!  UNDEF MAKEDLL
! ELSE
!  IFDEF nolink
!   UNDEF NTTEST
!   UNDEF MAKEDLL
!  ENDIF
! ENDIF # DEF NOLINK
!ENDIF # BUILDMSG != "Stop."

DYNLINK_LIB=$(TARGETPATHLIB)\$(TARGET_DIRECTORY)\$(TARGETNAME).lib

!IF !$(MPPC)
DYNLINK_EXP=$(TARGETPATHLIB)\$(TARGET_DIRECTORY)\$(TARGETNAME).exp
!ENDIF

#
# Determine type of target link we are doing
#
!IF "$(TARGETTYPE)" == "PROGLIB"
!ifndef PLATFORM_UNIX
TARGETEXT=exe
!endif
TARGETLIB=
!ELSEIF "$(TARGETTYPE)" == "PROGRAM"
!ifndef PLATFORM_UNIX
TARGETEXT=exe
!endif
TARGETLIB=
!ELSEIF "$(TARGETTYPE)" == "DYNLINK"

! IF "$(MAKEDLL)" != ""
!  IF "$(UMTYPE)" == "os2"
TARGETLIB=$(SDK_LIB_PATH)\ntdll.lib

!  ELSEIF "$(UMTYPE)" == "posix"
TARGETLIB=$(SDK_LIB_PATH)\libcpsx.lib $(SDK_LIB_PATH)\ntdll.lib

!  ELSEIF "$(TARGETNAME)" == "ntdll"
TARGETLIB=

!  ELSEIF defined (USE_NTDLL)           # USE_NTDLL never links with LIBC_LIB
TARGETLIB=$(WIN32DLL_LIBS) $(SDK_LIB_PATH)\ntdll.lib

!  ELSEIF defined (USE_SYSDLL)          # USE_SYSDLL uses either kernel32 (Win95) or ntdll (NT) for CRT support
!   if defined(CHICAGO_PRODUCT)
TARGETLIB=$(WIN32DLL_LIBS) $(SDK_LIB_PATH)\kernel32.lib
!   else
TARGETLIB=$(WIN32DLL_LIBS) $(SDK_LIB_PATH)\ntdll.lib
!   endif
!  ELSEIF defined (NO_NTDLL)            # NO_NTDLL never links with ntdll
TARGETLIB=$(WIN32DLL_LIBS) $(LIBC_LIB)

!  ELSE                                 # Everything else uses ntdll after libc.
TARGETLIB=$(WIN32DLL_LIBS) $(LIBC_LIB) $(SDK_LIB_PATH)\ntdll.lib

!  ENDIF
!  IF "$(TARGETEXT)" == ""
!ifdef PLATFORM_UNIX
TARGETEXT=$(SHARED_LIB_EXT)
!else
TARGETEXT=dll
!endif
!  ENDIF
!  IFDEF CAIROLIB

#
# If we are linking a DLL then add in the cairo libs.
#

TARGETLIB=$(CAIROLIB) $(TARGETLIB)
!  ENDIF
!  IFDEF CAIRO_PRODUCT
TARGETLIB=$(TARGETLIB:lib\*\ntdll.lib=lib\cairo\*\ntdll.lib)
!  ENDIF
! ELSE # "$(MAKEDLL)" != ""
TARGETEXT=lib
TARGETLIB=
! ENDIF # "$(MAKEDLL)" != ""

!ELSEIF "$(TARGETTYPE)" == "LIBRARY" || "$(TARGETTYPE)" == "ARCHIVE"
TARGETEXT=lib
TARGETLIB=

!ELSEIF "$(TARGETTYPE)" == "DRIVER"
TARGETEXT=sys
!if "$(DRIVERTYPE)" == "wdm" || "$(DRIVERTYPE)" == "WDM"
TARGETLIB=$(SDK_LIB_PATH)\wdm.lib
!ELSEIF "$(ALT_PROJECT)" == "HYDRA" && "$(TARGETNAME)" == "mup"
TARGETLIB=$(SDK_LIB_PATH_HYDRA)\ntoskrnl.lib $(SDK_LIB_PATH)\hal.lib
!ELSE
TARGETLIB=$(SDK_LIB_PATH)\ntoskrnl.lib $(SDK_LIB_PATH)\hal.lib
!ENDIF

!ELSEIF "$(TARGETTYPE)" == "EXPORT_DRIVER"
! IF "$(MAKEDLL)" != ""
TARGETEXT=sys
!if "$(DRIVERTYPE)" == "wdm" || "$(DRIVERTYPE)" == "WDM"
TARGETLIB=$(SDK_LIB_PATH)\wdm.lib
!ELSE
!IF "$(ALT_PROJECT)" == "HYDRA"
TARGETLIB=$(SDK_LIB_PATH_HYDRA)\ntoskrnl.lib $(SDK_LIB_PATH)\hal.lib
!ELSE
TARGETLIB=$(SDK_LIB_PATH)\ntoskrnl.lib $(SDK_LIB_PATH)\hal.lib
!ENDIF
!ENDIF

! ELSE
TARGETEXT=lib
TARGETLIB=
! ENDIF

!ELSEIF "$(TARGETTYPE)" == "HAL"
! IF "$(MAKEDLL)" != ""
TARGETEXT=dll
TARGETLIB=$(SDK_LIB_PATH)\ntoskrnl.lib
! ELSE
TARGETEXT=lib
TARGETLIB=
! ENDIF

!ELSEIF "$(TARGETTYPE)" == "BOOTPGM"
TARGETEXT=sys

!ELSEIF "$(TARGETTYPE)" == "MINIPORT"
TARGETEXT=sys

!ELSEIF "$(TARGETTYPE)" == "GDI_DRIVER"

TARGETEXT=dll
TARGETLIB=$(SDK_LIB_PATH)\win32k.lib
!ENDIF # TARGETTYPE


TARGET=

!IF "$(TARGETTYPE)" != "UMAPPL_NOLIB"

! IF "$(OBJECTS)" != ""
!if "$(TARGETEXT)" == ""
TARGET=$(TARGETPATH)\*\$(TARGETNAME)
!else
!if "$(TARGETLIBNAME)" != ""
FULLTARGETNAME=$(TARGETPRIORPATH)$(TARGETPRE)$(TARGETLIBNAME)
!else
FULLTARGETNAME=$(TARGETNAME)
!endif
TARGET=$(TARGETPATH)\*\$(FULLTARGETNAME).$(TARGETEXT)
!endif
! ENDIF

!ENDIF # TARGETTYPE != UMAPPL_NOLIB

!IFDEF NOTARGETLIB
TARGETLIB=
!ENDIF

!ifdef PLATFORM_UNIX
!ifndef UNIX_DLL_LIBS
UNIX_DLL_LIBS=
!endif
!endif

!IFNDEF MACHINE_TARGETLIBS
MACHINE_TARGETLIBS=$(TARGETLIB) $(TARGETLIBS)
!ENDIF


TARGETOBJFILES=$(TARGETOBJFILES) $(OBJECTS)

!IF "$(NOLINK)" == "" ||                                     \
    ("$(NOLINK)" != "" && ("$(TARGETTYPE)"=="LIBRARY" ||     \
                           "$(TARGETTYPE)"=="ARCHIVE" ||     \
                        (   ("$(TARGETTYPE)"=="DYNLINK" ||   \
                         "$(TARGETTYPE)"=="PROGLIB" || \
                         "$(TARGETTYPE)"=="EXPORT_DRIVER" || \
                         "$(TARGETTYPE)"=="HAL")    &&       \
                            "$(MAKEDLL)" == "")              \
                           )                                 \
    )


! IF "$(NOLINK)" != "" && "$(TARGET)" != ""
TARGETLIBFILES=$(TARGETLIBFILES) $(TARGETPATH)\*\$(TARGETNAME).lib
! ELSE
TARGETEXEFILES=$(TARGETEXEFILES) $(TARGET)
! ENDIF

!ENDIF # NOLINK == "" || building .lib file for dll

!IF "$(NTTEST)" != ""

TARGETOBJFILES=$(TARGETOBJFILES) $O\$(NTTEST).obj

! IFNDEF NOLINK

TARGETEXEFILES=$(TARGETEXEFILES) $O\$(NTTEST).exe

! ENDIF # NDEF NOLINK
!ENDIF # NTTEST != ""

UMOBJFILES=
UMEXEFILES=

!IF "$(UMAPPLEXT)" == ""
! IFDEF _DOT_COM_FILE
UMAPPLEXT=.com
! ELSE
!ifdef PLATFORM_UNIX
UMAPPLEXT=
!else
UMAPPLEXT=.exe
!endif
! ENDIF
!ENDIF

!IF "$(UMAPPL)" != ""

UMOBJFILES=obj\*\$(UMAPPL:*=.obj obj\*\).obj


! IF "$(UMAPPLEXT)" == ".com"
!  IFNDEF NOLINK

UMEXEFILES=obj\*\$(UMAPPL:*=.com obj\*\).com
!  ENDIF
! ELSEIF "$(UMAPPLEXT)" == ".exe"
!  IFNDEF NOLINK

UMEXEFILES=obj\*\$(UMAPPL:*=.exe obj\*\).exe
!  ENDIF
! ELSEIF "$(UMAPPLEXT)" == ".scr"
!  IFNDEF NOLINK

UMEXEFILES=obj\*\$(UMAPPL:*=.scr obj\*\).scr
!  ENDIF
! ELSE
!  ERROR Unsupport UMAPPLEXT = $(UMAPPLEXT)

! ENDIF # UMAPPLEXT
!ENDIF # UMAPPL != ""

!IF "$(UMTEST)" != ""

UMOBJFILES=$(UMOBJFILES) obj\*\$(UMTEST:*=.obj obj\*\).obj

! IFNDEF NOLINK

UMEXEFILES=$(UMEXEFILES) obj\*\$(UMTEST:*=.exe obj\*\).exe

! ENDIF
!ENDIF

!if "$(BUILD_ALT_DIR)" == "d"
UMOBJFILES=$(UMOBJFILES:obj\*\=objd\*\)
UMEXEFILES=$(UMEXEFILES:obj\*\=objd\*\)
!endif

#
# Define NT_UP as 0 in environment to turn on MP.
# If undefined or equal to 1, you get UP.
#

!IFNDEF NT_UP
NT_UP=1
!ENDIF

!IF "$(NT_UP)"=="0"
NT_UP_DEFINES=
!ELSE
NT_UP_DEFINES=-DNT_UP=1
!ENDIF

!IFNDEF NT_INST
NT_INST=0
!ENDIF

!IFNDEF PNP_POWER
PNP_POWER=0
!ENDIF

!IF "$(PNP_POWER)"=="0"
NT_PNP_POWER_DEFINES=
!ELSE
NT_PNP_POWER_DEFINES=-D_PNP_POWER_=1
!ENDIF

!IFNDEF PNP_STUB_ENABLED
PNP_STUB_ENABLED=0
!ENDIF

!IF "$(PNP_STUB_ENABLED)"=="0"
NT_PNP_STUB_DEFINES=
!ELSE
NT_PNP_STUB_DEFINES=-D_PNP_POWER_STUB_ENABLED_=1
!ENDIF

#
# User defined variables (environment variables or command line).
# A cpu specific definition will take precedence over the MSC definition.
#
# xxx_WARNING_LEVEL
# xxx_OPTIMIZATION
# xxx_CPPFLAGS
#

!IFNDEF MSC_WARNING_LEVEL
!IFDEF PLATFORM_UNIX
MSC_WARNING_LEVEL=-Wall -Wno-non-virtual-dtor -Wno-non-template-friend
!ELSE
MSC_WARNING_LEVEL=/W3
!ENDIF
!ENDIF

!ifdef PLATFORM_UNIX
DEFAULT_MSC_OPT=-O2
!else
DEFAULT_MSC_OPT = /Oxs
!endif

#
# End of user defined variables.
#

STD_DEFINES=-DCONDITION_HANDLING=1 $(NT_UP_DEFINES) \
            -DNT_INST=$(NT_INST) $(WIN32_DEFINE) $(NT_PNP_POWER_DEFINES) \
            $(NT_PNP_STUB_DEFINES)

!IFNDEF NOT_LEAN_AND_MEAN
STD_DEFINES = $(STD_DEFINES) -DWIN32_LEAN_AND_MEAN=1
!ENDIF

#
# -cbstring is evil.  It is an undocumented compiler switch which disables string 
# pooling and forces all strings to be inlined where they are used in the code.
# While it helps a little for data locality, it bloats the code.  Don't use it.
#
#!IFNDEF CBSTRING
#! IF "$(MAJORCOMP)" == "ntos" || "$(MAJORCOMP)" == "NTOS" || "$(DDKBUILDENV)" != ""
#CBSTRING= -cbstring
#! ELSE
CBSTRING=
#! ENDIF
#!ENDIF

!IF "$(NTDEBUG)" == "retail"
TARGET_DBG_DEFINES= -DDEVL=1
DBGFLAGS=
!ELSEIF "$(NTDEBUG)" == ""
TARGET_DBG_DEFINES= -DDEVL=1
DBGFLAGS=
!ELSEIF "$(NTDEBUG)" == "ntsdnodbg"
!if "$(PLATFORM_UNIX)" == "1"
DBGFLAGS=-g
!else
DBGFLAGS=/Zi
!endif
TARGET_DBG_DEFINES= -DDEVL=1
!ELSEIF "$(NTDEBUG)" == "ntsd"
!if "$(PLATFORM_UNIX)" == "1"
DBGFLAGS=-g
!else
DBGFLAGS= /Zi
!endif
TARGET_DBG_DEFINES= -DDBG=1 -DDEVL=1
!ELSEIF "$(NTDEBUG)" == "cvp" || "$(NTDEBUG)" == "sym"
DBGFLAGS= /Zd
TARGET_DBG_DEFINES= -DDBG=1 -DDEVL=1
!ELSE
! ERROR NTDEBUG macro can be either "retail", "", "ntsd", "cvp" or "sym" or "ntsdnodbg"
!ENDIF

!ifndef PLATFORM_UNIX
!IF "$(NTDEBUGTYPE)" == "windbg"
LINKER_DBG_TYPE = -debugtype:cv
USE_PDB=1
!ELSEIF "$(NTDEBUGTYPE)" == "ntsd" || "$(NTDEBUGTYPE)" == "coff" || "$(NTDEBUGTYPE)" == ""
LINKER_DBG_TYPE = -debugtype:coff
!ELSEIF "$(NTDEBUGTYPE)" == "both"
LINKER_DBG_TYPE = -debugtype:both
USE_PDB=1
!ELSEIF "$(NTDEBUGTYPE)" == "vc6"
#LINKER_DBG_TYPE = -debugtype:vc6
USE_PDB=1
!ELSE
! ERROR NTDEBUGTYPE must be one of "", "ntsd", "coff", "windbg",  "vc6" or "both"
!ENDIF
!endif

!if "$(PLATFORM_UNIX)" == "" || "$(FEATURE_PRECOMPILED_HEADERS)" == "1"
!IF "$(PRECOMPILED_OPTION)" == ""
! IF "$(PRECOMPILED_INCLUDE)" != ""
!  IF "$(PRECOMPILED_INCLUDE)" != "$(PRECOMPILED_INCLUDE:.hxx=)"
PRECOMPILED_CXX=1
!  ENDIF
!  IF "$(PRECOMPILED_INCLUDE)" != "$(PRECOMPILED_INCLUDE:.cxx=)"
PRECOMPILED_CXX=1
!  ENDIF
!  IF "$(PRECOMPILED_INCLUDE)" != "$(PRECOMPILED_INCLUDE:.cpp=)"
PRECOMPILED_CXX=1
!  ENDIF
!  IF "$(PRECOMPILED_PCH)" == ""
PRECOMPILED_PCH=$(PRECOMPILED_INCLUDE:.hxx=.pch)
PRECOMPILED_PCH=$(PRECOMPILED_PCH:.h=.pch)
PRECOMPILED_PCH=$(PRECOMPILED_PCH:.cxx=.pch)
PRECOMPILED_PCH=$(PRECOMPILED_PCH:.cpp=.pch)
PRECOMPILED_PCH=$(PRECOMPILED_PCH:.c=.pch)
PRECOMPILED_PCH=$(PRECOMPILED_PCH:..\=)
!  ENDIF
!  IF "$(PRECOMPILED_OBJ)" == ""
PRECOMPILED_OBJ=$(PRECOMPILED_PCH:.pch=.obj)
!  ENDIF
! ENDIF
!ENDIF
!endif

!if "$(PLATFORM_UNIX)" == "" || "$(FEATURE_PRECOMPILED_HEADERS)" == "1"
!IF "$(PRECOMPILED_OPTION)" == ""
! IF "$(PRECOMPILED_INCLUDE)" != ""
!  IF "$(PRECOMPILED_PCH)" != ""
!   IF "$(FEATURE_PRECOMPILED_HEADERS)" == "1"
HEADERFILE=$O/$(PRECOMPILED_PCH)
!   ELSE
HEADERFILE=/Fp$O\$(PRECOMPILED_PCH)
!   ENDIF
!  ENDIF
!  IF "$(PRECOMPILED_OBJ)" != ""
HEADEROBJNAME=$O\$(PRECOMPILED_OBJ)
!   IF "$(FEATURE_PRECOMPILED_HEADERS)" == "1"
HEADEROBJ=--dump-pch $(MAKEDIR)/$(HEADEROBJNAME) -x c++-cpp-output
!   ELSE
HEADEROBJ=/Fo"$(MAKEDIR)\$(HEADEROBJNAME)"
!   ENDIF
!  ENDIF

!  IF !$(MPPC)
!   IF "$(PRECOMPILED_CXX)" == ""
!    IF "$(FEATURE_PRECOMPILED_HEADERS)" == "1"
PRECOMPILED=--load-pch $(HEADEROBJNAME)
!    ELSE
PRECOMPILED=/Yu$(PRECOMPILED_INCLUDE:..\=) $(HEADERFILE)
!    ENDIF
PRECOMPILED_CXX=
!   ELSE
PRECOMPILED=
!    IF "$(FEATURE_PRECOMPILED_HEADERS)" == "1"
PRECOMPILED_CXX=--load-pch $(HEADEROBJNAME)
!    ELSE
PRECOMPILED_CXX=/Yu$(PRECOMPILED_INCLUDE:..\=) $(HEADERFILE)
!    ENDIF
!   ENDIF
!  ENDIF

PRECOMPILED_TARGET=$O\$(PRECOMPILED_PCH)
! ELSE
!  IF "$(PRECOMPILED_INCLUDE)" != ""
!   IF !$(MPPC)
!    IF "$(PRECOMPILED_CXX)" == ""
!     IF "$(FEATURE_PRECOMPILED_HEADERS)" == "1"
PRECOMPILED=--load-pch $(HEADEROBJNAME)
!     ELSE
PRECOMPILED=/Yu$(PRECOMPILED_INCLUDE)
!     ENDIF
PRECOMPILED_CXX=
!    ELSE
PRECOMPILED=
!     IF "$(FEATURE_PRECOMPILED_HEADERS)" == "1"
PRECOMPILED_CXX=--load-pch $(HEADEROBJNAME)
!     ELSE
PRECOMPILED_CXX=/Yu$(PRECOMPILED_INCLUDE)
!     ENDIF
!    ENDIF
!   ENDIF
!  ENDIF
! ENDIF
!ELSE
! IF "$(PRECOMPILED_CXX)" == ""
PRECOMPILED=$(PRECOMPILED_OPTION)
PRECOMPILED_CXX=
! ELSE
PRECOMPILED=
PRECOMPILED_CXX=$(PRECOMPILED_OPTION)
! ENDIF
PRECOMPILED_TARGET=$(PRECOMPILED_TARGET)
! IF "$(PRECOMPILED_TARGET)" != ""
HEADERFILE=/Fp$(PRECOMPILED_TARGET)
! ENDIF
! IF "$(PRECOMPILED_OBJ)" != ""
HEADEROBJNAME=$(PRECOMPILED_OBJ)
!  IF "$(FEATURE_PRECOMPILED_HEADERS)" == "1"
HEADEROBJ=--dump-pch $(HEADEROBJNAME) -x c++-cpp-output
!  ELSE
HEADEROBJ=/Fo$(HEADEROBJNAME)
!  ENDIF
! ENDIF
!ENDIF
!endif

USECXX_FLAG=$(USECXX_FLAG:p=P)

!IF "$(PRECOMPILED_CXX)" == "" && "$(USECXX_FLAG)" == ""
PRECOMPILED_FLAG=$(PRECOMPILED_FLAG) /Tc
!ELSE
PRECOMPILED_FLAG=$(PRECOMPILED_FLAG) /Tp
!ENDIF

!IF "$(NTNOPCH)" != "" || ("$(PLATFORM_UNIX)" == "1" && "$(FEATURE_PRECOMPILED_HEADERS)" != "1")
PRECOMPILED=
PRECOMPILED_CXX=
!ENDIF

#
# Set linker options
#

# Merge .rtc section with .text. .rtc section is meant for debug info.
# VC6 doesn't get rid of it. Win2000 loader fails to load retail mscor* dlls with 
# .rtc section.
!ifndef PLATFORM_UNIX
LINKER_FLAGS = $(LINKER_FLAGS) -MERGE:.rtc=.text
!endif

#
# Merge _PAGE with PAGE, _TEXT with .text, and make sure
# INIT sections are discardable
#

!if !$(MPPC) && !$(IA64)
!ifdef LINKER_NOREF
LINK_REF_FLAG=-OPT:NOREF -OPT:NOICF
!else
! ifdef LINKER_NOICF
LINK_REF_FLAG=-OPT:REF -OPT:NOICF
! else
LINK_REF_FLAG=-OPT:REF -OPT:ICF
! endif
!endif
!endif

!ifndef PLATFORM_UNIX
!ifdef LINKER_STACKSIZE
LINKER_FLAGS = $(LINKER_FLAGS) $(LINKER_STACKSIZE)
!else
LINKER_FLAGS = $(LINKER_FLAGS) -STACK:262144,4096
!endif

LINK_LIB_IGNORE_FLAG=-IGNORE:4001,4037,4039,4065,4070,4078,4087,4089

!ifdef LINK_NO_RELEASE
LINK_RELEASE=
!else
LINK_RELEASE=/release
!endif

!ifdef USE_INCREMENTAL_LINKING
USE_PDB = 1                     # PDB's are required to use Incremental linking
LINK_INCREMENTAL_FLAG = -OPT:NOREF \
                        $(LINK_LIB_IGNORE_FLAG)
!else
LINK_INCREMENTAL_FLAG = $(LINK_REF_FLAG) \
                        -INCREMENTAL:NO \
                        -FULLBUILD \
                        -FORCE:MULTIPLE \
                        $(LINK_RELEASE) \
                        $(LINK_LIB_IGNORE_FLAG)
!endif
!endif

!ifdef BACKGROUND_USE
LINKER_FLAGS = $(LINKER_FLAGS) -WS:aggressive
!endif

!if $(MPPC)
LINKER_FLAGS =  $(LINKER_FLAGS) \
                -SECTION:INIT,d \
                $(LINK_INCREMENTAL_FLAG) \
                -NODEFAULTLIB

!else
!ifdef PLATFORM_UNIX
!if "$(TARGETTYPE)" != "PROGRAM"
LINKER_FLAGS =  $(LINKER_FLAGS) $(LIB_LINKER_FLAGS)
!endif
LINKER_FLAGS =  $(LINKER_FLAGS:/LARGEADDRESSAWARE=) \
                $(LINK_INCREMENTAL_FLAG)
!else
LINKER_FLAGS =  $(LINKER_FLAGS) \
                -MERGE:_PAGE=PAGE \
                -MERGE:_TEXT=.text \
                -SECTION:INIT,d \
                $(LINK_INCREMENTAL_FLAG) \
                -NODEFAULTLIB
!endif
!ifndef VC40_HACK
!ifndef PLATFORM_UNIX
LINKER_MERGE_RDATA=-MERGE:.rdata=.text
!endif
!endif

#!ifndef NO_OPTIDATA
#LINKER_OPTIDATA=-optidata
#!else
#LINKER_OPTIDATA=-nooptidata
#!endif

!endif

#!if "$(_TGTOS)" == "NT64"
#LINKER_OPTIDATA=
#!endif

!ifndef PLATFORM_UNIX
!IF "$(NTDEBUG)" == "ntsd" || "$(NTDEBUG)" == "ntsdnodbg"
LINKER_DBG_SECTION=-debug:FULL
!ELSEIF "$(NTDEBUG)" == "retail"
LINKER_DBG_SECTION=-debug:NONE
!ELSE
LINKER_DBG_SECTION=-debug:MINIMAL
!ENDIF
!endif

!IF "$(NTLEANANDMEAN)" == "leanandmean"
! IF "$(NTDEBUGTYPE)" == "coff" || \
       "$(NTTEST)"=="ntoskrnl" || \
       "$(NTTEST)"=="ntkrnlmp" || \
       "$(TARGETTYPE)"=="DRIVER" || \
       "$(TARGETTYPE)"=="MINIPORT" || \
       "$(TARGETTYPE)"=="EXPORT_DRIVER" || \
       "$(TARGETTYPE)"=="HAL"
LINKER_DBG_SECTION=-debug:minimal
! ELSE
LINKER_DBG_SECTION=-debug:none
! ENDIF # NTDEBUGTYPE != coff || TARGETTYPE
!ENDIF # NTLEANANDMEAN == leanandmean

!ifndef PLATFORM_UNIX
LINK_OS_VERSIONS = -version:5.00 -osversion:5.00
!endif

!IF $(MPPC)

#*****MacPPC linker flags

TARGET_DIRECTORY=mppc
MACHINE_TYPE=mppc
UMLIBS=$(UMLIBS:*=mppc)
LINKLIBS=$(LINKLIBS:*=mppc)
DLLDEF=$(DLLDEF:*=mppc)
PRECOMPILED_TARGET= $(PRECOMPILED_TARGET:*=mppc)
PRECOMPILED_OBJ= $(PRECOMPILED_OBJ:*=mppc)
PRECOMPILED_OPTION= $(PRECOMPILED_OPTION:*=mppc)

#
# Set the default creator and type.  If were building a dll then use
# cfmg and shlb, for apps use ???? and APPL.
#

!ifndef MAC_CREATOR
!if "$(TARGETTYPE)" == "DYNLINK"
MAC_CREATOR=cfmg
!else
MAC_CREATOR=????
!endif
!endif

!ifndef MAC_TYPE
!if "$(TARGETTYPE)" == "DYNLINK"
MAC_TYPE=shlb
!else
MAC_TYPE=APPL
!endif
!endif

#
# MAC_CREATOR and MAC_TYPE may contain embedded spaces.  To do this we need to
# enclose their operand in quotes.  Now get rid of the quotes leaving the spaces
#

MAC_CREATOR=$(MAC_CREATOR:^"=)
MAC_TYPE=$(MAC_TYPE:^"=)

#
# Setup for the linker
#


!if "$(TARGETTYPE)"=="DYNLINK"
LINKER_FLAGS=$(LINKER_FLAGS) -mac:nobundle -dll -def:$(DLLDEF)
LINKER_FLAGS=$(LINKER_FLAGS) -mac:MFILEPAD
LINKER_FLAGS=$(LINKER_FLAGS) -mac:init="$(MAC_INITPROC)"
LINKER_FLAGS=$(LINKER_FLAGS) -mac:term="$(MAC_TERMPROC)"
!else
LINKER_FLAGS=-mac:bundle
!endif

LINKER_FLAGS=$(LINKER_FLAGS) -mac:type="$(MAC_TYPE)"
LINKER_FLAGS=$(LINKER_FLAGS) -mac:creator="$(MAC_CREATOR)"
LINKER_FLAGS=$(LINKER_FLAGS) -debug:FULL -machine:$(MACHINE_TYPE)
LINKER_FLAGS=$(LINKER_FLAGS) -debugtype:both
LINKER_FLAGS=$(LINKER_FLAGS) -NODEFAULTLIB

#*****End Mac linker flags
!ELSE
LINKER_FLAGS = $(LINKER_FLAGS) $(LINKER_DBG_SECTION) $(LINKER_DBG_TYPE) $(LINK_OS_VERSIONS)
!ENDIF

#
# Processor specific control and options.
#

!include $(TARGET_DIRECTORY)mk.inc

!if "$(USE_CC_LIB)" != "1"
CC_LIB=
!endif

!ifndef USE_OLDSTYLE_IMPLIB
#LIBRARIAN_FLAGS = $(LIBRARIAN_FLAGS) /newimplib
!endif

!ifdef PLATFORM_UNIX
REQUIRED_C_RUNTIME = $(REQUIRED_C_LIBS)
LINKER_FLAGS = $(LINKER_FLAGS) $(REQUIRED_C_RUNTIME)

!if "$(TARGETTYPE)" == "ARCHIVE"
LIBRARIAN_FLAGS = $(ARCHIVE_FLAGS)
LIBRARIAN = ar $(LIBRARIAN_FLAGS) $@
!if "$(RANLIB)" != ""
USE_RANLIB = 1
!endif
TARGETTYPE=LIBRARY
!else
LIBRARIAN_FLAGS = $(PARTIAL_LINKING) $(LIBRARIAN_FLAGS) $(LD_LIB_DIRS)
LIBRARIAN = ld $(LIBRARIAN_FLAGS) -o $@
!endif
!else
LIBRARIAN_FLAGS = $(LIBRARIAN_FLAGS) $(LINK_LIB_IGNORE_FLAG) -nodefaultlib
LIBRARIAN_FLAGS = -debugtype:cv $(LIBRARIAN_FLAGS) -machine:$(MACHINE_TYPE)

LIBRARIAN=lib -out:$@ $(LIBRARIAN_FLAGS)
!endif

!ifndef LINKER
!ifdef PLATFORM_UNIX
LINKER=ld -o $@
!ELSE
!IF defined(BOUNDSCHECK)
LINKER=nmlink -out:$@ -machine:$(TARGET_DIRECTORY)
LINKLIBS= $(SDK_LIB_PATH)\bcinterf.lib $(LINKLIBS)
!else
LINKER=link -out:$@ -machine:$(MACHINE_TYPE)
!endif
!endif
!endif

!if defined(NTPROFILEINPUT) && ("$(TARGETTYPE)" == "LIBRARY")
! message NTPROFILEINPUT s/b removed in: $(MAKEDIR).
!endif

!IF defined(NTPROFILEINPUT) || defined(EXEPROFILEINPUT)
ORDER=-order:@$(@B).prf
!ENDIF

!IFDEF DLLORDER
ORDER=-order:@$(DLLORDER)
!ENDIF

!IFDEF EXPORT_DRIVER_ORDER
ORDER=-order:@$(EXPORT_DRIVER_ORDER)
!ENDIF

!IFNDEF DRIVER_ALIGNMENT
DRIVER_ALIGNMENT=0x20
!ENDIF

!ifndef HAL_ALIGNMENT
HAL_ALIGNMENT=0x20
!endif

!ifndef KERNEL_ALIGNMENT
KERNEL_ALIGNMENT=0x40
!endif

#
# Standard inference rules for C files that produce object files.
#

.SUFFIXES: .cxx .cpp .c .f .rc .s .asm .obj .exe .res .satellite .p .tdl .odl .rcpp .thk .java .class

!if defined(USE_MAPSYM) && !defined(PLATFORM_UNIX)
# HACK, mapsym seems to have size limitations, we work around it by filtering
# out the __imp__* symbols

MAPSYM_CMD = 	copy $(@D)\$(@B).map $(@D)\$(@B).map.orig & \
				findstr /v "__imp__" $(@D)\$(@B).map.orig > $(@D)\$(@B).map & \
				mapsym -o $(@D)\$(@B).sym $(@D)\$(@B).map 
LINKER_FLAGS=$(LINKER_FLAGS) -map
BINPLACE_FLAGS = $(BINPLACE_FLAGS) -W
!else
MAPSYM_CMD =
!endif


!ifndef BINPLACE_NAME
BINPLACE_NAME=binplace
!endif

!ifndef COPY_NAME
COPY_NAME=copy
!endif

!if "$(USE_PDB)" == ""
LINKER_FLAGS = $(LINKER_FLAGS) -PDB:NONE
!elseif ("$(PDB_ROOT)" != "") && ("$(CAIRO_PRODUCT)" == "")
LINKER_FLAGS = $(LINKER_FLAGS) -PDB:$(PDB_ROOT)\$(TARGETEXT)^\
PDB_ROOTUM = -PDB:$(PDB_ROOT)\$(UMAPPLEXT:.=)^\
!elseif ("$(CAIROPDB_ROOT)" != "") && ("$(CAIRO_PRODUCT)" != "")
LINKER_FLAGS = $(LINKER_FLAGS) -PDB:$(CAIROPDB_ROOT)\$(TARGETEXT)^\
PDB_ROOTUM = -PDB:$(CAIROPDB_ROOT)\$(UMAPPLEXT:.=)^\
!endif

LIBRARY_OBJS=$(IMPLIB_OBJS) $(MFC_STATIC_LIB) $(LINKLIBS) $(OBJECTS)

LINKER_FLAGS = $(LINKER_FLAGS) $(LINKER_MERGE_RDATA)

!if $(DELAYLOAD_SUPPORTED)
! if "$(DELAYLOAD)" != ""
DELAYLOAD = $(DELAYLOAD: =)
DELAYLOAD_FLAGS = /delayload:$(DELAYLOAD:;= /delayload:)
LINKER_FLAGS = $(LINKER_FLAGS) $(DELAYLOAD_FLAGS)
! endif
!endif

#
# Clear the suffixes list so we can ensure only pass zero stuff will be built
#
!IFDEF PASS0ONLY
.SUFFIXES:
!ENDIF

!ifdef NO_BINPLACE
BINPLACE_CMD=
!else

! ifndef BINPLACE_PLACEFILE
BINPLACE_PLACEFILE = $(BASEDIR)\public\sdk\lib\placefil.txt
! endif

BINPLACE_FLAGS = -P $(BINPLACE_PLACEFILE) $(BINPLACE_FLAGS)

! IFDEF UP_DRIVER
BINPLACE_FLAGS= $(BINPLACE_FLAGS) -U
DRIVER_SWITCH = -driver:uponly
! else
DRIVER_SWITCH = -driver
! ENDIF

!if "$(DRIVERTYPE)" == "wdm" || "$(DRIVERTYPE)" == "WDM"
DRIVER_SWITCH = $(DRIVER_SWITCH) -driver:wdm
!endif

! IF "$(_NTTREE)" != ""
!  IFDEF ALT_PROJECT_TARGET
_NTTREE= $(_NTTREE)\$(ALT_PROJECT_TARGET)
!   if "$(_NTTREE_NO_SPLIT)" != ""
_NTTREE_NO_SPLIT= $(_NTTREE_NO_SPLIT)\$(ALT_PROJECT_TARGET)
!   endif
!  ENDIF

# If NTDBGFILES is defined then use binplace to split the symbols.
# Define BINPLACE flags as needed if separate .DBG file requested.

!  IFDEF NTDBGFILES
BINPLACE_DBGFLAGS_NT = -S $(_NTTREE)\Symbols
!  else
BINPLACE_DBGFLAGS_NT=
!  ENDIF

BINPLACE_DBGFLAGS_NT = -S $(_NTTREE)\Symbols -x -n $(_NTTREE)\Symbols.pri -y

BINPLACE_CMD_NT=$(BINPLACE_NAME) -R $(_NTTREE) $(BINPLACE_DBGFLAGS_NT) $(BINPLACE_FLAGS) $@
BINPLACE_CMD_NS=$(BINPLACE_NAME) -R $(_NTTREE_NO_SPLIT) -Q $(BINPLACE_FLAGS) $@

BINPLACE_CMD=$(BINPLACE_CMD_NT)

!  if "$(_NTTREE_NO_SPLIT)" != ""
BINPLACE_CMD=$(BINPLACE_CMD) & $(BINPLACE_CMD_NS)
!  endif

! ELSE
BINPLACE_CMD=
! ENDIF
!endif

BINPLACE_CMD=@$(BINPLACE_CMD)

!ifdef NTDUMPAMAP
MAPDUMP_CMD = link -dump -map $@ | sort /R /+62 > $(_NTDUMPAMAP)\$(@B).srt
!else
MAPDUMP_CMD =
!endif

#
# Define this macro so including make files can supply a yes prompt
# as appropriate.  Put the "yes." file in a visible place for OEM's
# so they can make too.
#

!IFNDEF NOPASS0

#
# Pass Zero Inference Rules: IDL files (MIDL) and MC files
#

.SUFFIXES: .idl .mc .odl .tdl .asn .thk
! IF $(ROTOR_X86)
PASS0_OBJECTS=$(PASS0_ROTOR_X86_OBJECTS)
! ELSEIF $(386)
PASS0_OBJECTS=$(PASS0_386_OBJECTS)
! ELSEIF $(AXP64)
PASS0_OBJECTS=$(PASS0_AXP64_OBJECTS)
! ELSEIF $(PPC)
PASS0_OBJECTS=$(PASS0_PPC_OBJECTS)
! ELSEIF $(MPPC)
PASS0_OBJECTS=$(PASS0_MPPC_OBJECTS)
! ELSEIF $(IA64)
PASS0_OBJECTS=$(PASS0_IA64_OBJECTS)
! ENDIF

!ENDIF  # IFNDEF NOPASS0

MIDL = midl
MKTYPLIB = mktyplib
ASN = asn1
!IFDEF USE_OLE_MC
MC = mc -o
!ELSE
MC = mc
!ENDIF

!IF "$(IDL_TYPE)" == "ole" || "$(IDL_TYPE)" == ""
IDL_TYPE=OLE
!ELSEIF "$(IDL_TYPE)" == "rpc"
IDL_TYPE=RPC
!ENDIF

!IFNDEF PASS0_HEADERDIR
PASS0_HEADERDIR=.
!ENDIF

!IF "$(WIN32_WINNT_VERSION)" != "0x0500"
MIDL_OPTIMIZATION=$(MIDL_OPTIMIZATION_NT4)
!ENDIF

!IF DEFINED(MIDL_NO_ROBUST)
MIDL_OPTIMIZATION=$(MIDL_OPTIMIZATION_NO_ROBUST)
!ENDIF

!IF "$(IDL_TYPE)" == "OLE"

! IF DEFINED(PASS0_CLIENTDIR) || DEFINED(PASS0_SERVERDIR)
!  ERROR PASS0_CLIENTDIR and PASS0_SERVERDIR can only be used with IDL_TYPE=RPC!
! ENDIF

! IFNDEF PASS0_SOURCEDIR
PASS0_SOURCEDIR=.
! ENDIF

! IFNDEF MIDL_UUIDDIR
MIDL_UUIDDIR=$(PASS0_SOURCEDIR)
! ENDIF

!if $(MPPC)
PACKING= -Zp2
!else
PACKING= -Zp8
!endif

!if "$(_TGTOS)"=="NT64"
MIDL_PLATFORM= -win64
!else
MIDL_PLATFORM= -win32
!endif

! IFNDEF NO_PASS0_RULES
.idl{$(PASS0_HEADERDIR)}.h:
    $(MIDL) \
    $(PACKING) \
    $(MIDL_PLATFORM) \
    $(INCPATH0) \
    $(MIDL_DEFINES) \
    -char unsigned \
    -ms_ext -c_ext \
    -proxy $(PASS0_SOURCEDIR)\$(<F:.idl=_p.c) \
    -dlldata $(PASS0_SOURCEDIR)\dlldata.c \
    -iid $(MIDL_UUIDDIR)\$(<F:.idl=_i.c) \
    -header $@ \
    -cpp_cmd $(TARGET_CPP) \
    $(C_DEFINES) \
    $(MIDL_FLAGS) \
    $(MIDL_OPTIMIZATION) \
    $<

{..\}.idl{$(PASS0_HEADERDIR)}.h:
    $(MIDL) \
    $(PACKING) \
    $(INCPATH0) \
    $(MIDL_DEFINES) \
    -char unsigned \
    -ms_ext -c_ext \
    -proxy $(PASS0_SOURCEDIR)\$(<F:.idl=_p.c) \
    -dlldata $(PASS0_SOURCEDIR)\dlldata.c \
    -iid $(MIDL_UUIDDIR)\$(<F:.idl=_i.c) \
    -header $@ \
    -cpp_cmd $(TARGET_CPP) \
    $(C_DEFINES) \
    $(MIDL_FLAGS) \
    $(MIDL_OPTIMIZATION) \
    $<
! ENDIF

!ELSEIF "$(IDL_TYPE)" == "RPC"

! IF DEFINED(PASS0_SOURCEDIR) || DEFINED(MIDL_UUIDDR)
!  ERROR PASS0_SOURCEDIR and MIDL_UUIDDIR can only be used with IDL_TYPE=OLE!
! ENDIF

! IFNDEF PASS0_CLIENTDIR
PASS0_CLIENTDIR=$(TARGETPATH)
! ENDIF

! IFNDEF PASS0_SERVERDIR
PASS0_SERVERDIR=$(PASS0_CLIENTDIR)
! ENDIF

! IFNDEF NO_PASS0_RULES
.idl{$(PASS0_HEADERDIR)}.h:
    $(MIDL) \
    $(PACKING) \
    $(INCPATH0) \
    -char unsigned \
    -ms_ext -c_ext \
    -cstub $(PASS0_CLIENTDIR)\$(<F:.idl=_c.c) \
    -sstub $(PASS0_SERVERDIR)\$(<F:.idl=_s.c) \
    -header $@ \
    -cpp_cmd $(TARGET_CPP) \
    $(C_DEFINES) \
    $(MIDL_FLAGS) \
    $(MIDL_OPTIMIZATION) \
    $<

{..\}.idl{$(PASS0_HEADERDIR)}.h:
    $(MIDL) \
    $(PACKING) \
    $(INCPATH0) \
    -char unsigned \
    -ms_ext -c_ext \
    -cstub $(PASS0_CLIENTDIR)\$(<F:.idl=_c.c) \
    -sstub $(PASS0_SERVERDIR)\$(<F:.idl=_s.c) \
    -header $@ \
    -cpp_cmd $(TARGET_CPP) \
    $(C_DEFINES) \
    $(MIDL_FLAGS) \
    $(MIDL_OPTIMIZATION) \
    $<

! ENDIF

!ELSE

! ERROR Invalid IDL_TYPE value. Supported values: OLE and RPC.

!ENDIF  # IDL_TYPE

CPPXX = $(C_PREPROCESSOR_FLAGS:/Tc=)
CPPXX = $(CPPXX:-Tc=)

!IFNDEF NO_PASS0_RULES

! IFDEF PASS0_SOURCEDIR
MC_SOURCEDIR=$(PASS0_SOURCEDIR)
! ELSE
MC_SOURCEDIR=$(PASS0_CLIENTDIR)
! ENDIF

{..\}.mc{$(PASS0_HEADERDIR)}.h:
    $(MC) -h $(PASS0_HEADERDIR) -r $(MC_SOURCEDIR) $(MC_FLAGS) $<

.mc{$(PASS0_HEADERDIR)}.h:
    $(MC) -h $(PASS0_HEADERDIR) -r $(MC_SOURCEDIR) $(MC_FLAGS) $<

MKTYPLIB_CPP = $(TARGET_CPP)

!ifdef USE_MIDL_FOR_MKTYPLIB

MIDL_MKTYPLIB_FLAGS = \
    $(PACKING) \
    $(INCPATH0) \
    -char unsigned \
    -ms_ext \
    -c_ext \
    $(C_DEFINES) -D__MKTYPLIB__ \
    $(MIDL_FLAGS) \
    $(MIDL_OPTIMIZATION) \
    $(MKTYPLIB_FLAGS:-h =-header ) \
    -tlb $@ \
    -cpp_cmd $(TARGET_CPP) \
    -mktyplib203

.odl{$O\}.tlb:
    $(MIDL) $(MIDL_MKTYPLIB_FLAGS) $<

{..\}.odl{$O\}.tlb:
    $(MIDL) $(MIDL_MKTYPLIB_FLAGS) $<

.tdl{$O\}.tlb:
    $(MIDL) $(MIDL_MKTYPLIB_FLAGS) $<

{..\}.tdl{$O\}.tlb:
    $(MIDL) $(MIDL_MKTYPLIB_FLAGS) $<

!else

.odl{$O\}.tlb:
    @echo $(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $<
    @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $O\MyTypLib.TMP
$(CPPXX: =
)
-D__MKTYPLIB__
<<NOKEEP
    @$(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $O\MyTypLib.TMP

{..\}.odl{$O\}.tlb:
    @echo $(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $<
    @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $O\MyTypLib.TMP
$(CPPXX: =
)
-D__MKTYPLIB__
<<NOKEEP
    @$(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $O\MyTypLib.TMP

.tdl{$O\}.tlb:
    @echo $(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $<
    @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $O\MyTypLib.TMP
$(CPPXX: =
)
-D__MKTYPLIB__
<<NOKEEP
    @$(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $O\MyTypLib.TMP

{..\}.tdl{$O\}.tlb:
    @echo $(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $<
    @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $O\MyTypLib.TMP
$(CPPXX: =
)
-D__MKTYPLIB__
<<NOKEEP
    @$(MKTYPLIB) /tlb $@ -nocpp $(MKTYPLIB_FLAGS) $O\MyTypLib.TMP

!endif


# OSSINFO must be set in the *environment* for the ASN compiler to find its
# configuration file, $(OSSINFO)\ossinfo.

! ifndef OSSINFO
OSSINFO=$(BASEDIR)\public\sdk\lib
! endif

! ifndef ASNDEFAULTFILE
ASNDEFAULTFILE=$(OSSINFO)\asn1dflt.z4
! endif

! ifndef ASNSYNTAX
ASNSYNTAX=-1990
! endif

ASNFLAGS=$(ASNDEFAULTFILE) $(ASNSYNTAX) $(ASNFLAGS)

# if ASNDBG is explicitly set, let that control whether the voluminous ASN
# symbols are supressed.  Otherwise, suppress the symbols for free builds.

! ifdef ASNDBG
!  if $(ASNDBG) == 0
ASNFLAGS=-minimize $(ASNFLAGS)
!  endif
! elseif $(FREEBUILD)
ASNFLAGS=-minimize $(ASNFLAGS)
! endif

{}.asn{$(PASS0_HEADERDIR)}.h:
    $(ASN) $(ASNFLAGS) -out $(PASS0_HEADERDIR)\$(@B) $<

!ENDIF

#
# Default language ID to US English (0x0409)
#

!IFDEF RCCODEPAGE
RCOPTIONS=$(RCOPTIONS) -c $(RCCODEPAGE)
!ENDIF

!IFNDEF RCNOFONTMAP
RCOPTIONS=-z "MS Sans Serif,Helv/MS Shell Dlg" $(RCOPTIONS)
!ENDIF

!ifndef EMPTY_RES
EMPTY_RES=empty.res
!endif

RC_COMPILER=rc -l 409 $(RCOPTIONS)

INCPATHRC = $(INCPATH0: =)
INCPATHRC = $(INCPATHRC:-I=;)
INCPATHRC = $(INCPATHRC:/I=;)

CDEFINERC = $(CDEFINES:  = )
CDEFINERC = $(CDEFINERC:  = )

!IF $(MPPC)
{..\}.rc{$O\}.res:
     $(RC_COMPILER) -r -m -fo $(@R).res $(RC_DEFINES) $(RCXBANG) $(INCPATH0) $<
!ELSEIF defined(FEATURE_PAL) && !defined(USE_RC_FROM_TOOLS)
{..\}.rc{$O\}.res:
    $(TARGETCOMPLUS)\$(RC_NAME) -fo $(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).satellite $(CDEFINERC) $(INCPATH0) $<
    $(MAKE_NEW_DIR)
    $(TYPE_COMMAND) $(CORBASE)\..\tools\bin\$(EMPTY_RES) >$@
!ifdef PLATFORM_UNIX
    if [ -f $(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).satellite ]; then $(BINPLACE_NAME) -R $(_NTTREE) $(BINPLACE_DBGFLAGS_NT) $(BINPLACE_FLAGS) $(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).satellite; fi
!else
	if exist $(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).satellite $(BINPLACE_NAME) -R $(_NTTREE) $(BINPLACE_DBGFLAGS_NT) $(BINPLACE_FLAGS) $(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).satellite
!endif
!ELSE
{..\}.rc{$O\}.res:
    @$(MAKE_NEW_DIR)
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
    $(RC_COMPILER) -r -fo $(@R).tmp $(CDEFINES) $(INCPATH0) $<
<<NOKEEP
    @set include=$(INCPATHRC)
    @$(RC_COMPILER) -r -fo $(@R).tmp $(CDEFINERC) $<
    @set include=
    @cvtres -nologo -machine:$(MACHINE_TYPE:i386=ix86) -readonly -out:$@ $(@R).tmp
! IF "$(NTKEEPRESOURCETMPFILES)" == ""
    @-$(DELETER) $(@R).tmp
! ENDIF
!ENDIF


!IF $(MPPC)
{}.rc{$O\}.res:
    $(RC_COMPILER) -r -m -fo $(@R).res $(RC_DEFINES) $(RCXBANG) $(INCPATH0) $<
!ELSEIF defined(FEATURE_PAL) && !defined(USE_RC_FROM_TOOLS)
{}.rc{$O\}.res:
    $(TARGETCOMPLUS)\$(RC_NAME) -fo $(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).satellite $(CDEFINERC) $(INCPATH0) $<
    $(MAKE_NEW_DIR)
    $(TYPE_COMMAND) $(CORBASE)\..\tools\bin\$(EMPTY_RES) >$@
!ifdef PLATFORM_UNIX
    if [ -f $(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).satellite ]; then $(BINPLACE_NAME) -R $(_NTTREE) $(BINPLACE_DBGFLAGS_NT) $(BINPLACE_FLAGS) $(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).satellite; fi
!else
    if exist $(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).satellite $(BINPLACE_NAME) -R $(_NTTREE) $(BINPLACE_DBGFLAGS_NT) $(BINPLACE_FLAGS) $(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).satellite
!endif
!ELSE
{}.rc{$O\}.res:
    if not exist $(@D) md $(@D)
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
    $(RC_COMPILER) -r -fo $(@R).tmp $(CDEFINES) $(INCPATH0) $<
<<NOKEEP
    @set include=$(INCPATHRC)
    @$(RC_COMPILER) -r -fo $(@R).tmp $(CDEFINERC) $<
    @set include=
    @cvtres -nologo -machine:$(MACHINE_TYPE:i386=ix86) -readonly -out:$@ $(@R).tmp
! IF "$(NTKEEPRESOURCETMPFILES)" == ""
    @-$(DELETER) $(@R).tmp
! ENDIF
!ENDIF

!IF $(MPPC)

#
# The definitions for the resource compiler are the same as the definitions
# for the C compiler accept we need to remove INC_OLE2 because the resource
# compiler doesn't understand the pragma's that the VC guys used to rename
# the macos include files.  Thus, the resource compiler can't parse the ole
# headers
#

RC_DEFINES=$(C_DEFINES:INC_OLE2=NO_OLE)

#
# Setup for the mac resource compiler
#

# Macintosh-specific resourse (.r) to .rsc rule
MRC_COMPILER=mrc -l 0x409

.SUFFIXES: .r

{..\}.r{$(_OBJ_DIR)\$(TARGET_DIRECTORY)\}.rsc:
    $(MRC_COMPILER) -o $(@R).rsc $(RC_DEFINES) $(INCPATH0) $<

.r{$(_OBJ_DIR)\$(TARGET_DIRECTORY)\}.rsc:
    $(MRC_COMPILER) -o $(@R).rsc $(RC_DEFINES) $(INCPATH0) $<
!ENDIF


{..\}.rc.rcpp:
    set include=$(INCPATHRC)
    $(RC_COMPILER) -r -p -fo $(@R).tmp $(CDEFINERC) $<
    @set include=

{}.rc.rcpp:
    set include=$(INCPATHRC)
    $(RC_COMPILER) -r -p -fo $(@R).tmp $(CDEFINERC) $<
    @set include=

.thk{$O\}.asm:
    thunk -o $@ $<

JVC = jvc /nologo

!ifndef JAVA_DEBUG_FLAGS
!if $(FREEBUILD)
JAVA_DEBUG_FLAGS = /O
!else
JAVA_DEBUG_FLAGS = /g
!endif
!endif

!ifndef JAVA_WARNING_FLAGS
JAVA_WARNING_FLAGS = /w4
!endif

JAVA_BASE_CLASS = \
    $(BASEDIR)\public\sdk\classes\afc.zip; \
    $(BASEDIR)\public\sdk\classes\classes.zip

JAVA_CLASS_PATH = $(JAVA_BASE_CLASS); $(MAKEDIR); $(USER_CLASS_PATH)
JAVA_CLASS_PATH = $(JAVA_CLASS_PATH: =)

JVC_FLAGS = /cp $(JAVA_CLASS_PATH) $(JAVA_DEBUG_FLAGS) $(JAVA_WARNING_FLAGS) /d $(O)

{$(MAKEDIR)}.java{$O\}.class:
    $(JVC) $(JVC_FLAGS) $<

!ifndef CL_OPT_FC
CL_OPT_FC = /FC
!endif

!IFNDEF NO_C_RULES

ECHO_RSP = $O\echo.msg
CL_RSP   = $O\cl.rsp
CLCOD_RSP = $O\clcod.rsp
LINK_RSP = $O\lnk.rsp

{$O\}.cxx{$O\}.obj:
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_CXX_MSG)
<<NOKEEP
    @$(CXX_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(MAKEDIR)\$<
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP

!ifdef BATCH_NMAKE
{..\}.cxx{$O\}.obj::
!else
{..\}.cxx{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_CXX_MSG)
<<NOKEEP
    @$(CXX_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(MAKEDIR)\$<
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP

!ifdef BATCH_NMAKE
{..\$(TARGET_DIRECTORY)\}.cxx{$O\}.obj::
!else
{..\$(TARGET_DIRECTORY)\}.cxx{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_CXX_MSG)
<<NOKEEP
    @$(CXX_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(MAKEDIR)\$<
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP

!ifdef PLATFORM_UNIX
!ifdef BATCH_NMAKE
{$O\}.cpp{$O\}.obj::
!else
{$O\}.cpp{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_CXX_MSG)
<<NOKEEP
    @$(C_PREPROCESSOR_NAME) $(C_PREPROCESSOR_FLAGS) $(OUTPUT_FLAG) $(MAKEDIR)/$*.ii $(CL_OPT_FC) $(MAKEDIR)/$<
    @$(CPP_MUNGER_NAME) -s$(MAKEDIR)/$< -p$(PRECOMPILED_INCLUDE) $(MAKEDIR)/$*.ii
    @$(CXX_COMPILER_NAME) $(CXX_COMPILER_FLAGS) $(OUTPUT_FLAG) $(MAKEDIR)/$@ $(CL_OPT_FC) $(MAKEDIR)/$*.ii
    - @$(DELETER) $(MAKEDIR)/$*.ii
!else
!ifdef BATCH_NMAKE
{$O\}.cpp{$O\}.obj::
!else
{$O\}.cpp{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_CXX_MSG)
<<NOKEEP
    @$(CXX_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(MAKEDIR)\$<
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!ifdef PLATFORM_UNIX
!ifdef BATCH_NMAKE
{..\}.cpp{$O\}.obj::
!else
{..\}.cpp{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_CXX_MSG)
<<NOKEEP
    @$(C_PREPROCESSOR_NAME) $(C_PREPROCESSOR_FLAGS) $(OUTPUT_FLAG) $(MAKEDIR)/$*.ii $(CL_OPT_FC) $(MAKEDIR)/$<
    @$(CPP_MUNGER_NAME) -s$(MAKEDIR)/$< -p$(PRECOMPILED_INCLUDE) $(MAKEDIR)/$*.ii
    @$(CXX_COMPILER_NAME) $(CXX_COMPILER_FLAGS) $(OUTPUT_FLAG) $(MAKEDIR)/$@ $(CL_OPT_FC) $(MAKEDIR)/$*.ii
    - @$(DELETER) $(MAKEDIR)/$*.ii
!else
!ifdef BATCH_NMAKE
{..\}.cpp{$O\}.obj::
!else
{..\}.cpp{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_CXX_MSG)
<<NOKEEP
    @$(CXX_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(MAKEDIR)\$<
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!ifdef PLATFORM_UNIX
!ifdef BATCH_NMAKE
{..\$(TARGET_DIRECTORY)\}.cpp{$O\}.obj::
!else
{..\$(TARGET_DIRECTORY)\}.cpp{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_CXX_MSG)
<<NOKEEP
    @$(C_PREPROCESSOR_NAME) $(C_PREPROCESSOR_FLAGS) $(OUTPUT_FLAG) $(MAKEDIR)/$*.ii $(CL_OPT_FC) $(MAKEDIR)/$<
    @$(CPP_MUNGER_NAME) -s$(MAKEDIR)/$< -p$(PRECOMPILED_INCLUDE) $(MAKEDIR)/$*.ii
    @$(CXX_COMPILER_NAME) $(CXX_COMPILER_FLAGS) $(OUTPUT_FLAG) $(MAKEDIR)/$@ $(CL_OPT_FC) $(MAKEDIR)/$*.ii
    - @$(DELETER) $(MAKEDIR)/$*.ii
!else
!ifdef BATCH_NMAKE
{..\$(TARGET_DIRECTORY)\}.cpp{$O\}.obj::
!else
{..\$(TARGET_DIRECTORY)\}.cpp{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_CXX_MSG)
<<NOKEEP
    @$(CXX_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(MAKEDIR)\$<
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!ifdef BATCH_NMAKE
{}.cxx{$O\}.obj::
!else
{}.cxx{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_CXX_MSG)
<<NOKEEP
    @$(CXX_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(MAKEDIR)\$<
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP

!ifdef BATCH_NMAKE
{$(TARGET_DIRECTORY)\}.cxx{$O\}.obj::
!else
{$(TARGET_DIRECTORY)\}.cxx{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_CXX_MSG)
<<NOKEEP
    @$(CXX_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(MAKEDIR)\$<
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP

!ifdef PLATFORM_UNIX
!ifdef BATCH_NMAKE
{}.cpp{$O\}.obj::
!else
{}.cpp{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_CXX_MSG)
<<NOKEEP
    @$(C_PREPROCESSOR_NAME) $(C_PREPROCESSOR_FLAGS) $(OUTPUT_FLAG) $(MAKEDIR)/$*.ii $(CL_OPT_FC) $(MAKEDIR)/$<
    @$(CPP_MUNGER_NAME) -s$(MAKEDIR)/$< -p$(PRECOMPILED_INCLUDE) $(MAKEDIR)/$*.ii
    @$(CXX_COMPILER_NAME) $(CXX_COMPILER_FLAGS) $(OUTPUT_FLAG) $(MAKEDIR)/$@ $(CL_OPT_FC) $(MAKEDIR)/$*.ii
    - @$(DELETER) $(MAKEDIR)/$*.ii
!else
!ifdef BATCH_NMAKE
{}.cpp{$O\}.obj::
!else
{}.cpp{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_CXX_MSG)
<<NOKEEP
    @$(CXX_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(MAKEDIR)\$<
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!ifdef PLATFORM_UNIX
!ifdef BATCH_NMAKE
{$(TARGET_DIRECTORY)\}.cpp{$O\}.obj::
!else
{$(TARGET_DIRECTORY)\}.cpp{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_CXX_MSG)
<<NOKEEP
    @$(C_PREPROCESSOR_NAME) $(C_PREPROCESSOR_FLAGS) $(OUTPUT_FLAG) $(MAKEDIR)/$*.ii $(CL_OPT_FC) $(MAKEDIR)/$<
    @$(CPP_MUNGER_NAME) -s$(MAKEDIR)/$< -p$(PRECOMPILED_INCLUDE) $(MAKEDIR)/$*.ii
    @$(CXX_COMPILER_NAME) $(CXX_COMPILER_FLAGS) $(OUTPUT_FLAG) $(MAKEDIR)/$@ $(CL_OPT_FC) $(MAKEDIR)/$*.ii
    - @$(DELETER) $(MAKEDIR)/$*.ii
!else
!ifdef BATCH_NMAKE
{$(TARGET_DIRECTORY)\}.cpp{$O\}.obj::
!else
{$(TARGET_DIRECTORY)\}.cpp{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_CXX_MSG)
<<NOKEEP
    @$(CXX_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(MAKEDIR)\$<
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

{..\}.cxx{}.cod:
    $(CXX_COMPILER_NAME) @<<$(CLCOD_RSP) $(CL_OPT_FC) $(CL_OPT_FC) $<
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP

!ifdef PLATFORM_UNIX
{..\}.cxx{}.pp:
    $(CXX_COMPILER_NAME) $(CXX_COMPILER_FLAGS) -E $< > $@
!else
{..\}.cxx{}.pp:
    $(CXX_COMPILER_NAME) @<<$(CL_RSP) /E $(CL_OPT_FC) $< > $@
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

{..\}.cpp{}.cod:
    $(CXX_COMPILER_NAME) @<<$(CLCOD_RSP) $(CL_OPT_FC) $(CL_OPT_FC) $<
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP

!ifdef PLATFORM_UNIX
{..\}.cpp{}.pp:
    $(CXX_COMPILER_NAME) $(CXX_COMPILER_FLAGS) -E $(CL_OPT_FC) $< > $@
!else
{..\}.cpp{}.pp:
    $(CXX_COMPILER_NAME) @<<$(CL_RSP) /E $(CL_OPT_FC) $< > $@
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

{}.cxx{}.cod:
    $(CXX_COMPILER_NAME) @<<$(CLCOD_RSP) $(CL_OPT_FC) $(CL_OPT_FC) $<
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP

!ifdef PLATFORM_UNIX
{}.cxx{}.pp:
    $(CXX_COMPILER_NAME) $(CXX_COMPILER_FLAGS) -E $< > $@
!else
{}.cxx{}.pp:
    $(CXX_COMPILER_NAME) @<<$(CL_RSP) /E $(CL_OPT_FC) $< > $@
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

{}.cpp{}.cod:
    $(CXX_COMPILER_NAME) @<<$(CLCOD_RSP) $(CL_OPT_FC) $(CL_OPT_FC) $<
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP

!ifdef PLATFORM_UNIX
{}.cpp{}.pp:
    $(CXX_COMPILER_NAME) $(CXX_COMPILER_FLAGS) -E $< > $@
!else
{}.cpp{}.pp:
    $(CXX_COMPILER_NAME) @<<$(CL_RSP) /E $(CL_OPT_FC) $< > $@
$(CXX_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!ifdef PLATFORM_UNIX
!ifdef BATCH_NMAKE
{..\}.c{$O\}.obj::
!else
{..\}.c{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_MSG)
<<NOKEEP
    @$(C_COMPILER_NAME) $(C_COMPILER_FLAGS) $(OUTPUT_FLAG) $(MAKEDIR)/$@ $(CL_OPT_FC) $(USECXX_FLAG) $<
!else
!ifdef BATCH_NMAKE
{..\}.c{$O\}.obj::
!else
{..\}.c{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_MSG)
<<NOKEEP
    @$(C_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(USECXX_FLAG) $<
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!if $(AXP64)
!ifdef BATCH_NMAKE
{..\alpha\}.c{$O\}.obj::
!else
{..\alpha\}.c{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_MSG)
<<NOKEEP
    @$(C_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(USECXX_FLAG) $<
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!ifdef PLATFORM_UNIX
!ifdef BATCH_NMAKE
{..\$(TARGET_DIRECTORY)\}.c{$O\}.obj::
!else
{..\$(TARGET_DIRECTORY)\}.c{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_MSG)
<<NOKEEP
    @$(C_COMPILER_NAME) $(C_COMPILER_FLAGS) $(OUTPUT_FLAG) $(MAKEDIR)/$@ $(CL_OPT_FC) $(USECXX_FLAG) $<
!else
!ifdef BATCH_NMAKE
{..\$(TARGET_DIRECTORY)\}.c{$O\}.obj::
!else
{..\$(TARGET_DIRECTORY)\}.c{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_MSG)
<<NOKEEP
    @$(C_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(USECXX_FLAG) $<
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!ifdef PLATFORM_UNIX
!ifdef BATCH_NMAKE
{$O\}.c{$O\}.obj::
!else
{$O\}.c{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_MSG)
<<NOKEEP
    @$(C_COMPILER_NAME) $(C_COMPILER_FLAGS) $(OUTPUT_FLAG) $(MAKEDIR)/$@ $(CL_OPT_FC) $<
!else
!ifdef BATCH_NMAKE
{$O\}.c{$O\}.obj::
!else
{$O\}.c{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_MSG)
<<NOKEEP
    @$(C_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $<
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!ifdef PLATFORM_UNIX
!ifdef BATCH_NMAKE
{}.c{$O\}.obj::
!else
{}.c{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_MSG)
<<NOKEEP
   @$(C_COMPILER_NAME) $(C_COMPILER_FLAGS) $(OUTPUT_FLAG) $(MAKEDIR)/$@ $(USECXX_FLAG) $(CL_OPT_FC) $<
!else
!ifdef BATCH_NMAKE
{}.c{$O\}.obj::
!else
{}.c{$O\}.obj:
!endif
    if not exist $(@D) md $(@D)
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_MSG)
<<NOKEEP
    @$(C_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(USECXX_FLAG) $<
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!if $(AXP64)
!ifdef BATCH_NMAKE
{alpha\}.c{$O\}.obj::
!else
{alpha\}.c{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_MSG)
<<NOKEEP
    @$(C_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(USECXX_FLAG) $<
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!ifdef BATCH_NMAKE
{$(TARGET_DIRECTORY)\}.c{$O\}.obj::
!else
{$(TARGET_DIRECTORY)\}.c{$O\}.obj:
!endif
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_MSG)
<<NOKEEP
    @$(C_COMPILER_NAME) @<<$(CL_RSP) $(OUTPUT_FLAG)"$(MAKEDIR)\$O/" $(CL_OPT_FC) $(USECXX_FLAG) $<
$(C_COMPILER_FLAGS: =
)
<<NOKEEP

{..\}.c{}.cod:
    $(C_COMPILER_NAME) @<<$(CLCOD_RSP) $(CL_OPT_FC) $(CL_OPT_FC) $(USECXX_FLAG) $<
$(C_COMPILER_FLAGS: =
)
<<NOKEEP

!if $(AXP64)
{..\alpha\}.c{}.cod:
    $(C_COMPILER_NAME) @<<$(CLCOD_RSP) $(CL_OPT_FC) $(CL_OPT_FC) $(USECXX_FLAG) $<
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

{..\$(TARGET_DIRECTORY)\}.c{}.cod:
    $(C_COMPILER_NAME) @<<$(CLCOD_RSP) $(CL_OPT_FC) $(CL_OPT_FC) $(USECXX_FLAG) $<
$(C_COMPILER_FLAGS: =
)
<<NOKEEP

!ifdef PLATFORM_UNIX
{..\}.c{}.pp:
    $(C_COMPILER_NAME) $(C_COMPILER_FLAGS) -E $(USECXX_FLAG) $< > $@
!else
{..\}.c{}.pp:
    $(C_COMPILER_NAME) @<<$(CL_RSP) /E $(CL_OPT_FC) $(USECXX_FLAG) $< > $@
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!if $(AXP64)
{..\alpha\}.c{}.pp:
    $(C_COMPILER_NAME) @<<$(CL_RSP) /E $(CL_OPT_FC) $(USECXX_FLAG) $< > $@
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!ifdef PLATFORM_UNIX
{..\$(TARGET_DIRECTORY)\}.c{}.pp:
    $(C_COMPILER_NAME) $(C_COMPILER_FLAGS) -E $(USECXX_FLAG) $< > $@
!else
{..\$(TARGET_DIRECTORY)\}.c{}.pp:
    $(C_COMPILER_NAME) @<<$(CL_RSP) /E $(CL_OPT_FC) $(USECXX_FLAG) $< > $@
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

{}.c{}.cod:
    $(C_COMPILER_NAME) @<<$(CLCOD_RSP) $(CL_OPT_FC) $(CL_OPT_FC) $(USECXX_FLAG) $<
$(C_COMPILER_FLAGS: =
)
<<NOKEEP

!if $(AXP64)
{alpha\}.c{}.cod:
    $(C_COMPILER_NAME) @<<$(CLCOD_RSP) $(CL_OPT_FC) $(CL_OPT_FC) $(USECXX_FLAG) $<
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

{$(TARGET_DIRECTORY)\}.c{}.cod:
    $(C_COMPILER_NAME) @<<$(CLCOD_RSP) $(CL_OPT_FC) $(CL_OPT_FC) $(USECXX_FLAG) $<
$(C_COMPILER_FLAGS: =
)
<<NOKEEP

!ifdef PLATFORM_UNIX
{}.c{}.pp:
    $(C_COMPILER_NAME) $(C_COMPILER_FLAGS) -E $(USECXX_FLAG) $< > $@
!else
{}.c{}.pp:
    $(C_COMPILER_NAME) @<<$(CL_RSP) /E $(CL_OPT_FC) $(USECXX_FLAG) $< > $@
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!if $(AXP64)
{alpha\}.c{}.pp:
    $(C_COMPILER_NAME) @<<$(CL_RSP) /E $(CL_OPT_FC) $(USECXX_FLAG) $< > $@
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!ifdef PLATFORM_UNIX
{$(TARGET_DIRECTORY)\}.c{}.pp:
    $(C_COMPILER_NAME) $(C_COMPILER_FLAGS) -E $(USECXX_FLAG) $< > $@
!else
{$(TARGET_DIRECTORY)\}.c{}.pp:
    $(C_COMPILER_NAME) @<<$(CL_RSP) /E $(CL_OPT_FC) $(USECXX_FLAG) $< > $@
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!if $(AXP64)
{}.c{alpha\}.pp:
    $(C_COMPILER_NAME) @<<$(CL_RSP) /E $(CL_OPT_FC) $(USECXX_FLAG) $< > $@
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!ifdef PLATFORM_UNIX
{}.c{$(TARGET_DIRECTORY)\}.pp:
    $(C_COMPILER_NAME) $(C_COMPILER_FLAGS) -E $(USECXX_FLAG) $< > $@
!else
{}.c{$(TARGET_DIRECTORY)\}.pp:
    $(C_COMPILER_NAME) @<<$(CL_RSP) /E $(CL_OPT_FC) $(USECXX_FLAG) $< > $@
$(C_COMPILER_FLAGS: =
)
<<NOKEEP
!endif

!ENDIF # NO_C_RULES

!if "$(NTNOFUZZYLOOKUP)"=="1"
LIBRARY_OBJS=
!else
!ifndef PLATFORM_UNIX
LIBRARY_OBJS = $(LIBRARY_OBJS) $(HEADEROBJNAME)
!endif
!endif

!ifdef USE_INCREMENTAL_LINKING
IMPLIB_DEPEND =
!else
IMPLIB_DEPEND = $(LIBRARY_OBJS)
!endif

#
# Standard inference rule for generating machine specific def files.
#

.SUFFIXES: .def .src

{..\}.src{$O}.def:
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_MSG) /EP $<
<<NOKEEP
    @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $@
$(CPPXX: =
)
<<NOKEEP

{}.src{$O}.def:
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_MSG) /EP $<
<<NOKEEP
    @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $@
$(CPPXX: =
)
<<NOKEEP

{..\}.def{$O}.def:
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_MSG) /EP $<
<<NOKEEP
    @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $@
$(CPPXX: =
)
<<NOKEEP

{}.def{$O}.def:
    @$(TYPE_COMMAND) <<$(ECHO_RSP)
$(ECHO_MSG) /EP $<
<<NOKEEP
    @$(C_PREPROCESSOR_NAME) @<<$(CL_RSP) /Tc$< > $@
$(CPPXX: =
)
<<NOKEEP

!ifdef NO_BROWSER_FILE
BROWSERFILE=
!else
! ifdef BROWSER_INFO
!  ifndef BROWSERFILE
BROWSERFILE = "$(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).bsc"
!  endif
! else
BROWSERFILE=
! endif
!endif

#
# Standard inference rule for User Mode object files that produce User Mode
# image files
#
!if "$(UMAPPLEXT)" != ""
!ifdef PLATFORM_UNIX
{$O\}.obj{$O\}$(UMAPPLEXT):
    $(LINKER) $(LINKER_FLAGS) $(PDB_ROOTUM) $(ORDER) $(LINKGPSIZE) $(LINKER_OPTIDATA) $(UMRES) $< $(UMOBJS) $(UMLIBS) $(CRTLIBS) $(LINKLIBS)
    $(MAPSYM_CMD)
    $(BINPLACE_CMD)
    $(POST_BUILD_CMD)
!else
{$O\}.obj{$O\}$(UMAPPLEXT):
    $(LINKER) @<<
$(LINKER_FLAGS: =
)
$(PDB_ROOTUM)
$(ORDER: =
)
$(LINKGPSIZE: =
)
$(LINKER_OPTIDATA)
-base:$(UMBASE)
-subsystem:$(SUBSYSTEM)
$(UMENTRY)
$(HEADEROBJNAME: =
)
$(UMRES: =
)
$<
$(UMOBJS: =
)
$(UMLIBS: =
)
$(CRTLIBS: =
)
$(LINKLIBS: =
)
<<NOKEEP
    $(MAPSYM_CMD)
    $(BINPLACE_CMD)
    $(POST_BUILD_CMD)
!endif
!endif

#
# Standard list of targets: all, clean and loc.  all is the default target.
#

!IFNDEF PASS0ONLY


all:  $(OBJECTMACFILE) \
        $(NTTARGETFILE0)  \
        $(PASS0_OBJECTS) \
!if "$(PLATFORM_UNIX)" != "1" || "$(FEATURE_PRECOMPILED_HEADERS)" == "1"
        $(PRECOMPILED_TARGET) \
        $(HEADEROBJNAME) \
!endif
        build_objects \
        $(TARGETLIBFILES) \
        $(NTTARGETFILE1)  \
        $(TARGETEXEFILES) \
        $(BROWSERFILE)   \
        build_umobjects \
        $(UMEXEFILES) \
! ifdef MISCFILES
!  ifdef _NTTREE
        $(NTTARGETFILES) \
        $(MISCFILES) \
        binplace_miscfiles
!  else
        $(NTTARGETFILES) \
        $(MISCFILES)
!  endif
! else
        $(NTTARGETFILES)
! endif
! if "$(BUILDMSG)" != ""
!ifdef PLATFORM_UNIX
    @echo
!else
    @echo.
!endif
    @echo $(BUILDMSG)
! endif

binplace_miscfiles: $(MISCFILES)
!ifndef NO_BINPLACE
    @!$(BINPLACE_NAME) -R $(_NTTREE) $(BINPLACE_DBGFLAGS_NT) $(BINPLACE_FLAGS) $**
!endif

build_objects: $(TARGETOBJFILES)

build_umobjects: $(UMOBJFILES)

clean: all

!ELSE   # PASS0ONLY

all:    $(NTTARGETFILE0)  \
        $(PASS0_OBJECTS)
! IF "$(BUILDMSG)" != ""
    @echo.
    @echo $(BUILDMSG)
! ENDIF

clean: all

!ENDIF  # PASS0ONLY

update:
    @echo Updating library.

!if exist (default.mac)
$(OBJECTMACFILE): default.mac
    @echo Rebuilding $(OBJECTMACFILE) from default.mac.
    @if not exist $(_OBJ_DIR) $(MD) $(_OBJ_DIR)
    $(TYPE_COMMAND) default.mac >$@
    @echo $@ was rebuilt, please reinvoke NMAKE
    @$(CAUSE_ERROR)
!else
!ifdef PLATFORM_UNIX
$(OBJECTMACFILE): $(SOURCES_USED)
    @echo Rebuilding $(OBJECTMACFILE) from $(SOURCES_USED).
    @build -Of >/dev/null 2>&1
    @echo $@ was rebuilt, please reinvoke NMAKE
    @$(CAUSE_ERROR)
!else
$(OBJECTMACFILE): $(SOURCES_USED)
    @echo Rebuilding $(OBJECTMACFILE) from $(SOURCES_USED).
    @build -Of >nul 2>&1
    @echo $@ was rebuilt, please reinvoke NMAKE
    @$(CAUSE_ERROR)
!endif
!endif

loc:
    @-loc *.h $(SOURCES)

print:
    @-ppr *.h $(SOURCES)

!IFDEF NTTARGETFILES
! INCLUDE .\makefile.inc
!ELSE
! IFDEF NTTARGETFILE0
!  INCLUDE .\makefile.inc
! ELSE
!  IFDEF NTTARGETFILE1
!   INCLUDE .\makefile.inc
!  ENDIF
! ENDIF
!ENDIF

!IF "$(PRECOMPILED_INCLUDE)" != ""
! IF "$(FEATURE_PRECOMPILED_HEADERS)" == "1"
# Precompile the header file by preprocessing it, running cppmunge, then
# producing the precompiled output to PRECOMPILED_TARGET.  gcc's output
# goes to the specified **directory** name, which is <filename>.obj in
# this makefile.  The 'date >$(O)/$(PRECOMPILED_PCH)' creates a <filename>.pch
# file in order to satisfy dependency information elsewhere in makefile.def.
# The contents are unimportant, but the timestamp of the file is.
$(PRECOMPILED_TARGET) $(HEADEROBJNAME): $(PRECOMPILED_INCLUDE)
    $(C_PREPROCESSOR_NAME) $(C_PREPROCESSOR_FLAGS) $(OUTPUT_FLAG) $(MAKEDIR)/$*.ii -x c++ $(PRECOMPILED_INCLUDE)
    @$(CPP_MUNGER_NAME) -s$(PRECOMPILED_INCLUDE) -p $(MAKEDIR)/$*.ii
    @$(C_COMPILER_NAME) $(C_PRECOMPILER_FLAGS) $(HEADEROBJ) $(MAKEDIR)/$*.ii
    @date >$(O)/$(PRECOMPILED_PCH)
    - @$(DELETER) $(MAKEDIR)/$*.ii
! ELSE
!  ifdef PRECOMPILED_SOURCEFILE
$(PRECOMPILED_TARGET) $(HEADEROBJNAME): $(PRECOMPILED_INCLUDE)
    @$(TYPE_COMMAND) <<
$(ECHO_PRECOMPILED_MSG1)
<<NOKEEP
    @$(C_COMPILER_NAME) @<< $(PRECOMPILED_FLAG) $(PRECOMPILED_SOURCEFILE)
$(C_COMPILER_FLAGS: =
) /Yl$(TARGETNAME) /Yc$(?F) $(HEADERFILE) $(HEADEROBJ)
<<NOKEEP
!  else
$(PRECOMPILED_TARGET) $(HEADEROBJNAME): $(PRECOMPILED_INCLUDE)
    if not exist $(@D) md $(@D)
    @$(TYPE_COMMAND) <<$O\pch_hdr.src
$(ECHO_PRECOMPILED_MSG2)

#include "$(?F)"

<<NOKEEP
    @$(C_COMPILER_NAME) @<< $(PRECOMPILED_FLAG)<<$O\pch_hdr.src
$(C_COMPILER_FLAGS: =
) /Yl$(TARGETNAME) /Yc$(?F) $(HEADERFILE) $(HEADEROBJ)
<<NOKEEP
#include "$(?F)"
<<NOKEEP
!  endif
! ENDIF
!ENDIF

!IFNDEF NOLINK

! IF "$(UMTEST)" != "" || "$(UMAPPL)" != ""

$(UMEXEFILES): $(UMLIBS) $(CRTLIBS) $(LINKLIBS)

! ENDIF
!ENDIF

!if defined(BROWSER_INFO) && !defined(NO_BROWSER_FILE)

! ifndef BSCMAKE_FLAGS
BSCMAKE_FLAGS = -nologo
! endif

$(BROWSERFILE) : $O\*.sbr $(OTHER_SBR_FILES)
    -bscmake $(BSCMAKE_FLAGS) -o $(BROWSERFILE) @<<$O\bscmake.rsp
$(**: =
)
<<NOKEEP
!endif

#
# These dependencies produce the target binaries from the object files.
# These will trigger the sources to object inference rules to generate the
# object files.
#

!IF "$(TARGET)" != ""
! IF "$(TARGETTYPE)"=="PROGLIB"
$(TARGET:.exe=.lib) $(TARGET:.exe=.exp): $(DLLDEF) $(IMPLIB_DEPEND)
    -lib -out:$(@R).lib @<<
$(LIBRARIAN_FLAGS: =
)
-def:$(DLLDEF)
$(LIBRARY_OBJS: =
)
<<NOKEEP
$(TARGET): $(OBJECTS) $(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).exp $(UMRES) $(UMLIBS) $(CRTLIBS) $(MACHINE_TARGETLIBS) $(LINKLIBS)
    $(LINKER) @<<
$(LINKER_FLAGS: =
)
$(ORDER: =
)
$(LINKGPSIZE: =
)
$(HEADEROBJNAME: =
)
$(LINKER_OPTIDATA)
-subsystem:$(SUBSYSTEM)
-base:$(UMBASE)
$(UMENTRY: =
)
$(**: =
)
<<NOKEEP
    $(MAPSYM_CMD)
    $(BINPLACE_CMD)
    $(POST_BUILD_CMD)

! ELSEIF "$(TARGETTYPE)"=="PROGRAM"
!ifdef PLATFORM_UNIX
$(TARGET): $(UMRES) $(OBJECTS) $(CRTLIBS) $(MACHINE_TARGETLIBS) $(LINKLIBS)
    $(LINKER) $(LINKER_FLAGS) $(LD_LIB_DIRS) $(ORDER) $(LINKGPSIZE) $(LINKER_OPTIDATA) $(UNIX_DLL_LIBS) $(START_GROUP) $(UMLIBS) $(**) $(END_GROUP) $(CC_LIB)
    $(MAPSYM_CMD)
    $(BINPLACE_CMD)
    $(POST_BUILD_CMD)
!else
$(TARGET): $(UMRES) $(OBJECTS) $(CRTLIBS) $(UMLIBS) $(MACHINE_TARGETLIBS) $(LINKLIBS)
    $(LINKER) @<<
$(LINKER_FLAGS: =
)
-subsystem:$(SUBSYSTEM)
-base:$(UMBASE)
$(ORDER: =
)
$(LINKGPSIZE: =
)
$(UMENTRY: =
)
$(LINKER_OPTIDATA)
$(HEADEROBJNAME: =
)
$(**: =
)
<<NOKEEP
    $(MAPSYM_CMD)
    $(BINPLACE_CMD)
    $(POST_BUILD_CMD)
!endif
! ELSEIF "$(TARGETTYPE)"=="DYNLINK"

!  ifdef RESOURCE_ONLY_DLL
DYNLINK_EXP=
!  else
!   IF "$(DLLLIBOBJECTS)" == " "

!ifdef PLATFORM_UNIX
$(DYNLINK_LIB) $(DYNLINK_EXP) : $(IMPLIB_DEPEND)
!else
$(DYNLINK_LIB) $(DYNLINK_EXP) : $(DLLDEF) $(IMPLIB_DEPEND)
    -lib -out:$(DYNLINK_LIB) @<<
$(LIBRARIAN_FLAGS: =
)
-def:$(DLLDEF)
$(LIBRARY_OBJS: =
)
<<NOKEEP
!endif

!   ELSE # "$(DLLLIBOBJECTS)" == " "

!ifdef PLATFORM_UNIX
$(DYNLINK_LIB) $(DYNLINK_EXP) : $(IMPLIB_DEPEND) $(DLLLIBOBJECTS)
!else
$(DYNLINK_LIB) $(DYNLINK_EXP) : $(DLLDEF) $(IMPLIB_DEPEND) $(DLLLIBOBJECTS)
    -lib -out:$(DYNLINK_LIB) @<<
$(LIBRARIAN_FLAGS: =
)
-def:$(DLLDEF)
$(LIBRARY_OBJS: =
)
<<NOKEEP
    -lib -out:$(DYNLINK_LIB) @<<
$(LIBRARIAN_FLAGS: =
)
$(@R).lib
$(DLLLIBOBJECTS)
<<NOKEEP
!endif

!   ENDIF # "$(DLLLIBOBJECTS)" == " "
!  endif # RESOURCE_ONLY_DLL

!  IF "$(MAKEDLL)" != ""

!ifdef PLATFORM_UNIX
$(TARGET): $(OBJECTS) $(LINKLIBS) $(CRTLIBS) $(MACHINE_TARGETLIBS)
    $(LINKER) $(LINKER_FLAGS) $(LD_LIB_DIRS) $(SHARED_LIB) $(ORDER) $(LINKER_OPTIDATA) $(UNIX_DLL_LIBS) $(START_GROUP) $(**) $(END_GROUP) $(CC_LIB) $(SONAME)
    $(MAPSYM_CMD)
    $(BINPLACE_CMD)
    $(MAPDUMP_CMD)
    $(POST_BUILD_CMD)
!else
$(TARGET): $(DYNLINK_EXP) $(OBJECTS) $(LINKLIBS) $(CRTLIBS) $(MACHINE_TARGETLIBS)
    $(LINKER) @<<
$(LINKER_FLAGS: =
)
-dll
$(ORDER: =
)
$(LINKER_OPTIDATA)
-base:$(DLLBASE)
-subsystem:$(SUBSYSTEM)
$(DLLENTRY: =
)
$(HEADEROBJNAME: =
)
$(**: =
)
<<NOKEEP
    $(MAPSYM_CMD)
    $(BINPLACE_CMD)
    $(MAPDUMP_CMD)
    $(POST_BUILD_CMD)
!endif

!  ENDIF # "$(MAKEDLL)" != ""

! ELSEIF "$(TARGETTYPE)"=="LIBRARY"

!ifdef PLATFORM_UNIX
$(TARGET): $(OBJECTS) $(OBJLIBFILES)
    @-$(DELETER) $@ 2> /dev/null
    -$(LIBRARIAN) $(**)
!if "$(USE_RANLIB)" == "1"
    -$(RANLIB) $(RANLIB_FLAGS) $@
!endif
!else
$(TARGET): $(OBJECTS) $(OBJLIBFILES)
    @-$(DELETER) $@ >nul 2>nul
    -$(LIBRARIAN) @<<
$(HEADEROBJNAME: =
)
$(**: =
)
<<NOKEEP
!endif
! ELSEIF "$(TARGETTYPE)"=="DRIVER" || \
    "$(TARGETTYPE)"=="MINIPORT"

$(TARGET): $(OBJECTS) $(MACHINE_TARGETLIBS) $(CRTLIBS)
    $(LINKER) @<<
$(LINKER_FLAGS: =
)
$(ORDER: =
)
$(SECTION_INFO1)
$(SECTION_INFO2)
$(LINKER_OPTIDATA)
$(DRIVER_SWITCH)
-align:$(DRIVER_ALIGNMENT)
-subsystem:native$(SUBSYSTEM_NATVER)
-base:$(DRIVERBASE)
-entry:DriverEntry$(ENTRY_SUFFIX)
-out:$(TARGET)
$(HEADEROBJNAME: =
)
$(**: =
)
<<NOKEEP
    $(MAPSYM_CMD)
    $(BINPLACE_CMD)
    $(MAPDUMP_CMD)
    $(POST_BUILD_CMD)

! ELSEIF "$(TARGETTYPE)"=="GDI_DRIVER"

$(TARGET): $(OBJECTS) $(MACHINE_TARGETLIBS) $(CRTLIBS) $(GDI_DRIVER_LIBS)
    $(LINKER) @<<
$(LINKER_FLAGS: =
)
-dll
$(ORDER: =
)
$(SECTION_INFO1)
$(SECTION_INFO2)
$(LINKER_OPTIDATA)
$(DRIVER_SWITCH)
-align:$(DRIVER_ALIGNMENT)
-subsystem:native$(SUBSYSTEM_NATVER)
-base:$(DRIVERBASE)
-entry:DrvEnableDriver$(GDI_ENTRY_SUFFIX)
-out:$(TARGET)
$(HEADEROBJNAME: =
)
$(**: =
)
<<NOKEEP
    $(MAPSYM_CMD)
    $(BINPLACE_CMD)
    $(MAPDUMP_CMD)
    $(POST_BUILD_CMD)

! ELSEIF "$(TARGETTYPE)"=="EXPORT_DRIVER"

$(DYNLINK_EXP) $(DYNLINK_LIB) : $(DLLDEF) $(OBJECTS) $(LINKLIBS) $(DLLLIBOBJECTS)
    -lib -out:$(DYNLINK_LIB) @<<
$(LIBRARIAN_FLAGS: =
)
-def:$(DLLDEF)
$(OBJECTS)
$(LINKLIBS)
<<NOKEEP
!  if "$(DLLLIBOBJECTS)" != " "
    -lib -out:$(DYNLINK_LIB) @<<
$(LIBRARIAN_FLAGS: =
)
$(DYNLINK_LIB)
$(DLLLIBOBJECTS)
<<NOKEEP
!  endif
!  IF "$(MAKEDLL)" != ""
$(TARGET): $(DYNLINK_EXP) $(OBJECTS) $(CRTLIBS) $(MACHINE_TARGETLIBS) $(LINKLIBS)
    $(LINKER) @<<
$(LINKER_FLAGS: =
)
$(ORDER: =
)
$(LINKER_OPTIDATA)
$(DRIVER_SWITCH)
-align:$(DRIVER_ALIGNMENT)
-subsystem:native$(SUBSYSTEM_NATVER)
-base:$(DRIVERBASE)
-entry:DriverEntry$(ENTRY_SUFFIX)
-out:$(TARGET)
$(HEADEROBJNAME: =
)
$(**: =
)
<<NOKEEP
    $(MAPSYM_CMD)
    $(BINPLACE_CMD)
    $(POST_BUILD_CMD)
!  ENDIF

! ELSEIF "$(TARGETTYPE)"=="HAL"

!  IF "$(MAKEDLL)" == ""
$(TARGET) $(TARGET:.lib=.exp): $(DLLDEF) $O\*.obj
    -lib -out:$(@R).lib @<<
$(LIBRARIAN_FLAGS: =
)
-def:$(DLLDEF)
$O\*.obj
<<NOKEEP
!  ELSE
$(TARGET:.dll=.lib) $(TARGET:.dll=.exp): $(DLLDEF) $O\*.obj
    -lib -out:$(@R).lib @<<
$(LIBRARIAN_FLAGS: =
)
-def:$(DLLDEF)
$O\*.obj
<<NOKEEP

$(TARGET): $(TARGETPATH)\$(TARGET_DIRECTORY)\$(TARGETNAME).exp $(OBJECTS) $(CRTLIBS) $(MACHINE_TARGETLIBS) $(LINKLIBS)
    $(LINKER) @<<
$(LINKER_FLAGS: =
)
$(LINKER_OPTIDATA)
$(DRIVER_SWITCH)
-align:$(HAL_ALIGNMENT)
-subsystem:$(SUBSYSTEM)
-base:$(HALBASE)
-miscrdata
-dll
-entry:HalInitSystem$(ENTRY_SUFFIX)
-out:$(TARGET)
$(**: =
)
<<NOKEEP
    $(BINPLACE_CMD)
    $(MAPDUMP_CMD)
    $(POST_BUILD_CMD)
!  ENDIF

! ELSEIF "$(TARGETTYPE)"=="BOOTPGM"

$(TARGET): $(OBJECTS) $(CRTLIBS) $(MACHINE_TARGETLIBS) $(LINKLIBS)
    $(LINKER) @<<
$(LINKER_FLAGS: =
)
$(DRIVER_SWITCH)
-subsystem:$(SUBSYSTEM)
-base:$(BOOTBASE)
-entry:_start
-map:$(@R).map
$(**: =
)
<<NOKEEP

! ENDIF
!ENDIF

!IFNDEF NOLINK

! IF "$(NTTEST)" != ""


!  IF "$(TARGETPATH)"=="..\..\mpobj"
KERNEL_DIR=mpobj
KERNEL_TYPE=mp
!  ELSE
KERNEL_DIR=obj
KERNEL_TYPE=up
!  ENDIF

!IF ("$(ALT_PROJECT)" == "HYDRA"  &&  ("$(NTTEST)" == "ntoskrnl" || "$(NTTEST)" == "ntkrnlmp"))

!  IF "$(TARGETPATH)"=="..\..\mpobj"
HYDRA_DIR=mpHYDRA
!  ELSE
HYDRA_DIR=upHYDRA
!  ENDIF


obj\$(TARGET_DIRECTORY)\$(NTTEST).exe: $(NTRES) obj\$(TARGET_DIRECTORY)\$(NTTEST).obj  \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(TARGET_DIRECTORY)\cache.lib  \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(HYDRA_DIR)\$(TARGET_DIRECTORY)\config.lib  \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(TARGET_DIRECTORY)\dbgk.lib            \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(HYDRA_DIR)\$(TARGET_DIRECTORY)\ex.lib      \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(TARGET_DIRECTORY)\FsRtl.lib           \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(TARGET_DIRECTORY)\fstub.lib           \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(HYDRA_DIR)\$(TARGET_DIRECTORY)\init.lib    \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(HYDRA_DIR)\$(TARGET_DIRECTORY)\io.lib      \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(TARGET_DIRECTORY)\kd.lib              \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(HYDRA_DIR)\$(TARGET_DIRECTORY)\ke.lib      \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(HYDRA_DIR)\$(TARGET_DIRECTORY)\lpc.lib     \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(HYDRA_DIR)\$(TARGET_DIRECTORY)\mm.lib      \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(HYDRA_DIR)\$(TARGET_DIRECTORY)\ntosrtl.lib \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(HYDRA_DIR)\$(TARGET_DIRECTORY)\ob.lib      \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(TARGET_DIRECTORY)\pnp.lib             \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(TARGET_DIRECTORY)\po.lib              \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(HYDRA_DIR)\$(TARGET_DIRECTORY)\ps.lib      \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(TARGET_DIRECTORY)\raw.lib             \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(HYDRA_DIR)\$(TARGET_DIRECTORY)\se.lib      \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(TARGET_DIRECTORY)\vdm.lib             \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(TARGET_DIRECTORY)\wmi.lib             \
                        $(BASEDIR)\public\sdk\lib\$(TARGET_DIRECTORY)\hal.lib \
                        $(BASEDIR)\public\sdk\lib\$(ALT_PROJECT)\$(TARGET_DIRECTORY)\ntoskrnl.exp \
                        $(BASEDIR)\public\sdk\lib\$(TARGET_DIRECTORY)\lsakrnlp.lib \
                        $(BASEDIR)\public\sdk\lib\$(TARGET_DIRECTORY)\libcntpr.lib
! ELSE


obj\$(TARGET_DIRECTORY)\$(NTTEST).exe: $(NTRES) obj\$(TARGET_DIRECTORY)\$(NTTEST).obj  \
                        $(RELATIVE_DEPTH)\$(KERNEL_DIR)\$(TARGET_DIRECTORY)\*.lib     \
                        $(LINKLIBS)                      \
                        $(BASEDIR)\public\sdk\lib\$(TARGET_DIRECTORY)\hal.lib \
                        $(BASEDIR)\public\sdk\lib\$(TARGET_DIRECTORY)\ntoskrnl.exp \
                        $(BASEDIR)\public\sdk\lib\$(TARGET_DIRECTORY)\lsakrnlp.lib \
                        $(BASEDIR)\public\sdk\lib\$(TARGET_DIRECTORY)\libcntpr.lib
!  ENDIF
    $(LINKER) @<<
$(LINKER_FLAGS: =
)
$(ORDER: =
)
$(LINKGPSIZE: =
)
$(NTTEST_LINK_OPTIONS: =
)
$(LINKER_OPTIDATA)
$(DRIVER_SWITCH)
-align:$(KERNEL_ALIGNMENT)
-subsystem:$(SUBSYSTEM)
-miscrdata
$(**: =
)
<<NOKEEP
    $(BINPLACE_CMD)
    $(MAPDUMP_CMD)
    $(POST_BUILD_CMD)

! ENDIF
!ENDIF

$O\*.res : $(MASTER_VERSION_FILE)

