#******************************************************************************
#  Makefile for the SRC\DEV\MOUSE Directory
#
#       SCCSID = @(#)makefile   6.10 92/06/09
#
#       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

#******************************************************************************
#  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
RMLIB=..\resource\rmcalls
TOOLSPATH=..\..\..\tools

AINC= -I. -I$(INC) -I..\..\dos\dosinc
LIBS= $(LIB)\os2286.lib     $(LIB)\os2286p.lib   $(RMLIB)\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=$(RMH);$(H);$(INC)] || [set LIB=$(LIBS)] || [set PATH=$(TOOLSPATH)]
!endif
#

#
# Compiler/tools Macros
#

ASM=masm
LINK=link
LOPTS=/nod /nop /map /exepack /packcode /packdata /far

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

WARNFILT = | sed -e /C4001/d

#
# Compiler and Linker Options
#

!ifndef smp
AFLAGS= -Mx -t $(LIST)
!else
AFLAGS= -Mx -t $(LIST) -DSMP
!endif

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

OBJSa=  data.obj strat.obj ioset.obj ioget.obj emi.obj
OBJSb=  mon.obj idc.obj abs.obj vdm.obj
OBJSc=  util1.obj util2.obj mem.obj move.obj
OBJSd=  pdi.obj serial.obj inport.obj bus.obj init.obj
OBJS=   $(OBJSa) $(OBJSb) $(OBJSc) $(OBJSd)
OBJSe=  mserm.obj

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

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

.asm.obj:
        $(ASM) $(AFLAGS) $(AINC) $*.asm $*.obj;
.asm.lst:
        $(ASM) $(AFLAGS) -l -c $(AINC) $*.asm $*.obj;




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

mouse.s$(LANG): $(OBJS) $(OBJSe) $(LIBS) mouse.l$(LANG) mouse.def
        $(LINK) $(LOPTS) @mouse.l$(LANG)
        mapsym mouse

#
# The following create the linker list file, MOUSE.l$(LANG), and the
# MOUSE.DEF file, dynamically when the MAKEFILE changes.
#

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

mouse.l$(LANG): makefile
        @echo $(OBJSa)+                           >  mouse.l$(LANG)
        @echo $(OBJSb)+                           >> mouse.l$(LANG)
        @echo $(OBJSc)+                           >> mouse.l$(LANG)
        @echo $(OBJSd)+                           >> mouse.l$(LANG)
        @echo $(OBJSe)                            >> mouse.l$(LANG)
        @echo mouse.s$(LANG)                      >> mouse.l$(LANG)
        @echo mouse.map $(LFLAGS)                 >> mouse.l$(LANG)
        @echo $(LIBS)                             >> mouse.l$(LANG)
        @echo mouse.def                           >> mouse.l$(LANG)

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