Skip to content

Commit

Permalink
Merge branch 'mr/update_gnatcoll_gpr' into 'master'
Browse files Browse the repository at this point in the history
Revert separation of gnatcoll into gnatcoll_core.gpr and gnatcoll_projects.gpr

See merge request eng/toolchain/gnatcoll-core!58
  • Loading branch information
Nikokrock committed Jan 23, 2024
2 parents 7e27dde + 20afc5a commit 2afa5f8
Show file tree
Hide file tree
Showing 6 changed files with 385 additions and 634 deletions.
56 changes: 12 additions & 44 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## ##
## GNATCOLL LIBRARY ##
## ##
## Copyright (C) 2017-2024 AdaCore. ##
## Copyright (C) 2017, AdaCore. ##
## ##
## This library is free software; you can redistribute it and/or modify it ##
## under terms of the GNU General Public License as published by the Free ##
Expand Down Expand Up @@ -40,7 +40,7 @@
# TARGET : target triplet for cross-compilation
# INTEGRATED : installs the project as part of the compiler installation;
# this adds NORMALIZED_TARGET subdir to prefix
# PROJECT : gnatcoll, gnatcoll_projects or gnatcoll_core
#
# Project specific:
#
# GNATCOLL_MMAP : whether MMAP is supported (yes/no)
Expand All @@ -56,8 +56,6 @@ ECHO := echo
WHICH := which
SED := sed

PROJECT=gnatcoll

# check for out-of-tree build
SOURCE_DIR := $(dir $(MAKEFILE_LIST))

Expand All @@ -69,14 +67,10 @@ endif
ifeq ($(SOURCE_DIR),./)
RBD=
GNATCOLL_GPR=gnatcoll.gpr
GNATCOLL_CORE_GPR=gnatcoll_core.gpr
GNATCOLL_PROJECTS_GPR=gnatcoll_projects.gpr
MAKEPREFIX=
else
RBD=--relocate-build-tree
GNATCOLL_GPR=$(SOURCE_DIR)/gnatcoll.gpr
GNATCOLL_CORE_GPR=$(SOURCE_DIR)/gnatcoll_core.gpr
GNATCOLL_PROJECTS_GPR=$(SOURCE_DIR)/gnatcoll_projects.gpr
MAKEPREFIX=$(SOURCE_DIR)/
endif

Expand Down Expand Up @@ -145,9 +139,9 @@ BUILDER=$(GNATCOV_PROJECT_PATH) gprbuild -p -m $(GTARGET) $(RBD) \
-j$(PROCESSORS) $(GPR_VARS) \
$(GPRBUILD_OPTIONS) $(GNATCOV_BUILD_OPTS)
INSTALLER=gprinstall -p -f $(GTARGET) $(GPR_VARS) \
$(RBD) --prefix=$(prefix)$(integrated_install)
$(RBD) --sources-subdir=include/gnatcoll --prefix=$(prefix)$(integrated_install)
CLEANER=gprclean -q $(RBD) $(GTARGET)
UNINSTALLER=$(INSTALLER) -p -f --uninstall
UNINSTALLER=$(INSTALLER) -p -f --install-name=gnatcoll --uninstall

#########
# build #
Expand All @@ -163,21 +157,17 @@ build-%: $(GNATCOV_RTS)
# the user choice.

ifeq ($(GNATCOLL_PROJECTS), yes)
$(SED) -e 's/^-- with "gnatcoll_projects"/with "gnatcoll_projects"/g' $(GNATCOLL_GPR) > tmp ; mv tmp $(GNATCOLL_GPR)
$(SED) -e 's/^-- with "gpr"/with "gpr"/g' $(GNATCOLL_GPR) > tmp ; mv tmp $(GNATCOLL_GPR)
else
$(SED) -e 's/^with "gnatcoll_projects"/-- with "gnatcoll_projects"/g' $(GNATCOLL_GPR) > tmp ; mv tmp $(GNATCOLL_GPR)
$(SED) -e 's/^with "gpr"/-- with "gpr"/g' $(GNATCOLL_GPR) > tmp ; mv tmp $(GNATCOLL_GPR)
endif

ifeq ($(GNATCOV), yes)
$(GNATCOV_PROJECT_PATH) gnatcov instrument -P $(GNATCOLL_CORE_GPR) $(RBD) \
$(GNATCOV_PROJECT_PATH) gnatcov instrument -P $(GNATCOLL_GPR) $(RBD) \
--no-subprojects --level=stmt+decision
endif
$(BUILDER) -XLIBRARY_TYPE=$* -XXMLADA_BUILD=$* -XGPR_BUILD=$* \
$(GPR_VARS) $(GNATCOLL_CORE_GPR) -v
ifeq ($(GNATCOLL_PROJECTS), yes)
$(BUILDER) -XLIBRARY_TYPE=$* -XXMLADA_BUILD=$* -XGPR_BUILD=$* \
$(GPR_VARS) $(GNATCOLL_PROJECTS_GPR) -v
endif
$(GPR_VARS) $(GNATCOLL_GPR) -v

###################
# Instrumentation #
Expand All @@ -191,34 +181,17 @@ gnatcovrts:
###########

uninstall:
ifneq (,$(wildcard $(prefix)$(integrated_install)/share/gpr/manifests/gnatcoll_core))
$(UNINSTALLER) $(GNATCOLL_CORE_GPR) --install-name=gnatcoll_core --sources-subdir=include/gnatcoll_core
ifneq (,$(wildcard $(prefix)$(integrated_install)/share/gpr/manifests/gnatcoll))
$(UNINSTALLER) $(GNATCOLL_GPR)
endif
ifeq ($(GNATCOLL_PROJECTS), yes)
ifneq (,$(wildcard $(prefix)$(integrated_install)/share/gpr/manifests/gnatcoll_projects))
$(UNINSTALLER) $(GNATCOLL_PROJECTS_GPR) --install-name=gnatcoll_projects --sources-subdir=include/gnatcoll_projects
endif
endif




install: uninstall $(LIBRARY_TYPES:%=install-%)

install-%:
$(INSTALLER) -XLIBRARY_TYPE=$* -XXMLADA_BUILD=$* -XGPR_BUILD=$* \
--build-name=$* $(GPR_VARS) \
--sources-subdir=include/gnatcoll_core \
--build-var=LIBRARY_TYPE --build-var=GNATCOLL_BUILD \
--build-var=GNATCOLL_CORE_BUILD $(GNATCOLL_CORE_GPR)
ifeq ($(GNATCOLL_PROJECTS), yes)
$(INSTALLER) -XLIBRARY_TYPE=$* -XXMLADA_BUILD=$* -XGPR_BUILD=$* \
--build-name=$* $(GPR_VARS) \
--sources-subdir=include/gnatcoll_projects \
--build-var=LIBRARY_TYPE --build-var=GNATCOLL_BUILD \
--build-var=GNATCOLL_CORE_BUILD $(GNATCOLL_PROJECTS_GPR)
endif
cp $(GNATCOLL_GPR) $(prefix)/share/gpr
--build-var=GNATCOLL_CORE_BUILD $(GNATCOLL_GPR)

###########
# Cleanup #
Expand All @@ -227,13 +200,8 @@ endif
clean: $(LIBRARY_TYPES:%=clean-%)

clean-%:
ifeq ($(GNATCOLL_PROJECTS), yes)
-$(CLEANER) -XLIBRARY_TYPE=$* -XXMLADA_BUILD=$* -XGPR_BUILD=$* \
$(GPR_VARS) $(GNATCOLL_PROJECTS_GPR)
endif
-$(CLEANER) -XLIBRARY_TYPE=$* -XXMLADA_BUILD=$* -XGPR_BUILD=$* \
$(GPR_VARS) $(GNATCOLL_CORE_GPR)

$(GPR_VARS) $(GNATCOLL_GPR)

#########
# setup #
Expand Down
Loading

0 comments on commit 2afa5f8

Please sign in to comment.