
# simple Win32 console "hello world" sample.
# either JWASM and WLINK (default)
# or MASM and MS LINK
# can be used and must be found in a directory included in PATH.

# to create the binary with JWASM/WLINK, just enter NMAKE
# to create the binary with MASM/MS LINK, enter NMAKE MASM=1

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

NAME=WinCUI1
OUTDIR=.

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

!if $(MSLINK)
LOPTS=/NOLOGO /MAP /LibPath:..\..\Lib /SUBSYSTEM:CONSOLE /FIXED:NO /OPT:NOWIN98
LIBS=kernel32.lib user32.lib
LINK=link.exe $*.obj $(LOPTS) $(LIBS)
!else
LOPTS=op MAP,quiet libpath ..\..\Lib 
LIBS=library kernel32.lib,user32.lib
LINK=wlink format windows nt file $*.obj $(LOPTS) $(LIBS)
!endif


$(OUTDIR)\$(NAME).exe: $(OUTDIR)\$(NAME).obj makefile
	@$(LINK)

$(OUTDIR)\$(NAME).obj: $(NAME).asm makefile
	@$(ASM) $(NAME).asm

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