# 
# tapedrv.mk -- nmake script for ibm firmware utility - tapedrv.exe
#
# Compile with
# 16-bit: Microsoft MSVC 1.5 (cl v8.00c)
# 32-bit: Microsoft MSVC 6.0 (cl v12.00.8168)
#

# 16-bit compiler
MC16=F:\msvc15
INCLUDE_SAVE=$(INCLUDE)
LIB_SAVE=$(LIB)
NILL=

!IF "$(OS)" == "Windows_NT" || "$(windir)" != "$(NILL)" || "$(WINDIR)" != "$(NILL)"
tapedrv: tapedrv16 tapedrv32	# 32-bit environemt
!ELSE
tapedrv: tapedrv16		# 16-bit environemt
!ENDIF

tapedrv16: tapedrvS.exe
tapedrv32: tapedrv.exe

tapedrv.exe:	tapedrv.c tapedrvS.exe
#	cl -nologo -Oas -W4 -Zi -Fm $(*F).c -link -incremental:no -stub:tapedrvS.exe advapi32.lib
	cl -nologo -Oas -W4 -Fm $(*F).c -link -incremental:no -pdb:none -stub:tapedrvS.exe advapi32.lib
#	-del vc?0.pdb
	-del $(*F).obj

STACKSIZE=/stack:4096
tapedrvS.exe:	tapedrv.c
	set INCLUDE=$(MC16)\include
	set LIB=$(MC16)\lib
	$(MC16)\bin\cl -nologo -Oas -G2s -W4 -Fm$(*F).map -Fo$(*F).exe -Fe$(*F).exe tapedrv.c -link /knoweas /noe $(STACKSIZE)
	-$(MC16)\bin\exehdr /max:0xc00 $(*F).exe > nul
	-del $(*F).obj
	set INCLUDE=$(INCLUDE_SAVE)
	set LIB=$(LIB_SAVE)
# Create symbol file for symdeb.exe
#	mapsym $(*F)

# (end tapedrv.mk)
