
# Makefile for NMAKE. Tools to be used:
# either JWASM, WRC and WLINK (default)
# or      MASM, MS RC and MS LINK.
# the tools must be found somewhere 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=WinGUI1
DEBUG=0
OUTDIR=.

!if $(DEBUG)
LOPTD=/DEBUG:FULL
AOPTD=-Zi
!else
LOPTD=
AOPTD=
!endif

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

!if $(MSLINK)
LOPT=/LibPath:..\..\Lib /MAP:$*.map /SUBSYSTEM:WINDOWS $(LOPTD) /OPT:NOWIN98
LIBS=kernel32.lib user32.lib
LINK=@link.exe $(LOPT) /OUT:$*.exe $*.obj rsrc.res $(LIBS) 
RC=@rc.exe /i..\..\Include
!else
LOPT= LibPath ..\..\Lib op MAP, quiet, res=rsrc.res
LIBS=library kernel32.lib,user32.lib
LINK=@wlink.exe format windows nt runtime windows file $(OUTDIR)\$(NAME).obj $(LOPT) $(LIBS)
RC=@wrc -q -r -i=..\..\Include
!endif

$(OUTDIR)\$(NAME).exe: $(OUTDIR)\$(NAME).obj rsrc.res Makefile
	$(LINK)

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

$(OUTDIR)\rsrc.res: rsrc.rc makefile
	$(RC) rsrc.rc

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

