# SCCSID = @(#)makefile 6.8 91/10/13
#******************************************************************************
#  Makefile for the dddd directory
#
#       SCCSID = @(#)makefile   6.8 91/10/13
#
#       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)
#******************************************************************************


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


#
# Conditional Setup Area and User Defines Macros
#


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

!IFNDEF MRI
MRI     = mri
!ENDIF
MRIPATH = ..\..\..\..\$(MRI)\TOUCH
TARGET1 = pditou01.sys
TARGET2 = pditou02.sys
TARGET3 = tdd.msg
TARGET4 = tddh.msg
LIBS    = os2286 llibcdll

H=..\..\..\..\h
INC=..\..\..\..\inc
LIB=..\..\..\..\lib
TOOLSPATH=..\..\..\..\tools
cc=cl
CC=CL

AINC    = ..\TOUCHINC                           # asm include path
CINC    = ..\TOUCHH                             # C include path
ADEP    = $(INC)\*.inc $(AINC)\*.inc            # masm dependencies

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

#
# Compiler/tools Macros
#


#
# Compiler and Linker Options
#

!ifndef smp
# masm flags
AFLAGS  = /Mx /S /I$(AINC) /I$(INC) /I. /w2 /t
!else
# masm flags
AFLAGS  = /Mx /S /I$(AINC) /I$(INC) /I. /w2 /t -DSMP
!endif

CFLAGS  = -Alfw -W3 -G2s -Zlp -Oid -nologo -c -DINCL_16 -I$(CINC)

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

OBJS1   = segdef.obj toumain.obj touioctl.obj toufam1.obj toumou.obj pinifile.obj
OBJS2   = segdef.obj toumain.obj touioctl.obj touabios.obj toumoua.obj pinifile.obj



#******************************************************************************
#   Setup the inference rules for compiling and assembling source code to
#   object code.
#******************************************************************************
#******************************************************************************
#   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:    $(TARGET1) $(TARGET2) $(TARGET3) $(TARGET4)

$(TARGET1): $(OBJS1) makefile
        link /m /noe /nod /noi /nol $(OBJS1:.obj=),$@,,$(LIBS),<<$(*).def ;
;
; $(*).def - Touch display DDDD (FAMILY/1), link definition file
;

LIBRARY $(*)

DESCRIPTION '8516 Touch Display Device Dependant Driver (FAMILY/1)'

PROTMODE

CODE PRELOAD
DATA PRELOAD

SEGMENTS
        DSEG            CLASS 'DATA'    IOPL
        _DATA           CLASS 'DATA'    IOPL
        CONST           CLASS 'CONST'   IOPL
        _BSS            CLASS 'BSS'     IOPL
;       c_common        CLASS 'BSS'     IOPL

        CSEG            CLASS 'CODE'    IOPL
        PINIFILE_TEXT   CLASS 'CODE'    IOPL
        _TEXT           CLASS 'CODE'    IOPL
        C_ETEXT         CLASS 'ENDCODE' IOPL
        _MSGSEG         CLASS 'CODE'    IOPL    ; see comment below

        IMPORTS
           DOSIODELAYCNT = DOSCALLS.427

;end
<<KEEP
        mapsym $* >nul

$(TARGET2): $(OBJS2) makefile
        link /m /noe /nod /noi /nol $(OBJS2:.obj=),$@,,$(LIBS),<<$(*).def ;
;
; $(*).def - Touch display DDDD (ABIOS), link definition file
;

LIBRARY $(*)

DESCRIPTION '8516 Touch Display Device Dependant Driver (ABIOS)'

PROTMODE

CODE PRELOAD
DATA PRELOAD


; The segment ordering here must match the seg order as defined in segdef.asm
; All grouped segments must have the same attributes (ie. IOPL)

SEGMENTS
        DSEG            CLASS 'DATA'    IOPL
        _DATA           CLASS 'DATA'    IOPL
        CONST           CLASS 'CONST'   IOPL
        _BSS            CLASS 'BSS'     IOPL
;       c_common        CLASS 'BSS'     IOPL

        CSEG            CLASS 'CODE'    IOPL
        PINIFILE_TEXT   CLASS 'CODE'    IOPL
        _TEXT           CLASS 'CODE'    IOPL
        C_ETEXT         CLASS 'ENDCODE' IOPL
        _MSGSEG         CLASS 'CODE'    IOPL    ; fix result of PTR pb723833
                                                ; Moves msgseg into default
                                                ; codeseg and causes IOPL
                                                ; attribute conflict.
        IMPORTS
           DOSIODELAYCNT = DOSCALLS.427

;end
<<KEEP
        mapsym $* >nul

CLEAN:
        -del *.map
        -del *.bak
        -del *.lst
        -del *.sym
        -del *.sys
        -del *.obj


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

tdd.msg: $(MRIPATH)\$$(@B).txt
        mkmsgf $(MRIPATH)\$*.txt $*.msg
        copy $*.msg $(MRIPATH)\. > nul
        -erase $*.msg

tddh.msg: $(MRIPATH)\$$(@B).txt
        mkmsgf $(MRIPATH)\$*.txt $*.msg
        copy $*.msg $(MRIPATH)\. > nul
        -erase $*.msg

segdef.obj: $(ADEP) $$(@B).asm

toumain.obj: $(ADEP) $$(@B).asm dmc.asm

touioctl.obj: $(ADEP) $$(@B).asm

toufam1.obj: $(ADEP) $$(@B).asm

toumou.obj: $(ADEP) $$(@B).asm

touabios.obj: $(ADEP) $$(@B).asm

toumoua.obj: $(ADEP) $$(@B).asm

pinifile.obj: pinifile.c
        $(CC) $(CFLAGS) pinifile.c

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