# SCCSID = @(#)makefile	6.1 91/05/19
#******************************************************************************
#  Makefile for the VFLPY directory
#
#       SCCSID = @(#)makefile	6.1 91/05/21
#
#       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
#

!ifdef DMAKE
MAKE=DMAKE
!endif


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

VDD =vflpy
DEF =..\..\..\lib\$(VDD).def
#FLAGS=-DVDDTRACE

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

OBJS=vfinit.obj vfdata.obj vfuser.obj vfio.obj vfevent.obj vfvddreq.obj

OBDS=vfinit.obd vfdata.obd vfuser.obd vfio.obd vfevent.obd vfvddreq.obd

STBS=vfinit.stb vfdata.obj vfuser.obj vfio.obj vfevent.obj vfvddreq.obj

#****************************************************************************
#   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

inc:
        cd ..\..\..\inc
        $(MAKE) -c
        cd ..\src\vdev\$(VDD)

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

sys:    $(VDD)d.sys $(VDD).sys $(VDD)s.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 *.cvk del *.cvk
        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 *.hpl del *.hpl
        if exist *.hp2 del *.hp2
        if exist *.ppr del *.ppr
        if exist *.ppx del *.ppx
        if exist *.txt del *.txt


#*****************************************************************************
#   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.
#

$(VDD).sys: $(OBJS) $(LIBS) $(DEF) makefile
        $(LINK) $(LFLAGS) @<<$(@B).lnk
$(OBJS)
$@
$*.map
$(LIBS)
$(DEF)
<<keep
        $(MAPSYM) $*.map

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

$(VDD)s.sys: $(STBS) $(LIBS) $(DEF) makefile
        $(LINK) $(LFLAGS) @<<$(@B).lnk
$(STBS)
$@
$*.map
$(LIBS)
$(DEF)
<<keep
        $(MAPSYM) $*.map


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

$(VDD).hpl $(VDD).hp2 $(VDD).ppr $(VDD).ppx $(VDD).txt: ../../equate.sci \
        $(VDD).doc \
        $(VDD)exk.sin $(VDD)lok.sin \
        $(VDD)ext.sin $(VDD)lot.sin \
        $(VDD)exp.sin $(VDD)imp.sin $(VDD)lop.sin \
        $(VDD)isu.isu

$(VDD)2.doc: $(VDD).doc
        sed -e "s;:h3;:h1;" -e "s;:h4;:h3;" -e "s;:h5;:h4;" $(VDD).doc >$(VDD)2.doc

$(VDD)2.hpl $(VDD)2.hp2 $(VDD)2.ppr $(VDD)2.ppx $(VDD)2.txt: ../../equate.sci \
        $(VDD)2.doc \
        $(VDD)exk.sin $(VDD)lok.sin \
        $(VDD)ext.sin $(VDD)lot.sin \
        $(VDD)exp.sin $(VDD)imp.sin $(VDD)lop.sin \
        $(VDD)isu.isu

#       Document .sin dependencies

$(VDD)exk.sin: ../../../h/vfdpfd.h
        echo .fo off> t.tmp
        echo .gml off>> t.tmp
        echo $$include ../../../h/vfdpfd.h, EK>> t.tmp
        echo .gml on>> t.tmp
        echo .fo on>> t.tmp
        sinc t.tmp> $(VDD)exk.sin
        -del t.tmp

$(VDD)lok.sin: vfdp.h
        echo .fo off> t.tmp
        echo .gml off>> t.tmp
        echo $$include vfdp.h, LK>> t.tmp
        echo .gml on>> t.tmp
        echo .fo on>> t.tmp
        sinc t.tmp> $(VDD)lok.sin
        -del t.tmp

$(VDD)ext.sin: ../../../h/vfdpfd.h
        echo .fo off> t.tmp
        echo .gml off>> t.tmp
        echo $$include ../../../h/vfdpfd.h, ET>> t.tmp
        echo .gml on>> t.tmp
        echo .fo on>> t.tmp
        sinc t.tmp> $(VDD)ext.sin
        -del t.tmp

$(VDD)lot.sin: vfdp.h
        echo .fo off> t.tmp
        echo .gml off>> t.tmp
        echo $$include vfdp.h, LT>> t.tmp
        echo .gml on>> t.tmp
        echo .fo on>> t.tmp
        sinc t.tmp> $(VDD)lot.sin
        -del t.tmp

$(VDD)exp.sin: vfinit.c vfuser.c vfevent.c vfio.c vfvddreq.c
        echo .fo off> t.tmp
        echo .gml off>> t.tmp
        echo $$include vfinit.c, EP>> t.tmp
        echo $$include vfuser.c, EP>> t.tmp
        echo $$include vfevent.c, EP>> t.tmp
        echo $$include vfio.c, EP>> t.tmp
        echo $$include vfvddreq.c, EP>> t.tmp
        echo .gml on>> t.tmp
        echo .fo on>> t.tmp
        sinc t.tmp> $(VDD)exp.sin
        -del t.tmp

$(VDD)imp.sin: vfinit.c vfuser.c vfevent.c vfio.c vfvddreq.c
        echo :ul>$(VDD)imp.sin
        qgrep -X "VDH[A-Za-z]*(" *.c > 1.tmp
        sed -e "s!.*\(VDH[A-Za-z]*(\).*!:li.\1)!" < 1.tmp > 2.tmp
        sort                                      < 2.tmp > 3.tmp
        uniq                                      < 3.tmp >>$(VDD)imp.sin
        echo :eul>>$(VDD)imp.sin
        -del 1.tmp 2.tmp 3.tmp

$(VDD)lop.sin: vfinit.c vfuser.c vfevent.c vfio.c vfvddreq.c
        echo .fo off> t.tmp
        echo .gml off>> t.tmp
        echo $$include vfinit.c, LP>> t.tmp
        echo $$include vfuser.c, LP>> t.tmp
        echo $$include vfevent.c, LP>> t.tmp
        echo $$include vfio.c, LP>> t.tmp
        echo $$include vfvddreq.c, LP>> t.tmp
        echo .gml on>> t.tmp
        echo .fo on>> t.tmp
        sinc t.tmp> $(VDD)lop.sin
        -del t.tmp


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