# SCCSID = @(#)makefile 6.5 92/02/29

#******************************************************************************
#  Makefile for the FAMILY1 directory
#
#       SCCSID = @(#)makefile   6.5 92/02/29
#
#       IBM/Microsoft Confidential
#
#       Copyright (c) IBM Corporation 1987, 1989
#       Copyright (c) Microsoft Corporation 1987, 1989
#
#       All Rights Reserved
#
#******************************************************************************

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

.SUFFIXES:
.SUFFIXES: .asm .c .obj .lst .def .lnk .exe .pcl .vis

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

#
# Conditional Setup Area and User Defines Macros
#

!ifndef LANG
LANG=us
!endif

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

H=..\..\..\..\h
RMH=..\;..\..\resource\rsm_h
INC=..\..\..\..\inc
LIB=..\..\..\..\lib
RLIB=..\..\resource\rmcalls
TOOLSPATH=..\..\..\..\tools

AINC= -I. -I$(INC) -I..\..\..\dos\dosinc
LIBS= $(LIB)\os2286.lib $(RLIB)\rmcalls.lib

#
# 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=$(H);$(RMH);$(INC)] || [set LIB=$(LIB);$(RMLIB)] || [set PATH=$(TOOLSPATH)]
!endif
#

#
# Compiler/tools Macros
#

ASM=masm
LINK=link

CC=cl
COPTS=-Fc /W4 -c -Asnw -G2s -Zl -Zp -Osegli -nologo

WARNFILT = | sed -e /C4001/d

#
# Compiler and Linker Options
#

AFLAGS= -Mx -t
VFLAGS= -Mx -t -DVIS
PFLAGS= -Mx -t -DPCL
LFLAGS= /nodefaultlibrarysearch /noignorecase /exepack /align:16 /map

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

FILES=  pclogic.asm vision.asm data.asm strategy.asm init.asm ..\mserm.c

VISOBJS=   data.vis strategy.obj vision.obj init.obj  ..\mserm.obj
PLOOBJS=   data.pcl strategy.obj pclogic.obj init.obj ..\mserm.obj

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

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

.asm.vis:
        $(ASM) $(VFLAGS) $(AINC) $*.asm $*.vis;

.asm.pcl:
        $(ASM) $(PFLAGS) $(AINC) $*.asm $*.pcl;


.c.obj:
        $(CC) $(COPTS) $*.c $(WARNFILT);


#******************************************************************************
#   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: pclogic.s$(LANG) vision.s$(LANG)

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

pclogic.s$(LANG): $(PLOOBJS) $(LIBS) $(RMLIB) pclogic.def pclogic.l$(LANG)
        $(LINK) $(LFLAGS) @pclogic.l$(LANG)
        mapsym pclogic

pclogic.def:   makefile
        @echo LIBRARY pclogic                  >  pclogic.def
        @echo PROTMODE                         >> pclogic.def
        @echo CODE    PRELOAD                  >> pclogic.def
        @echo DATA    PRELOAD                  >> pclogic.def
        @echo SEGMENTS                            >> pclogic.def
        @echo    DSEG    CLASS 'DATA'             >> pclogic.def
        @echo    _DATA   CLASS 'DATA'             >> pclogic.def
        @echo    CONST   CLASS 'CONST'            >> pclogic.def
        @echo    _BSS    CLASS 'BSS'              >> pclogic.def
        @echo    CSEG    CLASS 'CODE'             >> pclogic.def
        @echo    RMCode  CLASS 'CODE'             >> pclogic.def
        @echo    _TEXT   CLASS 'CODE'             >> pclogic.def
        @echo    DUMMY   CLASS 'CODE'             >> pclogic.def
        @echo IMPORTS                          >> pclogic.def
        @echo    DOSIODELAYCNT = DOSCALLS.427  >> pclogic.def

pclogic.l$(LANG):   makefile
        @echo $(PLOOBJS)                       >  pclogic.l$(LANG)
        @echo pclogic.s$(LANG)                 >> pclogic.l$(LANG)
        @echo pclogic.map $(LFLAGS)            >> pclogic.l$(LANG)
        @echo $(LIBS) $(RMLIB)                 >> pclogic.l$(LANG)
        @echo pclogic.def                      >> pclogic.l$(LANG)

vision.s$(LANG): $(VISOBJS) $(LIBS) $(RMLIB) vision.def vision.l$(LANG)
        $(LINK) $(LFLAGS) @vision.l$(LANG)
        mapsym vision

vision.def:   makefile
        @echo LIBRARY vision                   >  vision.def
        @echo PROTMODE                         >> vision.def
        @echo CODE    PRELOAD                  >> vision.def
        @echo DATA    PRELOAD                  >> vision.def
        @echo SEGMENTS                            >> vision.def
        @echo    DSEG    CLASS 'DATA'             >> vision.def
        @echo    _DATA   CLASS 'DATA'             >> vision.def
        @echo    CONST   CLASS 'CONST'            >> vision.def
        @echo    _BSS    CLASS 'BSS'              >> vision.def
        @echo    CSEG    CLASS 'CODE'             >> vision.def
        @echo    RMCode  CLASS 'CODE'             >> vision.def
        @echo    _TEXT   CLASS 'CODE'             >> vision.def
        @echo    DUMMY   CLASS 'CODE'             >> vision.def
        @echo IMPORTS                          >> vision.def
        @echo    DOSIODELAYCNT = DOSCALLS.427  >> vision.def

vision.l$(LANG):   makefile
        @echo $(VISOBJS)                       >  vision.l$(LANG)
        @echo vision.s$(LANG)                  >> vision.l$(LANG)
        @echo vision.map $(LFLAGS)             >> vision.l$(LANG)
        @echo $(LIBS) $(RMLIB)                 >> vision.l$(LANG)
        @echo vision.def                       >> vision.l$(LANG)

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