1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
|
## 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@
TARGET_ALIAS=@target_alias@
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}
ifeq (${HOST},${TARGET})
IPREFIX=${prefix}
else
GPROPTS+=--target=${TARGET_ALIAS}
IPREFIX=${prefix}/${TARGET_ALIAS}
endif
ifdef RTS
GPROPTS+=--RTS=${RTS}
IPREFIX:=${IPREFIX}/$(notdir ${RTS})
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)/lib/gnat/manifests/xmlada))
-${GPRINSTALL} -f --uninstall ${GPROPTS} --prefix=$(IPREFIX) \
--project-subdir=lib/gnat xmlada
endif
install-clean: install-clean-obsolete
ifneq (,$(wildcard $(IPREFIX)/share/gpr/manifests/xmlada))
-${GPRINSTALL} -f --uninstall ${GPROPTS} --prefix=$(IPREFIX) xmlada
endif
## Do the installation for an explicit target
GPRINST_OPTS=-f -p ${GPROPTS} --prefix=${IPREFIX} --install-name=xmlada \
--build-var=LIBRARY_TYPE --build-var=XMLADA_BUILD
install-static:
${GPRINSTALL} -XLIBRARY_TYPE=static ${GPRINST_OPTS} \
--build-name=static xmlada.gpr
install-shared install-relocatable:
${GPRINSTALL} -XLIBRARY_TYPE=relocatable ${GPRINST_OPTS} \
--build-name=relocatable xmlada.gpr
install-static-pic:
${GPRINSTALL} -XLIBRARY_TYPE=static-pic ${GPRINST_OPTS} \
--build-name=static-pic 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:
|