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

.SUFFIXES: .c .obj


!ifndef TOOLBASE
TOOLBASE = ..\..\..\..\..\tools
!endif

!ifndef BLDTOOLS
BLDTOOLS = $(TOOLBASE)
!endif

!ifndef CSET2
CSET2    = $(TOOLBASE)\cset2
!endif

!ifndef TOOLKT21
TOOLKT21 = $(TOOLBASE)\toolkt20
!endif

#****************************************************************************
#  Environment Setup for the component(s).
#****************************************************************************
DDK      = ..\..\..\..\..
IH       = ..\..\..\h
TLKH     = ..\..\penbase\inc
PENH     = $(IH);$(TLKH)
CSET2H   = $(CSET2)\include;$(CSET2)\include\sys
CSET2L   = $(CSET2)\lib;
CSET2B   = $(CSET2)\bin
CSET2M   = $(CSET2)\locale;$(CSET2)\help
PINCLUDE  = -I. -I..\..\penbase\inc
OS2H     = $(TOOLKT21)\c\os2h;$(DDK)\IBMH;$(DDK)\inc;
OS2L     = $(TOOLKT21)\os2lib;$(DDK)\lib
OS2B     = $(TOOLKT21)\os2bin

!if [set INCLUDE=$(PENH);$(CSET2H);$(OS2H);$(PINCLUDE);%INCLUDE%]  ||  \
    [set LIB=$(CSET2L);$(OS2L);%LIB%]         ||  \
    [set PATH=$(CSET2B);$(OS2B);$(BLDTOOLS);$(PATH);%PATH%]     ||  \
    [set DPATH=$(CSET2M);$(DPATH);%DPATH%]
!endif

SOMTEMP= $(TMP)

!if [set SMTMP=$(SOMTEMP)] || \
    [set SMEMIT=ih;h;ph;psc;sc;c]
!endif

#
# Compiler/tools Macros
#
!ifdef DEBUG
CDBFLAG=/Ti+ /O-
LDBFLAG=/DEBUG /BATCH
!endif

CC       = icc /c /Gm- /Ss $(CDBFLAG)
LINK       = link386 $(LDBFLAG)
LDFLAGS    = /noi /map /nol /nod /exepack /packcode /packdata /align:16
LIBS       = os2386.lib dde4sbs.lib

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

OBJS = pentl.obj

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

.c.obj:
#       $(CC) $(INCLUDE) $<
        $(CC) /fo$*.obj $(PINCLUDE) $<

.asm.obj:
        $(MASM) $*.asm $*.obj

.csc.ih:
        sc -v -r $*.csc

.csc.c:
        sc $*.csc

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

all: pentl.exe

#
# Specific Process Tag
#

pentl.exe : $(OBJS)
        $(LINK) /NOI /NOD @<<
         $(OBJS)
         $@
         $*.map   /map
         $(LIBS)
         $*.def
<<

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