ada: compile runtime bodies, customizable tools

This is a follow-up commit for "ada: runtime and library support".

Issue #2748
This commit is contained in:
Johannes Kliemann 2018-04-16 15:26:00 +02:00 committed by Christian Helmuth
parent 0c6504da5c
commit c02ef3ec94
2 changed files with 20 additions and 2 deletions

View File

@ -70,13 +70,22 @@ endif
# The mandatory runtime directories 'adainclude' and 'adalib' are expected in
# the program directory.
#
#
# We need to override these to build the ada runtime
#
CUSTOM_ADA_MAKE ?= $(GNATMAKE)
CUSTOM_ADA_FLAGS ?= -q -c --GCC=$(CC) --RTS=$(ADA_RTS)
CUSTOM_ADA_OPT ?= -cargs $(CC_ADA_OPT)
CUSTOM_ADA_INCLUDE ?= $(INCLUDES)
%.o: %.adb
$(MSG_COMP)$@
$(VERBOSE)$(GNATMAKE) -q -c --GCC=$(CC) --RTS=$(ADA_RTS) $< -cargs $(CC_ADA_OPT) $(INCLUDES)
$(VERBOSE)$(CUSTOM_ADA_MAKE) $(CUSTOM_ADA_FLAGS) $< $(CUSTOM_ADA_OPT) $(CUSTOM_ADA_INCLUDE)
%.ali %.o: %.ads
$(MSG_COMP)$@
$(VERBOSE)$(CC) -c -gnatg -gnatp -gnatpg -gnatn2 -I- -I$(ADA_RTS_SOURCE) $(CC_ADA_OPT) $<
$(VERBOSE)$(CUSTOM_ADA_MAKE) $(CUSTOM_ADA_FLAGS) $< $(CUSTOM_ADA_OPT) $(CUSTOM_ADA_INCLUDE)
#
# Compiling Rust sources

View File

@ -5,9 +5,18 @@ ADAINCLUDE = $(ADA_RTS)/adainclude
PACKAGES = system
body_exists := $(filter $1.adb,$(shell if [ -e $(ADA_RTS_SOURCE)/$1.adb ]; then echo $1.adb; fi))
ADA_RTS_SOURCE = $(call select_from_ports,gcc)/src/noux-pkg/gcc/gcc/ada
SRC_ADS += $(foreach package, $(PACKAGES), $(package).ads)
SRC_ADB += $(foreach package, $(PACKAGES), $(body_exists, $(package)))
CUSTOM_ADA_MAKE = $(CC)
CUSTOM_ADA_FLAGS = -c -gnatg -gnatp -gnatpg -gnatn2
CUSTOM_ADA_OPT = $(CC_ADA_OPT)
CUSTOM_ADA_INCLUDE = -I- -I$(ADA_RTS_SOURCE)
vpath %.adb $(ADA_RTS_SOURCE)
vpath %.ads $(ADA_RTS_SOURCE)
SHARED_LIB = yes