
# create READTOC.EXE

name = READTOC

DEBUG=0
OUTDIR=.

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

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

!if $(MASM)
ASM = ml -c -coff -nologo -Fl -Sg -Fo$* -I ..\..\include
!else
ASM = jwasm -c -Sg -Fl$* -Fo$* -D?FLAT=1 -D_ML -coff -I..\..\Include
!endif

!if $(MSLINK)
LIBS=kernel32.lib user32.lib msvcrt.lib
LOPT=/OUT:$(OUTDIR)\$(name).exe /MAP:$*.map /SUBSYSTEM:CONSOLE $(LOPTD) /LIBPATH:..\..\Lib
LINK=link $(LOPT) $(OUTDIR)\$(name).obj $(LIBS)
!else
LIBS= Library kernel32.lib, user32.lib, msvcrt.lib
LOPT=format windows nt LIBPATH ..\..\Lib op map, quiet
LINK=@wlink.exe $(LOPT) file $(OUTDIR)\$(name).obj $(LIBS)
!endif

$(name).exe: $*.obj
	$(LINK)

$(name).obj: $(name).asm
	$(ASM) $(name).asm

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

