#***************************************************************************
#  Copyright (C) 1993-1995  IBM Corporation                                *
#                                                                          *
#      DISCLAIMER OF WARRANTIES.  The following [enclosed] code is         *
#      sample code created by IBM Corporation. This sample code is not     *
#      part of any standard or IBM product and is provided to you solely   *
#      for  the purpose of assisting you in the development of your        *
#      presentation drivers.  The code is provided "AS IS", without        *
#      warranty of any kind.  IBM shall not be liable for any damages      *
#      arising out of your use of the sample code, even if they have been  *
#      advised of the possibility of such damages.                         *
#                                                                          *
#***************************************************************************
#***************************************************************************
#                                                                          *
# FILENAME       : MAKEFILE                                                *
# AUTHOR         : Matthew F. Rutkowski                                    *
# DATE WRITTEN   : 05-17-93                                                *
# DESCRIPTION    : Font Test's makefile                                    *
#                                                                          *
############################################################################
# 03-16-95 - Matt Rutkowski modified for version 1.4 file adds/changes
############################################################################

PROGRAM =Font Test 32-bit
AUTHOR  =by Matthew F. Rutkowski
VERSION =v1.5
COMMENT =$(PROGRAM) $(VERSION) $(AUTHOR)

############################################################################
# Module Names                                                             #
############################################################################

MAKEFILE = makefile
APPNAME  = ft32
MODUTIL  = ftutil
MODPAINT = ftpaint
MODQUEUE = ftqueue
MODMENU  = menu
MODFONT  = ftfont
MODDEV   = ftdev
GPLNAME  = genplib

############################################################################
#     Setup Environment Variables                                          #
############################################################################

BMPDIR          = bitmaps
SUBSYS          = osdd
SUBSYS_RELATIVE = ft32

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

USE_IBMC_LIB = 1

#------------------------------------------------------------------------------
#  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\ft32=)
!if "$(ROOT)" == "$(MAKEDIR)"
ROOT            = $(MAKEDIR:\SRC\OSDD\FT32=)
!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\$(GPLNAME);$(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

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

PRIV_HDR  = $(ROOT)\$(SRC_RELATIVE)

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

OUTDIR  = $(DRIVERS_NLV)\$(SUBSYS_RELATIVE)
TOOLDIR = $(ROOT)\src\$(SUBSYS)\common\tools

!if "$(TARGET_PROC)"=="ppc"
GENPLIB = $(O)\..\$(GPLNAME)\libgenp.a
!else
GENPLIB = $(O)\..\$(GPLNAME)\genplib.lib
!endif


############################################################################
#     Setup Environment for this MAKEFILE's life                           #
############################################################################

############################################################################
#  Environment specific commands                                           #
############################################################################

COPY     = copy
CD       = cd
ERASE    = del
MKDIR    = mkdir

############################################################################
#     Compiler/Tools Macros                                                #
############################################################################
CC       = icc
LINK     = link386
HELP     = ipfc
MAPSYM   = mapsym
RC       = rc

!if "$(BLD_TYPE)"=="retail"
CFLAGS  = /C /Gd- /Ge /Re /ss /Gm+ /Ti- /W3 /V"$(COMMENT)"
LFLAGS  = /NOE /NOD /ALIGN:16 /EXEPACK /M
RCFLAGS = -r
Trg=retail
!else
DEFINES = /DDEBUG=1
CFLAGS  = /C /Gd- /Ge /Re /ss /Gm+ /Ti+ /W3 /V"$(COMMENT)" $(DEFINES)
RCFLAGS = -r -DDEBUG=1
LFLAGS  = /NOE /NOD /MAP /CODEVIEW /ALIGN:16
Trg=debug
!endif


############################################################################
#  Resource paths                                                          #
############################################################################
#  NOTE: GENPLIB.LIB is currently a private library on the DDK,            #
#        to recompile w/o it simply replace all the GplMemoryXXX()         #
#        functions with your own                                           #
############################################################################

BITMAPS= $(BMPDIR)\BOOK.BMP     $(BMPDIR)\DEFOPTS.BMP  $(BMPDIR)\FOLDER.BMP   \
         $(BMPDIR)\FONT.BMP     $(BMPDIR)\HELP.BMP     $(BMPDIR)\HELPPLUS.BMP \
         $(BMPDIR)\KEYBOARD.BMP $(BMPDIR)\LITEBULB.BMP $(BMPDIR)\OPENFLDR.BMP \
         $(BMPDIR)\PAPER.BMP    $(BMPDIR)\PRINTER.BMP  $(BMPDIR)\PRNTFILE.BMP \
         $(BMPDIR)\QSTNMARK.BMP $(BMPDIR)\REDCROSS.BMP $(BMPDIR)\SEARCH.BMP   \
         $(BMPDIR)\SELCOLOR.BMP $(BMPDIR)\SELFMT.BMP   $(BMPDIR)\SETTINGS.BMP \
         $(BMPDIR)\SRCHTEXT.BMP

LIBS       = DDE4MBS + $(R206_LIB)\OS2386 + $(GENPLIB)

OBJMODULES = $(Trg)\$(APPNAME).obj $(Trg)\$(MODUTIL).obj \
             $(Trg)\$(MODPAINT).obj $(Trg)\$(MODQUEUE).obj \
             $(Trg)\$(MODMENU).obj $(Trg)\$(MODFONT).obj \
             $(Trg)\$(MODDEV).obj

LNKMODULES = $(Trg)\$(APPNAME).obj+$(Trg)\$(MODUTIL).obj+ \
             $(Trg)\$(MODPAINT).obj+$(Trg)\$(MODQUEUE).obj+ \
             $(Trg)\$(MODMENU).obj+$(Trg)\$(MODFONT).obj+ \
             $(Trg)\$(MODDEV).obj

#--------------------------------------------------------------------------
# Create target directories (retail/debug) (redirect mkdir result to NULL
#--------------------------------------------------------------------------

!if [ $(MKDIR) $(Trg) 2>NUL ]
!endif

############################################################################
#     Target Information                                                   #
############################################################################

all: $(Trg)\$(APPNAME).exe $(Trg)\$(APPNAME).hlp

$(Trg)\$(APPNAME).exe: $(OBJMODULES) $(APPNAME).def $(Trg)\$(APPNAME).res makefile
       if EXIST $(Trg)\$(APPNAME).exe del $(Trg)\$(APPNAME).exe
       $(LINK) $(LFLAGS) $(LNKMODULES),$(Trg)\$(APPNAME).exe,$(Trg)\$(APPNAME).map,$(LIBS),$(APPNAME).def
       $(CD) $(Trg)
       $(RC) $(APPNAME).res
       $(MAPSYM) $(APPNAME)
       $(CD) ..

$(Trg)\$(APPNAME).obj: $(APPNAME).c $(APPNAME).h $(MODMENU).h fthelp.h ftdlg.h
       if EXIST $(Trg)\$(APPNAME).obj del $(Trg)\$(APPNAME).obj
       $(CC) $(CFLAGS) $(DEBUGFLAGS) -Fo$(Trg)\$(APPNAME).obj $(APPNAME).c

$(Trg)\$(MODUTIL).obj: $(MODUTIL).c $(APPNAME).h ftdlg.h
       if EXIST $(Trg)\$(MODUTIL).obj del $(Trg)\$(MODUTIL).obj
       $(CC) $(CFLAGS) -Fo$(Trg)\$(MODUTIL).obj $(MODUTIL).c

$(Trg)\$(MODPAINT).obj: $(MODPAINT).c $(APPNAME).h
       if EXIST $(Trg)\$(MODPAINT).obj del $(Trg)\$(MODPAINT).obj
       $(CC) $(CFLAGS) -Fo$(Trg)\$(MODPAINT).obj $(MODPAINT).c

$(Trg)\$(MODQUEUE).obj: $(MODQUEUE).c $(APPNAME).h ftdlg.h
       if EXIST $(Trg)\$(MODQUEUE).obj del $(Trg)\$(MODQUEUE).obj
       $(CC) $(CFLAGS) -Fo$(Trg)\$(MODQUEUE).obj $(MODQUEUE).c

$(Trg)\$(MODMENU).obj: $(MODMENU).c $(APPNAME).h $(MODMENU).h
       if EXIST $(Trg)\$(MODMENU).obj del $(Trg)\$(MODMENU).obj
       $(CC) $(CFLAGS) -Fo$(Trg)\$(MODMENU).obj $(MODMENU).c

$(Trg)\$(MODFONT).obj: $(MODFONT).c $(APPNAME).h ftdlg.h
       if EXIST $(Trg)\$(MODFONT).obj del $(Trg)\$(MODFONT).obj
       $(CC) $(CFLAGS) -Fo$(Trg)\$(MODFONT).obj $(MODFONT).c

$(Trg)\$(MODDEV).obj: $(MODDEV).c $(APPNAME).h ftdlg.h fthelp.h
       if EXIST $(Trg)\$(MODDEV).obj del $(Trg)\$(MODDEV).obj
       $(CC) $(CFLAGS) -Fo$(Trg)\$(MODDEV).obj $(MODDEV).c

$(Trg)\$(APPNAME).res: $(APPNAME).rc $(APPNAME).dlg $(APPNAME).ico $(BITMAPS) ftdlg.h fthelp.h
       if EXIST $(Trg)\$(APPNAME).res del $(Trg)\$(APPNAME).res
       if EXIST $(Trg)\r*     del $(Trg)\r*
       if EXIST $(Trg)\0*     del $(Trg)\0*
       $(RC) $(RCFLAGS) $(APPNAME)
       $(COPY)  $(APPNAME).res $(Trg)\$(APPNAME).res
       $(ERASE) $(APPNAME).res

$(Trg)\$(APPNAME).hlp: $(APPNAME).ipf $(APPNAME).h fthelp.h
       $(HELP)  $(APPNAME).ipf
       $(COPY)  $(APPNAME).hlp $(Trg)\$(APPNAME).hlp
       $(ERASE) $(APPNAME).hlp

############################################################################
#     Special Targets                                                      #
############################################################################

# Clean target directory for fresh build
clean:
       if EXIST $(Trg)\$(APPNAME).exe     del $(Trg)\$(APPNAME).exe
       if EXIST $(Trg)\$(APPNAME).obj     del $(Trg)\$(APPNAME).obj
       if EXIST $(Trg)\$(MODUTIL).obj     del $(Trg)\$(MODUTIL).obj
       if EXIST $(Trg)\$(MODPAINT).obj    del $(Trg)\$(MODPAINT).obj
       if EXIST $(Trg)\$(MODQUEUE).obj    del $(Trg)\$(MODQUEUE).obj
       if EXIST $(Trg)\$(MODMENU).obj     del $(Trg)\$(MODMENU).obj
       if EXIST $(Trg)\$(MODFONT).obj     del $(Trg)\$(MODFONT).obj
       if EXIST $(Trg)\$(MODDEV).obj      del $(Trg)\$(MODDEV).obj
       if EXIST $(Trg)\$(APPNAME).res     del $(Trg)\$(APPNAME).res
       if EXIST $(Trg)\$(APPNAME).hlp     del $(Trg)\$(APPNAME).hlp
       if EXIST $(Trg)\$(APPNAME).map     del $(Trg)\$(APPNAME).map
       if EXIST $(Trg)\$(APPNAME).sym     del $(Trg)\$(APPNAME).sym

