
#--- before running nmake create subdirectory Release first!

name = EXTRSECT

#--- this app may be generated as standard MZ executable as well
#--- but then set the path of the 16-bit OMF linker first
#--- currently used: Digital Mars C++ OMF linker

MZAPP=1

!ifndef DEBUG
DEBUG=0
!endif

OUTDIR=RELEASE
AOPTD=

LIBOMF=\lib\asm
LOPTD=

ASM = ml -c -nologo -Sg -Fl$* -Fo$* -D?FLAT=0 -D_ML $(AOPTD) -D_KERNEL32_ -D_USER32_
LIBS=$(LIBOMF)\jmppm32.lib $(LIBOMF)\libc32.lib $(LIBOMF)\duser32s.lib 
LOPT=/MAP:FULL/NON/NOE
LINK=\dm\bin\link.exe
MODS=$(LIBOMF)\jmppm32.obj $*.obj $(LIBOMF)\dmythunk.obj


!if $(MZAPP)
$(OUTDIR)\$(name).EXE: $*.obj makefile
    $(LINK) @<<
$(MODS),$*,$*,$(LIBS) $(LOPT);
<<
!else
$(OUTDIR)\$(name).EXE: $*.obj makefile
    $(LINK) $* $(LIBS) $(LOPT)
!if $(DEBUG)==0
	@copy $*.EXE ..\..\bin\*.* >NUL
!ifdef TOOLSDIR
	@copy $*.EXE $(TOOLSDIR)\$(name).EXE
!endif    
!endif
!endif

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

