#
# This is the MIDL compile phase of the build process.
#
# The following symbols should be defined in your environment:
#   BASEDIR   -  Used to indicate where the start of the nt tree is.
#                  ie. this could be set to d:\nt  or c:\ntrel
#

# The following is where you put the name of your .idl file without
# the .idl extension:

IDL_NAME  = srvsvc
IMPORT    = import

#
#

!IFNDEF BASEDIR
BASEDIR=\nt
!ENDIF

SDKINC = $(BASEDIR)\public\sdk\inc
SDKCRTINC = $(BASEDIR)\public\sdk\inc\crt
FLAGS = -Di386
INCS  = -I$(SDKINC)  -I$(SDKCRTINC)

!IF "$(NTVERSION)" == "1.0"
CPP= -cpp_cmd "cl386" -cpp_opt "-E $(FLAGS) $(INCS)"
!ELSE
CPP =
!ENDIF

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    \
            client\$(IMPORT)_y.c    \
            .\$(IDL_NAME).h

EXTRN_DEPENDS = $(SDKINC)\lmcons.h   \
                $(SDKINC)\windef.h   \
                $(SDKINC)\lmchdev.h  \
                $(SDKINC)\lmshare.h  \
                $(SDKINC)\lmserver.h \
                $(SDKINC)\lmstats.h  \
                $(IDL_NAME).acf

!IFNDEF MIPS
MIPS=0
!ENDIF

!IF $(MIPS)
FLAGS = -DMIPS
!ELSE
FLAGS = -Di386
!ENDIF

!IFDEF _JAZZIDW
_JAZZIDW=1
!ELSE
_JAZZIDW=0
!ENDIF

!IF "$(NTVERSION)" == "1.0"
!IF $(_JAZZIDW)
CPP = -cpp_cmd "cc" -cpp_opt "-E $(FLAGS) $(INCS)"
!ELSE
CPP = -cpp_cmd "cl386" -cpp_opt "-E $(FLAGS) $(INCS)"
!ENDIF
!ELSE
CPP =
!ENDIF

#
# 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 $(CPP) $(FLAGS) -import ms_nt $(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



