# I moved the working makefile to spritelib.mak until I can get this one
# building spritelib...

depth = ..\..  # why doesn't this work?

# We're using MFC for now, but it would be nice to eliminate.  I (conal)
# think it's mainly for the simplified threading interface.
#LINCLUDES = -I$(ROOT)\inc\mfc42
LINCLUDES = \
	-I..\..   # for privinc
# Why _PRESTOEXT?  Because we want EXT_API and friends to expand to say
# dllexport.  SpriteLib clients *must not* define _PRESTOEXT, so that EXT_API
# will expand to say dllimport for them.  SPRITELIB_CPLUSPLUS means to
# expose the C++ interfaces.  Doing so has been problematic because of MFC
# complications (we think).  

LCDEFS = -D "_DEBUG" \
	 -D SPRITELIB_CPLUSPLUS \
#	 -D "_WINDLL" -D "_AFXDLL" -D "_PRESTOEXT" -D "_AFXEXT" \
#	 -D "_MBCS" \
#	 -D "WIN32" -D "_WINDOWS" \

# For now, no DLL and no multi-byte characters

# -MDd means multi-thread debug DLL.  -MTd means multi-thread debug libc
LCOPTS = -MTd

#LLINCS = ??
LLOPTS = -base:"0x8000000" -subsystem:windows -dll -profile -debug -machine:I386

# The VC project for spritelib gives the following for the project options
# 
# /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D
# "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_AFXEXT" /FR".\Debug/"
# /Fp".\Debug/SpriteLib.pch" /YX"stdafx.h" /Fo".\Debug/" /Fd".\Debug/" /FD
# /c  

# and the following libs for linking:
# 
# ddraw.lib dsound.lib d3drm.lib winmm.lib wntab32x.lib 
#
# and the following for options
# 
# ddraw.lib dsound.lib d3drm.lib winmm.lib wntab32x.lib /nologo
# /base:"0x8000000" /subsystem:windows /dll /profile /debug /machine:I386
# /def:".\SpriteLib.def" /out:".\Debug/SpriteLib.dll"
# /implib:".\Debug/SpriteLib.lib"  

# include $(depth)\commondefs   XXX why doesn't $depth work?
include ..\..\commondefs


OBJS    = \
    Behavior.obj \
    Sprite.obj \
    ddcheck.obj \
    DDrawEnv.obj \
    SpriteEngine.obj \
    ddhelp.obj \
    SimpleTablet.obj \
    SpriteLib.obj \
    VBlankHandler.obj \
    ddutil.obj \
    wave.obj \
    waveBuffer.obj


LIBS = ..\..\utils\utils.lib


TARGETS = \
   $(SPRITELIB).lib
#   $(SPRITELIB).dll

default : $(TARGETS)       # Goes first so it's the default


LDIRT = 
include ..\..\commonrules

# DirectX, "multimedia stuff" (mmio), and Wintab.
# Standard windows stuff.
# vc/mfc libs.

# LIBS  = ddraw.lib dsound.lib d3drm.lib winmm.lib wntab32x.lib \
#          user32.lib gdi32.lib kernel32.lib \

# These other libs are found when we don't link with -NODEFAULTLIB
#         mfc42d.lib mfcs42d.lib msvcrtd.lib 


# install : $(WINDIR)\$(SPRITELIB).dll

# $(WINDIR)\$(SPRITELIB).dll: $(SPRITELIB).dll
# 	copy $(SPRITELIB).dll $@


# $(SPRITELIB).dll: $(OBJS)
# 	$(LINK) $(LFLAGS) $(OBJS) $(LIBS) -OUT:$@

$(SPRITELIB).lib : $(OBJS)
	$(LIB) -nologo $(OBJS) -OUT:$@
