# mciole16     makefile
#
# Copyright (c) 1991, Microsoft Corporation
#
# History:
#   Created
#       06-May-1993 Stephen Estrop (StephenE)
#       24-Jan-1994 Lee Hart (LeeHart) - Added Version Resources
#

# work around stupid bug in RC 3.1 that doesn't allow rcpp.err to be
# in a directory that is greater than 128 chars down the path, even if
# rc 3.1 is running as an OS/2 app.

PATH    = ..\..\tools16;$(PATH)

INCS    = -I. -I..\inc -I..\..\inc
DEFINES = -DWOW $(MVDMFLAGS)
AOBJ    = -Mx -t -D?QUIET $(DEFINES) $(INCS)
CW16    = -AS -G2sw -Os -W3 -Zp $(DEFINES) $(INCS)
CW16B   = $(CW16) -B1 c1l.exe -B2 c2l.exe -B3 c3l.exe
LPATH   = ..\..\tools.os2
LINK    = /map /nod
W16LIBS = ..\lib\libw.lib ..\lib\snocrt.lib olecli.lib

!if "$(NTDEBUG)"!="" && "$(NTDEBUG)"!="retail"
!if "$(NTDEBUGTYPE)"=="windbg"
AOBJ    = $(AOBJ) -Zi
CW16    = $(CW16) /Od /Oi /Zi
LINK    = $(LINK) /CO
!else
AOBJ    = $(AOBJ) -Zd
CW16    = $(CW16) /Od /Oi /Zd
LINK    = $(LINK) /LI
!endif
!endif

.SUFFIXES:
.SUFFIXES: .c .asm .h .inc .obj .lst .sys .exe .com .map .sym .def .lib .res .rc

.asm.obj:
    masm $(AOBJ) $*;

.asm.lst:
    masm $(AOBJ) -l $*,nul,$*.lst;

.c.obj:
    cl16 -c -nologo $(CW16) $*.c

.c.lst:
    cl16 -c -nologo $(CW16) -Fonul -Fc$*.lst $*.c

.def.lib:
    implib $*.lib $*.def

.rc.res:
     $(RESCOMP) -r -fo $@ $(INCS) $*.rc


OBJ1= libinit.obj mciole.obj


!IFDEF NTVDM_BASED_BUILD
LINKER=link16
RESCOMP=rc16
!ELSE
LINKER=$(LPATH)\link
RESCOMP=$(LPATH)\rc
!ENDIF

mciole16.dll: $(OBJ1) mciole16.res
        $(LINKER) $(LINK) @<<
$(OBJ1)
mciole16.dll
mciole16.map
$(W16LIBS)
mciole.def
<<
        $(RESCOMP) -t mciole16.res mciole16.dll
        mapsym mciole16.map
        -binplace mciole16.dll
        -binplace mciole16.sym

mciole16.res: $*.rc $*.rcv ..\inc\common.ver

clean:
    if exist *.lrf del *.lrf
    if exist *.obj del *.obj
    if exist *.exe del *.exe
    if exist *.dll del *.dll
    if exist *.map del *.map
    if exist *.sym del *.sym
    if exist *.res del *.res
