
# please note that this sample requires 2 libraries from
# the DirectX SDK (see DDLIBS below).
# either JWASM/WLINK (default) or MASM/MSLINK is used

NAME = DINPUT1

DEBUG=0
OUTDIR=.

!if $(DEBUG)
LOPTD=/DEBUG:FULL
AOPTD=-Zd -DDEBUG
!else
LOPTD=/DEBUG:NONE
AOPTD=
!endif

DDPATH=\dxsdk\lib

!ifndef MASM
MASM=0
MSLINK=0
!else
MSLINK=1
!endif

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

!if $(MSLINK)
LIBS= kernel32.lib user32.lib gdi32.lib crtdll.lib ole32.lib
DDLIBS=$(DDPATH)\dinput.lib $(DDPATH)\dxguid.lib 
LOPT=/OUT:$*.exe /LIBPATH:..\..\Lib /SUBSYSTEM:CONSOLE $(LOPTD) /FIXED:NO /NOLOGO /MAP /OPT:NOWIN98
LINK=@link.exe $*.obj $(LIBS) $(DDLIBS) $(LOPT)
!else
DDLIBS=$(DDPATH)\dinput.lib, $(DDPATH)\dxguid.lib 
LIBS= Library kernel32.lib, user32.lib, gdi32.lib, crtdll.lib, ole32.lib, $(DDLIBS)
LOPT=LIBPATH ..\..\Lib op MAP
LINK=@wlink.exe format windows nt file $*.obj $(LOPT) $(LIBS) op q
!endif

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

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

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