#
#   Makefile for VIWD.386
#
#   Author: tfe
#

!if "$(DEBUG)" == "YES"
DEBUG_VIWD    =   TRUE            
!else
!endif

OUTPUT  =   aux
WINAPPS =   d:\mwin
WINLIB  =   c:\windev\lib
WININC  =   c:\windev\include
!IFNDEF WINDIR
WINDIR  =   d:\mwin
!ENDIF



#
# for VIWD.386 build
#

!IFDEF DEBUG_VIWD

!if "$(TIMEVOICE)" == "YES"
VAS =   masm5 -p -w2 -Mx -Zi -DDEBUG -DTIMEVOICE
!else if "$(TIMEIRQ)" == "YES"
VAS =   masm5 -p -w2 -Mx -Zi -DDEBUG -DTIMEIRQ
!else if "$(TIMEDMA)" == "YES"
VAS =   masm5 -p -w2 -Mx -Zi -DDEBUG -DTIMEDMA
!else if "$(TIMETVOICE)" == "YES"
VAS =	masm5 -p -w2 -Mx -Zi -DDEBUG -DTIMETVOICE
!else
VAS =   masm5 -p -w2 -Mx -Zi -DDEBUG
!endif
VLN =   link386 /MA /LI
VRC =   rc -v -DDEBUG
VZZ =   VIWD: ***** DEBUG ***** DEBUG ***** DEBUG ***** DEBUG *****

!ELSE

VAS =   masm5 -p -w2 -Mx -DRELEASE
VLN =   link386
VRC =   rc -v -DRELEASE
VZZ =   VIWD: **** RELEASE *** RELEASE *** RELEASE *** RELEASE ****

!ENDIF


VMISC   =   VIWD.def  VIWD.lnk

VINCS   =   VIWD.inc
VSRCS   =   VIWD.asm iwirq.asm iwio.asm iwapi.asm
VOBJS   =   VIWD.obj iwirq.obj iwio.obj iwapi.obj


#
# now the rules
#

all         :   VIWD.386
		@echo ================= BUILD COMPLETE ===================
		@echo $(VZZ)
		@echo ================= BUILD COMPLETE ===================

dist:

# VIWD.386

VIWD.386  :   $(VOBJS) VIWD.def
		$(VLN) @VIWD.lnk
		addhdr VIWD.386
!if "$(DEBUG)" == "YES"
		msym VIWD
!endif
#                mapsym32 VIWD
		@echo $(VZZ)
		@echo $(VZZ)
		@echo $(VZZ)

VIWD.obj  :   VIWD.asm  VIWD.inc
		$(VAS) $*,,$*,$*;

iwirq.obj:   iwirq.asm  VIWD.inc
		$(VAS) $*,,$*,$*;

iwio.obj:   iwio.asm  VIWD.inc
		$(VAS) $*,,$*,$*;

iwapi.obj:   iwapi.asm  VIWD.inc
		$(VAS) $*,,$*,$*;

VIWD.lst  :   VIWD.asm  VIWD.inc
		$(VAS) $*;

iwirq.lst:   iwirq.asm  VIWD.inc
		$(VAS) $*;

iwio.lst:   iwio.asm  VIWD.inc
		$(VAS) $*;

iwapi.lst:   iwapi.asm  VIWD.inc
		$(VAS) $*;


# MISC JUNK

clean   :
	    del *.386
	    del *.lib
	    del *.dll
	    del *.exe
	    del *.res
	    del *.obj
	    del *.sym
	    del *.map
	    del *.lst
	    del *.zip
	    del *.crf

zip     :   clean
	    pkzip -a VIWD.zip *.*

ship    :   all
	    del *.lib
	    del *.res
	    del *.obj
	    del *.sym
	    del *.map
	    del *.lst
	    del *.zip
	    touch *.*
	    pkzip -a VIWD .zip *.*
