#******************************************************************************
#  Makefile for the VXGA directory
#
#         makes:     VXGA.SYS
#
#       SCCSID = @(#)makefile   6.00 92/08/21
#
#       IBM Confidential
#
#       Copyright (c) IBM 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
#
#       -Fs gives listing   -Fm gives map    -P gives include file
#       -Fa gives assembler listing

#CFLAGS  = -G3s -Fa -Fs -Fm -Sl 132 -Sp 60 -Zflp -W2 -X $(CINC) -nologo -c $(GCFLAGS) $(FLAGS)
#CFLAGS  = -G3s -Fa -Fs -Fm -Sl 132 -Sp 60 -Zflp -W2 -X -FcvvXGA.cod -DVDDFLOW $(CINC) -nologo -c $(GCFLAGS) $(FLAGS)
CFLAGS  = -G3s -Zflp -W2 -X $(CINC) -nologo -c $(GCFLAGS) $(FLAGS)

#LFLAGSD= $(LFLAGS) /co
#DEBSTRP= debstrip

LFLAGSD = $(LFLAGS)
DEBSTRP = REM debstrip

KRNLLIB = ..\..\dos\mvdm\vdd.lib


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

XGAOBJ=vvXGA.obj

#       Debug object modules

XGAOBD=vvXGA.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
#

!include      "$(H)\version.mak"

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

all:    vvdp.inc vXGA vXGAd

vXGA:   vXGA.sys vXGA.sym

vXGAd:  vXGAd.sys vXGAd.sym

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

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

clean:
        if exist *.obj del *.obj
        if exist *.obd del *.obd
        if exist *.lrf del *.lrf
        if exist *.lnk del *.lnk
        if exist *.sys del *.sys
        if exist *.sym del *.sym
        if exist *.map del *.map
        if exist *.exe del *.exe
        if exist *.com del *.com
        if exist *.cvk del *.cvk

#       These targets (VxxxOBJ) are to facilitate faster rebuilding
#       when the programmer has changed an include file and doesn't want
#       everything to rebuild as a result.

vXGAobj: inc vvxgap.inc
        -touch $(XGAOBJ)

vXGAdobj: inc vvxgap.inc
        -touch $(XGADOBJ)

allobj: inc vvdp.inc vvxgap.inc
        -touch *.?g? *.?n? *.ob?

vvdp.inc: ..\vvideo\vvdp.h


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

vXGA.sys: $(XGAOBJ) $(LIBS) $(DEF) makefile
        copy $(DEF) + << $(@B).def >nul

DESCRIPTION "$(FILEVER)  Virtual Video Device Driver (XGA)"
<<
        $(LINK) $(LFLAGS) @<<$(@B).lnk
$(XGAOBJ)
$@
$*.map
$(LIBS)
$(@B).def
<<keep

vXGAd.sys: $(XGAOBD) $(LIBS) $(DEF) makefile
        copy $(DEF) + << $(@B).def >nul

DESCRIPTION "$(FILEVER)  Virtual Video Device Driver (XGA)"
<<
        $(LINK) $(LFLAGSD) @<<$(@B).lnk
$(XGAOBD)
$@
$*.map
$(LIBS)
$(@B).def
<<keep
        $(DEBSTRP) -o $*.cvk $@

vtests.exe: vtests.obj

vtests.com: vtests.exe


#       The VDD.LRF and KRNLLIB targets were for building a library
#       that could in turn be linked with the kernel for easy source-level
#       debugging.  They are obsolete now, but just in case.... -JTP

egalib: $(KRNLLIB)

vdd.lrf: makefile
        echo $(KRNLLIB)>vdd.lrf
        echo y>>vdd.lrf
        echo $(EGAOBJ1) ^^&>>vdd.lrf
        echo $(EGAOBJ2) ^^&>>vdd.lrf
        echo $(EGAOBJ3) ^^&>>vdd.lrf
        echo $(EGAOBJ4)>>vdd.lrf
        echo.>>vdd.lrf

$(KRNLLIB): $(EGAOBJ1) $(EGAOBJ2) $(EGAOBJ3) $(EGAOBJ4) vdd.lrf
        -del $(KRNLLIB)
        lib @vdd.lrf


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