# Captures common definitions for presto makefiles

# Makefile assumes $TOOLROOT environment variable is set pointing to the 
# directory which contains compiler tools, and $ROOT points to dir containing
# include and lib
# example:
#
# setenv TOOLROOT \\kgreene\nt\mstools
# setenv ROOT \\kgreene\nt\public\sdk\inc\crt
#
# TOOLROOT = \\kgreene\nt\mstools
# ROOT = \\kgreene\nt\public\sdk\inc\crt

CC   = $(TOOLROOT)\cl
LIB  = $(TOOLROOT)\lib
LINK = $(TOOLROOT)\link
MAKE = $(TOOLROOT)\nmake
RC   = $(TOOLROOT)\rc
RM   = $(TOOLROOT)\rm
SH   = $(TOOLROOT)\sh
TCSH = $(TOOLROOT)\tcsh

SPRITELIB = PrestoSpriteLib

# local cflags set in the makefile + global cflags
CFLAGS = $(LCFLAGS) $(GCFLAGS)

LCFLAGS = $(LCDEFS) $(LINCLUDES) $(LCOPTS)
GCFLAGS = $(GCDEFS) $(GINCLUDES) $(GCOPTS)


# -ZI = fix'n'continue debug info; -Gx = enable exception handling; 
# -W3 lots of warnings
GCOPTS = $(OPTIMIZER) -nologo -ZI  -GX -W3
GCDEFS = -D_WIN32_WINNT=0x0400
# "-X" means don't search default directories.
GINCLUDES = \
    -I$(ROOT)\dxmsdk\include \
	-X -I$(ROOT)\inc \
	-I$(ROOT)\inc\crt \
	-I$(ROOT)\inc\atl21 \
    -I$(ROOT)\inc\atl \


OPTIMIZER = 


LFLAGS  = $(LLFLAGS) $(GLFLAGS)
LLFLAGS = $(LLINCS) $(LLOPTS)
GLFLAGS = $(GLINCS) $(GLOPTS)

GLINCS  = -LIBPATH:$(ROOT)\lib\i386 
GLOPTS  = -nologo -NODEFAULTLIB:libc -DEBUG

# About -NODEFAULTLIB:libc, we're running multi-threaded, so we need the
# multi-thread debug version of libc.  If we dropped the ":libc", we'd
# have to link in the following explicitly as well: user32.lib, gdi32.lib,
# kernel32.lib, mfc42d.lib, mfcs42d.lib, msvcrtd.lib.

