#/*
#*   Licensed Material -- Property of IBM
#*
#*   (c) Copyright IBM Corp. 1998    All Rights Reserved
#*/
#/***********************************************************************/
#/*                                                                     */
#/* Driver Name: USBAUDIO.SYS                                           */
#/*                                                                     */
#/* Source File Name: MAKEFILE                                          */
#/*                                                                     */
#/* Descriptive Name: MAKEFILE for the USB device driver.               */
#/*                                                                     */
#/* Function:                                                           */
#/*                                                                     */
#/*---------------------------------------------------------------------*/
#/*                                                                     */
#/* Copyright (C) 1998      IBM Corporation                             */
#/*                                                                     */
#/* DISCLAIMER OF WARRANTIES.  The following [enclosed] code 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. IBM shall not be liable      */
#/* for any damages arising out of your use of this code, even if       */
#/* they have been advised of the possibility of such damages.          */
#/*                                                                     */
#/*---------------------------------------------------------------------*/
#/*                                                                     */
#/* Change Log                                                          */
#/*                                                                     */
#/* Mark    Date      Programmer                Comment                 */
#/* ----    ----      ----------                -------                 */
#/*        10/26/98  Vjacheslav Chibis         Original developer       */
#/*                                                                     */
#/*                                                                     */
#/***********************************************************************/

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

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

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

#
# Conditional Setup Area and User Defined Macros
#

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

DOSINC = ..\..\..\dos\dosinc
INIT   = ..\..\..\dos\init
TASK   = ..\..\..\dos\task
INC    = ..\..\..\..\inc
H      = ..\..\..\..\h
USBH   = ..\include
LIB    = ..\..\..\..\lib
TOOLSPATH = ..\..\..\..\tools
DISKH  = ..\..\dasd\diskh
RMH    = ..\..\resource\rsm_h
DHLIB  = ..\..\dasd\devhelp
RMLIB  = ..\..\resource\rmcalls
USBLIB  = ..\misc

#
# 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=$(DOSINC);$(INIT);$(TASK);$(INC);$(RMH)] || \
   [set LIB=$(LIB);$(DHLIB)] || [set PATH=$(TOOLSPATH);$(DK_TOOLS)]
!endif


#
# Compiler/tools Macros
#

AS=masm
CC=cl
IMPLIB=implib
LINK=link
MAPSYM=mapsym

#
# Compiler and Linker Options
#


AFLAGS = -MX -T -Z -T -DCONVERTER $(ENV)
AINC   = -I. -I$(DOSINC) -I$(INIT) -I$(TASK) -I$(INC)
CINC   = -I$(H) -I$(USBH) -I$(DISKH) -I$(MAKEDIR)

# environment variable RELEASE is used to switch between release and debug builds.
# use SET DEBUG=1 to build release version of module.
!ifdef DEBUG
CFLAGS = /c /Zp /Zl /G2s /Answ /W3 /Fc /nologo /Osegli /DDEBUG /DCONVERTER
!else
CFLAGS = /c /Zp /Zl /G2s /Answ /W3 /Fc /nologo /Osegli /DCONVERTER
!endif

LFLAGS= /B /map
RFLAGS = -r

LIBS  =  $(USBLIB)\usbmisc.lib $(DHLIB)\dhcalls.lib $(RMLIB)\rmcalls.lib $(LIB)\slibcep.lib
DEF   = usbaudio.def

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

#
#       OBJ Files
#
OBJ1 =  startup.obj \
        audiodat.obj\
        audiocom.obj\
        mmddcmds.obj\
        audintr.obj \
        audsubs.obj \
        cdevhlp.obj \
        audiodd.obj \
        rmhelp.obj       

OBJS = $(OBJ1)


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


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

.asm.mbj:
        $(AS) $(AFLAGS) -DMMIOPH $(AINC) $*.asm $*.mbj;

.asm.lst:
        $(AS) -l -n $(AFLAGS) $(AINC) $*.asm;

.c.obj:
        $(CC) $(CFLAGS) $(CINC) $*.c

.c.lst:
        $(CC) $(CFLAGS) /Fc $(CINC) $*.c
        copy $*.cod $*.lst
        del $*.cod


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

!include      "$(H)\version.mak"

#
# Should be the default tag for all general processing
#

all:    usbaudio.sys

clean:
        if exist *.lnk  del *.lnk
        if exist *.obj  del *.obj
        if exist *.mbj  del *.mbj
        if exist *.map  del *.map
        if exist *.old  del *.old
        if exist *.lst  del *.lst
        if exist *.lsd  del *.lsd
        if exist *.sym  del *.sym
        if exist *.sys  del *.sys
        if exist *.dmd  del *.dmd
        if exist *.tff  del *.tff

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

usbaudio.sys:  $(OBJS) $(LIBS)  makefile
        Rem Create DEF file <<$(DEF)
LIBRARY USBAUDIO
DESCRIPTION '$(FILEVER)  OS/2 USB Audio Device Driver'
PROTMODE

CODE PRELOAD 
DATA PRELOAD

<<keep
        $(LINK) $(LFLAGS) @<<$(@B).lnk
$(OBJ1) 
$*.sys
$*.map
$(LIBS)
$(DEF)
<<keep
             $(MAPSYM) $*.map

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