#   Copyright (c) Microsoft Corporation. All rights reserved.
#
# Purpose:
#   This makefile builds the C++ runtimes for Multi-thread, Single-Thread
#   and DLL.
#
#   This is a general-purpose makefile.  It is !INCLUDEd by the makefile
#   in each subdirectory (hence the .SUB extension).  All subdirectory-
#   specific make information should be embedded in the SOURCES file in
#   that subdirectory, not in this file.
#
#   Change to the appropriate subdirectory and type NMAKE DEPEND to
#   rebuild the dependencies.  These are stored in DEPEND.DEF in each
#   subdirectory.
#
#
###############################################################################
#
# Macro definitions:
#
###############################################################################

#
# Add .S and .I suffixes for assembler files on platforms other than x86
#

.SUFFIXES:
.SUFFIXES: .exe .obj .asm .s .i .c .cpp .cxx .res .rc

DBFLAGS = -Zi

# Secure CRT deprecation in on by default


# Disable the manifest directives when building CRT
CFLAGS=-D_CRT_NOFORCE_MANIFEST -D_STL_NOFORCE_MANIFEST $(CFLAGS)

!if "$(BLD_DBG)" == "1"
CFLAGS=$(CFLAGS) $(DBFLAGS) -D_DEBUG -Od
AFLAGS=$(AFLAGS) -Zi -D_DEBUG
!else
CFLAGS=$(CFLAGS) -O1
CFLAGS=$(CFLAGS) $(DBFLAGS)
AFLAGS=$(AFLAGS) -Zi
!endif

CC=cl
LIB=link -lib -nologo
AS=ml
CFLAGS=$(CFLAGS) -D_X86_ -GR-
AFLAGS=$(AFLAGS) -safeseh

#
# Source file definitions:
#
###############################################################################

A_INCLUDES=-I"Asm"
CCMN_INCLUDES=-I"C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include" -I"..\Include" -I"Include"
C_INCLUDES=$(CCMN_INCLUDES) -I"Include\C" -I"Src"
CPP_INCLUDES=$(CCMN_INCLUDES) -I"Include\P" -I"SrcP"

#
# Inference rules:
#
# (Due to the kind of dependencies used below, we must explicitly define
# inference rules to effect construction of the object files.)
#
###############################################################################

CXXFLAGS=$(CFLAGS) -d1Binl

CXXFLAGS=$(CXXFLAGS) -Istdhpp

#
# Rules for end-user source build
#
#
# LSOURCES will override A_INCLUDES and C_INCLUDES for conv/ and tran/ subdirs.
#
###############################################################################

!INCLUDE makefile.inc

{src}.c{$(OBJDIR)}.obj::
    $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<

{src}.cpp{$(OBJDIR)}.obj::
    $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<

{src\p}.c{$(OBJDIR)}.obj::
    $(CC) $(CFLAGS) $(CPP_INCLUDES) -Fo$(OBJDIR)\ $<

{src\p}.cpp{$(OBJDIR)}.obj::
    $(CC) $(CXXFLAGS) $(CPP_INCLUDES) -Fo$(OBJDIR)\ $<

{asm}.asm{$(OBJDIR)}.obj:
    $(AS) $(AFLAGS) $(A_INCLUDES) -Fo$(OBJDIR)\ $< 

#<eof>
