diff --git a/Makefile b/Makefile index f0b81be6..3b7d1998 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,32 @@ -# Build mode (dev or prod) -BUILD_MODE=dev + +# Common scenario variables of the GPR files: +# +# VSS_BUILD_PROFILE | BUILD_PROFILE = release | validation | development +# +# VSS_COVERAGE_MODE | COVERAGE_MODE = none | gcov +# +# VSS_CI_MODE | CI_MODE = none | on +# +# ADAFLAGS = ... GPRBUILD_FLAGS = -p -j0 + PREFIX ?= /usr GPRDIR ?= $(PREFIX)/share/gpr LIBDIR ?= $(PREFIX)/lib BINDIR ?= $(PREFIX)/bin INSTALL_PROJECT_DIR ?= $(DESTDIR)$(GPRDIR) -INSTALL_INCLUDE_DIR ?= $(DESTDIR)$(PREFIX)/include/vss +INSTALL_INCLUDE_DIR ?= $(DESTDIR)$(PREFIX)/include/vss/$* INSTALL_EXEC_DIR ?= $(DESTDIR)$(BINDIR) INSTALL_LIBRARY_DIR ?= $(DESTDIR)$(LIBDIR) -INSTALL_ALI_DIR ?= $(INSTALL_LIBRARY_DIR)/vss +INSTALL_ALI_DIR ?= $(INSTALL_LIBRARY_DIR)/vss/$* -GPRINSTALL_FLAGS = --prefix=$(PREFIX) --exec-subdir=$(INSTALL_EXEC_DIR)\ - --lib-subdir=$(INSTALL_ALI_DIR) --project-subdir=$(INSTALL_PROJECT_DIR)\ - --link-lib-subdir=$(INSTALL_LIBRARY_DIR) --sources-subdir=$(INSTALL_INCLUDE_DIR) +GPRINSTALL_FLAGS = \ + -XVSS_LIBRARY_TYPE=$* \ + --build-name=$* --build-var=LIBRARY_TYPE --build-var=VSS_LIBRARY_TYPE \ + --prefix=$(PREFIX) --exec-subdir=$(INSTALL_EXEC_DIR) \ + --lib-subdir=$(INSTALL_ALI_DIR) --project-subdir=$(INSTALL_PROJECT_DIR) \ + --link-lib-subdir=$(INSTALL_LIBRARY_DIR) --sources-subdir=$(INSTALL_INCLUDE_DIR) OK_RE_TESTS := 504 # Number of re_tests to be passed @@ -26,14 +38,20 @@ endif .PHONY: docs -all: - gprbuild $(GPRBUILD_FLAGS) gnat/vss_gnat.gpr -XVSS_BUILD_MODE=$(BUILD_MODE) -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_text.gpr -XVSS_BUILD_MODE=$(BUILD_MODE) -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_json.gpr -XVSS_BUILD_MODE=$(BUILD_MODE) -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_regexp.gpr -XVSS_BUILD_MODE=$(BUILD_MODE) -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml.gpr -XVSS_BUILD_MODE=$(BUILD_MODE) -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml_templates.gpr -XVSS_BUILD_MODE=$(BUILD_MODE) -cargs $(ADAFLAGS) - gprbuild $(GPRBUILD_FLAGS) gnat/vss_xml_xmlada.gpr -XVSS_BUILD_MODE=$(BUILD_MODE) -cargs $(ADAFLAGS) +.NOTPARALLEL: + +all: build-libs-relocatable + +build-all-libs: build-libs-relocatable build-libs-static build-libs-static-pic + +build-libs-%: + gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_gnat.gpr + gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_text.gpr + gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_json.gpr + gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_regexp.gpr + gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_xml.gpr + gprbuild -XVSS_LIBRARY_TYPE=$* $(GPRBUILD_FLAGS) gnat/vss_xml_templates.gpr + gprbuild -XVSS_LIBRARY_TYPE=$* -XXMLADA_BUILD=$* $(GPRBUILD_FLAGS) gnat/vss_xml_xmlada.gpr generate: gprbuild $(GPRBUILD_FLAGS) gnat/tools/gen_ucd.gpr @@ -42,12 +60,12 @@ generate: gnatchop .objs/ucd.ada source/text/ucd build_tests: - gprbuild $(GPRBUILD_FLAGS) gnat/tests/vss_text_tests.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/tests/vss_os_tests.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/tests/vss_json_tests.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/tests/vss_stream_tests.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/tests/vss_regexp_tests.gpr - gprbuild $(GPRBUILD_FLAGS) gnat/tests/vss_html_tests.gpr + gprbuild -XVSS_LIBRARY_TYPE=static $(GPRBUILD_FLAGS) gnat/tests/vss_text_tests.gpr + gprbuild -XVSS_LIBRARY_TYPE=static $(GPRBUILD_FLAGS) gnat/tests/vss_os_tests.gpr + gprbuild -XVSS_LIBRARY_TYPE=static $(GPRBUILD_FLAGS) gnat/tests/vss_json_tests.gpr + gprbuild -XVSS_LIBRARY_TYPE=static $(GPRBUILD_FLAGS) gnat/tests/vss_stream_tests.gpr + gprbuild -XVSS_LIBRARY_TYPE=static $(GPRBUILD_FLAGS) gnat/tests/vss_regexp_tests.gpr + gprbuild -XVSS_LIBRARY_TYPE=static -XXMLADA_BUILD=static $(GPRBUILD_FLAGS) gnat/tests/vss_html_tests.gpr check: build_tests check_text check_json check_regexp check_html @@ -148,14 +166,18 @@ docs: clean: rm -rf .objs .libs re_tests -install: +install: install-libs-relocatable + +install-all-libs: install-libs-relocatable install-libs-static install-libs-static-pic + +install-libs-%: gprinstall $(GPRINSTALL_FLAGS)/gnat -f -p -P gnat/vss_gnat.gpr gprinstall $(GPRINSTALL_FLAGS)/text -f -p -P gnat/vss_text.gpr gprinstall $(GPRINSTALL_FLAGS)/json -f -p -P gnat/vss_json.gpr gprinstall $(GPRINSTALL_FLAGS)/regexp -f -p -P gnat/vss_regexp.gpr gprinstall $(GPRINSTALL_FLAGS)/xml -f -p -P gnat/vss_xml.gpr gprinstall $(GPRINSTALL_FLAGS)/xml_templates -f -p -P gnat/vss_xml_templates.gpr - gprinstall $(GPRINSTALL_FLAGS)/xml_xmlada -f -p -P gnat/vss_xml_xmlada.gpr + gprinstall -XXMLADA_BUILD=$* $(GPRINSTALL_FLAGS)/xml_xmlada -f -p -P gnat/vss_xml_xmlada.gpr misc: # Check compilation of other projects gprbuild $(GPRBUILD_FLAGS) -aPgnat gnat/tools/json_schema.gpr diff --git a/config/vss_config.gpr b/config/vss_config.gpr index 9e64dc4e..60609e50 100644 --- a/config/vss_config.gpr +++ b/config/vss_config.gpr @@ -1,3 +1,9 @@ +-- +-- Copyright (C) 2020-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + -- This file is stub to build VSS outside of the Alire environment. Alire will -- overwrite it during builds. -- diff --git a/gnat/vss_common.gpr b/gnat/vss_common.gpr index 91a84a3a..b4e7913a 100644 --- a/gnat/vss_common.gpr +++ b/gnat/vss_common.gpr @@ -26,16 +26,14 @@ abstract project VSS_Common is CI_Mode : VSS_CI_Mode := external ("VSS_CI_MODE", external ("CI_MODE", "none")); - Superproject := external ("SUPERPROJECT", ""); - Ada_Switches := (); Ada_Coverage_Switches := (); Linker_Options := (); - Library_Dir := "../.libs/" & Superproject & "/" & Library_Kind; - Object_Dir := "../.objs/" & Superproject & "/" & Library_Kind; - Tests_Object_Dir := "../../.objs/" & Superproject & "/tests"; - Tools_Object_Dir := "../../.objs/" & Superproject & "/tools"; + Library_Dir := "../.libs/" & "/" & Library_Kind; + Object_Dir := "../.objs/" & "/" & Library_Kind; + Tests_Object_Dir := "../../.objs/" & "/tests"; + Tools_Object_Dir := "../../.objs/" & "/tools"; -- Build Profile diff --git a/testsuite/text/performance/U816-022/Makefile b/testsuite/text/performance/U816-022/Makefile index 6ed8e286..771773d1 100644 --- a/testsuite/text/performance/U816-022/Makefile +++ b/testsuite/text/performance/U816-022/Makefile @@ -1,6 +1,6 @@ all: - gprbuild -p -P test.gpr -XSUPERPROJECT= -XBUILD_MODE=prod + gprbuild -p -P test.gpr -XBUILD_PROFILE=release run: all valgrind --tool=callgrind .objs/main