/*
** INGRES MINGH file for front!ice!ICETranslate
**
** This MINGH file unifies the requirements of the Ingres
** and Xerces builds. The compiler must be a C++ compiler.
**
** SAX Parser:
** ICETranslate currently requires the XERCES SAX C++ parser from
** the Apache project (http://www.apache.org). The major platforms
** are supported; for those that are not, source is available. When
** compiling XERCES ensure that the Apache recommended build 
** instructions are followed. 
**
** XERCES Version:
** See the variable XERCES_VER, below.
**
** Building SAX:
** When building XERCES from scratch, it is worthwhile also building
** the samples and at least running SAX2Print as a sanity check. Again
** ensure that the Apache recommended build instructions are followed.
**
** Unicode support:
** XERCES supports Unicode with the XMLCh type.
** In XERCES version 1.4, the XERCES character type XMLCh was
** universally typedefd to 'unsigned short'.
** However debugging is greatly simplified by changing this to
** the platform's native wide character type (wchar_t).
** See the XERCES build instructions for how to make this change.
** Doing this requires changing a fundamental header file for the SAX
** system and therefore implies re-building the SAX library.
**
** 01-jul-2001 (peeje01)
**    SIR 103810
**    Created
** 27-Jun-2001 (hanje04)
**    Updated to build in non baroque environments.
** 23-Oct-2001 (peeje01)
**    BUG 105899
**    Correct typo in baroque SAX header path
**    Add common header path
** 16-nov-2001 (somsa01)
**    Modified LNK_FLAGS to include CCLDMACH.
** 19-Nov-2001 (hanje04)
**    Re-modified LNK_FLAGS to link to compat.1 so that the shared library 
**    is picked up and not the archive.
** 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.
** 15-Oct-2002 (somsa01)
**    Added usage of CXXLDMACH, which denotes link flags for C++ programs.
** 12-Mar-2004 (gupsh01)
**    Added support for Xerces 2.3. libxerces-c1_4.so is now just 
**    libxerces-c.so the way it is delivered in Xerces 2.3 release.
*/

HDRc    = $(ING_SRC)/cl/hdr/$(ING_VERS)/hdr
HDRg    = $(ING_SRC)/gl/hdr/$(ING_VERS)/hdr
HDRcmn	= $(ING_SRC)/common/hdr/$(ING_VERS)/hdr
HDR1    = $(ING_SRC)/front/ice/$(ING_VERS)/hdr
HDR4    = $(ING_SRC)/front/hdr/$(ING_VERS)/hdr
HDR_SAXb = $(ING_SRC)/front/ice/$(ING_VERS)/src/SAX
HDR_SAXnb = $(ING_SRC)/front/ice/SAX

XERCES_VER =
XERCESLIB  = xerces-c$(XERCES_VER)
INCLUDES   = -I$(HDRc) -I$(HDRg) -I$(HDR1) -I$(HDR4) -I$(HDR_SAXb) \
	     -I$(HDR_SAXnb) -I$(HDRcmn)

INGICEOBJS = $(ICECONFLIB)

LNK_LIBS   = -L$ING_BUILD/lib -l$(XERCESLIB) $(XERC_LIBS) -lcompat.1
LNK_FLAGS  = $(CXXLDMACH) $(INGICEOBJS) $(LNK_LIBS)

CPP_FLAGS  = $(CXX_DEFS) $(XERC_DEFS) $(INCLUDES)

all: $(ING_BUILD)/bin/ICETranslate

$(ING_BUILD)/bin/ICETranslate: ICETranslate.o  ICETranslateHandlers.o
	$(CXX) $(CPP_FLAGS) -o $(<) $(*) $(LNK_FLAGS)
	$(CHMOD) $(EXEMODE) $(ING_BUILD)/bin/ICETranslate

ICETranslate.o: ICETranslate.cpp
	$(CXX) -c $(CPP_FLAGS) $(*)

ICETranslateHandlers.o: ICETranslateHandlers.cpp
	$(CXX) -c $(CPP_FLAGS) $(*)

clean:
	$(RM) *.o
