# ***************************************************************************
#     DEBUG_RETAIL.msvc      (!INCLUDE ed by "makefile-dllmod.msvc")
# --------------------------------------------------------------------------
# (C) Copyright Roger Bowler, 2005-2007
# --------------------------------------------------------------------------
#
#  Sets appropriate compiler/linker flags (cdebug & ldebug) depending on
#  whether a normal retail release or debugging version of the product is
#  being built...  (also sets preprocessor #defines too, as appropriate)
#
# ***************************************************************************

MAPFILE = /map:$(MAPDIR)\$(@B).map

!IFDEF NODEBUG
# -------------------------------
# RETAIL: full optimization
# -------------------------------

# PROGRAMMING NOTE: we're purposely discarding the existing $(cdebug) setting
# and replacing them with our own by leaving "$(cdebug)" out of the statement

cdebug = /O2 /GL /D NDEBUG
ldebug = $(ldebug) /LTCG

# Create .PDB (Program Database) files for debugging for 'Release' builds too!
# (so we can easily analyze "MiniDump" crash dumps should Herc ever crash)

cdebug = $(cdebug) /Zi /Gm
ldebug = $(ldebug) /DEBUG /PDB:$(PDBDIR)\$(@B).pdb

!ELSE
# -------------------------------
# DEBUG: no optimizations at all
# -------------------------------

# PROGRAMMING NOTE: we're purposely discarding the existing $(cdebug) setting
# and replacing them with our own by leaving "$(cdebug)" out of the statement

cdebug  = -Zi -Od -D DEBUG -D _DEBUG -Gm
ldebug = /DEBUG /PDB:$(PDBDIR)\$(@B).pdb

!ENDIF
