/*
**  Copyright (c) 2001, 2002 Computer Associates International, Inc.
*/

/*
** INGRES MING file for front!misc!impxml
**
** This MINGH file unifies the requirements of the Ingres
** and Xerces builds. The compiler must be a C++ compiler.
**
** Xerces parser is used to parse an input XML file,
** which is conforming to the IngresDTD, in order to import
** XML Data into Ingres.
**
** 12-jun-2001 (gupsh01)
**    Created
** 18-jun-2001 (gupsh01)
**    Added HDR_SAX2 for non-baroque paths.
** 16-jul-2001 (gupsh01)
**    Cleaned up MINGH and corrected the shared library 
**    references to be relative paths.
** 19-Jul-2001 (hanje04)
**    Removed hard coded Solaris refences to mkdefaults.sh.
** 05-Aug-2001 (hanje04)
**    Added XERC_LIBS to link line.
** 09-aug-2001 (devjo01)
**    Removed space between "-L" & $(ING_BUILD) in LNK_FLAGS.
**    Was breaking build for Tru64.
** 16-nov-2001 (somsa01)
**    Modified LNK_FLAGS to include LD_FLAGS.
** 15-Feb-2002 (bonro01)
**    Removed LDLIBMACH & CCLDMACH from build of ICETranslate because on
**    Unixware the C and C++ compiler uses different flags, and these
**    defines are used by the C Compiler.
**    After removing LDLIBMACH & CCLDMACH, no additional librarys were
**    required for the C++ compiler, so I suspect that the other platforms
**    don't require these defines as well.  Other platforms should use
**    CXX_DEFS & XERC_LIBS if they need to add compile and link parameters.
**    Also removed -lc, because Unixware complains when LIBC is included
**    on the link.  Unixware automatically includes LIBC at the right place.
**    The -lc is another option that should be placed in mkdefault if needed.
** 15-Oct-2002 (somsa01)
**    Added usage of CXXLDMACH, which denotes link flags for C++ programs.
**    Also, removed inclusion of "-g" compile flag (debug).
** 15-Mar-2004 (gupsh01)
**    Modified to support Xerces 2.3.
*/

HDRc    = $(ING_SRC)/cl/hdr/$(ING_VERS)/hdr
HDRg    = $(ING_SRC)/gl/hdr/$(ING_VERS)/hdr
HDR1    = $(ING_SRC)/front/ice/$(ING_VERS)/hdr
HDR4    = $(ING_SRC)/front/hdr/$(ING_VERS)/hdr
HDR5 = $(ING_SRC)/common/hdr/$(ING_VERS)/hdr
HDR6 = $(ING_SRC)/front/misc/$(ING_VERS)/hdr
HDR_SAX = $(ING_SRC)/front/ice/$(ING_VERS)/src/SAX
HDR_SAX2 = $(ING_SRC)/front/ice/SAX

XERCES_VER =
XERCESLIB  = xerces-c$(XERCES_VER)
INCLUDES   = -I$(HDRc) -I$(HDRg) -I$(HDR1) -I$(HDR4)  -I$(HDR5) -I$(HDR6) -I$(HDR_SAX) -I$(HDR_SAX2)

INGICEOBJS = $(ICECONFLIB)

LNK_LIBS   = -l$(XERCESLIB) $(XFERDBLIB) $(GNLIB) $(MALLOCLIB)  -lframe.1 -lq.1 -lcompat.1
LNK_FLAGS  = $(CXXLDMACH) $(INGICEOBJS) -L$(ING_BUILD)/lib $(LNK_LIBS)

CPP_FLAGS  = $(CXX_DEFS) $(INCLUDES)

all: $(ING_BUILD)/bin/impxml 

$(ING_BUILD)/bin/impxml: SAXImport.o SAXIngres.o SAXImportHandlers.o
        echo "$(CXX) SAXImport.o SAXIngres.o SAXImportHandlers.o"
        echo LIBS set to: "$(LIBS)"
        echo LNK_FLAGS Set to: "$(LNK_FLAGS)"
	echo performing "$(CXX) $(CPP_FLAGS) -o $(<) $(*) $(LNK_FLAGS)"
   $(CXX) $(CPP_FLAGS) $(XERC_LIBS) -o $(<) $(*) $(LNK_FLAGS)
   $(CHMOD) $(EXEMODE) $(ING_BUILD)/bin/impxml

SAXIngres.o: SAXIngres.cpp
        echo "$(CXX) $(CPP_FLAGS) SAXIngres.cpp"
	$(CXX) -c $(CPP_FLAGS) $(*)

SAXImport.o: SAXImport.cpp
        echo "$(CXX) $(CPP_FLAGS) SAXImport.cpp"
	$(CXX) -c $(CPP_FLAGS) $(*)

SAXImportHandlers.o: SAXImportHandlers.cpp
        echo "$(CXX) $(CPP_FLAGS) SAXImportHandlers.cpp"
	$(CXX) -c $(CPP_FLAGS) $(*)

clean:
        $(RM) *.o

