#******************************************************************************
#
#  Makefile for the svgautil directory
#
#       IBM Confidential
#
#       Copyright (c) IBM Corporation 1991
#
#       All Rights Reserved
#
#
#  MODIFICATIONS:
#
#  11/14/92     drw     - Added separate generation of exe for PS/ValuePoint
#  06/02/93     wkb     - Change C compiler definition for large model
#  01/10/94     sen     - Added diamond specific source file.
#
#******************************************************************************

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

.SUFFIXES:
.SUFFIXES: .c .asm .obj .lst .def .lnk .exe

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

#
# Conditional Setup Area and User Defines Macros
#

!ifndef LANG
LANG=us
!endif

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


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


.SUFFIXES:
.SUFFIXES:      .com .exe .obj .lst .c .asm .def .lrf .lnk

#       Definitions for Assembler
ASM=masm
AFLAGS=-W2 -Mx -t -Z -DSVGAUTIL
AINC= -I. -I$(INC) -I..\..\..\src\dos\dosinc


#       Definitions for C compiler

CC=cl
#CFLAGS= -W3 -Zepl -G2s -Owait -AS -Lr -nologo
CFLAGS= -W3 -Zepl -G2s -Owait -AC -Lr -nologo -Gt 256
CINC= -I..\..\..\h -I.

#       Definitions for linker for old style .exe files

LINK=link
LFLAGS  = /noi /noe /nol /nod /exepack /packcode /map
#LIBS= $(LIB)\slibcer.lib
LIBS= $(LIB)\clibcer.lib
RESP=

#       Rules for generating object and linker response and definition files

.asm.obj:
        $(ASM) $(AFLAGS) $(AINC) $*.asm;

.asm.lst:
        $(ASM) -l $(AFLAGS) $(AINC) $*.asm;

.c.obj:
        $(CC) $(CFLAGS) $(CINC) -c $*.c

.c.cod:
        $(CC) $(CFLAGS) -Fc $(CINC) -c $*.c

.c.lst:
        $(CC) $(CFLAGS) -Fs -Sl100 $(CINC) -c $*.c

#       List of files required

OBJS1  = svga.obj svgagen.obj chipdata.obj svgaid.obj #svgadiam.obj
OBJS2  = svgaati.obj svgacirs.obj svgas3.obj svgatsng.obj svgawd.obj

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

#******************************************************************************
#   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: svga.e$(LANG)

svga.e$(LANG): $(OBJS1) $(OBJS2) $(LIBS) svga.l$(LANG) makefile
        $(LINK) $(LFLAGS) @svga.l$(LANG);

list:   $(CLIST)

#
# The following create the linker list files, *.LNK, and the *.DEF files
# for the associated DLL dynamically when the MAKEFILE changes.
#

svga.l$(LANG): makefile
       @ECHO  >$@ $(OBJS1) $(OBJS2)
       @ECHO >>$@ $*.e$(LANG)
       @ECHO >>$@ $*.m$(LANG) $(LFLAGS)
       @ECHO >>$@ $(LIBS)
       @ECHO >>$@ ; $@ end of generated file (see makefile)

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