Files
xmlada/Makefile.in
Emmanuel Briot 2802f3f3c0 Add support for passing extra switches to GPRBUILD
Needed on some platforms like Darwin for shared libs that might get
repositioned by installers.
Also useful for passing -d to monitor progress

Requested on githuba for commit 0f5b329

Change-Id: Icf78b82cd9f7bbcf81b9d3bbb11809078f4c84f1
2016-06-30 09:26:38 +02:00

130 lines
3.8 KiB
Makefile

## The type of library we want to build. Possible values:
## relocatable
## static
LIBRARY_TYPE=static
# Replace with the location for the installation directory
PACKAGE_TARNAME=@PACKAGE_TARNAME@
VERSION=@PACKAGE_VERSION@
BUILDS_SHARED=@GNAT_BUILDS_SHARED@
prefix=@prefix@
# Add support for passing extra switches
GPRBUILD_OPTIONS=
# Set a default value (ignored if set in the environment)
PROCESSORS?=0
GPRBUILD=@gprbuild@ -j${PROCESSORS} -m ${GPRBUILD_OPTIONS}
GPRINSTALL=@gprinstall@
TARGET=@target@
HOST=@host@
# Compiler mode: one of "distrib", "Debug", "Production", "profile", "coverage"
MODE=@BUILD_TYPE@
# In some cases, we use cp instead of install for doing the installation,
# since the latter does not support installing multiple files at once.
RM=rm
#########################################################################
## Nothing to modify below this point
#########################################################################
MODULES=unicode input_sources sax dom schema
MODULE_INSTALL=${MODULES:%=%_inst}
GPROPTS=-XBUILD=${MODE} -XPROCESSORS=${PROCESSORS}
PSUB=lib/gnat
ifeq (${HOST},${TARGET})
IPREFIX=${prefix}
else
GPROPTS+=--target=${TARGET}
IPREFIX=${prefix}/${TARGET}
endif
ifeq (${BUILDS_SHARED},yes)
all: static relocatable static-pic
install: install-clean install-static install-relocatable install-static-pic
else
all: static
install: install-clean install-static
endif
static:
${GPRBUILD} -p -XLIBRARY_TYPE=static ${GPROPTS} xmlada.gpr
shared relocatable:
${GPRBUILD} -p -XLIBRARY_TYPE=relocatable ${GPROPTS} xmlada.gpr
static-pic:
${GPRBUILD} -p -XLIBRARY_TYPE=static-pic ${GPROPTS} xmlada.gpr
# Rebuild the tests (and not the XML/Ada code itself)
test: force
${GPRBUILD} -p -XLIBRARY_TYPE=static ${GPROPTS} \
-XTESTS_ACTIVATED=Only xmlada.gpr
# Run the tests. This requires an install of XML/Ada first
run_test: force
@make --no-print-directory -C tests tests
run_test_valgrind: test
cd tests/domt; valgrind --tool=memcheck --leak-check=full ./obj/testxml -auto
docs: force
-${MAKE} -e -C docs html latexpdf
install-clean-obsolete:
ifneq (,$(wildcard $(IPREFIX)/$(PSUB)/manifests/xmlada_schema))
-${GPRINSTALL} --uninstall ${GPROPTS} --prefix=$(IPREFIX) \
--project-subdir=$(PSUB) xmlada_schema
-${GPRINSTALL} --uninstall ${GPROPTS} --prefix=$(IPREFIX) \
--project-subdir=$(PSUB) xmlada_dom
-${GPRINSTALL} --uninstall ${GPROPTS} --prefix=$(IPREFIX) \
--project-subdir=$(PSUB) xmlada_sax
-${GPRINSTALL} --uninstall ${GPROPTS} --prefix=$(IPREFIX) \
--project-subdir=$(PSUB) xmlada_input
-${GPRINSTALL} --uninstall ${GPROPTS} --prefix=$(IPREFIX) \
--project-subdir=$(PSUB) xmlada_unicode
endif
install-clean: install-clean-obsolete
ifneq (,$(wildcard $(IPREFIX)/$(PSUB)/manifests/xmlada))
-${GPRINSTALL} --uninstall ${GPROPTS} --prefix=$(IPREFIX) \
--project-subdir=$(PSUB) xmlada
endif
## Do the installation for an explicit target
install-static:
${GPRINSTALL} -f -p -XLIBRARY_TYPE=static ${GPROPTS} \
--prefix=${IPREFIX} --project-subdir=$(PSUB) \
--build-var=XMLADA_BUILD --build-name=static \
--install-name=xmlada xmlada.gpr
install-shared install-relocatable:
${GPRINSTALL} -f -p -XLIBRARY_TYPE=relocatable ${GPROPTS} \
--prefix=${IPREFIX} --project-subdir=$(PSUB) \
--build-var=XMLADA_BUILD --build-name=relocatable \
--install-name=xmlada xmlada.gpr
install-static-pic:
${GPRINSTALL} -f -p -XLIBRARY_TYPE=static-pic ${GPROPTS} \
--prefix=${IPREFIX} --project-subdir=$(PSUB) \
--build-var=XMLADA_BUILD --build-name=static-pic \
--install-name=xmlada xmlada.gpr
clean_%: force
-gprclean -XLIBRARY_TYPE=$* -q xmlada.gpr
-gprclean -XLIBRARY_TYPE=$* -q -XTESTS_ACTIVATED=Yes xmlada.gpr
clean: clean_relocatable clean_static clean_static-pic
cd docs; ${MAKE} -e clean
distclean: clean
${RM} tests/dom/default.gpr
${RM} Makefile config.cache config.log config.status Makefile.314
force: