#
# 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  = winspl
IMPORT    = import

UNICODE=1

SDKBIN = $(BASEDIR)\public\sdk\bin
SDKINC = $(BASEDIR)\public\sdk\inc
OAKINC = $(BASEDIR)\public\oak\inc
SDKCRTINC = $(BASEDIR)\public\sdk\inc\crt
INCS  = -I. -I$(SDKINC)  -I$(SDKCRTINC) -I$(OAKINC)

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

TARGETS =   client\$(IDL_NAME)_c.c  \
            server\$(IDL_NAME)_s.c  \
            $(IDL_NAME).h           \
            win32\$(IDL_NAME)_c.c

EXTRN_DEPENDS = $(SDKINC)\lmcons.h   \
                $(SDKINC)\windef.h   \
                $(SDKINC)\lmchdev.h  \
                $(SDKINC)\lmshare.h  \
                $(SDKINC)\lmserver.h \
                $(SDKINC)\lmstats.h \
                $(SDKINC)\winspool.h \
                $(IMPORT).h

#
# 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 allocation -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 &  \
        copy $(IDL_NAME)_c.c .\win32 & \
        copy $(IDL_NAME)_c.c .\dll & del  $(IDL_NAME)_c.c
    IF EXIST $(IDL_NAME)_s.c copy $(IDL_NAME)_s.c .\server & \
        del  $(IDL_NAME)_s.c

