# SCCSID = @(#)makefile	6.5 92/02/17
#******************************************************************************
#  Makefile for the vtouch directory
#
#       SCCSID = @(#)makefile	6.5 92/02/17
#
#       IBM/Microsoft Confidential
#
#       Copyright (c) IBM Corporation 1987, 1989
#       Copyright (c) Microsoft Corporation 1987, 1989
#
#       All Rights Reserved
#
#******************************************************************************

#******************************************************************************
#  Dot directive definition area (usually just suffixes)
#******************************************************************************


#******************************************************************************
#  Environment Setup for the component(s).
#******************************************************************************


#
# Conditional Setup Area and User Defines Macros
#


#
# Compiler Location w/ includes, libs and tools
#

CINC   = -I..\..\..\h386 -I..\..\..\h
CSRC   = vtinit.c vtevent.c vtdosreq.c vtvddreq.c vthook.c vtint7f.c vtdata.c
LIBS   = ..\..\..\lib\vdh.lib

H=..\..\..\h
INC=..\..\..\inc
LIB=..\..\..\lib
TOOLSPATH=..\..\..\tools

#
# Since the compiler/linker and other tools use environment
# variables ( INCLUDE, LIB, etc ) in order to get the location of files,
# the following line will check the environment for the LIFE of the
# makefile and will be specific to this set of instructions. All MAKEFILES
# are requested to use this format to insure that they are using the correct
# level of files and tools.
#

!if [set INCLUDE=$(H);$(INC)] || [set LIB=$(LIB)] || [set PATH=$(TOOLSPATH)]
!endif
#

#
# Compiler/tools Macros
#

ASMSRC = vtrouter.asm
CC     = cl386
LINK   = link386
LINK16 = link
ASM    = masm


#
# Compiler and Linker Options
#

LFLAGS = /nod /noi /map:0 /nol /align:16 /exepack
CFLAGS = -c -W2 -Asnw -G3s -Zflp -Owait -X $(CINC) -nologo
AFLAGS = -Mx -n -t -W2
L16FLAGS = /noi /noe /nod /map:0


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

COBJ   = $(CSRC:.c=.obj)
AOBJ   = $(ASMSRC:.asm=.obj)



#******************************************************************************
#   Setup the inference rules for compiling and assembling source code to
#   object code.
#******************************************************************************
#******************************************************************************
#   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: vtouch.sys vtouch.com

$(COBJ): $$(@B).c vtdef.h vtdptd.h
        $(CC) $(CFLAGS) $*.c

$(AOBJ): $$(@B).asm
        $(ASM) $(AFLAGS) $*.asm;


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

vtouch.com: vtrouter.asm
        $(ASM) $(AFLAGS) -DTOUCHCOM=1 vtrouter.asm,touchcom.obj;
	$(LINK16) $(L16FLAGS) touchcom;
	reloc touchcom.exe vtouch.com

vtouch.sys: $(COBJ) $(AOBJ) makefile vtouch.def vtouch.lrf
        $(LINK) @vtouch.lrf
        mapsym  vtouch

vtouch.lrf: makefile
        echo $(COBJ) $(AOBJ)            > vtouch.lrf
        echo vtouch.sys                 >>vtouch.lrf
        echo vtouch.map $(LFLAGS)       >>vtouch.lrf
        echo $(LIBS)                    >>vtouch.lrf
        echo vtouch.def                 >>vtouch.lrf

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