#----------------------------------------------------------------------------
# MAKEFILE for the PLOTTERS DRIVER
#
# SCCSID: src/osdd/plotter/makefile nextbuild 95/06/09
#
# COMPONENT_NAME: PLOTTER
#
# FUNCTIONS: PLOTTER PRESENTATION DRIVER
#
# ORIGINS: Linked to os2
#
# (C) COPYRIGHT International Business Machines Corp. 1992
# All Rights Reserved
# Licensed Materials - Property of IBM
#
# US Government Users Restricted Rights - Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#----------------------------------------------------------------------------
# SUBSYS is a macro to define the name of the subsystem that this makefile is a
# part of.   It is the name of the subdirectory that is above all of the
# individual components.
#
# SUBSYS_RELATIVE is a macro to define the name of this component.
# SRC_RELATIVE is the full path for the current directory from the
# ROOT.
#
# This uses the substitution feature which takes the current directory of
# this makefile (MAKEDIR) and removes the relative part of the directory to
# get the TOP level directory.
#
# The other macros are used to build directories in other levels of the tree.
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# Modified by:
# Description:  Makefile for PLOTTER PRESENTATION DRIVER
# Date       :  Jun 8, 1995
#------------------------------------------------------------------------------

DRIVER   = plotters
DRIVER_U = PLOTTERS
GPLNAME  = genplib

!ifdef DISABLE_DJP_SUPPORT
CDJPOPTS = -DDISABLE_DJP_SUPPORT=1
ADJPOPTS = /DDISABLE_DJP_SUPPORT=1
!endif

# By default use the ibm visual age compiler.

!if "$(USE_IBMCPP)" == ""
!ifndef VACPP_VER
VACPP_VER       = v308
#VACPP_VER       = v36
!endif
COMP_VER_FLAG   = "VACPP_VER=$(VACPP_VER)"
!else
!undef VACPP_VER
COMP_VER_FLAG   = "USE_IBMCPP=1"
!endif

# This will adjust for either the older genplib name, or the
# Visual Age genplib name(genplibv).

!if "$(VACPP_VER)" != ""
GPLNAME_LIB     = genplibv
!else
GPLNAME_LIB     = genplib
!endif

SUBSYS          = osdd
SUBSYS_RELATIVE = plotter
SRC_RELATIVE    = src\$(SUBSYS)\$(SUBSYS_RELATIVE)
SRC_NL_RELATIVE = mri\$(NLV)\$(SUBSYS)\$(SUBSYS_RELATIVE)
MRISRC  = $(ROOT)\$(SRC_NL_RELATIVE)
MRIOUT  = $(O_NLV)

USE_IBMC_LIB = 1

SRCDIR  = $(ROOT)\$(SRC_RELATIVE)
OUTDIR  = $(DRIVERS_NLV)\$(DRIVER)
PRDESC  = $(O)\..\prdesc\$(NLV)

#EA      = ea
EA       = $(ROOT)\src\$(SUBSYS)\common\tools\rxea.cmd

#------------------------------------------------------------------------------
#  Use built in macro "MAKEDIR" to establish "ROOT".  Due to case sensitivity
#  of nmake macro substitution, try all lowercase then all uppercase.  Fail if
#  current working directory path is mixed case.  This is a current nmake
#  limitation on macro substitutions but should not be a problem for most
#  people.  We are searching for a fix to this problem.
#------------------------------------------------------------------------------

ROOT            = $(MAKEDIR:\src\osdd\plotter=)
!if "$(ROOT)" == "$(MAKEDIR)"
ROOT            = $(MAKEDIR:\SRC\OSDD\PLOTTER=)
!endif
!if "$(ROOT)" == "$(MAKEDIR)"
!error Problem setting "ROOT"! Make sure current working directory is either all\
       uppercase or all lowercase!
!endif

#-----------------------------------------------------------------
# Set up component/subsystem specific macros for use in header.mak
# This allows you establish a search order for header and lib paths.  A
# prefix would be a path that you would like to add to the beginning of
# the standard path which is set in header.mak.  A suffix tags onto the
# end of the standard path.
#-----------------------------------------------------------------

#CMP_HDR_PREFIX = <specify non-default path(s) for front of INCLUDE path>
CMP_HDR_PREFIX  =
#CMP_HDR_SUFFIX = <specify non-default path(s) for back INCLUDE path>
CMP_HDR_SUFFIX  = $(ROOT)\SRC\OSDD\GENPLIB;$(ROOT)\$(SRC_RELATIVE)
#CMP_LIB_PREFIX = <specify non-default path(s) for front of LIB path>
CMP_LIB_PREFIX  =
#CMP_LIB_SUFFIX = <specify non-default path(s) for back LIB path>
CMP_LIB_SUFFIX  =

#-----------------------------------------------------------------------------
# PUBLIC can be one of "ibmmk", "cps","os2".  Please define the below macros
# if you want to include the public files in a different order.  These macros
# would be used if you have a preference as to which directory gets searched
# first.  For example, you would like to search the OS2 header or include
# files before you search the ibmmk header or include files.  In this case,
# you would specify PUBLIC1 = OS2 and PUBLIC2= IBMMK and PUBLIC3 = CPS.
# These macros are then used in header.mak to set the path order.
#------------------------------------------------------------------------------

PUBLIC1 = os2
#PUBLIC2 = ibmmk
#PUBLIC3 = ibmmk\pns_runtime
#PUBLIC4 = cps

#------------------------------------------------------------------------------
# HOST_PROC and HOST_OS will be set in the environment by the build lab.
# Set them in your private builds.
# Please don't set these variables in the public build.
# HOST_PROC=386
# HOST_OS=OS2
#-----------------------------------------------------------------------------

!ifndef HOST_PROC
HOST_PROC=386
HOST_OS=OS2
!endif

#------------------------------------------------------------------------------
# header.mak is the public makefile that sets up all paths and options.  It
# should not be altered.  Additions or changes to header.mak for a component
# can be overwritten in this makefile.  Additions or changes to header.mak
# for an entire subsystem can be overwritten in subsys.mak
#-----------------------------------------------------------------------------

!include $(ROOT)\header.mak

!include $(ROOT)\src\$(SUBSYS)\common\version.mak

EXT = drv

#-------------------------------------------------------------------------
# subsys.mak is used as a way for each subsystem to override any settings
# that were set in header.mak.  It is owned by development.
#-------------------------------------------------------------------------
!include $(ROOT)\src\$(SUBSYS)\common\subsys.mak

#-------------------------------------------------------------------------
# Insert any paths or macros that weren't defined in header.mak or
# subsys.mak here.
#--------------------------------------------------------------------------

GENPLIB = $(O)\..\$(GPLNAME)\$(NLV)\$(GPLNAME_LIB).lib

#----------------------------------------------------------------
# Set up the list of suffixes, if the suffixes in header.mak are not
# sufficient.  Be sure to include the entire list.
#-----------------------------------------------------------------

.SUFFIXES:
.SUFFIXES: .c .cpp .asm .h .inc .obj .def .dll .lib .o .res .rc .drv .map .sym

#------------------------------------------------------------------------
# Please define all compiler, assembler, and linker flags here.
# Use if statement to define the flags for each type of builds.
# See $(ROOT)\src\$(SUBSYS)\common\subsys.mak for defines.
#------------------------------------------------------------------------


!if "$(VACPP_VER)" != ""
WARN_CFLAGS    = /W3 /Wgen+ /Wext- /Wrea+ /Wuse+ /Wcnd+
! if (  ("$(VACPP_VER)" == "v304") \
    || ("$(VACPP_VER)" == "v306") \
    || ("$(VACPP_VER)" == "v308") \
    )
VACPP_CDEFINES = /D_V3_CRT_=1 # /D_RMEM_=1
! else
# cpprns36 does not have a run time library to init
VACPP_CDEFINES =
! endif
!else
WARN_CFLAGS    = /W3 /Kb+
VACPP_CDEFINES =
!endif

!if "$(BLD_TYPE)"=="retail"
DBG_CFLAGS=
!else
DBG_CFLAGS= -DDEBUG=1 -DDEBUGK=1
!endif
DEFS      = -DHELP=1 -DIBM=1 -DHP=1 $(DBG_CFLAGS) $(CDJPOPTS) $(VACPP_CDEFINES)
!if "$(BLD_TYPE)"=="retail"
CFLAGS    = /Q+ /C $(WARN_CFLAGS) /Ss+ /Gs+ /Ge- /O+ /Ms /Rn /Gd- /Gn+ /Fo$*.obj
CFLAGSEXE = /Q+ /C $(WARN_CFLAGS) /Ss+ /Gs+ /Ge+ /O+ /Ms /Rn /Gd- /Gn+ /Fo$*.obj
!else
CFLAGS    = /Q+ /C $(WARN_CFLAGS) /Ss+ /Gs+ /Ge- /Ti+ /O- /Ms /Fa$*.cod /Rn /Gd- /Gn+ /Gh+ /Fo$*.obj
CFLAGSEXE = /Q+ /C $(WARN_CFLAGS) /Ss+ /Gs+ /Ge+ /Ti+ /O- /Ms /Fa$*.cod /Rn /Gd- /Gn+ /Gh+ /Fo$*.obj
!endif
!if "$(BLD_TYPE)"=="retail"
LFLAGS    = /nod /map /noe /EXEPACK
LFLAGSEXE = /map /EXEPACK
!else
LFLAGS    = /DE /CODEView /nod /map /noe /EXEPACK
LFLAGSEXE = /DE /CODEView /map /EXEPACK
!endif
LIBOS2    = $(R206_LIB)\os2386.lib
LIBOS2P   = $(R206_LIB)\os2386p.lib

!if "$(VACPP_VER)" != ""
! if (  ("$(VACPP_VER)" == "v304") \
    || ("$(VACPP_VER)" == "v306") \
    || ("$(VACPP_VER)" == "v308") \
    )
CLIBSDLL  = $(COMPILER_LIB)\cppom30.lib
! else
CLIBSDLL  = $(COMPILER_LIB)\cpprns36.lib  # cpiors40 cpiorn40 cpiorm40 cpprsi36 cpprni36 cpprmi36
! endif
!else
CLIBSDLL  = $(COMPILER_LIB)\dde4nbs.lib
!endif

#--------------------------------------------------------------------------
# If the Inference rules defined in header.mak are not sufficient, then
# define the inference rules necessary at this point.
# The following inference rules are just an example.
# You can delete this section if you don't need to add more inference rules.
#-------------------------------------------------------------------------

.c{$(O)}.obj:
        $(CC) $(DEFS) $(DBG_CFLAGS) $(CFLAGS) $(@B).c

.c.lst:
        $(CC) $(DEFS) $(DBG_CFLAGS) $(CFLAGS) /Fo- /Labejs $(@B).c

.c.lst:
        $(CC) $(DEFS) $(DBG_CFLAGS) $(CFLAGS) /C+ /Fo- /Labejs $(@B).c

.c.i:
        $(CC) $(DEFS) $(DBG_CFLAGS) $(CFLAGS) /C+ /Fo- /P+ $(*B).c

.c.cod:
        $(CC) $(DEFS) $(DBG_CFLAGS) $(CFLAGS) /C+ /Fo- /Fa$(*B).cod $(*B).c

.asm{$(O)}.obj:
        $(AS) -Z -Mx -I. -I$(ROOT)\rel\os2c\include\os2\inc32 -DINCL_32 $(ADJPOPTS) $(@B).asm,$(O)\$(@B).obj;

.asm.lst:
        $(AS) $(ADEFINES) -d -la $(@B).asm,$(O)\$(@B).obj;

.asm.cod:
        $(AS) /l $(ADEFINES) $(@B).asm,nul;

#------------------------------------------------------------------------
# Component defines start here. Example of som defines are attached in
# this template
#------------------------------------------------------------------------

LIBS      = $(LIBOS2) $(LIBOS2P) $(CLIBSDLL) $(GENPLIB)

OBJ01     = $(O)\attribs.obj      $(O)\bitmap.obj       $(O)\bounds.obj
OBJ02     = $(O)\box.obj          $(O)\compress.obj     $(O)\chargen.obj
OBJ03     = $(O)\clip.obj         $(O)\color.obj        $(O)\devmode.obj
OBJ04     = $(O)\dispatch.obj     $(O)\band.obj         $(O)\dosio.obj
OBJ05     = $(O)\enable.obj       $(O)\escquery.obj     $(O)\font.obj
OBJ06     = $(O)\marker.obj       $(O)\outparc.obj      $(O)\outpline.obj
OBJ07     = $(O)\output.obj       $(O)\paths.obj        $(O)\plotters.obj
OBJ08     = $(O)\profile.obj      $(O)\textout.obj      $(O)\utils.obj
OBJ09     = $(O)\xforms.obj       $(O)\initterm.obj     $(O)\lockddc.obj
OBJ10     = $(O)\forms.obj        $(O)\djp.obj

#--------------------------------------------------------------------------
# Below are files that are either Intel or PowerPC specific.
#--------------------------------------------------------------------------

OBJ11     = $(O)\glib.obj         $(O)\init.obj         $(O)\prdmath.obj
OBJ12     = $(O)\new.obj          $(O)\util.obj

#---------------------------------------------------------------------------

PLTOBJS = $(OBJ01) $(OBJ02) $(OBJ03) $(OBJ04) $(OBJ05) \
          $(OBJ06) $(OBJ07) $(OBJ08) $(OBJ09) $(OBJ10) \
          $(OBJ11) $(OBJ12)

#-----------------------------------------------------------------------------
# The all target is used to specify a list of targets that need to be built
#Please don't delete "dep" from the target list.  It is used to generate the
#depend.mak file
#Please look at the example for more details.
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# We need to recurse yet another time because nmaking all or dep will generate
# a new set of depend*.mak files but before we create them, we !include
# the old set.  Therefore, nmake the rest of the driver after dependencies
# have been generated!
#-----------------------------------------------------------------------------
all:     dep
        @$(MAKE) $(MAKE_OPTS) -f $(MAKEFILE_NAME) nodep

nodep: killea \
       $(OUTDIR)\$(DRIVER).$(EXT) \
       $(OUTDIR)\$(DRIVER).hlp \
       $(PRDESC)\$(DRIVER).lst \
       $(OUTDIR)\$(DRIVER).ea

killea:
        if exist $(O)\setea.cmd del $(O)\setea.cmd

$(PRDESC)\$(DRIVER).lst: $(OUTDIR)\$(DRIVER).$(EXT)
     $(CREATE_PATH)
     -..\common\tools\devnames -e$(OUTDIR)\$(DRIVER).$(EXT) > $(PRDESC)\$(DRIVER).tmp
     -sed -e /$(DRIVER)/s//$(DRIVER_U)/ -e /.drv/s//.DRV/ $(PRDESC)\$(DRIVER).tmp > $(PRDESC)\$(DRIVER).lst
     -erase $(PRDESC)\$(DRIVER).tmp

$(OUTDIR)\$(DRIVER).hlp: $(MRISRC)\$(DRIVER).itl
        $(CREATE_PATH)
        cd $(MRISRC)
        ipfc /l=$(L) /codepage=$(P) /country=$(C) $(MRISRC)\$(DRIVER).itl $(OUTDIR)\$(DRIVER).hlp
        cd $(ROOT)\$(SRC_RELATIVE)

$(O)\setea.cmd:
    echo call $(EA) -e .VERSION=$(_VERSION21)                        PLOTTERS.$(EXT)  > $(O)\setea.cmd
    echo call $(EA) -e .VERSION=$(_VERSION21)                        PLOTTERS.sym >> $(O)\setea.cmd
    echo call $(EA) -e VendorName=PLOTTERS                           PLOTTERS.$(EXT) >> $(O)\setea.cmd
    echo call $(EA) -e RequiredDriverFiles=PLOTTERS.$(EXT),PLOTTERS.HLP PLOTTERS.$(EXT) >> $(O)\setea.cmd
    echo call $(EA) -e OptionalDriverFiles=PLOTTERS.SYM              PLOTTERS.$(EXT) >> $(O)\setea.cmd
    echo $(SRCDIR)\..\common\tools\devnames -ePLOTTERS.$(EXT)                                  >> $(O)\setea.cmd
#   echo ea                                                          PLOTTERS.$(EXT) >> $(O)\setea.cmd

$(OUTDIR)\$(DRIVER).ea: $(OUTDIR)\$(DRIVER).$(EXT)
     eautil $(OUTDIR)\$(DRIVER).$(EXT) $(OUTDIR)\$(DRIVER).ea  /s /p /r

$(MRIOUT)\pltus.res: $(MRISRC)\pltus.rc \
                     $(ROOT)\$(SRC_RELATIVE)\dialog.h \
                     $(MRISRC)\pltus.dlg \
                     $(MRISRC)\plotter.ico
        $(CREATE_PATH)
        cd $(MRISRC)
        $(RC) -r -cp $(P) -i . pltus.rc $(MRIOUT)\pltus.res
        cd $(ROOT)\$(SRC_RELATIVE)

###$(OUTDIR)\$(DRIVER).$(EXT): $(DRIVER).$(EXT)

$(OUTDIR)\$(DRIVER).$(EXT): makefile $(PLTOBJS) $(OUTDIR)\$(DRIVER).hlp \
                            $(MRIOUT)\pltus.res $(O)\setea.cmd
        $(CREATE_PATH)
!if "$(VACPP_VER)" != ""
#Intel Visual Age build
        Rem Create DEF file <<$(O)\$(@B).def
; SCCSID "@(#)$(DRIVER).def      13.491/09/09"
LIBRARY PLOTTERS INITINSTANCE TERMINSTANCE

DESCRIPTION '$(FILEVER21) Presentation Manager driver for IBM & HP Plotters'

;;DATA FIXED SHARED PRELOAD           ;change FIXED to MOVEABLE
;;DATA MULTIPLE MOVEABLE SHARED                   ;change FIXED to MOVEABLE
DATA MULTIPLE NONSHARED READWRITE     ;change to NONShared for vac++ memalloc?

; PAGE_TUNE
; Add 'PerProcess' to conform to the page-tuning requirements.
; Defines data to be in per-process memory.
SEGMENTS
  _PLOT          CLASS 'CODE'  CONFORMING
  DDE4_DATA32    CLASS 'DATA'  NONSHARED READWRITE
  PerProcess     CLASS 'DATA'  NONSHARED
  Global         CLASS 'DATA' SHARED

; PAGE_TUNE
; Add QueryTunerProcData (from PTUNE.C)
EXPORTS
        main_dialog_proc            @1
        options_dialog_proc         @2
        priority_dialog_proc        @3
        OS2_PM_DRV_ENABLE      = Enable                 @200
        OS2_PM_DRV_DEVMODE     = OS2_DevPostDeviceModes @201
        OS2_PM_DRV_DEVICENAMES = QueryDeviceNames       @202
        OS2_PM_DRV_POSTESCAPE                           @206
        QueryDeviceSurface                              @203

IMPORTS
        GetDriverInfo    = PMGRE.37
        SetDriverInfo    = PMGRE.38

; HEAPSIZE  49152
; Heap increased to fix PTR B724996, 09/06/91, Steve Urquhart

PROTMODE
<<keep
!else
# Intel C-Set build
        Rem Create DEF file <<$(O)\$(@B).def
; SCCSID "@(#)$(DRIVER).def      13.491/09/09"
LIBRARY PLOTTERS

DESCRIPTION '$(FILEVER21) Presentation Manager driver for IBM & HP Plotters'

;;DATA FIXED SHARED PRELOAD           ;change FIXED to MOVEABLE
DATA MOVEABLE SHARED                   ;change FIXED to MOVEABLE

; PAGE_TUNE
; Add 'PerProcess' to conform to the page-tuning requirements.
; Defines data to be in per-process memory.
SEGMENTS
  _PLOT          CLASS 'CODE'  CONFORMING
  DDE4_DATA32    CLASS 'DATA'  NONSHARED READWRITE
  PerProcess     CLASS 'DATA'  NONSHARED
  global         CLASS 'DATA' SHARED

; PAGE_TUNE
; Add QueryTunerProcData (from PTUNE.C)
EXPORTS
        main_dialog_proc            @1
        options_dialog_proc         @2
        priority_dialog_proc        @3
        OS2_PM_DRV_ENABLE      = Enable                 @200
        OS2_PM_DRV_DEVMODE     = OS2_DevPostDeviceModes @201
        OS2_PM_DRV_DEVICENAMES = QueryDeviceNames       @202
        OS2_PM_DRV_POSTESCAPE                           @206
        QueryDeviceSurface                              @203

IMPORTS
        GetDriverInfo    = PMGRE.37
        SetDriverInfo    = PMGRE.38

; HEAPSIZE  49152
; Heap increased to fix PTR B724996, 09/06/91, Steve Urquhart

PROTMODE
<<keep
!endif
                     $(LINK) @<<$(O_NLV)\$(DRIVER).RSP
$(LFLAGS) +
$(PLTOBJS:.obj=.obj+
)
$(OUTDIR)\$(DRIVER).dll
$(O)\$(DRIVER).MAP
$(LIBS)
$(O)\$(DRIVER).def
<<keep
  -@del $(OUTDIR)\$(DRIVER).$(EXT)
  @ren $(OUTDIR)\$(DRIVER).dll $(DRIVER).$(EXT) 2>&1 > nul
##$(RC) $(MRIOUT)\pltus.res $(@B).$(EXT) LMT
  $(RC) $(MRIOUT)\pltus.res $(@)
  cd $(OUTDIR)
  $(MAPSYM) $(O)\$(@B).map
  $(O)\setea
  cd $(SRCDIR)


##****************************************************************************
##  Dependency generation and Checking
##****************************************************************************
#
## Includes is currently commented out for test purposes.
#
#$(O)\depend.mak:  $(O)\dephold
#        -$(CREATE_PATH)
#        -$(TOUCH) $(O)\depchk
#        -echo generate depend.mak
##         includes -e -S$$(O) -I. -I$(COMPILER_HDR) -I$(R_PUB_HDR) -I$(PRIV_HDR) -I$(R_OS2_HDR) *.c *.h > $@
#        makedep -A -DPS -TP $(O) $(HCINC:-I=-I ) -o $@ *.c
#        -del $(O)\depchk
#
#$(O)\dephold:
#        -$(TOUCH) $@

.SUFFIXES:
.SUFFIXES: .c .cpp .asm .h .inc .obj .def .dll .lib .o .res .rc .drv .map .sym .mak

.c{$(O)}.mak:
        -cpp -S $(ROOT)=$$(ROOT) -E -P $(O)\$(@B).obj $(DEFS) $(@B).c $*.mak

.c{$(O_NLV)}.mak:
        -cpp -S $(ROOT)=$$(ROOT) -E -P $(O_NLV)\$(@B).obj $(DEFS) $(@B).c $*.mak

.asm{$(O)}.mak:
        -@echo $(O)\$(@B).obj: $(ROOT)\$(SRC_RELATIVE)\$(@B).asm | filter -S $(ROOT)=$$(ROOT)  > $(O)\$(@B).mak
        -@nop >> $(O)\$(@B).mak
        -@echo $(O)\$(@B).mak: $(ROOT)\$(SRC_RELATIVE)\$(@B).asm | filter -S $(ROOT)=$$(ROOT) >> $(O)\$(@B).mak

.asm{$(O_NLV)}.mak:
        -@echo $(O_NLV)\$(@B).obj: $(ROOT)\$(SRC_RELATIVE)\$(@B).asm | filter -S $(ROOT)=$$(ROOT)  > $(O_NLV)\$(@B).mak
        -@nop >> $(O_NLV)\$(@B).mak
        -@echo $(O_NLV)\$(@B).mak: $(ROOT)\$(SRC_RELATIVE)\$(@B).asm | filter -S $(ROOT)=$$(ROOT) >> $(O_NLV)\$(@B).mak

$(O)\depend.mak: inithold depexists gendeps termhold

inithold:
        -$(TOUCH) $(O)\depchk

termhold:
        -del $(O)\depchk 1>nul 2>&1

depexists: $(PLTOBJS:.obj=.mak)

gendeps:
#
# Create depend.mak in object directory
#
        -@del $(O)\depend.mak 1>nul 2>&1
        -@del $(O)\depend.tmp 1>nul 2>&1
        -@for %%i in ($(O)\*.mak) do \
          @if not "%%i" == "$(O)\depend.mak" echo !include %%i >> $(O)\depend.tmp
        -@filter -S $(ROOT)=$$(ROOT) < $(O)\depend.tmp > $(O)\depend.mak
        -@del $(O)\depend.tmp 1>nul 2>&1
#
# Create depend.mak in NLV object directory
#
        -@del $(O_NLV)\depend.mak 1>nul 2>&1
        -@del $(O_NLV)\depend.tmp 1>nul 2>&1
        -@for %%i in ($(O_NLV)\*.mak) do \
          @if not "%%i" == "$(O_NLV)\DEPEND.MAK" echo !include %%i >> $(O_NLV)\depend.tmp
        -@filter -S $(ROOT)=$$(ROOT) < $(O_NLV)\depend.tmp > $(O_NLV)\depend.mak
        -@del $(O_NLV)\depend.tmp 1>nul 2>&1
#
# Create depend2.mak in object directory
#
        -@nop > $(O)\depend2.tmp
        -@echo $(O)\depend2.mak: ^\>> $(O)\depend2.tmp
        -@for %%i in ($(O)\*.mak) do \
          @if not "%%i" == "$(O)\depend2.mak" echo                   %%i ^\>> $(O)\depend2.tmp
        -@echo                   Makefile >> $(O)\depend2.tmp
        -@filter -S $(ROOT)=$$(ROOT) < $(O)\depend2.tmp > $(O)\depend2.mak
        -@del $(O)\depend2.tmp 1>nul 2>&1

$(O)\dephold:
        -$(TOUCH) $@

#
# Make sure that the NLV object directory exists and that depend.mak exists in it.
# It will be !included right afterwards.
#
!ifdef TARGET_PROC
!   ifdef EXE_FMT
!      if [ if not exist $(O_NLV)\depend.mak \
               makepath $(O_NLV) & \
               $(TOUCH) $(O_NLV)\depend.mak ]
!      endif
!      include $(O_NLV)\depend.mak
!   endif
!endif

#***************************************************************************
# Include Footer.mak at this point.
#***************************************************************************

!include $(ROOT)\footer.mak

myclean:
        -delpath /Y $(O)
        -delpath /Y $(O_NLV)
        -delpath /Y $(OUTDIR)
