# Generated automatically from Makefile.in by configure.

# Replace with the location for the installation directory
PREFIX=@EXEC_PREFIX@

# Set the following to True to build shared libraries. Note that this will
# not work on most systems, you need to at least compile with -fPIC
BUILD_SHARED=FALSE

GNATMAKE=gnatmake
CC=gcc


  
# List of all modules to compile
# You can remove "dom" if you don't intend to use the DOM interface
MODULES=unicode input_sources sax dom

# Version of the library
MAJOR=0
MINOR=8.1

# Compiler mode: one of "distrib", "debug", "optimize", "profile"
MODE=distrib

FPIC=
CHMOD=chmod
CP=cp -p -f
MKDIR=mkdir -p
RANLIB= @RANLIB@
ARFLAGS=cr
CFLAGS=
CP=cp -p -f
CHMOD=chmod
LN=ln -f -s

#########################################################################
## Nothing to modify below this point
#########################################################################

MODULE_TEST=${MODULES:%=%_test}
MODULE_INSTALL=${MODULES:%=%_inst}

.PHONY: all obj clean install install_dirs

all: obj docs 
obj: ${MODULES}
test: ${MODULE_TEST}

docs: force
	${MAKE} -e -C docs

${MODULES}: force
	${GNATMAKE} ${FPIC} -u -P$@/$@.gpr -XMODE=${MODE}

${MODULE_TEST}: force
	${GNATMAKE} ${FPIC} -P${@:%_test=%}/${@:%_test=%}.gpr -XMODE=debug

${MODULE_INSTALL}: force
	# Build the libraries themselves
	cd ${@:%_inst=%}/obj; ${AR} ${ARFLAGS} libxmlada_${@:%_inst=%}.a *.o
ifneq (${RANLIB}, "")
	cd ${@:%_inst=%}/obj; ${RANLIB} libxmlada_${@:%_inst=%}.a
endif
ifeq (${BUILD_SHARED}, TRUE)
	cd ${@:%_inst=%}/obj; ${CC} -shared -o libxmlada_${@:%_install=%}-${MAJOR}.${MINOR}.so *.o
endif
	#Install the libraries
	${CP} ${@:%_inst=%}/obj/*.ali ${PREFIX}/include/xmlada
	${CP} ${@:%_inst=%}/*.ad[bs]  ${PREFIX}/include/xmlada
	${CP} ${@:%_inst=%}/obj/libxmlada_* ${PREFIX}/lib
ifeq (${BUILD_SHARED}, TRUE)
	cd ${PREFIX}/lib; ${LN} libxmlada_${@:%_inst=%}-${MAJOR}.${MINOR}.so libxmlada_${@:%_inst=%}.so
endif

install_dirs: force
	@${MKDIR} ${PREFIX}/lib
	@${MKDIR} ${PREFIX}/bin
	@${MKDIR} ${PREFIX}/include/xmlada

install: obj install_dirs ${MODULE_INSTALL}
	cd ${PREFIX}/include/xmlada; ${CHMOD} -w *.ali
	${CP} xmlada-config ${PREFIX}/bin
	${CHMOD} +x ${PREFIX}/bin/xmlada-config

clean: force
	-${RM} ${MODULES:%=%/obj/*}  2>/dev/null
	cd docs; ${MAKE} -e clean

force:
