# Copyright (c) 1994, Microsoft Corporation, all rights reserved
#
# makefile
# Remote Access external APIs
# Windows NT WOS 16->32 thunks, 16-bit side
#
# 04/02/94 Steve Cobb (adapted from WFWNET makefile)

!INCLUDE ..\makefile.inc


# W0 used because the CallProc32W prototype causes scads of warnings
# in normal use.  CallProcEx32W should solve this, when available.
#
DEFINES = $(DEFINES) -DBUILDDLL
INCLUDES=.;..\inc;$(SDK_INC_PATH)
INCS = -I. -I..\inc
CW16 = -Alfu -G2s -W0 $(DEFINES)
LINKOPTS = /map /align:16 /nod

!if !$(FREEBUILD)
CW16 = $(CW16) /Od /Oi /Zd
LINKOPTS = $(LINKOPTS) /LI
!endif


.c.obj:
    set include=$(INCLUDES)
    $(CL) -c -nologo $(CW16) $*.c

.c.lst:
    set include=$(INCLUDES)
    $(CL) -c -nologo $(CW16) -Fonul -Fc$*.lst $*.c

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


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


all: $(DEST)\rasapi16.dll $(DEST)\rasapi16.sym
    -binplace -o $(ALT_PROJECT_TARGET) $(DEST)\rasapi16.dll $(DEST)\rasapi16.map $(DEST)\rasapi16.sym

clean: cleanup all

cleanup:
    cd $(DEST)
    if exist *.lrf del *.lrf
    if exist *.obj del *.obj
    if exist *.dll del *.dll
    if exist *.map del *.map
    if exist *.sym del *.sym
    if exist *.res del *.res
    cd ..\..\..

$(DEST)\rasapi16.obj: .\ras.h .\raserror.h ..\inc\windows.h
    set include=$(INCLUDES)
    $(CL) -c -Fo$* -nologo $(CW16) $(*F).c

$(DEST)\rasapi16.lrf: makefile.sub
    echo $(DEST)\rasapi16.obj+ >> $@
    echo ..\lib\libentry.obj >> $@
    echo $(DEST)\rasapi16.dll >> $@
    echo $(DEST)\rasapi16.map >> $@
    echo ..\lib\$(ALT_PROJECT)\libw.lib+ >> $@
    echo ..\lib\ldllcew.lib >> $@
    echo rasapi16.def >> $@

$(DEST)\rasapi16.res: $(*F).rc ..\inc\common.ver ..\inc\version.h ..\inc\ver.h
    $(RC) $(INCS) -r -fo$*.res $(*F).rc

$(DEST)\rasapi16.dll: $*.obj $(DEST)\rasapi16.res $(DEST)\rasapi16.lrf
$(DEST)\rasapi16.dll: ..\lib\libentry.obj ..\lib\$(ALT_PROJECT)\libw.lib
    $(LINK) $(LINKOPTS) @$*.lrf;
    $(RC) -t $*.res $*.dll