
# either JWASM/WLINK (default) or MASM/MSLINK is used.
# if MS Link is used: a newer version than the one included in MASM32 is
# needed for the DDRAW libraries (used the one from Visual C++ Toolkit 2003)

NAME=Dir3D1

OUTDIR=.

#using WLink is not a good idea. The binary becomes pretty huge...

!ifndef MASM
MASM=0
MSLINK=1
#DDPATH=\watcom\lib386\nt
!else
MSLINK=1
!endif

DDPATH=\DDraw\lib

DDLIBS=d3d9.lib d3dx9d.lib dxerr9.lib
MSVCRTLIB=\MSVC8\lib\msvcrt.lib

ASMOPT= -c -nologo -coff -Fl$* -Fo$*.obj -Sa -I..\..\Include
!if $(MASM)
ASM=@ml.exe $(ASMOPT)
!else
ASM=@jwasm.exe $(ASMOPT)
!endif

!if $(MSLINK)
LIBS=kernel32.lib advapi32.lib gdi32.lib user32.lib $(MSVCRTLIB) $(DDLIBS) 
LOPTS= /MAP /LIBPATH:..\..\Lib /LIBPATH:$(DDPATH) /SUBSYSTEM:windows /OPT:NOWIN98
LINK=@\MSVC8\bin\link.exe $(LOPTS) $* $(LIBS)
!else
LIBS=Library kernel32.lib,user32.lib,$(MSVCRTLIB)
LOPTS= LIBPATH ..\..\Lib LIBPATH $(DDPATH) op map
LINK=@wlink.exe debug watcom system nt_win file $*.obj $(LOPTS) $(LIBS)
!endif

$(OUTDIR)\$(NAME).exe: $*.obj
	$(LINK)

$(OUTDIR)\$(NAME).obj: $(NAME).asm Makefile
	$(ASM) $(NAME).asm

CLEAN :
	-@erase "$(OUTDIR)\$(NAME).exe"
	-@erase "$(OUTDIR)\$(NAME).obj"
	-@erase "$(OUTDIR)\$(NAME).lst"
	-@erase "$(OUTDIR)\$(NAME).map"
