#----------------------------------------------------------------------------
# MAKEFILE for the POSTSCRIPT DRIVER
#
# SCCSID: src/wp.osdd/pscript/makefile nextbuild 94/05/11
#
# COMPONENT_NAME: PSCRIPT
#
# FUNCTIONS: POSTSCRIPT 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.
#----------------------------------------------------------------------------
#
#General Rules for the developers.
#
#1. Use Absolute Paths from Root. The root is defined relatively.
#   The complexity of the tree can be overcome by
#   absolute paths($(ROOT)\src\) instead of relative path (..\..\..\src\ etc)
#   This makes the output readable.
#
#2. Please don't write generated output to the \src tree. The intermediate
#   output should go into the \obj tree and the release tree (\rel)
#   should contain the files that needs to be shipped. The location of files
#   in the release tree should be decided after discussions with the
#   install group.
#
#3. Include the compiler and flags that need to be used for each build option
#   in compiler.mak. This will give us a global way to change the compiler
#   options and flags for any given sub-system. For example, changing
#   from metaware, ibm C set++ etc.
#
#4. Development should give the build lab the list of components that
#   need to be built and the order in which they need to be built.
#   The wait dependencies for the components should be given, so that
#   components are not kicked off before libraries, tools, etc.(Dependencies)
#   Call the build lab if you have any questions regarding dependencies.
#
#5. Development should provide a mechanism to have all components associated
#   with public code (i.e. \src\public) to be built as soon as possible. This
#   list can be placed in the Build Lab's Makefile that invokes the development's
#   Component makefile. A psuedo-target called public can be used to list
#   the components necessary to be built. Again the component dependencies should
#   provided.
#
#6. All public headers and libs should be used from the "rel" tree.
#   You can't use files from other sub-systems source/output tree.
#
#7. Make Sure that the output paths exists. There will be a build break
#   if directory into which you are writing doesn't exist.
#   Use tools like "makepath", or macro "create_path" to create directory
#   structure. Some base paths are created in header.mak
#
#8. When building for the DDK, include the parameter "ddkbld=1" (case
#   sensitive).
#----------------------------------------------------------------------------
# Define this Component Specific Macros
#----------------------------------------------------------------------------
# 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.
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# The syntax for generating a list (combination of C and assembler) is:
# nmake OPT=<retos2c | dbgos2c> <file name>.lis
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# RENAMING THE DRIVER
# To rename the physical driver name, search for "PS_DEF_NAME" and "PS_DRV_NAME"
# (below).  Follow the instructions that accompany them.
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# Modified by:
# Description:  Makefile for POSTSCRIPT PRESENTATION DRIVER
# Date       :  May 17, 1994
#------------------------------------------------------------------------------


#------------------------------------------------------------------------------
# CHANGING THE NAME OF THE DRIVER
#
# The following macros define the definition name and driver name for this
# driver.  The first two lines are reserved for the Japanese driver and should
# not be modified.  The second two lines may be modified when necessary.
#
# PS_DEF_NAME sets up the "#define" string that is used in the driver that
# is used in the full device name.  This string is copied to DRVNAME.H.
# The entire string *MUST* be in uppercase.
#
# PS_DRV_NAME defines the physical name for .DRV, .SYM, .MAP, etc. file names
# that are created in this makefile.  Since this driver is built in HPFS,
# this string is case-sensitive, so it is recommended that this string be in
# lowercase.
#
# IMPORTANT - Except for case, both "PS_DEF_NAME" and "PS_DRV_NAME" must match.
# There is a REXX utility called COMPARE.CMD that ensures this.  COMPARE will
# display an error if the strings do not match (case insensitive).
#------------------------------------------------------------------------------
!if ( "$(NLV)" == "jp" || "$(NLV)" == "JP" || \
      "$(NLV)" == "JA" || "$(NLV)" == "ja" || \
      "$(NLV)" == "tw" || "$(NLV)" == "TW" || \
      "$(NLV)" == "ko" || "$(NLV)" == "KO"  )
# Do not modify these lines
PS_DEF_NAME = PSCRIPT2
PS_DRV_NAME = pscript2
!else
# Modify these flags to change the driver name.
PS_DEF_NAME = PSCRIPT
PS_DRV_NAME = pscript
!endif

# GP@SWHT Enable Visual Age using for PS
# USE_IBMCPP = 1

!if "$(USE_IBMCPP)" == ""
!ifndef VACPP_VER
VACPP_VER       = v308
!if [set VACPP_VER=v308]
!endif
COMP_VER_FLAG   = "VACPP_VER=$(VACPP_VER)"
!endif
!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
FNTLIB_NAME = fntlibv
!else
GPLNAME_LIB = genplib
FNTLIB_NAME = fntlib
!endif

SUBSYS          = osdd
SUBSYS_RELATIVE = pscript\post32
SRC_RELATIVE    = src\$(SUBSYS)\$(SUBSYS_RELATIVE)
SRC_NL_RELATIVE = mri\$(NLV)\$(SUBSYS)\$(SUBSYS_RELATIVE)


#------------------------------------------------------------------------------
# Names for all the paths and locations..
#------------------------------------------------------------------------------

PS_SRC   = $(ROOT)\$(SRC_RELATIVE)
MRIPATH  = $(ROOT)\$(SRC_NL_RELATIVE)
PS_INC   = $(PS_SRC)\inc
OUTDIR   = $(DRIVERS_NLV)\pscript
DATAPATH = $(ROOT)\obj\data\pscript\$(NLV)
DATAINC  = $(DATAPATH)\inc
MRIOUT   = $(O_NLV)
PPDPATH  = $(MRIPATH)\..\ppd
PPBPATH  = $(DATAPATH)\ppb
PPDSRC   = $(PS_SRC)\ppd
PPDBIN   = $(O_NLV)\ppd
AFMSRC   = $(PS_SRC)\afm
AFMOUT   = $(DATAPATH)\afm
AFMBIN   = $(O_NLV)\afm
PRDESC   = $(O)\..\..\prdesc\$(NLV)
ODCOMMON = $(ROOT)\src\$(SUBSYS)\common

#------------------------------------------------------------------------------
#  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.
#------------------------------------------------------------------------------
# \src\mm\misc\mmpmcrt is an example of the path for a specific component
# in the tree structure. Please change the path as applied to your component.
# Refer to Nmake documentation, if you have any questions about MAKEDIR
#------------------------------------------------------------------------------

ROOT            = $(MAKEDIR:\src\osdd\pscript\post32=)
!if "$(ROOT)" == "$(MAKEDIR)"
ROOT            = $(MAKEDIR:\SRC\OSDD\PSCRIPT\POST32=)
!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 = $(DATAINC);$(PS_INC);$(ROOT)\src\osdd\genplib;$(MRIPATH);$(PPBPATH)
#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=

# Uncomment to use ibmc libs.  With this out, it uses the
# default metaware libs location.
USE_IBMC_LIB = 1

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

#-----------------------------------------------------------------------------
# Version of build in here
#-----------------------------------------------------------------------------
!include $(ODCOMMON)\version.mak


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

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


# The $(ROOT)\src\$(SUBSYS)\common\options.mak is called by root header.mak

EXT = drv
PRIV_HDR  = $(PS_INC)

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


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


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


# PPC pragma defintions are:
#   88 - Expression has no side-effects.
#  257 - '=' encountered where '==' may have been intended.
#  290 - Static function is not referenced.
#  587 - Linkage pragma not supported yet.
#  652 - Variable is never used.


# For the DDK build.  If defined, define interal '#ifdef' directive.
! ifdef ddkbld
DDKBLD = -DDDKBLD
! endif

!ifdef DISABLE_DJP_SUPPORT
DJPOPTS = -DDISABLE_DJP_SUPPORT
!endif

# Set DBCS defines
#  $(NLV)  $(L) $(P) $(C) Description              Locale Alt  Oth Wind Warp 4 FP Warp 3 FP CSD
#  ------  ---- ---- ---- ------------------------ ------ ---  --- ---- --------- --------- ---
#  ar      ARA  864  785  Arabic/Egypt             ar_AA                AR                  A
#  bg      BGR  915  359  Bulgarian/Bulgaria       bg_BG  850  855 1251                     4
#  br      PTB  850  55   Portuguese/Brazil        pt_BR  437      1252 BR        BR        B
#  cf      FRA  437  33   French/Canada            fr_CA  863 1004 1252                    C
#  ca      CAT  850  034  Catalan/Spain            ca_ES  437 1004 1252                     3
#  ce                     Central European English                      CE                  0
#  cn      PRC  1381 086  Simplified Chinese/PRC          946                               M
#  cx      PRC  1886 086  Chinese GBK                     946       936                     6
#  cz      CZE  852  421  Czech/Czech Republic     cs_CZ  850      1250 CZ                  Z
#  de      DEU  850  49   German/Germany           de_DE  437 1004 1252 DE        GR        G
#  dk      DAN  850  45   Danish/Denmark           da_DK      1004 1252 DK        DK        D
#  en      ENU  437  1    English/North America    en_US  437 1004 1252 US        US        0 or _
#  es      ESP  850  34   Spanish/Spain            es_ES  437 1004 1252 ES        SP        S
#  fi      FIN  850  358  Finnish/Finland          fi_FI  437 1004 1252 FI        SU        L
#  fr      FRA  437  33   French/France            fr_FR  437 1004 1252 FR        FR        F
#  gk      ELL  813  030  Greek/Greece             el_GR  813      1253 GK                  K
#  ge      ENU  869  030  Greek/English            el_US                GE                  5
#  he      HEB  862  972  Hebrew/Israel            iw_IL                                    E
#  hu      HUN  852  036  Hungarian/Hungary        hu_HU  850      1250 HU                  Y
#  it      ITA  437  39   Italian/Italy            it_IT  437 1004 1252 IT        IT        I
#  jp      JPN  932  81   Japanese/Japan           ja_JP            932 JP        JP        J
#  ko      KOR  949  082  Korean/Korea             ko_KR  944       949                     Q
#  lt           921  82   Lithuanian/Lithuania     lt_LT  850      1257 LT                  7
#  nl      NLD  850  31   Dutch/Netherlands        nl_NL                NL        NL        H
#  no      NOR  850  47   Norweigian/Norway        no_NO                NO        NO        N
#  pl      POL  852  048  Polish/Poland            pl_PL                PL                  O
#  pt      PTG  850  351  Portuguese/Portugul      pt_PT                PT        PO        P
#  ru      RUS  866  007  Russian/Russia           ru_RU                RU                  R
#  sl      SLO  852  386  Slovenian/Slovenia       sl_SI                                    2
#               852  422  Slovenian/Slovenia       sk_SK
#  sv      SVE  850  46   Swedish/Sweden           sv_SE                SW        SV        W
#  th      THI  874  066  Thai/Thailand            th_TH                TH                  V
#  tr      TRK  857  090  Turkish/Turkey           tr_TR                TR                  1
#  tw      CHT  950  088  Trad. Chinese/Taiwan     zh_TW                                    T
#  uk      ENG  850  044  English/Great Britain    en_GB                UK        UK        U
!if ( "$(NLV)" == "jp" || "$(NLV)" == "JP" )
JPNBLD  = -DJPNBLD=1
!endif

DBCSBLD = $(JPNBLD)

# Tack on your specfic options instead of adding to CFLAGS
PSOPTS = $(DDKBLD) $(DJPOPTS)

!if "$(VACPP_VER)" != ""
!ifndef ddkbld
WARN_CFLAGSX   = /W3 /Wgen+ /Wext- /Wrea+ /Wuse+ /Wcnd+ /Wcnv+ /Wpro+
WARN_CFLAGS    = /W3 /Wgen+ /Tl1
!else
WARN_CFLAGSX   = /W0
WARN_CFLAGS    = /W0 /Tl1
!endif
VACPP_CDEFINES = /D_V3_CRT_=1 /Gm-
LLFLAGS = /IGnorecase
!else
WARN_CFLAGS    = /W3 /Kb+
VACPP_CDEFINES =
!endif

! if "$(BLD_TYPE)"=="retail"
DBG_CFLAGS= /O+ /Gs
BUILD  = retos2c
! else
DBG_CFLAGS=  /Tm+ /Ti+ /O- /Gs- /DLINT_ARGS /DIPMD=1
LDFLAGS = /DEBUG
BUILD  = dbgos2c
# This will create debug version of ppd2bin.exe
# PPDDEBUG = /Ti+
! endif

#
# @IBM-J UDC add -Sn+ to prevent erron on Japanese charaters
#
CFLAGS    = $(TUNEROPT) $(COPT) $(PSOPTS) -c -Q+ -Ge- -Ss -Sn+ -Rn -Ms -Gn -Sp \
            -W3 $(VACPP_CDEFINES) $(WARN_CFLAGS) $(DBCSBLD) /Fo$@
LFLAGS    = /SEG:512 /MAP /PACKCODE /NOD /NOE /a:4 $(LINK_CV) $(LLFLAGS)
LIBOS2    = $(R206_LIB)\os2386.lib
#LIBOS2P   = $(R206_LIB)\os2386p.lib
#CLIBSDLL  = $(COMPILER_LIB)\dde4nbs.lib
!if "$(VACPP_VER)" != ""
CLIBSDLL  = $(COMPILER_LIB)\cppom30.lib
!else
CLIBSDLL  = $(COMPILER_LIB)\dde4nbs.lib
!endif
LINKLIBS  = $(LIBOS2) $(LIBOS2P) $(CLIBSDLL) $(GENPLIB) $(TUNERLIB)
! ifndef ddkbld
LINKLIBS1 = $(FNTLIB)
! else
LINKLIBS1 =
! endif

# 140397 - Remove '/O+'
# TOOLS_OPT= /O+ -Ss+ -Sp $(LISTING) /Fo$(@R).obj /Fe$(@R).exe
TOOLS_OPT= -Ss+ -Sp $(LISTING) $(WARN_CFLAGS) /Fo$(@R).obj /Fe$(@R).exe

#--------------------------------------------------------------------------
# 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) $(DBG_CFLAGS) $(CFLAGS) $(@B).c

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

.c.lis:
        $(CC) $(DBG_CFLAGS) $(CDEFINES) $(CFLAGS) -Fo- -Fa$(@B).lis $(@B).c

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

.asm{$(O)}.obj:
        $(AS) -DINCL_32 $(@B).asm,$(O)\$(@B).obj;

.asm{$(O_NLV)}.obj:
        $(AS) -DINCL_32 $(@B).asm,$(O_NLV)\$(@B).obj;

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

LIBSDLL = $(LIBOS2) $(LIBOS2P) $(CLIBSDLL)

# For OEM support
!ifndef ddkbld
OBJOEM = $(O_NLV)\hp.obj $(O_NLV)\oem.obj
!endif

OBJ01 = $(O_NLV)\arcs.obj       $(O_NLV)\asm2c.obj      $(O_NLV)\attrs.obj
OBJ02 = $(O_NLV)\bitmaps.obj    $(O_NLV)\bounds.obj     $(O_NLV)\box.obj
OBJ03 = $(O_NLV)\charstr.obj    $(O_NLV)\charstr2.obj   $(O_NLV)\colortab.obj
OBJ04 = $(O_NLV)\config.obj     $(O_NLV)\devblock.obj   $(O_NLV)\devesc.obj
OBJ05 = $(O_NLV)\devmode.obj    $(O_NLV)\dlg.obj        $(O_NLV)\download.obj
OBJ06 = $(O_NLV)\enable.obj     $(O_NLV)\flchkdlg.obj   $(O_NLV)\fonts.obj
OBJ07 = $(O_NLV)\init.obj       $(O_NLV)\jpdlg.obj      $(O_NLV)\memory.obj
OBJ08 = $(O_NLV)\noinstal.obj   $(O_NLV)\patfill.obj
OBJ09 = $(O_NLV)\path.obj       $(O_NLV)\path2.obj      $(O_NLV)\polystuf.obj
OBJ10 = $(O_NLV)\ppdlg.obj      $(O_NLV)\prdevect.obj   $(O_NLV)\profile.obj
OBJ11 = $(O_NLV)\psdjp.obj      $(O_NLV)\pstuner.obj    $(O_NLV)\query.obj
OBJ12 = $(O_NLV)\querybox.obj   $(O_NLV)\querychr.obj   $(O_NLV)\surface.obj
OBJ13 = $(O_NLV)\utlchnl.obj    $(O_NLV)\utllog.obj     $(O_NLV)\utlprint.obj
OBJ14 = $(O_NLV)\utlps.obj      $(O_NLV)\xforms.obj     $(O_NLV)\enumpage.obj
OBJ15 = $(O_NLV)\devlst.obj

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

GPLMRI  = $(ROOT)\mri\$(NLV)\$(SUBSYS)\drvmri
OBJ99  = $(O_NLV)\stub.obj
GENPLIB = $(O)\..\..\genplib\$(NLV)\$(GPLNAME_LIB).lib
FNTLIB  = $(O)\fntlib\$(FNTLIB_NAME).lib
RESFILE = $(MRIOUT)\$(PS_DRV_NAME).res
MRIPATH  = $(ROOT)\$(SRC_NL_RELATIVE)

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

PSOBJS = $(OBJ01) $(OBJ02) $(OBJ03) $(OBJ04) $(OBJ05) \
         $(OBJ06) $(OBJ07) $(OBJ08) $(OBJ09) $(OBJ10) \
         $(OBJ11) $(OBJ12) $(OBJ13) $(OBJ14) $(OBJ15) \
         $(OBJ99) $(OBJOEM)

#-----------------------------------------------------------------------------
#  RESOURCE creation
#
#
#
#
#-----------------------------------------------------------------------------

# Adobe Font Metrics files
AFM = $(AFMSRC)

AFM01 = $(AFM)\agb.afm   $(AFM)\agbo.afm $(AFM)\agd.afm                 \
        $(AFM)\agdo.afm  $(AFM)\bd.afm   $(AFM)\bdi.afm $(AFM)\bl.afm
AFM02 = $(AFM)\bli.afm   $(AFM)\cb.afm   $(AFM)\cbo.afm $(AFM)\cm.afm   \
        $(AFM)\co.afm    $(AFM)\gal.afm  $(AFM)\gdb.afm $(AFM)\gdbi.afm
AFM03 = $(AFM)\gdi.afm   $(AFM)\gdrg.afm $(AFM)\gdsb.afm                \
        $(AFM)\gdsbi.afm $(AFM)\hb.afm   $(AFM)\hbo.afm $(AFM)\hm.afm
AFM04 = $(AFM)\ho.afm    $(AFM)\hvn.afm  $(AFM)\hvnb.afm                \
        $(AFM)\hvnbo.afm $(AFM)\hvno.afm $(AFM)\lb.afm
AFM05 = $(AFM)\lbo.afm   $(AFM)\ld.afm   $(AFM)\ldo.afm $(AFM)\ncb.afm  \
        $(AFM)\ncbi.afm  $(AFM)\nci.afm  $(AFM)\ncr.afm $(AFM)\pb.afm
AFM06 = $(AFM)\pbi.afm   $(AFM)\pi.afm   $(AFM)\pr.afm  $(AFM)\sd.afm   \
        $(AFM)\sdi.afm   $(AFM)\sl.afm   $(AFM)\sli.afm $(AFM)\sm.afm
AFM07 = $(AFM)\tb.afm    $(AFM)\tbi.afm  $(AFM)\ti.afm  $(AFM)\tr.afm   \
        $(AFM)\zc.afm    $(AFM)\zd.afm

#### Country unique font files definitions
AFMJP1 = $(AFM)\jp\fgbrh.afm  $(AFM)\jp\fmbrh.afm  $(AFM)\jp\gmrh.afm   \
         $(AFM)\jp\gmrh2.afm  $(AFM)\jp\jlrh.afm   $(AFM)\jp\rlrh.afm

AFMJP2 = $(AFM)\jp\rlrh2.afm  $(AFM)\jp\hggb90.afm $(AFM)\jp\hgml90.afm

AFMJP3 = $(AFM)\jp\rgbext.afm $(AFM)\jp\rgmext.afm $(AFM)\jp\rgyext.afm \
         $(AFM)\jp\rmbext.afm $(AFM)\jp\rmlext.afm $(AFM)\jp\rslext.afm

!if ( "$(NLV)" == "jp" || "$(NLV)" == "JP" )
AFMDBCS = $(AFMJP1) $(AFMJP2) $(AFMJP3)
!endif

AFMS = $(AFM01) $(AFM02) $(AFM03) $(AFM04) $(AFM05)         \
       $(AFM06) $(AFM07) $(AFMDBCS)

# List of all Printer description files
PPD = $(PPDPATH)

PPD01= $(PPD)\39300os2.ppd $(PPD)\39600os2.ppd $(PPD)\401917us.ppd \
       $(PPD)\401939us.ppd $(PPD)\40291730.ppd $(PPD)\40291760.ppd
PPD02= $(PPD)\40293930.ppd $(PPD)\40293960.ppd $(PPD)\7050-int.ppd \
       $(PPD)\7050-us.ppd  $(PPD)\7728-int.ppd $(PPD)\7728-us.ppd
PPD03= $(PPD)\agct4.ppd    $(PPD)\agfa94us.ppd $(PPD)\agfa__us.ppd \
       $(PPD)\amchr518.ppd $(PPD)\apl230us.ppd $(PPD)\apl380us.ppd
PPD04= $(PPD)\apl422us.ppd $(PPD)\aplw3601.ppd $(PPD)\aplwcob1.ppd \
       $(PPD)\aplwgri1.ppd $(PPD)\ast470us.ppd $(PPD)\aw8122.ppd
PPD05= $(PPD)\aw8200.ppd   $(PPD)\aw8300.ppd   $(PPD)\brhl2060.ppd \
       $(PPD)\ca04291.ppd  $(PPD)\cc6603ps.ppd $(PPD)\cc6613ps.ppd
PPD06= $(PPD)\cc6613xf.ppd $(PPD)\clbp3601.ppd $(PPD)\cn1260.ppd   \
       $(PPD)\cn126p.ppd   $(PPD)\cn1760u3.ppd $(PPD)\cn2460e1.ppd
PPD07= $(PPD)\cn3260e1.ppd $(PPD)\cn460a10.ppd $(PPD)\cn_500_1.ppd \
       $(PPD)\cn_psgp1.ppd $(PPD)\cngp55p2.ppd $(PPD)\cngpxfp1.ppd
PPD08= $(PPD)\cnlbp4_1.ppd $(PPD)\cnlbp8_1.ppd $(PPD)\cnlbp8r1.ppd \
       $(PPD)\cnlbp8t1.ppd $(PPD)\cnmdcp01.ppd $(PPD)\cnps3r31.ppd
PPD09= $(PPD)\cnps3r51.ppd $(PPD)\cnps3r71.ppd $(PPD)\cnps3r81.ppd \
       $(PPD)\cp_pse31.ppd $(PPD)\cpper241.ppd $(PPD)\cppro518.ppd
PPD10= $(PPD)\cppsna10.ppd $(PPD)\cppsnb10.ppd $(PPD)\cpqpm153.ppd \
       $(PPD)\cpqpm203.ppd $(PPD)\datap_us.ppd $(PPD)\dclf02_1.ppd
PPD11= $(PPD)\dclf02f1.ppd $(PPD)\decln_us.ppd $(PPD)\declp_us.ppd \
       $(PPD)\dj1200c3.ppd $(PPD)\dp470_us.ppd $(PPD)\ef150r01.ppd
PPD12= $(PPD)\ef150x03.ppd $(PPD)\ef150x13.ppd $(PPD)\ef200m_1.ppd \
       $(PPD)\ef200r01.ppd $(PPD)\ef200r13.ppd $(PPD)\ef200x03.ppd
PPD13= $(PPD)\ef200x13.ppd $(PPD)\efmc5012.ppd $(PPD)\efme1012.ppd \
       $(PPD)\efxjc101.ppd $(PPD)\efxjc201.ppd $(PPD)\efxjr603.ppd
PPD14= $(PPD)\efxjx201.ppd $(PPD)\efxr3031.ppd $(PPD)\efxr5031.ppd \
       $(PPD)\ep826051.ppd $(PPD)\epl75523.ppd $(PPD)\escript8.ppd
PPD15= $(PPD)\fs-1600.ppd  $(PPD)\fs-3400.ppd  $(PPD)\fs-3600.ppd  \
       $(PPD)\fs-6500a.ppd $(PPD)\fs-850a.ppd  $(PPD)\fs_1500.ppd
PPD16= $(PPD)\fs_1550.ppd  $(PPD)\fs_3500.ppd  $(PPD)\fs_400.ppd   \
       $(PPD)\fs_5500.ppd  $(PPD)\gener_us.ppd
PPD17= $(PPD)\hl_10h.ppd   $(PPD)\hl_10ps.ppd  $(PPD)\hl_1260.ppd  \
       $(PPD)\hl_4ps.ppd   $(PPD)\hl_8ps.ppd   $(PPD)\hp1600c1.ppd
PPD18= $(PPD)\hp2100_4.ppd $(PPD)\hp2500c1.ppd $(PPD)\hp2500c2.ppd \
       $(PPD)\hp3500c1.ppd $(PPD)\hp3dl2.ppd   $(PPD)\hp3l2.ppd
PPD19= $(PPD)\hp3pl2.ppd   $(PPD)\hp3si523.ppd $(PPD)\hp4000_4.ppd \
       $(PPD)\hp4050_4.ppd $(PPD)\hp4500.ppd   $(PPD)\hp4plus3.ppd
PPD20= $(PPD)\hp4plus6.ppd $(PPD)\hp4si_30.ppd $(PPD)\hp5000_6.ppd \
       $(PPD)\hp700__1.ppd $(PPD)\hp750__1.ppd $(PPD)\hp755cm1.ppd
PPD21= $(PPD)\hp8000_4.ppd $(PPD)\hp8100_4.ppd $(PPD)\hp_3d522.ppd \
       $(PPD)\hp_3p522.ppd $(PPD)\hp_650c1.ppd $(PPD)\hp_750_1.ppd
PPD22= $(PPD)\hp__clj1.ppd $(PPD)\hp__clj5.ppd $(PPD)\hp_clj85.ppd \
       $(PPD)\hpiid522.ppd $(PPD)\hpiii522.ppd $(PPD)\hpiip522.ppd
PPD23= $(PPD)\hplj4_30.ppd $(PPD)\hplj4ml3.ppd $(PPD)\hplj4ml4.ppd \
       $(PPD)\hplj4mp4.ppd $(PPD)\hplj4mv1.ppd $(PPD)\hplj5m_4.ppd
PPD24= $(PPD)\hplj5p_1.ppd $(PPD)\hplj5si1.ppd $(PPD)\hplj5sim.ppd \
       $(PPD)\hplj6p_4.ppd $(PPD)\hpm240_4.ppd $(PPD)\hpm320_4.ppd
PPD25= $(PPD)\hppjxl3.ppd  $(PPD)\hs_1ps.ppd   $(PPD)\hs_1ps2.ppd  \
       $(PPD)\ibm20_us.ppd $(PPD)\ibm30_us.ppd $(PPD)\ibm31_us.ppd
PPD26= $(PPD)\ibm4039p.ppd $(PPD)\ibm4079.ppd  $(PPD)\iipx.ppd     \
       $(PPD)\imageser.ppd $(PPD)\it1200w1.ppd $(PPD)\it2400w1.ppd
PPD27= $(PPD)\kc580cue.ppd \
                           $(PPD)\kc700pue.ppd $(PPD)\kc9000ue.ppd
PPD28= $(PPD)\l1_380us.ppd $(PPD)\l1_425us.ppd $(PPD)\l2_471us.ppd \
       $(PPD)\l2_493us.ppd $(PPD)\l3_470us.ppd $(PPD)\l3_471us.ppd
PPD29= $(PPD)\l3_493us.ppd $(PPD)\l5_493us.ppd $(PPD)\lex4039p.ppd \
       $(PPD)\lex4079p.ppd $(PPD)\lexoptra.ppd $(PPD)\lopc1200.ppd
PPD30= $(PPD)\lopc40.ppd   $(PPD)\lopc45.ppd   $(PPD)\lope310.ppd  \
       $(PPD)\lops1255.ppd $(PPD)\lops1625.ppd $(PPD)\lops1855.ppd
PPD31= $(PPD)\lops2455.ppd $(PPD)\lops3455.ppd $(PPD)\loptrac.ppd  \
       $(PPD)\loptraep.ppd $(PPD)\loptrak.ppd  $(PPD)\loptran.ppd
PPD32= $(PPD)\loptras.ppd  $(PPD)\loptrasc.ppd $(PPD)\lp1200.ppd   \
       $(PPD)\lp1800.ppd   $(PPD)\ls-6550.ppd  $(PPD)\lw_nt_us.ppd
PPD33= $(PPD)\lw_ntxus.ppd $(PPD)\mipwp181.ppd $(PPD)\mipwp251.ppd \
       $(PPD)\n2090522.ppd $(PPD)\n2290520.ppd $(PPD)\n890x505.ppd
PPD34= $(PPD)\nc62p__1.ppd $(PPD)\nc95___1.ppd $(PPD)\nc95f__1.ppd \
       $(PPD)\nc97f__1.ppd $(PPD)\nc_10971.ppd $(PPD)\ncol_519.ppd
PPD35= $(PPD)\ncps40_1.ppd $(PPD)\ncps80_1.ppd $(PPD)\nec470us.ppd \
       $(PPD)\okol8701.ppd $(PPD)\ol830525.ppd $(PPD)\ol840518.ppd
PPD36= $(PPD)\ol850525.ppd $(PPD)\oliv50us.ppd $(PPD)\os2n2432.ppd \
       $(PPD)\p3954101.ppd $(PPD)\p4455514.ppd $(PPD)\p_2000.ppd
PPD37= $(PPD)\pap54101.ppd $(PPD)\pers_cp.ppd  $(PPD)\pmii.ppd     \
       $(PPD)\q1000mc2.ppd $(PPD)\q1700524.ppd $(PPD)\q860pls2.ppd
PPD38= $(PPD)\q860psys.ppd $(PPD)\q_8010.ppd   $(PPD)\qcs1000.ppd  \
       $(PPD)\qcs10002.ppd $(PPD)\qcs10010.ppd $(PPD)\qcs10030.ppd
PPD39= $(PPD)\qcsm30si.ppd $(PPD)\qmc330.ppd   $(PPD)\qms10602.ppd \
       $(PPD)\qms16602.ppd $(PPD)\qms1725.ppd  $(PPD)\qms2025.ppd
PPD40= $(PPD)\qms2060b.ppd $(PPD)\qms2425d.ppd $(PPD)\qms3225.ppd  \
       $(PPD)\qms3260.ppd  $(PPD)\qms3825e.ppd $(PPD)\qms4060.ppd
PPD41= $(PPD)\qms420.ppd   $(PPD)\qms4525.ppd  $(PPD)\qmscs210.ppd \
       $(PPD)\qmscs230.ppd $(PPD)\qmscs_us.ppd $(PPD)\qmsmc2cx.ppd
PPD42= $(PPD)\qmsmccx.ppd  $(PPD)\qps1500.ppd  $(PPD)\qps2000.ppd  \
       $(PPD)\qps2200.ppd  $(PPD)\qps2210.ppd  $(PPD)\qps2220.ppd
PPD43= $(PPD)\qps410.ppd   $(PPD)\qps800.ppd   $(PPD)\qps800p.ppd  \
       $(PPD)\qps810.ppd   $(PPD)\qps810t.ppd  $(PPD)\qps815.ppd
PPD44= $(PPD)\qps815mr.ppd $(PPD)\qps820.ppd   $(PPD)\qps820t.ppd  \
       $(PPD)\qps825.ppd   $(PPD)\qps825mr.ppd $(PPD)\qume47us.ppd
PPD45= $(PPD)\r6000505.ppd $(PPD)\ri_62001.ppd $(PPD)\ria401e1.ppd \
       $(PPD)\rid53302.ppd $(PPD)\seiko_04.ppd $(PPD)\seiko_14.ppd
PPD46= $(PPD)\shtfdrus.ppd $(PPD)\skpsfcd1.ppd $(PPD)\star_ls5.ppd \
       $(PPD)\t1513470.ppd $(PPD)\t1535470.ppd $(PPD)\tek_cpus.ppd
PPD47= $(PPD)\ti08__us.ppd $(PPD)\ti15__us.ppd $(PPD)\til23521.ppd \
       $(PPD)\tim17521.ppd $(PPD)\tim35521.ppd $(PPD)\timlp231.ppd
PPD48= $(PPD)\timlp672.ppd $(PPD)\timp3232.ppd $(PPD)\timpe231.ppd \
       $(PPD)\titrb161.ppd $(PPD)\titrbo61.ppd $(PPD)\titrbo91.ppd
PPD49= $(PPD)\tix17521.ppd $(PPD)\tix35521.ppd $(PPD)\tk200171.ppd \
       $(PPD)\tk200391.ppd $(PPD)\tk220171.ppd $(PPD)\tk220391.ppd
PPD50= $(PPD)\tk240171.ppd $(PPD)\tk240391.ppd $(PPD)\tk340171.ppd \
       $(PPD)\tk340691.ppd $(PPD)\tk350171.ppd $(PPD)\tk350691.ppd
PPD51= $(PPD)\tk550171.ppd $(PPD)\tk550391.ppd $(PPD)\tkp200i1.ppd \
       $(PPD)\tkp200j1.ppd $(PPD)\tkp220i1.ppd $(PPD)\tkp220j1.ppd
PPD52= $(PPD)\tkp2sdj1.ppd $(PPD)\tkp2sdx1.ppd $(PPD)\tkp300i1.ppd \
       $(PPD)\tkp300j1.ppd $(PPD)\tkp300x1.ppd $(PPD)\tkp360p1.ppd
PPD53= $(PPD)\tkp380p1.ppd $(PPD)\tkp450p1.ppd $(PPD)\tkp480j1.ppd \
       $(PPD)\tkp480x1.ppd $(PPD)\tkp540p1.ppd $(PPD)\tkp560p1.ppd
PPD54= $(PPD)\tkp600p1.ppd $(PPD)\tkp740e1.ppd $(PPD)\tkp740p1.ppd \
       $(PPD)\tkp780g1.ppd $(PPD)\tkp780p1.ppd $(PPD)\tkp840e1.ppd
PPD55= $(PPD)\tkp840p1.ppd $(PPD)\tkph1401.ppd $(PPD)\tkph2sd1.ppd \
       $(PPD)\tkph3801.ppd $(PPD)\tkph4401.ppd $(PPD)\tkph4501.ppd
PPD56= $(PPD)\tkph4801.ppd $(PPD)\tkph5401.ppd $(PPD)\tkph5601.ppd \
       $(PPD)\tkph6001.ppd $(PPD)\tkph7401.ppd $(PPD)\tkph7801.ppd
PPD57= $(PPD)\tkph8401.ppd $(PPD)\tkphpx.ppd   $(PPD)\tkphpxi1.ppd \
       $(PPD)\tkphz2j1.ppd $(PPD)\tkphz3j1.ppd $(PPD)\tkphzr21.ppd
PPD58= $(PPD)\tkphzr31.ppd $(PPD)\tkpxe171.ppd $(PPD)\tkpxe391.ppd \
       $(PPD)\vt600_us.ppd $(PPD)\wang15us.ppd $(PPD)\wangfpus.ppd
PPD59= $(PPD)\x4517.ppd    $(PPD)\xc55dp10.ppd $(PPD)\xn17ps2.ppd  \
       $(PPD)\xr049152.ppd $(PPD)\xr049202.ppd $(PPD)\xr_42201.ppd
PPD60= $(PPD)\xr_45051.ppd $(PPD)\xr_45201.ppd $(PPD)\xr_49001.ppd \
       $(PPD)\xr_dc230.ppd $(PPD)\xrnc60ps.ppd $(PPD)\xrx4215.ppd
PPD61= $(PPD)\xrx4219.ppd  $(PPD)\LOPC710.PPD  $(PPD)\LOPM410.PPD  \
       $(PPD)\LOPT610.PPD  $(PPD)\LOPT612.PPD  $(PPD)\LOPT614.PPD
PPD62= $(PPD)\LOPT616.PPD  $(PPD)\LOPW810.PPD  $(PPD)\kc0400ue.ppd \
       $(PPD)\kc0600ue.ppd $(PPD)\kc0680ue.ppd $(PPD)\kc0800ue.ppd
PPD63= $(PPD)\kc0850ue.ppd $(PPD)\kc1200ue.ppd $(PPD)\kc1500ue.ppd \
       $(PPD)\kc1550ue.ppd $(PPD)\kc155pue.ppd $(PPD)\kc1600ue.ppd
PPD64= $(PPD)\kc1602ue.ppd $(PPD)\kc160pue.ppd $(PPD)\kc1700ue.ppd \
       $(PPD)\kc170pue.ppd $(PPD)\kc1750ue.ppd $(PPD)\kc2000ue.ppd
PPD65= $(PPD)\kc3400ue.ppd $(PPD)\kc340pue.ppd $(PPD)\kc3500ue.ppd \
       $(PPD)\kc3600ue.ppd $(PPD)\kc3602ue.ppd $(PPD)\kc360pue.ppd
PPD66= $(PPD)\kc3700ue.ppd $(PPD)\kc370pue.ppd $(PPD)\kc3750ue.ppd \
       $(PPD)\kc5500ue.ppd $(PPD)\kc580cue.ppd $(PPD)\kc590cue.ppd
PPD67= $(PPD)\kc6300ue.ppd $(PPD)\kc6500ue.ppd $(PPD)\kc6502ue.ppd \
       $(PPD)\kc650pue.ppd                     $(PPD)\kc6900ue.ppd
PPD68= $(PPD)\kc7000ue.ppd $(PPD)\kc700pue.ppd $(PPD)\kc8010ue.ppd \
       $(PPD)\kc9000ue.ppd $(PPD)\QMS4032.PPD  $(PPD)\FPP12V.PPD
PPD69= $(PPD)\oln17000.ppd $(PPD)\oln24000.ppd $(PPD)\oln32000.ppd \
       $(PPD)\oln40000.ppd $(PPD)\hp8150_4.ppd $(PPD)\Xrn2025p.ppd
PPD70= $(PPD)\Xrn2125p.ppd $(PPD)\Xrn2825p.ppd $(PPD)\Xrn3225p.PPD \
       $(PPD)\Xrn4025p.ppd $(PPD)\hp8550.ppd   $(PPD)\xrph1235.ppd
PPD71= $(PPD)\QMSMC2P.PPD $(PPD)\QMS6100.PPD $(PPD)\2560wppd.ppd \
       $(PPD)\lopc710.ppd $(PPD)\lope312.ppd $(PPD)\lopm412.ppd
PPD72= $(PPD)\tk850dp1.ppd $(PPD)\tk850dx1.ppd $(PPD)\tkp850n1.ppd \
       $(PPD)\ibm43032.ppd $(PPD)\ibm43121.ppd $(PPD)\ibm43171.ppd
PPD73= $(PPD)\ibm43201.ppd $(PPD)\ibm43241.ppd $(PPD)\ibm43321.ppd \
       $(PPD)\ibm43322.ppd $(PPD)\docu1202.ppd $(PPD)\ibm43221.ppd
PPD75= $(PPD)\tk750dp1.ppd $(PPD)\tk750dx1.ppd $(PPD)\tkp750n1.ppd \
       $(PPD)\tkp750p1.ppd $(PPD)\docu1210.ppd
PPD76= $(PPD)\hp2250.ppd


PPDS = $(PPD01) $(PPD02) $(PPD03) $(PPD04) $(PPD05) $(PPD06) $(PPD07)   \
       $(PPD08) $(PPD09) $(PPD10) $(PPD11) $(PPD12) $(PPD13) $(PPD14)   \
       $(PPD15) $(PPD16) $(PPD17) $(PPD18) $(PPD19) $(PPD20) $(PPD21)   \
       $(PPD22) $(PPD23) $(PPD24) $(PPD25) $(PPD26) $(PPD27) $(PPD28)   \
       $(PPD29) $(PPD30) $(PPD31) $(PPD32) $(PPD33) $(PPD34) $(PPD35)   \
       $(PPD36) $(PPD37) $(PPD38) $(PPD39) $(PPD40) $(PPD41) $(PPD42)   \
       $(PPD43) $(PPD44) $(PPD45) $(PPD46) $(PPD47) $(PPD48) $(PPD49)   \
       $(PPD50) $(PPD51) $(PPD52) $(PPD53) $(PPD54) $(PPD55) $(PPD56)   \
       $(PPD57) $(PPD58) $(PPD59) $(PPD60) $(PPD61) $(PPD62) $(PPD63)   \
       $(PPD64) $(PPD66) $(PPD67) $(PPD68) $(PPD69) $(PPD70) $(PPD71)   \
       $(PPD72) $(PPD73) $(PPD74) $(PPD75) $(PPD76)


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


#all: dep paths fntlib buildres $(OUTDIR)\$(PS_DRV_NAME).$(EXT)
all: dep paths fntlib buildres $(OUTDIR)\$(PS_DRV_NAME).$(EXT)

nodep: paths fntlib buildres $(OUTDIR)\$(PS_DRV_NAME).$(EXT)

paths:
  -makepath $(OUTDIR) $(MRIOUT) $(PRDESC)

fntlib:
! ifndef ddkbld
   -cd $(ROOT)\$(SRC_RELATIVE)\fntlib
   nmake $(BUILD)
   -cd $(ROOT)\$(SRC_RELATIVE)
! endif

#------------------------------------------------------------------------------
# General Resource building
#------------------------------------------------------------------------------

# Need to get makefile in os2c mode for resources
# toolsmode shoud hace the mode fo building tools
TOOLSMODE = retos2c

makeres:
!if "$(TARGET_PROC)"!="$(TOOLSMODE)"
  @echo switching to $(TOOLSMODE) to make tools
  @set TOOLSFLAG=
  $(MAKE) $(MAKE_OPTS) -f $(MAKEFILE_NAME) OPT=$(TOOLSMODE) /NOLOGO buildres
!else
  buildres
!endif

BUILT_RES =  $(AFMOUT)\fntremap.txt $(DATAPATH)\makevect.out \
             $(PPBPATH)\directry.ppb $(PPBPATH)\ppbs.rc \
             $(AFMOUT)\psfont.rc $(AFMOUT)\fontres.h

buildres: tools_paths $(BUILT_RES)
  @echo Tools Built!

tools_paths:
  -makepath $(DATAINC) $(PPDBIN) $(PPBPATH) $(AFMBIN) $(AFMOUT)

#Flag files
FLAG_FILES = $(DATAPATH)\fntremap.out $(DATAPATH)\$(PS_DRV_NAME).out \
             $(DATAPATH)\ppd2bin.out $(DATAPATH)\fontprep.out


$(FLAG_FILES):

#Copy the afms over to data since it can have dbcs subdirs
$(DATAPATH)\afmcopy.out: $(AFMS)
  copy $(AFMSRC)\*.afm $(AFMOUT)
  if exist $(AFMSRC)\$(NLV)\*.* copy $(AFMSRC)\$(NLV)\*.* $(AFMOUT)
  @echo AFMS copied > $(DATAPATH)\afmcopy.out


# Make fntremap.txt
$(AFMOUT)\fntremap.txt: $(AFMBIN)\fntremap.exe $(DATAPATH)\afmcopy.out
  cd $(AFMOUT)
  $(AFMBIN)\fntremap -d$(AFMOUT)
  @echo Ran fntremap > $(DATAPATH)\fntremap.out
  cd $(PS_SRC)

$(AFMBIN)\fntremap.exe: $(AFMSRC)\fntremap.c $(PS_INC)\mapping.h  \
                        $(DATAPATH)\afmcopy.out
  cd $(AFMSRC)
  $(CC) $(TOOLS_OPT) fntremap.c
  cd $(PS_SRC)


# Make the table for hooking engine

$(DATAPATH)\makevect.out: $(O_NLV)\makevect.exe $(R_OS2_HDR)\pmddim.h
  $(O_NLV)\makevect $(R_OS2_HDR)\pmddim.h $(DATAINC)
  @echo Ran makevect > $(DATAPATH)\makevect.out

$(O_NLV)\makevect.exe: makevect.c $(R_OS2_HDR)\pmddim.h
  $(CC) $(TOOLS_OPT) makevect.c


# Make the PPBs

$(PPBPATH)\directry.ppb: $(PPDBIN)\ppd2bin.exe $(PPDSRC)\ppdfile.lst $(PPDS)
  cd $(PPDPATH)
  $(PPDBIN)\ppd2bin -i $(PPDSRC)\ppdfile.lst -o $(PPBPATH)\ -g gener_us  -p$(MRIPATH) -e1
  @echo Ran ppd2bin > $(DATAPATH)\ppd2bin.out
  cd $(PS_SRC)

$(PPBPATH)\ppbs.rc:
#This is a dummy entry to keep nmake happy.  When directry.ppb is built
#it will take care of this

# Make PPD compiler

$(PPDBIN)\ppd2bin.exe: $(PPDSRC)\ppd2bin.h $(PPDSRC)\ppd2bin.c \
                       $(PS_INC)\ppdialog.h $(AFMOUT)\fontres.h \
                       $(PS_INC)\ppdtable.h $(PPBPATH)\drvname.h
  cd $(PPDSRC)
  $(CC) $(TOOLS_OPT) $(PPDDEBUG) ppd2bin.c
  cd $(PS_SRC)

$(PPBPATH)\drvname.h:  makefile
    @echo  @<<$(PPBPATH)\drvname.h
#define PSCRIPT_DRV_NAME    "$(PS_DEF_NAME)"
<<KEEP
   if exist $(O_NLV)\*.obj del $(O_NLV)\*.obj

# Make the PFMs

$(AFMOUT)\fontres.h $(AFMOUT)\psfont.rc: $(AFMBIN)\afm2bin.exe \
                                         $(AFMBIN)\fontprep.exe $(AFMS)
  cd $(AFMOUT)
  $(AFMBIN)\fontprep -d$(AFMOUT) -e$(AFMBIN)
  -copy $(AFMOUT)\fontres.h $(DATAINC)\fontres.h
  @echo Ran fontprep > $(DATAPATH)\fontprep.out
  cd $(PS_SRC)

# Make the tools

$(AFMBIN)\fontprep.exe: $(AFMSRC)\fontprep.h $(AFMSRC)\fontprep.c
  cd $(AFMSRC)
  $(CC) $(TOOLS_OPT) fontprep.c
  cd $(PS_SRC)

$(AFMBIN)\afm2bin.exe: $(AFMSRC)\afm2bin.h $(AFMSRC)\afm2bin.c
  cd $(AFMSRC)
  $(CC) $(TOOLS_OPT) afm2bin.c
  cd $(PS_SRC)



# For OEM support
!ifndef ddkbld
OEMDLG  = psoem.dlg
OEMDLGp = $(MRIPATH)\$(OEMDLG)
OEMDLGc = + $(OEMDLGp)
OEMRC   = psoem.rc
OEMRCp  = $(MRIPATH)\$(OEMRC)
OEMRCc  = + $(OEMRCp)
!endif

###FILEVER21 = @^#$(_VENDOR):$(_VERSION21)^#@

#$(MRIOUT)\pscript.rc: $(MRIPATH)\postscr.rc $(AFMOUT)\psfont.rc \
#                      $(PPBPATH)\ppbs.rc
$(MRIOUT)\pscript.rc: $(MRIPATH)\postscr.rc   $(DATAPATH)\fontprep.out \
                      $(DATAPATH)\ppd2bin.out $(PPBPATH)\drvname.h
  copy $(MRIPATH)\postscr.rc $(OEMRCc) + $(AFMOUT)\psfont.rc + $(PPBPATH)\ppbs.rc \
       $(MRIOUT)\pscript.rc
  @echo icon 01 "laser.ico"  >> $(MRIOUT)\pscript.rc
  @echo Ran pscript > $(DATAPATH)\$(PS_DRV_NAME).out


RESOURCES = $(FLAG_FILES) $(MRIPATH)\config.dlg \
            $(PS_INC)\config.h $(PS_INC)\fremap.h \
            laser.ico $(MRIOUT)\pscript.rc $(OEMDLGp) \
            $(OUTDIR)\$(PS_DRV_NAME).hlp $(GPLMRI)\gplnup.rc \
            $(GPLMRI)\gplwm.rc $(GPLMRI)\fontsub.rc \
            $(GPLMRI)\gplfm.rc $(GPLMRI)\gplweb.rc

#
# Build Resource File for OS2C
#
$(MRIOUT)\$(PS_DRV_NAME).res: $(RESOURCES)
  copy $(MRIPATH)\config.dlg $(OEMDLGc) $(DATAPATH)\..
  copy $(GPLMRI)\*.rc
  copy $(GPLMRI)\gpl_*.bmp
  rc -cp $(P) $(DDKBLD) -r -i . $(MRIOUT)\pscript.rc $(MRIOUT)\$(PS_DRV_NAME).res
  -del $(DATAPATH)\..\config.dlg
  -del *.rc
  -del gpl_*.bmp

$(OUTDIR)\$(PS_DRV_NAME).hlp: $(MRIPATH)\pscript.itl $(GPLMRI)\common.itl \
                              $(GPLMRI)\gpldlg.itl $(GPLMRI)\fontsub.itl  \
                              $(GPLMRI)\gplfm.itl $(GPLMRI)\gplweb.itl
  cd $(MRIPATH)
  ipfc /L:$(L) /C:$(P) /D:$(C) $(MRIPATH)\pscript.itl $(OUTDIR)\$(PS_DRV_NAME).hlp
  cd $(PS_SRC)

$(OUTDIR)\$(PS_DRV_NAME).$(EXT): makefile $(PSOBJS) $(O_NLV)\$(PS_DRV_NAME).def $(LINKLIBS) $(LINKLIBS1) \
                       $(PS_SRC)\pkgps.cmd $(RESFILE) $(ODCOMMON)\version.mak
       $(LINK) $(LFLAGS) $(LDFLAGS) @<<$(O_NLV)\pscript.lnk
$(PSOBJS:.obj=.obj+
)
$(OUTDIR)\$(PS_DRV_NAME).dll
$(O_NLV)\$(PS_DRV_NAME).map
$(LINKLIBS)+
$(LINKLIBS1)
$(O_NLV)\$(PS_DRV_NAME).def
<<keep
  -del $(OUTDIR)\$(PS_DRV_NAME).$(EXT) 1>nul 2>&1
  -ren $(OUTDIR)\$(PS_DRV_NAME).dll $(PS_DRV_NAME).$(EXT)
  $(RC) $(MRIOUT)\$(PS_DRV_NAME).res $(@)
  cd $(OUTDIR)
  $(MAPSYM) $(O_NLV)\$(PS_DRV_NAME).map
  cd $(PS_SRC)
  pkgps $(_VERSION21) $@ $(PPBPATH)\directry.ppb  $(PRDESC)\pscript.lst $(PS_DEF_NAME)
  eautil $(OUTDIR)\$(PS_DRV_NAME).$(EXT) $(OUTDIR)\$(PS_DRV_NAME).ea /s /r /p

$(O_NLV)\$(PS_DRV_NAME).def: makefile
!if "$(VACPP_VER)" != ""
#VAC
  @echo Writing new  @<<$(O_NLV)\$(PS_DRV_NAME).def
LIBRARY $(PS_DEF_NAME)  INITINSTANCE  TERMINSTANCE
DESCRIPTION '$(FILEVER21) $(PS_DEF_NAME) PRINTER DEVICE DRIVER DYNA-LINK'
PROTMODE
DATA MULTIPLE READWRITE LOADONCALL
CODE LOADONCALL

SEGMENTS
  DDE4_DATA32 CLASS  'DATA' NONSHARED
  global      CLASS  'DATA' SHARED
  perprocess  CLASS  'DATA' NONSHARED

EXPORTS
        OS2_PM_DRV_ENABLE           @200
        OS2_PM_DRV_DEVMODE          @201
        OS2_PM_DRV_DEVICENAMES      @202
        QueryDeviceSurface          @203
        QueryTunerProcData          @204
        OS2_PM_DRV_POSTESCAPE       @206

IMPORTS
        GetDriverInfo      = PMGRE.37
        SetDriverInfo      = PMGRE.38
        Debug32Output      = PMWIN.955
        DosQueryModFromEIP = DOSCALL1.360
<<KEEP
!else
#Cset
  @echo Writing new  @<<$(O_NLV)\$(PS_DRV_NAME).def
LIBRARY $(PS_DEF_NAME)  INITINSTANCE  TERMINSTANCE
DESCRIPTION '$(FILEVER21) $(PS_DEF_NAME) PRINTER DEVICE DRIVER DYNA-LINK'
PROTMODE
DATA SINGLE READWRITE LOADONCALL
CODE LOADONCALL

SEGMENTS
  DDE4_DATA32 CLASS  'DATA' NONSHARED
  global      CLASS  'DATA' SHARED
  perprocess  CLASS  'DATA' NONSHARED

EXPORTS
        OS2_PM_DRV_ENABLE           @200
        OS2_PM_DRV_DEVMODE          @201
        OS2_PM_DRV_DEVICENAMES      @202
        QueryDeviceSurface          @203
        QueryTunerProcData          @204
        OS2_PM_DRV_POSTESCAPE       @206

IMPORTS
        GetDriverInfo      = PMGRE.37
        SetDriverInfo      = PMGRE.38
        Debug32Output      = PMWIN.955
        DosQueryModFromEIP = DOSCALL1.360
<<KEEP
!endif


# 143708 - Remove WinCallHelpHook.  Go back to Win16CallHelpHook.
#       WinCallHelpHook    = PMWIN.288


#****************************************************************************
#  Dependency generation and Checking
#****************************************************************************

# Includes is currently commented out for test purposes.

#$(O)\depend.mak:  $(O)\dephold
#        -$(CREATE_PATH)
#        -del $(O_NLV)\*.obj
#        -$(TOUCH) $(O)\depchk
#        -echo generate depend.mak
#        makedep -A -DPS -TP $(O_NLV) $(HCINC:-I=-I ) -o $@ *.c
#####    makedep2 -Q -A -DPA -TP $(O_NLV) $(HCINC:-I=-I ) $(MAKEDEP_REP_FLAG) -O $@ *.c .\ppd\*.c .\afm\*.c
#        -del $(O)\depchk
#        -compare $(PS_DRV_NAME) $(PS_DEF_NAME)
#
#$(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 $(CDEFINES) $(@B).c $*.mak

.c{$(O_NLV)}.mak:
        -cpp -S $(ROOT)=$$(ROOT) -E -P $(O_NLV)\$(@B).obj $(CDEFINES) $(@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: $(PSOBJS:.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
        -@echo !include $(O_NLV)\depend.mak >> $(O)\depend.tmp
        -@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
        -@for %%i in ($(O_NLV)\*.mak) do \
          @if not "%%i" == "$(O_NLV)\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

clean:
        -echo y | del $(O_NLV)\*
