
# 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 using JWASM/WLINK, just enter NMAKE
# to create the binary using MASM/MS LINK, enter NMAKE MASM=1

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

NAME=WinGUI2
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 $(ASMOPT)
!else
ASM = @jwasm $(ASMOPT)
!endif

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

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

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

$(OUTDIR)\RSCR.res: RSRC.rc makefile
	$(RC) RSRC.rc

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

