# -*-makefile-*-  Makefile mode for Emacs

# include $(NTMAKEENV)/makefile.plt
#
# If BUILDMSG is not defined, the define it as the empty string to make
# the conditionals easier to write.
#

ifndef MAKE_VERBOSE
MAKE_VERBOSE=false      # for make.noise
endif
ifndef FIRST_PASS
ifndef SECOND_PASS
FIRST_PASS = TRUE
SECOND_PASS = TRUE
endif
endif

include ${MWHOME}/make.noise
include ${MWHOME}/mw.defines
include ${MWHOME}/mw.defines-clearcase

# Disable clearmake dependenc generation
.NO_CMP_NON_MF_DEPS: all

# Disable clearcase parallele makefiles.
.NOTPARALLEL:

ifndef BUILDMSG
BUILDMSG=
endif

ifndef NO_STRICT
STRICT=1
endif

#ifndef USERX_HOME
#define USERX_HOME /vobs/build/userx
#endif

SDK_INC_PATH=${USERX_HOME}/public/sdk/inc
SDK_LIB_PATH=${USERX_HOME}/public/sdk/lib/${MWARCH}
SAG_INC_PATH=${USERX_HOME}/public/sag/inc

###########################################################################
#
# The files lists in this section were adapted from (copied?) from the "sources" file
# used by NT build.
#

ifeq "${COMPILE_OPTION}" ""
COMPILE_OPTION=debug
endif

TARGETPATH  = obj
O           = ${TARGETPATH}/unix/${MWOS}
HERE_FROM_O = ../../..

THIS = GNUmakefile

CHECKED_ALT_DIR=1
NO_BROWSER_FILE=1
SYNCHRONIZE_BLOCK=1

WIN_INC_PATH=${USERX_HOME}/private/windows/inc

PASS0_SOURCEDIR = ../proxy/${O}
MIDL_UUIDDIR    = ../uuid/${O}

# Special files
# These are hacks.
# When we put back mimeole.idl and mimeole.h into circulation, remove this hack
# For eg. msoeapi.idl requires mimeole.idl, but since we don't compile mimeole.idl
# we have the ctrl-m characters.
#

# needs to run on Win95 and NT 3.51
MIDL_OPTIMIZATION=$(MIDL_OPTIMIZATION) -Oic

C_DEFINES       = -DWIN32=300 -D_CAIRO_=300 -DREGISTER_PROXY_DLL

#ifndef FREEBUILD
#  MKTYPLIB_FLAGS  = $(MKTYPLIB_FLAGS) -DDEBUG
#  C_DEFINES       = $(C_DEFINES) -DDEBUG
#endif

MKTYPLIB_FLAGS  = $(MKTYPLIB_FLAGS) /OLD -DWINNT -h $*.h

# HOW TO ADD A FILE:
#
# You should simply add your files to the lists below according
# to these instructions.  In most cases, you should not need to
# add anything to makefile.inc.  The inference rules there cover
# almost everything but the hole in the ozone layer.
#
# IDL FILES
#
#  To add foo.idl to the build (as an example):
#
#  1) add foo.idl to the SOURCES list.  This will create foo.tlb and obj\foo.h.
#
#  2) copy foo.idl, foo.tlb, and foo.h to their proper directories so external
#     projects can use them.  Here's how:
#
#        a) foo.idl: add $(SDK_INC_PATH)\foo.idl to the NTTARGETFILE0 list.
#           This will copy the idl file to \nt\public\sdk\inc before it is
#           built.
#
#        b) foo.tlb: add $(SDK_LIB_PATH)\foo.tlb to the NTTARGETFILES list.
#           This will copy the type library to \nt\public\sdk\lib\*.
#
#        a) foo.h: add $(SDK_INC_PATH)\foo.h or $(WIN_INC_PATH)\foo.h (depending
#           on where you want the header file propagated) to the NTTARGETFILES
#           list.  This will copy the header file to \nt\public\sdk\inc
#           or \nt\private\windows\inc, so other projects can #include it.
#
#  3) Optional: to add your object library to ACTXPRXY.DLL, add entries
#     to ..\proxy\sources and ..\proxy\dlldatax.c.
#
#  4) Optional: to add your GUIDs to UUID.LIB, add an entry to
#     ..\uuid\makefile.inc.
#
#

#
# To build files inside iedev\inc, add them to the SOURCES list.
# For example, given foo.idl, the results will be:
#
#       iedev\inc\foo.tlb
#       iedev\inc\obj\foo.h
#

# (Notice this is in alphabetical order.  Hint. Hint.)

# I don't know where this is done for win32 (davidd)
 
UNIXSOURCES = \
    propbag2.idl

SOURCES= \
    ${UNIXSOURCES} \
    activaut.idl    \
    activdbg.idl    \
    activscp.idl    \
    callback.idl    \
    comcat.idl      \
    dbgprop.idl     \
    dimm.idl        \
    dispex.idl      \
    disptree.idl    \
    docobj.idl      \
    dom.idl         \
    dslisten.idl    \
    dwnnot.idl      \
    emptyvc.idl     \
    exdisp.idl      \
    hliface.idl     \
    hlink.idl       \
    htiface.idl     \
    htiframe.idl    \
    htmlfilter.idl  \
    iextag.idl      \
    imgutil.idl     \
    imnact.idl      \
    imnxport.idl    \
    inetsdk.idl     \
    interned.idl    \
    mimeedit.idl    \
    mimeinfo.idl    \
    mimeole.idl     \
    mlang.idl       \
    mobsync.idl     \
    mobsyncp.idl    \
    msdatsrc.idl    \
    mshtmhst.idl    \
    mshtml.idl      \
    msieftp.idl     \
    msnotify.idl    \
    msoeapi.idl     \
    notftn.idl      \
    objsafe.idl     \
    ocmm.idl        \
    omscript.idl    \
    opsprof.idl     \
    optary.idl      \
    perhist.idl     \
    prgsnk.idl      \
    procdm.idl      \
    recalc.idl      \
    safeocx.idl     \
    sensevts.idl    \
    servprov.idl    \
    simpdata.idl    \
    subsmgr.idl     \
    syncmgr.idl     \
    urlhist.idl     \
    urlmon.idl      \
    urltrack.idl    \
    vervec.idl      \
    vrsscan.idl     \
    webcheck.idl    \
    xmldom.idl      \
    xmlparser.idl   \
    msxml.idl       \


#
#  This happens AFTER the SOURCES list is built.
#
#  To propagate files from iedev\inc or iedev\inc\obj to public\sdk or
#  windows\inc, add the destination file to NTTARGETFILES.  The inference
#  rules in makefile.inc will copy them to the right location.
#
#  Because the del command (in the clean rule) cannot handle super-long
#  lines, we have to split the list out into FILESa, FILESb, FILESc, etc.
#  Pick your bucket, it really doesn't matter which one it goes in.
#
#  If you add an additional FILES? bucket, be sure to add a line to the
#  clean rule in makefile.inc.
#


# (Notice this is in alphabetical order and by type.  Hint. Hint.)

UNIXFILES = \
    $(SDK_INC_PATH)/propbag2.h

# .h files A-L
FILESa= \
    ${UNIXFILES} \
    $(SDK_INC_PATH)/activaut.h  \
    $(SDK_INC_PATH)/activdbg.h  \
    $(SDK_INC_PATH)/activscp.h  \
    $(SDK_INC_PATH)/callback.h  \
    $(SDK_INC_PATH)/comcat.h    \
    $(SDK_INC_PATH)/cryptdlg.h  \
    $(SDK_INC_PATH)/dbgprop.h   \
    $(SDK_INC_PATH)/dimm.h      \
    $(SDK_INC_PATH)/dispex.h    \
    $(SDK_INC_PATH)/disptree.h  \
    $(SDK_INC_PATH)/docobj.h    \
    $(SDK_INC_PATH)/dslisten.h  \
    $(SDK_INC_PATH)/dwnnot.h    \
    $(SDK_INC_PATH)/emptyvc.h   \
    $(SDK_INC_PATH)/exdisp.h    \
    $(SDK_INC_PATH)/exdispid.h  \
    $(SDK_INC_PATH)/hliface.h   \
    $(SDK_INC_PATH)/hlink.h     \
    $(SDK_INC_PATH)/htiface.h   \
    $(SDK_INC_PATH)/htiframe.h  \
    $(SDK_INC_PATH)/htmlfilter.h  \
    $(SDK_INC_PATH)/iehelpid.h  \
    $(SDK_INC_PATH)/iextag.h    \
    $(SDK_INC_PATH)/imgutil.h   \
    $(SDK_INC_PATH)/imnact.h    \
    $(SDK_INC_PATH)/imnxport.h  \
    $(SDK_INC_PATH)/inetsdk.h   \
    $(SDK_INC_PATH)/interned.h  \
    $(SDK_INC_PATH)/mimeole.h  \

# .h files M-Z
FILESb= \
    $(SDK_INC_PATH)/mimeedit.h  \
    $(SDK_INC_PATH)/mimeinfo.h  \
    $(SDK_INC_PATH)/mimeole.h   \
    $(SDK_INC_PATH)/mlang.h     \
    $(SDK_INC_PATH)/mobsync.h   \
    $(SDK_INC_PATH)/mobsyncp.h  \
    $(SDK_INC_PATH)/msdatsrc.h  \
    $(SDK_INC_PATH)/mshtmhst.h  \
    $(SDK_INC_PATH)/mshtml.h    \
    $(SDK_INC_PATH)/msieftp.h   \
    $(SDK_INC_PATH)/msnotify.h  \
    $(SDK_INC_PATH)/msoeapi.h   \
    $(SDK_INC_PATH)/msxml.h     \
    $(SDK_INC_PATH)/notftn.h    \
    $(SDK_INC_PATH)/objsafe.h   \
    $(SDK_INC_PATH)/ocmm.h      \
    $(SDK_INC_PATH)/omscript.h  \
    $(SDK_INC_PATH)/opsprof.h   \
    $(SDK_INC_PATH)/optary.h    \
    $(SDK_INC_PATH)/perhist.h   \
    $(WIN_INC_PATH)/powercfp.h  \
    $(SDK_INC_PATH)/prgsnk.h    \
    $(SDK_INC_PATH)/procdm.h    \
    $(SDK_INC_PATH)/recalc.h    \
    $(SDK_INC_PATH)/safeocx.h   \
    $(SDK_INC_PATH)/scrptids.h  \
    $(SDK_INC_PATH)/sensevts.h  \
    $(SDK_INC_PATH)/servprov.h  \
    $(SDK_INC_PATH)/simpdata.h  \
    $(SDK_INC_PATH)/subsmgr.h   \
    $(SDK_INC_PATH)/syncmgr.h   \
    $(SDK_INC_PATH)/urlhist.h   \
    $(SDK_INC_PATH)/urlmon.h    \
    $(SDK_INC_PATH)/urltrack.h  \
    $(SDK_INC_PATH)/vervec.h  \
    $(SDK_INC_PATH)/vrsscan.h   \
    $(SDK_INC_PATH)/webcheck.h  \
    $(SDK_INC_PATH)/dom.h       \
    $(SDK_INC_PATH)/xmldom.h    \
    $(SDK_INC_PATH)/xmlparser.h \



# .tlb files
FILESc= \
    $(SDK_LIB_PATH)/exdisp.tlb      \
    $(SDK_LIB_PATH)/iextag.tlb      \
    $(SDK_LIB_PATH)/mshtml.tlb      \
    $(SDK_LIB_PATH)/msieftp.tlb     \
    $(SDK_LIB_PATH)/msxml.tlb       \
    $(SDK_LIB_PATH)/omscript.tlb    \
    $(SDK_LIB_PATH)/sensevts.tlb    \
    $(SDK_LIB_PATH)/subsmgr.tlb     \
    $(SDK_LIB_PATH)/webcheck.tlb    \
    $(SDK_LIB_PATH)/xmlparser.tlb   \

#  Do not add files directly to NTTARGETFILES, but in one of the
#  FILES? buckets.  Why?  See the comment block above.

NTTARGETFILES=  \
    $(FILESa) \
    $(FILESb) \
    $(FILESc) \


#
#  This happens BEFORE the SOURCES list is built.
#
#  To propagate files from iedev\inc or iedev\inc\obj to public\sdk or
#  windows\inc, add the destination file to NTTARGETFILES0.  The inference
#  rules in makefile.inc will copy them to the right location.
#
#  Because the del command (in the clean rule) cannot handle super-long
#  lines, we have to split the list out into FILES0a, FILES0b, FILES0c, etc.
#  Pick your bucket, it really doesn't matter which one it goes in.
#
#  If you add an additional FILES0? bucket, be sure to add a line to the
#  clean rule in makefile.inc.
#


# (Notice this is in alphabetical order and by type.  Hint. Hint.)

# BUGBUG : GNUmake doesn't have a good way for testing for the existence of a file.
# Since these files DON'T exist in our tree, I'm just going to comment this out for
# now -- JayF
#
# !if exist($(BASEDIR)\private\admin\services\sched\types\idl\mstask.idl)
#     $(SDK_INC_PATH)\mstask.h        \
#     $(SDK_INC_PATH)\mstask.idl      \
# !endif

# .idl files A-M
FILES0a=  \
    $(SDK_INC_PATH)/${UNIXSOURCES}  \
    $(SDK_INC_PATH)/activaut.idl    \
    $(SDK_INC_PATH)/activdbg.idl    \
    $(SDK_INC_PATH)/activscp.idl    \
    $(SDK_INC_PATH)/comcat.idl      \
    $(SDK_INC_PATH)/dimm.idl        \
    $(SDK_INC_PATH)/dispex.idl      \
    $(SDK_INC_PATH)/disptree.idl    \
    $(SDK_INC_PATH)/docobj.idl      \
    $(SDK_INC_PATH)/dom.idl         \
    $(SDK_INC_PATH)/dslisten.idl    \
    $(SDK_INC_PATH)/dwnnot.idl      \
    $(SDK_INC_PATH)/emptyvc.idl     \
    $(SDK_INC_PATH)/hliface.idl     \
    $(SDK_INC_PATH)/hlink.idl       \
    $(SDK_INC_PATH)/htiface.idl     \
    $(SDK_INC_PATH)/htiframe.idl    \
    $(SDK_INC_PATH)/htmlfilter.idl    \
    $(SDK_INC_PATH)/imgutil.idl     \
    $(SDK_INC_PATH)/imnact.idl      \
    $(SDK_INC_PATH)/imnxport.idl    \
    $(SDK_INC_PATH)/inetsdk.idl     \
    $(SDK_INC_PATH)/interned.idl    \
    $(SDK_INC_PATH)/mimeedit.idl    \
    $(SDK_INC_PATH)/mimeinfo.idl    \
    $(SDK_INC_PATH)/mimeole.idl     \
    $(SDK_INC_PATH)/mlang.idl       \
    $(SDK_INC_PATH)/msdatsrc.idl    \
    $(SDK_INC_PATH)/mshtmhst.idl    \
    $(SDK_INC_PATH)/mshtml.idl      \
    $(SDK_INC_PATH)/msnotify.idl    \
    $(SDK_INC_PATH)/msoeapi.idl     \
    $(SDK_INC_PATH)/msxml.idl       \


# .idl files N-Z
FILES0b = \
    $(SDK_INC_PATH)/mobsync.idl     \
    $(SDK_INC_PATH)/mobsyncp.idl    \
    $(SDK_INC_PATH)/notftn.idl      \
    $(SDK_INC_PATH)/objsafe.idl     \
    $(SDK_INC_PATH)/ocmm.idl        \
    $(SDK_INC_PATH)/omscript.idl    \
    $(SDK_INC_PATH)/optary.idl      \
    $(SDK_INC_PATH)/perhist.idl     \
    $(SDK_INC_PATH)/prgsnk.idl      \
    $(SDK_INC_PATH)/procdm.idl      \
    $(SDK_INC_PATH)/recalc.idl      \
    $(SDK_INC_PATH)/safeocx.idl     \
    $(SDK_INC_PATH)/sensevts.idl    \
    $(SDK_INC_PATH)/servprov.idl    \
    $(SDK_INC_PATH)/simpdata.idl    \
    $(SDK_INC_PATH)/subsmgr.idl     \
    $(SDK_INC_PATH)/syncmgr.idl     \
    $(SDK_INC_PATH)/urlhist.idl     \
    $(SDK_INC_PATH)/urlmon.idl      \
    $(SDK_INC_PATH)/urltrack.idl    \
    $(SDK_INC_PATH)/vervec.idl    \
    $(SDK_INC_PATH)/vrsscan.idl     \
    $(SDK_INC_PATH)/xmldom.idl      \
    $(SDK_INC_PATH)/xmldso.idl      \
    $(SDK_INC_PATH)/xmlparser.idl   \
    $(SDK_INC_PATH)/webcheck.idl    \

# .h files A-M
FILES0c = \
    $(SDK_INC_PATH)/addisp.h        \
    $(SDK_INC_PATH)/advpub.h        \
    $(SDK_INC_PATH)/avifmt.h        \
    $(SDK_INC_PATH)/capi.h          \
    $(SDK_INC_PATH)/cleanoc.h       \
    $(SDK_INC_PATH)/control.h       \
    $(SDK_INC_PATH)/domdid.h        \
    $(SDK_INC_PATH)/evcode.h        \
    $(SDK_INC_PATH)/hlguids.h       \
    $(SDK_INC_PATH)/hlinkez.h       \
    $(SDK_INC_PATH)/htmlguid.h      \
    $(SDK_INC_PATH)/htmlhelp.h      \
    $(SDK_INC_PATH)/icwcfg.h        \
    $(SDK_INC_PATH)/idispids.h      \
    $(SDK_INC_PATH)/iert.h          \
    $(SDK_INC_PATH)/ieverp.h        \
    $(SDK_INC_PATH)/iimgctx.h       \
    $(SDK_INC_PATH)/inetcpl.h       \
    $(SDK_INC_PATH)/inethelp.h      \
    $(SDK_INC_PATH)/inetreg.h       \
    $(SDK_INC_PATH)/inseng.h        \
    $(SDK_INC_PATH)/jobexec.h       \
    $(SDK_INC_PATH)/lendian.hpp     \
    $(SDK_INC_PATH)/marqinfo.h      \
    $(SDK_INC_PATH)/mshtmcid.h      \
    $(SDK_INC_PATH)/mshtmdbg.h      \
    $(SDK_INC_PATH)/mshtmdid.h      \
    $(SDK_INC_PATH)/msluapi.h       \
    $(SDK_INC_PATH)/msluguid.h      \
    $(SDK_INC_PATH)/msxmldid.h      \

# .h files N-Z
FILES0d = \
    $(SDK_INC_PATH)/oleacc.h        \
    $(SDK_INC_PATH)/perftags.h      \
    $(SDK_INC_PATH)/pkgguid.h       \
    $(SDK_INC_PATH)/pkgmgr.h        \
    $(SDK_INC_PATH)/platform.h      \
    $(SDK_INC_PATH)/ratings.h       \
    $(SDK_INC_PATH)/rowpos.h        \
    $(SDK_INC_PATH)/unaligned.hpp   \
    $(SDK_INC_PATH)/uuids.h         \
    $(SDK_INC_PATH)/wab.h           \
    $(SDK_INC_PATH)/wabapi.h        \
    $(SDK_INC_PATH)/wabcode.h       \
    $(SDK_INC_PATH)/wabdefs.h       \
    $(SDK_INC_PATH)/wabiab.h        \
    $(SDK_INC_PATH)/wabmem.h        \
    $(SDK_INC_PATH)/wabnot.h        \
    $(SDK_INC_PATH)/wabtags.h       \
    $(SDK_INC_PATH)/wabutil.h       \
    $(SDK_INC_PATH)/winable.h       \
    $(SDK_INC_PATH)/wincrerr.h      \
    $(SDK_INC_PATH)/wininet.h       \
    $(SDK_INC_PATH)/winineti.h      \
    $(SDK_INC_PATH)/xmldomdid.h     \
    $(SDK_INC_PATH)/xmldsodid.h     \


#  Do not add files directly to NTTARGETFILE0, but in one of the
#  FILES0? buckets.  See the comment block above.

NTTARGETFILE0=  \
    $(FILES0a) \
    $(FILES0b) \
    $(FILES0c) \
    $(FILES0d) \

# List any file that is relocated.  For instance, omscript at one time
# was built in private\windows\inc.  It's now in public\sdk\inc.  Adding
# the original name to the RELOCATED_FILES macro will ensure it's deleted
# from the old location during a clean build (hopefully avoiding bogus build
# errors.  (See the clean rule in makefile.inc.)

RELOCATED_FILES = \
    $(WIN_INC_PATH)/omscript.*

TARGETSRCS += ${SOURCES:%=${O}/%}

ifdef FIRST_PASS 
TARGETSRCS += $(NTTARGETFILE0)
endif
ifdef SECOND_PASS
TARGETSRCS += ${NTTARGETFILES}
endif

###########################################################################

ifeq (${MW_CLEARCASE},yes)  # Why?
WINERR_TARGETS =
else
WINERR_TARGETS = $(SDK_INC_PATH)/winerror.h nlsmsg/winerror.rc
endif

## Tools ##

TOOLSDIR =     ${MWHOME}/lib-${MWCONFIG_NAME}
SLASH =        ${TOOLSDIR}/Slash
DEC_PROTECT =  ${TOOLSDIR}/dec_protect
HSPLIT =       ${TOOLSDIR}/hsplit
WCSHDR =       ${TOOLSDIR}/wcshdr
HEXTRACT =     ${TOOLSDIR}/hextract
LISTMUNG =     ${TOOLSDIR}/listmung
WS2HDR =       ${TOOLSDIR}/ws2hdr
MC =           ${MWHOME}/bin/mc
MIDL :=        midl

RM =           /bin/rm -f
PROTECT =      chmod a-w 
UNPROTECT =    chmod a+w
CP =           /bin/cp

.NO_CMP_SCRIPT: ${TARGETSRCS}
.NO_CMP_NON_MF_DEPS: ${TARGETSRCS}

all: ${SDK_LIB_PATH} ${O} ${MIDL_UUIDDIR} ${PASS0_SOURCEDIR} ${TARGETSRCS}

clean:
	-${RM} $(FILES0a)
	-${RM} $(FILES0b)
	-${RM} $(FILES0c)
	-${RM} $(FILES0d)
	-${RM} $(FILESa)
	-${RM} $(FILESb)
	-${RM} $(FILESc)
	-${RM} $(RELOCATED_FILES)
	-${RM} -r ${O}

proxy: ${PROXY_FILES}
iid: ${UUID_FILES}

rebuild: clean all

###########################################################################
#
# Implicit rules
#

X_TO_PUBLIC_H = \
	${RM} $@ ; \
	${WCSHDR} < $< | ${DOS2UNIX} > $@

X_TO_PRIVATE_H = \
	${RM} $@ ; \
	${WCSHDR} < $< | ${DOS2UNIX} > $@

COPY = \
	${RM} $@; \
	${DOS2UNIX} < $< >$@ 


# This rule cannot take any actions, not even an ECHO!  Otherwise the config records
# generated by midl will get trashed.

ifdef SECOND_PASS
${MIDL_UUIDDIR}/%_i.c ${PASS0_SOURCEDIR}/%_p.c ${SDK_INC_PATH}/%.h: $(O)/%.idl ${THIS}
	${ECHOSOURCE}
	${RM} ${SDK_INC_PATH}/$*.h ${MIDL_UUIDDIR}/$*_i.c ${PASS0_SOURCEDIR}/$*_p.c
	cd ${O}; ${MIDL} -DUNIX -I${SDK_INC_PATH} -I${HERE_FROM_O} -I${SAG_INC_PATH} $(notdir $<) -dlldata /dev/null \
				     -h ${SDK_INC_PATH}/$*.h \
				     -iid ${HERE_FROM_O}/${MIDL_UUIDDIR}/$*_i.c \
				     -proxy ${HERE_FROM_O}/${PASS0_SOURCEDIR}/$*_p.c \
				     -tlb /dev/null
	-${PROTECT} ${SDK_INC_PATH}/$*.h ${MIDL_UUIDDIR}/$*_i.c ${PASS0_SOURCEDIR}/$*_p.c

${SDK_LIB_PATH}/%.tlb: $(O)/%.idl ${THIS}
	${ECHONOISE} "[ $(notdir $<) --> $(SDK_LIB_PATH)/$(notdir $@) ]"
	${RM} ${SDK_LIB_PATH}/$*.tlb
	cd ${O}; ${MIDL} -DUNIX -I${SDK_INC_PATH} -I${HERE_FROM_O} -I${SAG_INC_PATH} $(notdir $<) -dlldata /dev/null \
				     -h /dev/null \
				     -iid /dev/null \
				     -proxy /dev/null \
				     -tlb ${SDK_LIB_PATH}/$*.tlb
	-${PROTECT} ${SDK_LIB_PATH}/$*.tlb
endif

$(O)/%.idl: %.idl
	${ECHONOISE} "[ $(notdir $<) --> $(O)/$(notdir $@) ]"
	${COPY}

$(SDK_INC_PATH)/%.h: $(O)/%.x ${THIS}
	${ECHONOISE} "[ $(notdir $<) --> $(SDK_INC_PATH)/$(notdir $@) ]"
	${X_TO_PUBLIC_H}
	-${PROTECT} $@

$(WIN_INC_PATH)/%.h: $(O)/%.x ${THIS}
	${ECHONOISE} "[ $(notdir $<) --> $(WIN_INC_PATH)/$(notdir $@) ]"
	${X_TO_PRIVATE_H}
	-${PROTECT} $@

$(WIN_INC_PATH)/%.h: %.h ${THIS}
	${ECHONOISE} "[ $(notdir $<) --> $(WIN_INC_PATH)/$(notdir $@) ]"
	${COPY}
	-${PROTECT} $@

$(SDK_INC_PATH)/%.h: %.h ${THIS}
	${ECHONOISE} "[ $(notdir $<) --> $(SDK_INC_PATH)/$(notdir $@) ]"
	${COPY}
	-${PROTECT} $@

$(SDK_INC_PATH)/%.hpp: %.hpp ${THIS}
	${ECHONOISE} "[ $(notdir $<) --> $(SDK_INC_PATH)/$(notdir $@) ]"
	${COPY}
	-${PROTECT} $@

$(SDK_INC_PATH)/%.idl: %.idl ${THIS}
	${ECHONOISE} "[ $(notdir $<) --> $(SDK_INC_PATH)/$(notdir $@) ]"
	${COPY}
	-${PROTECT} $@

$(SDK_INC_PATH)/%.dlg: %.dlg ${THIS}
	${ECHONOISE} "[ $(notdir $<) --> $(SDK_INC_PATH)/$(notdir $@) ]"
	${COPY}
	-${PROTECT} $@

# $(SDK_INC_PATH)/%.h: %.idl ${O}/%.h
#       ksh -ec 'if [ $< -nt ${O}/$*.h ] ; then \
#           echo +++ ;\
#           echo +++ Regenerating ${O}/$*.h from $< ;\
#           echo +++ ;\
#           ${MIDL} $< /out ${O} ;\
#       fi'

$(O)/%.x $O/%p.x: %.w ${THIS}
	${ECHONOISE} "[ $(notdir $<) --> $(O)/$(notdir $*.x) $(O)/$(notdir $*p.x) ]"
	${RM} $O/$*.x $O/$*p.x
	${HSPLIT} -e -o $O/$*.x $O/$*p.x $<
	-${PROTECT} $O/$*.x $O/$*p.x

###########################################################################
#
# Explicit rules
#

#
# Special rules for splitting out .w files
#

$(SDK_INC_PATH)/winineti.h: $(O)/wininetp.x ${THIS}
	${ECHOOBJ}
	${X_TO_PUBLIC_H}
	-${PROTECT} $@

#
# Non-obvious Dependencies
#

shdisp.odl: ./exdisp.tlb

###########################################################################

${SDK_LIB_PATH} ${O} ${MIDL_UUIDDIR} ${PASS0_SOURCEDIR}:
	${ECHONOISE} "[ $@ ]"
	mkdir -p $@

.PHONY: all clean













