
# makefile for NMAKE, uses either JWASM/WLINK (default) or MASM/MSLINK

!ifndef DEBUG
DEBUG = 0
!endif

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

NAME=ADO1

!IF $(DEBUG)
AOPTD=-Zi
LOPTD=/debug
!else
AOPTD=
LOPTD=
!endif

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

!if $(MSLINK)
LOPTS=/nologo /subsystem:windows /out:$(NAME).exe $(LOPTD) /LIBPATH:..\..\Lib /OPT:NOWIN98 /MAP
LIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
LINK=@link.exe $(LOPTS) $(NAME).obj rsrc.res $(LIBS) 
RC=@rc.exe /fo"$*.res" /d "NDEBUG" -I..\..\Include 
!else
LOPTS=op map
LIBS=Library kernel32.lib, user32.lib, gdi32.lib, comdlg32.lib, advapi32.lib, shell32.lib, ole32.lib, oleaut32.lib, uuid.lib
LINK=@wlink.exe system nt_win $(LOPTS) file $(NAME).obj op map, quiet, res=rsrc.res $(LIBS)
RC=@wrc.exe -q -r -i=..\..\Include
!endif

$(NAME).exe: $(NAME).obj rsrc.res
	$(LINK)

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

rsrc.res: rsrc.rc Makefile
	$(RC) rsrc.rc

clean:
	@erase *.obj
	@erase *.lst
	@erase *.map
	@erase rsrc.res
