#******************************************************************************
#  Makefile for the VDSK directory
#
#       SCCSID = @(#)makefile	6.4 91/07/17
#
#       IBM/Microsoft Confidential
#
#       Copyright (c) IBM Corporation 1987, 1989
#       Copyright (c) Microsoft Corporation 1987, 1989
#
#       All Rights Reserved
#
#******************************************************************************

#
# ******  NOTE  ******
#
#
#        If you are using a SED command with TAB characters, many editors
#        will expand tabs causing unpredictable results in other programs.
#
#        Documentation:
#
#        Using SED command with TABS. Besure to invoke set tab save option
#        on your editor. If you don't, the program 'xyz' will not work
#        correctly.
#

!include ..\vdevsub.mak

#
# Conditional Setup Area and User Defined Macros
#


#
# Compiler and Linker Option changes from ..\VDEVSUB.MAK
#

#****************************************************************************
# Set up Macros that will contain all the different dependencies for the
# executables and dlls etc. that are generated.
#****************************************************************************

OBJS=vdsk.obj vdskint.obj vdskio.obj
OBDS=vdsk.obd vdskint.obd vdskio.obd


#****************************************************************************
#   Target Information
#****************************************************************************
#
# This is a very important step. The following small amount of code MUST
# NOT be removed from the program. The following directive will do
# dependency checking every time this component is built UNLESS the
# following is performed:
#                    A specific tag is used -- ie. all
#
# This allows the developer as well as the B & I group to perform incremental
# build with a degree of accuracy that has not been used before.
# There are some instances where certain types of INCLUDE files must be
# created first. This type of format will allow the developer to require
# that file to be created first. In order to achive that, all that has to
# be done is to make the DEPEND.MAK tag have your required target. Below is
# an example:
#
#    depend.mak:   { your file(s) } dephold
#
# Please DON'T remove the following line
#


#
# Should be the default tag for all general processing
#

all:    sys

lib:
        cd ..\..\..\lib
        $(MAKE) -c vdh.lib
        cd ..\src\vdev\vdsk

sys:    vdskd.sys vdsk.sys

clean:
        if exist *.obj del *.obj
        if exist *.obd del *.obd
        if exist *.stb del *.stb
        if exist *.lnk del *.lnk
        if exist *.sys del *.sys
        if exist *.sym del *.sym
        if exist *.exe del *.exe
        if exist *.com del *.com
        if exist *.lst del *.lst
        if exist *.lsd del *.lsd
        if exist *.ltb del *.ltb
        if exist *.sin del *.sin
        if exist *.map del *.map
        if exist *.old del *.old
        if exist *.cvk del *.cvk


#*****************************************************************************
#   Specific Description Block Information
#*****************************************************************************

# This section would only be for specific direction as to how to create
# unique elements that are necessary to the build process. This could
# be compiling or assembling, creation of DEF files and other unique
# files.
# If all compiler and assembly rules are the same, use an inference rule to
# perform the compilation.
#

vdsk.sys: $(OBJS) $(LIBS) $(DEF) makefile
        $(LINK) $(LFLAGS) @<<$(@B).lnk
$(OBJS)
vdsk.sys
vdsk.map
$(LIBS)
$(DEF)
<<keep
        mapsym vdsk

vdskd.sys: $(OBDS) $(LIBS) $(DEF) makefile
        $(LINK) $(LFLAGS) @<<$(@B).lnk
$(OBDS)
vdskd.sys
vdskd.map /co
$(LIBS)
$(DEF)
<<keep
        mapsym vdskd
        debstrip -o vdskd.cvk vdskd.sys

vmdisk.com: vmdisk.asm
        masm vmdisk;
        link vmdisk;
        reloc vmdisk.exe vmdisk.com
        -del vmdisk.exe vmdisk.obj



#*****************************************************************************
#       List of documentation source files
#*****************************************************************************

vdsk.hpl vdsk.hp2 vdsk.ppr vdsk.ppx vdsk.txt: $(DRV6)/src/equate.sci \
        vdskexk.sin vdskext.sin vdskexp.sin \
        vdsklok.sin vdsklot.sin vdsklop.sin \
        vdskimp.sin vdskisu.isu vdsk.doc

vdsk2.doc: vdsk.doc
        sed -e "s;:h3;:h1;" -e "s;:h4;:h3;" -e "s;:h5;:h4;" vdsk.doc >vdsk2.doc

vdsk2.hpl vdsk2.hp2 vdsk2.ppr vdsk2.ppx vdsk2.txt: $(DRV6)/src/equate.sci \
        vdskexk.sin vdskext.sin vdskexp.sin \
        vdsklok.sin vdsklot.sin vdsklop.sin \
        vdskimp.sin vdskisu.isu vdsk2.doc

#       Document .sin dependencies

vdskexk.sin: $(DRV6)\h\vdskpdd.h
        echo .fo off > vdsk.tmp
        echo .gml off >> vdsk.tmp
        echo $$include $(DRV6)\h\vdskpdd.h, EK>> vdsk.tmp
        echo .gml on >> vdsk.tmp
        echo .fo on >> vdsk.tmp
        sinc vdsk.tmp > vdskexk.sin
        -del vdsk.tmp

vdsklok.sin: vdskp.h
        echo .fo off > vdsk.tmp
        echo .gml off >> vdsk.tmp
        echo $$include vdskp.h, LK>> vdsk.tmp
        echo .gml on >> vdsk.tmp
        echo .fo on >> vdsk.tmp
        sinc vdsk.tmp > vdsklok.sin
        -del vdsk.tmp

vdskext.sin: $(DRV6)\h\vdskpdd.h
        echo .fo off > vdsk.tmp
        echo .gml off >> vdsk.tmp
        echo $$include $(DRV6)\h\vdskpdd.h, ET>> vdsk.tmp
        echo .gml on >> vdsk.tmp
        echo .fo on >> vdsk.tmp
        sinc vdsk.tmp > vdskext.sin
        -del vdsk.tmp

vdsklot.sin: vdskp.h
        echo .fo off > vdsk.tmp
        echo .gml off >> vdsk.tmp
        echo $$include vdskp.h, LT>> vdsk.tmp
        echo .gml on >> vdsk.tmp
        echo .fo on >> vdsk.tmp
        sinc vdsk.tmp > vdsklot.sin
        -del vdsk.tmp

vdskexp.sin: vdsk.c vdskint.c vdskio.c
        echo .fo off > vdsk.tmp
        echo .gml off >> vdsk.tmp
        echo $$include vdsk.c, EP>> vdsk.tmp
        echo $$include vdskint.c, EP>> vdsk.tmp
        echo $$include vdskio.c, EP>> vdsk.tmp
        echo .gml on >> vdsk.tmp
        echo .fo on >> vdsk.tmp
        sinc vdsk.tmp > vdskexp.sin
        -del vdsk.tmp

vdsklop.sin: vdsk.c vdskint.c vdskio.c
        echo .fo off > vdsk.tmp
        echo .gml off >> vdsk.tmp
        echo $$include vdsk.c, LP>> vdsk.tmp
        echo $$include vdskint.c, LP>> vdsk.tmp
        echo $$include vdskio.c, LP>> vdsk.tmp
        echo .gml on >> vdsk.tmp
        echo .fo on >> vdsk.tmp
        sinc vdsk.tmp > vdsklop.sin
        -del vdsk.tmp

vdskimp.sin: vdsk.c vdskint.c vdskio.c
        echo :ul > vdskimp.sin
        qgrep -X "VDH[A-Za-z]*(" vdsk.c vdskint.c vdskio.c >1.tmp
        sed -e "s/.*\(VDH[A-Za-z]*(\).*/:li.\1)/" <1.tmp >2.tmp
        sort                                      <2.tmp >3.tmp
        uniq                                      <3.tmp >>vdskimp.sin
        echo :eul >> vdskimp.sin
        -del 1.tmp 2.tmp 3.tmp

#****************************************************************************
