#******************************************************************************
#
#  Author       - Joe Celi
#  Date Created - 6/2/94
#
#  Makefile for a template PM Video Accelerator dd
#
#  IBM Confidential
#
#  Copyright (c) IBM Corporation 1993
#
#  All Rights Reserved
#
#******************************************************************************

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

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

#******************************************************************************
#  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
IBMH=..\..\..\ibmh
H386=..\..\..\h386
LIB=..\..\..\lib
TOOLSPATH=..\..\..\tools

#
# CSET/2 specific defines
#

LOCALE  =..\..\..\ibmc\clocale
IBMCINC =..\..\..\ibmc\cinclude
IBMCLIB =..\..\..\ibmc\clib
IBMCBIN =..\..\..\ibmc\cbin
IBMCHELP=..\..\..\ibmc\chelp
INC     =..\..\..\inc

CINC    = -I. -I.. -I$(IBMH) -I$(H386) -I$(H)
AINC    = -I. -I$(INC)
LIB386  = $(LIB)\os2386.lib
LIBP    = $(LIB)\os2386p.lib
LIBDDE  = $(IBMCLIB)\dde4nbs
LIBS    = $(LIB386) $(LIBP) $(LIBDDE)

DPATH   = $(LOCALE);$(IBMCHELP);

#
# Add new object modules here
#

OBJS    = tmpinit.obj  tmpdata.obj   tmpentry.obj  tmpcaps.obj \
          tmpput.obj   tmpext.obj    tmpio.obj     tmpring2.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 HELP=$(IBMCHELP)] || \
    [SET LIB=$(IBMCLIB);$(LIB)] || \
    [SET PATH=$(IBMCBIN);$(TOOLSPATH)] || \
    [SET INCLUDE=$(IBMCINC);$(IBMH);$(H386);$(H);$(INC);..\]
!endif

#
# Compiler/tools Macros
#

CC=     icc
LINK=   link386
ASM=    masm

#
# Compiler and Linker Options
#

CFLAGS= /C+ /Ge- /Gm+ /Fm+ /Sp1 /Ss+ /O+ /Kb
LFLAGS= /nod /noi /map /nol /noe /exepack /packcode /packdata /nofar /align:32
AFLAGS= -Ml -t -Z -W1

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


#******************************************************************************
#   Setup the inference rules for compiling and assembling source code to
#   object code.
#******************************************************************************

.c.obj:
        $(CC) $(CFLAGS) /Fo$@ $*.c

.c.cod:
        $(CC) $(CFLAGS) /Fo$*.obj /Fa$@ $*.c

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

#******************************************************************************
#   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: template.dll

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

#------------------------------------------------------------------------
# Build device dependant DLL
#------------------------------------------------------------------------

template.dll: $(OBJS) template.def template.lnk
              $(LINK) $(LFLAGS) @template.lnk;
              mapsym $*

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

template.lnk: makefile
    @ECHO  >$@ $(OBJS)
    @ECHO >>$@ $*.dll
    @ECHO >>$@ $*.map $(LFLAGS)
    @ECHO >>$@ $(LIBS)
    @ECHO >>$@ $*.def
    @ECHO >>$@ ; $@ end of generated file (see makefile)

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