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

INCS  = -I..\runtime\mtrt\nt -I..\runtime\mtrt

COMMON_MIDL = \
     .\nsicom.h

SERVER_MIDL = \
     server\nsisvr_s.c  \
     client\nsisvr_c.c  \
     .\nsisvr.h

CLIENT_MIDL = \
     server\nsiclt_s.c  \
     client\nsiclt_c.c  \
     .\nsiclt.h

MGMT_MIDL = \
     server\nsimgm_s.c  \
     client\nsimgm_c.c  \
     .\nsimgm.h

LOCTOLOC_MIDL = \
     server\locloc_s.c \
     server\locloc_c.c \
     .\loctoloc.h

TARGETS = nsicom.h nsisvr.h nsiclt.h nsimgm.h loctoloc.h

RPC_FLAGS = -mode c_port -error allocation -oldnames -error ref

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


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

clean: delete_source all

delete_source:
    -erase  $(CLIENT_MIDL) $(COMMON_MIDL) $(MGMT_MIDL) \
            $(LOCTOLOC_MIDL) $(SERVER_MIDL)

#
# MIDL COMPILE
#


nsiclt.h : nsiclt.idl
    midl $(CPP) $(INCS) $(RPC_FLAGS) nsiclt.idl \
    -cstub client\nsiclt_c.c \
    -sstub server\nsiclt_s.c 

nsisvr.h : nsisvr.idl
    midl $(CPP) $(INCS) $(RPC_FLAGS) nsisvr.idl \
    -cstub client\nsisvr_c.c \
    -sstub server\nsisvr_s.c 

nsimgm.h : nsimgm.idl
    midl $(CPP) $(INCS) $(RPC_FLAGS) nsimgm.idl \
    -cstub client\nsimgm_c.c \
    -sstub server\nsimgm_s.c 

nsicom.h : nsicom.idl
    midl $(CPP) $(INCS) $(RPC_FLAGS) -client none -server none \
    nsicom.idl

loctoloc.h: loctoloc.idl
    midl $(CPP) $(INCS) $(RPC_FLAGS) loctoloc.idl \
    -cstub server\locloc_c.c -sstub server\locloc_s.c \
    -prefix client CLIENT_
