
# nmake makefile. this will create WS2_32.DLL
# adjust paths in file "..\dirs" first!
# to create a debug version use "nmake debug=1"
# output will be in subdir RELEASE or DEBUG, format
# of object modules is COFF format, true flat

!include <..\dirs>

!ifndef DEBUG
DEBUG=0
!endif

!if $(DEBUG)
AOPTD=-D_DEBUG
OUTDIR=DEBUG
!else
AOPTD=
OUTDIR=RELEASE
!endif

AOPT= -c -coff -nologo -Sg $(AOPTD) -I$(INC32DIR) -D?FLAT=1 -Fl$* -Fo$* 

LOPTS= /NOLOGO /MAP /SUBSYSTEM:CONSOLE /DLL /ENTRY:DllMain /LIBPATH:$(LIBCOFF)

NAME=WS2_32
LIBS=dkrnl32.lib

.SUFFIXES: .asm .obj

.asm{$(OUTDIR)}.obj:
	@$(ASM) $(AOPT) $<

ALL: $(OUTDIR) $(OUTDIR)\$(NAME).DLL

$(OUTDIR):
	@mkdir $(OUTDIR)

$(OUTDIR)\$(NAME).DLL: $(OUTDIR)\$(NAME).OBJ $(NAME).DEF Makefile
!if $(MSLINK)
	@link @<<
$(OUTDIR)\$(NAME).OBJ $(LOPTS) $(LIBS)
/DEF:$(NAME).def /OUT:$*.DLL
<<
!else
	@$(LINKBIN) format win pe dll name $*.DLL f $(OUTDIR)\$(NAME).OBJ libpath $(LIBCOFF) lib {$(LIBS)} op q, map=$*, implib=$* @$(NAME).rsp
!endif

clean:
	@del $(OUTDIR)\*.obj
	@del $(OUTDIR)\*.lib
	@del $(OUTDIR)\*.dll
	@del $(OUTDIR)\*.lst
