#******************************************************************************
#                 IBM Sample Audio Physical Device Driver
#                       Copyright IBM Corp 1993.
#
# DISCLAIMER OF WARRANTIES.  The following [enclosed] code is
# sample code created by IBM Corporation and Media Vision Corporation.
# It 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.
# The authoring companies 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.
#
#******************************************************************************
#
# makefile - produce MVPRODD.sys
#
# OS/2-MMPM/2 Physical Device Driver for Media Vision
# Pro Audio Spectrum 16 (PAS-16) audio adapter.
#
# Build procedure:
#    "nmake" - no parms
#
#******************************************************************************

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

NAMESYS   = mvprodd


# Based on optional definition of some environment
# variables.  To turn on, "set varname=1" before nmake
#DDKTEAM GK Removed MVMIXA.OBJ from the object list
#DDKTEAM GK Added MVMIX.OBJ   to the mixer objects

!ifdef DEBUG
ASM_DEBUG=-Zi
ASM_LST=-Fl
C_DEBUG=/Zi
C_LST= /Fc$(<B).cod
LNK_DEBUG=/CO
!endif

!ifdef PAS16PTRACE
ASM_PTRACE=-DPTRACE
C_PTRACE=/DPTRACE
!endif

!ifdef PAS16RAS
ASM_MMRAS=-DMMRAS
C_MMRAS=/DMMRAS
!endif


# Definitions for assembler
# Microsoft MASM 6.0

ASM=ML
AFLAGS=-c -Cx -Sn -Fl


# Definitions for C compiler
# Microsoft C version 6.0 (16-bit)

CCOMP=cl
CFLAGS= /c /Zp /Zl /G2s /Asnw /W3 /O \
        /Fc /D LINT_ARGS $(C_DEBUG) $(C_PTRACE) $(C_MMRAS) $(C_LST) /I.

# Definitions for 16-bit linker

LINK=link
LFLAGS= $(LNK_DEBUG) /B /NOE
LIBS286=DOSCALLS+os2286+rmcalls.lib

# Inference rules

.c.obj:
     $(CCOMP) $(CFLAGS) /Fo$(<B).obj $(C_LST) $(<B).c

.asm.obj:
     $(ASM) $(AFLAGS) $(ASM_LST) $(<B).asm


# Object file list
# MvProDD.obj must be last object file listed so
# PDD Init code can be droped from code and data segments.

BASEOBJS=startup.obj  \
        audiodat.obj  \
        mmddcmds.obj  \
        audiovdm.obj  \
        audintr.obj   \
        audsubs.obj   \
        globals.obj   \
        cdevhlp.obj   \
        rmhelp.obj

MATHOBJS=annalmul.obj \
         annaldiv.obj \
         anldiv.obj   \
         anlmul.obj

OPL3OBJS=fmmain.obj   \
         adlib.obj    \
         do.obj       \
         patcher.obj  \
         namer.obj    \
         assign2.obj  \
         outchip.obj  \
         midia.obj    \
         fmparse.obj

MIXEROBJS=mvmixer.obj \
          mvmix.obj  \
          mixsubs.obj \
          commdbg.obj \
          mvsound.obj \
          mixinitc.obj

LASTOBJS= mvprodd.obj \
          findpas.obj \
          inita.obj   \
          initc.obj   \
          endsegs.obj


# Target descriptions

all:sys

##################################
# audiodd.sys Target descriptions
##################################

sys: $(NAMESYS).sys

$(NAMESYS).sys: $(BASEOBJS) $(OPL3OBJS) $(MATHOBJS) $(MIXEROBJS) $(LASTOBJS) \
                   makefile $(NAMESYS).lrf $(NAMESYS).def
                $(LINK) $(LFLAGS) @$(NAMESYS).lrf
                mapsym $(NAMESYS)

$(NAMESYS).def: makefile
        @echo Creating file <<$(@B).def
LIBRARY $(NAMESYS)
PROTMODE
CODE    PRELOAD
DATA    PRELOAD
<<keep

$(NAMESYS).lrf:  makefile
        @echo Creating file <<$(@B).lrf
$(BASEOBJS)+
$(OPL3OBJS)+
$(MATHOBJS)+
$(MIXEROBJS)+
$(LASTOBJS)
$(NAMESYS).sys
$(NAMESYS).map /map /nod
$(LIBS286)
$(NAMESYS).def;
<<keep

###################################
# START Dependencies

# C files
2op_cdrm.obj    : makefile *.h
4_cmp_p.obj     : makefile *.h
adlib.obj       : makefile *.h
assign2.obj     : makefile *.h
audintr.obj     : makefile *.h
audiodat.obj    : makefile *.h
audiovdm.obj    : makefile *.h
audsubs.obj     : makefile *.h
cmp_drum.obj    : makefile *.h
commdbg.obj     : makefile *.h
do.obj          : makefile *.h
findpas.obj     : makefile *.h
fmmain.obj      : makefile *.h
fmparse.obj     : makefile *.h
globals.obj     : makefile *.h
initc.obj       : makefile *.h
mixinitc.obj    : makefile *.h
mixsubs.obj     : makefile *.h
mmddcmds.obj    : makefile *.h
mvmix.obj       : makefile *.h
mvmixer.obj     : makefile *.h
mvprodd.obj     : makefile *.h
namedat.obj     : makefile *.h
namer.obj       : makefile *.h
outchip.obj     : makefile *.h
parse.obj       : makefile *.h
patcher.obj     : makefile *.h
rmhelp.obj      : makefile *.h

# Assembler files
anldiv.obj      : makefile *.inc *.mac
anlmul.obj      : makefile *.inc *.mac
annaldiv.obj    : makefile *.inc *.mac
annalmul.obj    : makefile *.inc *.mac
cdevhlp.obj     : makefile *.inc *.mac
endsegs.obj     : makefile *.inc *.mac
inita.obj       : makefile *.inc *.mac
midia.obj       : makefile *.inc *.mac
mvmixa.obj      : makefile *.inc *.mac
mvsound.obj     : makefile *.inc *.mac
startup.obj     : makefile *.inc *.mac
