# SCCSID = @(#)makefile 6.4 92/05/08
#/***********************************************************************/
#/*									*/
#/* Driver Name: DHCALLS.LIB - C Callable DevHelp Interface		*/
#/*		 ------------------------------------------		*/
#/*									*/
#/* Source File Name: MAKEFILE						*/
#/*									*/
#/* Descriptive Name: MAKEFILE for DHCALLS.LIB				*/
#/*									*/
#/* Function:								*/
#/*									*/
#/*									*/
#/*---------------------------------------------------------------------*/
#/*									*/
#/* Copyright (C) 1992 IBM Corporation					*/
#/*									*/
#/* DISCLAIMER OF WARRANTIES.  The following [enclosed] code is 	*/
#/* provided to you solely for the purpose of assisting you in		*/
#/* the development of your applications. 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 this code, even if	*/
#/* they have been advised of the possibility of such damages.		*/
#/*									*/
#/*---------------------------------------------------------------------*/
#/*									*/
#/* Change Log								*/
#/*									*/
#/* Mark    Date      Programmer  Comment				*/
#/* ----    ----      ----------  -------				*/
#/*	    09/25/92  Kip Harris  Added DHCALL12 to .OBJ targets,	*/
#/*				  with Feature 26087.			*/
#/*									*/
#/***********************************************************************/
#
#
#	You can optionally generate the listing files for the device driver.
#
#	   make  [option]
#
#	     option:	 list	      -> create listings
#			 dhcalls.lib  ->
#
#	     default:  create dhcalls.lib
#
# ******  NOTE	******
#
#	 If you are using a SED command with TAB characters, many editors
#	 will expand tabs causing unpredictable results in other programs.
#
#	 Documentation:
#
#	 Using SED command with TABS. Besure to invoke set tab save option
#	 on your editor. If you don't, the program 'xyz' will not work
#	 correctly.
#

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

.SUFFIXES:
.SUFFIXES: .com .sys .exe .obj .mbj .asm .inc .def .lnk .lrf .crf .ref
.SUFFIXES: .lst .sym .map .c .h .lib

#****************************************************************************
#  Environment Setup for the component(s).
#****************************************************************************

#
# Conditional Setup Area and User Defined Macros
#

#
# Compiler Location w/ includes, libs and tools
#

DOSINC = ..\..\..\dos\dosinc
INIT   = ..\..\..\dos\init
TASK   = ..\..\..\dos\task
INC    = ..\..\..\..\inc
H      = ..\..\..\..\h
LIB    = ..\..\..\..\lib
TOOLSPATH = ..\..\..\..\tools
DISKH  = ..\diskh
DEVLIB = ..\devhelp

#
# 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 INCLUDE=$(DOSINC);$(INIT);$(TASK);$(INC)] || \
   [set LIB=$(LIB)] || [set PATH=$(TOOLSPATH);$(DK_TOOLS)]
!endif


#
# Compiler/tools Macros
#

AS=masm
CC=cl
IMPLIB=implib
IPF=ipfc
LIBUTIL=lib
LINK=link
MAPSYM=mapsym
RC=rc

#
# Compiler and Linker Options
#

AFLAGS = -MX -T -Z $(ENV)
AINC   = -I. -I$(DOSINC) -I$(INIT) -I$(TASK) -I$(INC)
CINC   = -I$(H) -I$(DISKH) -I$(MAKEDIR)
CFLAGS = /c /Zp /G2s /Answ $(ENV)
LFLAGS = /map /noi /nod /exepack /packd /a:16 /far
RFLAGS = -r

LIBS  =  $(DEVLIB)\dhcalls.lib
DEF02 =  os2dasd.def

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

#
#
#
OBJ1x  = dhcall1.obj dhcall1a.obj dhcall1b.obj dhcall1c.obj
OBJ2x  = dhcall2.obj dhcall2a.obj dhcall2b.obj dhcall2c.obj dhcall2d.obj \
	 dhcall2e.obj
OBJ3x  = dhcall3.obj dhcall3a.obj
OBJ5x  = dhcall5.obj dhcall5a.obj dhcall5b.obj
OBJ6x  = dhcall6.obj dhcall6a.obj dhcall6b.obj dhcall6c.obj
OBJ8x  = dhcall8.obj dhcall8a.obj dhcall8b.obj
OBJ11x = dhcall11.obj dhcal11a.obj dhcal11b.obj dhcal11c.obj dhcal11d.obj \
	 dhcal11e.obj dhcal11f.obj dhcal11g.obj dhcal11h.obj dhcal11i.obj

OBJ1 =	$(OBJ1x) $(OBJ2x) $(OBJ3x) dhcall4.obj
OBJ2 =	$(OBJ5x) $(OBJ6x) dhcall7.obj $(OBJ8x)
OBJ3 =	dhcall9.obj dhcall10.obj $(OBJ11x) dhcall12.obj dhret.obj

#
#	LIST Files
#

LST1x  = dhcall1.lst dhcall1a.lst dhcall1b.lst dhcall1c.lst
LST2x  = dhcall2.lst dhcall2a.lst dhcall2b.lst dhcall2c.lst dhcall2d.lst \
	 dhcall2e.lst
LST3x  = dhcall3.lst dhcall3a.lst
LST5x  = dhcall5.lst dhcall5a.lst dhcall5b.lst
LST6x  = dhcall6.lst dhcall6a.lst dhcall6b.lst dhcall6c.lst
LST8x  = dhcall8.lst dhcall8a.lst dhcall8b.lst
LST11x = dhcall11.lst dhcal11a.lst dhcal11b.lst dhcal11c.lst dhcal11d.lst \
	 dhcal11e.lst dhcal11f.lst dhcal11g.lst dhcal11h.lst dhcal11i.lst

LST1 =	$(LST1x) $(LST2x) $(LST3x) dhcall4.lst
LST2 =	$(LST5x) $(LST6x) dhcall7.lst $(LST8x)
LST3 =	dhcall9.lst dhcall10.lst $(LST11x) dhcall12.lst dhret.lst

LIST = $(LST1) $(LST2) $(LST3)
OBJS = $(OBJ1)	$(OBJ2)  $(OBJ3)

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


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


.asm.lst:
	$(AS) -l -n $(AFLAGS) $(AINC) $*.asm;

.c.obj:
	$(CC) $(CFLAGS) $(CINC) $*.c

.c.lst:
	$(CC) $(CFLAGS) /Fl $(CINC) $*.c
	copy $*.cod $*.lst
	del $*.cod


#****************************************************************************
#   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:	dhcalls.lib

list: $(LST)

clean:
	if exist *.lnk	del *.lnk
	if exist *.obj	del *.obj
	if exist *.mbj	del *.mbj
	if exist *.map	del *.map
	if exist *.old	del *.old
	if exist *.lst	del *.lst
	if exist *.lsd	del *.lsd
	if exist *.sym	del *.sym
	if exist *.sys	del *.sys
	if exist *.tff	del *.tff


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

dhcalls.lib:  $(OBJS) makefile
	-erase	    $*.lib > NUL
	$(LIBUTIL)  @<<$(@B).lnk
$@
y
$(OBJS);
<<keep


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