# **************************************************************************
# *
# * Make file for AUDIODD - IBM C language OS/2 audio device driver
# *
# *  Generates:
# *       audiodd.sys
# *
# **************************************************************************

#
# Set the environmental variables for compiling
#
!if  [SET LIB=..\..\lib;..\..\..\..\lib;%LIB%]								|| \
     [SET INCLUDE=..\..\h;..\..\..\..\h;..\..\inc;..\..\..\..\inc;%INCLUDE%]
!endif

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

NAMESYS   = audiodd

#
# Definitions for assembler
# ML == Microsoft MASM 6.0
#
ASM=ML
AFLAGS=-c -Cx -Sn -Fl

#
# Definitions for C compiler
#
CCOMP=cl
CFLAGS= /c /Zp /Zl /G2s /Asnw /W3 /O
C_LST=/Fl

#
# Definitions for linker
#
LINK=link
LFLAGS= /B
LIBS286=DOSCALLS+SLIBC7P+os2286


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

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

#
# Object file list
# AudioDD.obj must be last object file listed so
# PDD Init code can be droped from code and data segments.
#
SYSOBJS=startup.obj     \
        audiodat.obj    \
        mmddcmds.obj    \
        audintr.obj     \
        audsubs.obj     \
        cdevhlp.obj     \
        audiovdm.obj    \
        audiodd.obj

#
# Target descriptions
#

all:sys

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

sys: $(NAMESYS).sys

$(NAMESYS).sys:     $(SYSOBJS) 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
$(SYSOBJS)
$(NAMESYS).sys
$(NAMESYS).map /map /nod
$(LIBS286)
$(NAMESYS).def;
<<keep
