#
# This is the MIDL compile phase of the build process.
#
# The following is where you put the name of your .idl file without
# the .idl extension:
#

!INCLUDE $(NTMAKEENV)\makefile.plt

IDL_NAME  = afpsvc
IMPORT    = import

SDKINC = $(BASEDIR)\public\sdk\inc
SDKCRTINC = $(BASEDIR)\public\sdk\inc\crt
INCS  = -I$(SDKINC)  -I$(SDKCRTINC) -I..\h

CPP = -cpp_cmd "$(MIDL_CPP)" -cpp_opt "-E $(MIDL_FLAGS) $(INCS) $(C_DEFINES)"

TARGETS =   client\$(IDL_NAME)_c.c  \
            client\$(IDL_NAME)_x.c  \
            server\$(IDL_NAME)_y.c  \
            server\$(IDL_NAME)_s.c  \
            client\$(IMPORT)_x.c    \
            server\$(IMPORT)_y.c    \
            .\$(IDL_NAME).h

EXTRN_DEPENDS = .\..\h\macfile.h \
		$(IDL_NAME).acf

#
# Define Products and Dependencies
#

all:    $(TARGETS) $(EXTRN_DEPENDS)
!IF "$(BUILDMSG)" != ""
    @ech ; $(BUILDMSG) ;
!ENDIF

clean: delete_source all

delete_source:
    erase $(TARGETS)

#
# MIDL COMPILE
#

$(TARGETS) : $(IDL_NAME).idl $(EXTRN_DEPENDS)
    midl -oldnames -error ref -mode c_port $(CPP) -import used_multiple $(IDL_NAME).idl $(INCS)
    IF EXIST $(IDL_NAME)_c.c copy $(IDL_NAME)_c.c .\client & del  $(IDL_NAME)_c.c
    IF EXIST $(IDL_NAME)_s.c copy $(IDL_NAME)_s.c .\server & del  $(IDL_NAME)_s.c
    IF EXIST $(IDL_NAME)_x.c copy $(IDL_NAME)_x.c .\client & del  $(IDL_NAME)_x.c
    IF EXIST $(IDL_NAME)_y.c copy $(IDL_NAME)_y.c .\server & del  $(IDL_NAME)_y.c
    IF EXIST $(IMPORT)_x.c copy $(IMPORT)_x.c .\client & del  $(IMPORT)_x.c
    IF EXIST $(IMPORT)_y.c copy $(IMPORT)_y.c .\server & del  $(IMPORT)_y.c
