76f9c7f44f
gcc/ada/ * atree.ads, atree.adb: Major rewrite to support variable-sized node types. Add pragmas Suppress and Assertion_Policy. We now have an extra level of indirection: Node_Offsets is a table mapping Node_Ids to the offset of the start of each node in Slots. Slots is a table containing one or more contiguous slots for each node. Each slot is a 32-bit unchecked union that can contain any mixture of 1, 2, 4, 8, and 32-bit fields that fits. The old low-level getters and setters (e.g. Flag123) are removed. * gen_il-fields.ads, gen_il-gen-gen_entities.adb, gen_il-gen-gen_nodes.adb, gen_il-gen.adb, gen_il-gen.ads, gen_il-main.adb, gen_il-types.ads, gen_il-utils.adb, gen_il-utils.ads, gen_il.adb, gen_il.ads: New gen_il program that generates various Ada and C++ files. In particular, the following files are generated by gen_il: einfo-entities.adb einfo-entities.ads, gnatvsn.ads, nmake.adb, nmake.ads, seinfo.ads, seinfo_tables.adb, seinfo_tables.ads, sinfo-nodes.adb, sinfo-nodes.ads, einfo.h, and sinfo.h. * sinfo-utils.adb, sinfo-utils.ads, einfo-utils.adb, einfo-utils.ads: New files containing code that needs to refer to Sinfo.Nodes and Einfo.Entities. This code is mostly moved here from Sinfo and Einfo to break cycles. * back_end.adb: Pass node_offsets_ptr and slots_ptr to gigi, instead of nodes_ptr and flags_ptr. The Nodes and Flags tables no longer exist. (Note that gigi never used the Flags table.) * sinfo-cn.ads (Change_Identifier_To_Defining_Identifier, Change_Character_Literal_To_Defining_Character_Literal, Change_Operator_Symbol_To_Defining_Operator_Symbol): Turn N into an IN formal. * sinfo-cn.adb: Update. Add assertions, which can be removed at some point. Rewrite to use higher-level facilities. Make sure vanishing fields are zeroed out. Add with/use for new packages. * sem_util.adb: Remove "Assert(False)" immediately followed by "raise Program_Error". Use higher-level facilities such as Walk_Sinfo_Fields instead of depending on low-level Set_FieldN routines that no longer exist. Use Get_Comes_From_Source_Default instead of Default_Node.Comes_From_Source (Default_Node no longer exists). Use Set_Basic_Convention instead of Basic_Set_Convention. Add with/use for new packages. * sem_util.ads: The Convention field had getter Convention and setter Basic_Set_Convention. Make that more uniform: there is now a field called Basic_Convention, with Basic_Convention and Set_Basic_Convention as getter/setter, and write Convention and Set_Convention here. * nlists.adb: Rewrite to use abstractions, rather then depending on low-level implementation details of Atree. Necessary because those details have changed. Add with/use for new packages. * sem_ch12.adb: Use higher-level facilities such as Walk_Sinfo_Fields instead of depending on low-level Set_FieldN routines that no longer exist. Add with/use for new packages. * exp_cg.adb, sem_ch10.adb, sem_ch4.adb, sem_eval.adb, sem_prag.adb, sem_warn.adb: Change expanded names to refer to the new packages for things that moved. Add with/use for new packages. * sem_ch3.adb: Likewise. Reinitialize vanishing fields. * exp_disp.adb: Likewise. Remove failing assertion. * sinfo.ads, einfo.ads: Remove code that is now generated into Sinfo.Nodes and Einfo.Entities. * sinfo.adb, einfo.adb: Replace bodies with "pragma No_Body;". We should delete these at some point, but No_Body makes make files easier. Some code is moved to Sinfo.Nodes, Einfo.Entities, Sinfo.Utils, and Einfo.Utils. Some is no longer necessary. * treepr.adb: Rewrite to use new tables. We no longer need treeprs.ads. * treepr.ads: Add comment. * types.ads: Move types Component_Alignment_Kind and Float_Rep_Kind here. * atree.h: Major update to match atree.ads changes. Add slot types, for use by getters/setters. * types.h: Move types Component_Alignment_Kind and Float_Rep_Kind here. * fe.h: Rewrite to deal with code that has changed or moved from Atree, Sinfo, Einfo. * nlists.h: Move some code to fe.h. * alloc.ads: Split Nodes_* constants into Node_Offsets and Slots, because Atree has two separate tables. Increase values. Remove Nodes_Release_Threshold. Improve comment. * debug.adb, gnat1drv.adb: Remove obsolete gnatd.A and gnatd.N switches. Add with/use for new packages. * opt.ads: Minor comment fix. * aspects.adb, checks.adb, comperr.adb, contracts.adb, cstand.adb, debug_a.adb, errout.adb, eval_fat.adb, exp_aggr.adb, exp_atag.adb, exp_attr.adb, exp_ch11.adb, exp_ch12.adb, exp_ch13.adb, exp_ch2.adb, exp_ch3.adb, exp_ch4.adb, exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_ch8.adb, exp_ch9.adb, exp_code.adb, exp_dbug.adb, exp_dist.adb, exp_fixd.adb, exp_imgv.adb, exp_intr.adb, exp_pakd.adb, exp_prag.adb, exp_put_image.adb, exp_sel.adb, exp_smem.adb, exp_spark.adb, exp_strm.adb, exp_tss.adb, exp_unst.adb, exp_util.adb, exp_util.ads, expander.adb, freeze.adb, frontend.adb, get_targ.ads, ghost.adb, gnat_cuda.adb, impunit.adb, inline.adb, itypes.adb, itypes.ads, layout.adb, lib.adb, lib-load.adb, lib-writ.adb, lib-xref.adb, lib-xref.ads, lib-xref-spark_specific.adb, live.adb, par.adb, par_sco.adb, pprint.adb, repinfo.adb, restrict.adb, rtsfind.adb, scil_ll.adb, scn.adb, sem.adb, sem.ads, sem_aggr.adb, sem_attr.adb, sem_aux.adb, sem_case.adb, sem_cat.adb, sem_ch11.adb, sem_ch13.adb, sem_ch2.adb, sem_ch5.adb, sem_ch6.adb, sem_ch7.adb, sem_ch8.adb, sem_ch9.adb, sem_dim.adb, sem_disp.adb, sem_dist.adb, sem_elab.adb, sem_elim.adb, sem_intr.adb, sem_mech.adb, sem_res.adb, sem_scil.adb, sem_smem.adb, sem_type.adb, set_targ.ads, sinput.adb, sinput-l.adb, sprint.adb, style.adb, styleg.adb, tbuild.adb, tbuild.ads, uname.adb: Add with/use for new packages. * libgnat/a-stoubu.adb, libgnat/a-stouut.adb: Simplify to ease bootstrap. * libgnat/a-stobfi.adb, libgnat/a-stoufi.adb (Create_File, Create_New_File): Create file in binary format, to avoid introducing unwanted text conversions on Windows. Simplify to ease bootstrap. * libgnat/a-stteou__bootstrap.ads: New. * ceinfo.adb, csinfo.adb, nmake.adt, treeprs.adt, xeinfo.adb, xnmake.adb, xsinfo.adb, xtreeprs.adb: Delete. * Make-generated.in: Build and run the gen_il program to generate files. The files are generated in the ada/gen_il subdirectory, and then moved up to ada. We rely on gnatmake (as opposed to make) to build the gen_il program efficiently (i.e. don't do anything if the sources didn't change). * gcc-interface/Makefile.in (ADAFLAGS): Add -gnatU. (GNATMAKE_OBJS): Add new object files. (GENERATED_FILES_FOR_TOOLS): New variable. (../stamp-tools): Create a link for all GENERATED_FILES_FOR_TOOLS. * gcc-interface/Make-lang.in (GNAT_ADA_OBJS): Add new object files. Remove ada/treeprs.o. (GNATBIND_OBJS): Add new object files. (ada.mostlyclean): Remove ada/sdefault.adb and add ada/stamp-gen_il. (ada.maintainer-clean): Remove ada/treeprs.ads. (update-sources): Remove obsolete target. (ada_generated_files): Rename to... (ADA_GENERATED_FILES): ... this. Add new source files. Add comment. * gcc-interface/trans.c: Remove obsolete Nodes_Ptr and Flags_ptr. Add Node_Offsets_Ptr and Slots_Ptr, which point to the corresponding tables in Atree. * gcc-interface/gigi.h (gigi): New parameters for initializing Node_Offsets_Ptr and Slots_Ptr. * gcc-interface/decl.c: Numeric_Kind, Discrete_Or_Fixed_Point_Kind, and Record_Kind were nonhierarchical, and were therefore removed for simplicity. Replace uses with calls to Is_In_... functions. gnattools/ * Makefile.in (GENERATED_FILES_FOR_TOOLS): New variable. ($(GCC_DIR)/stamp-tools): Walk it for the first copy operation.
300 lines
8.3 KiB
Makefile
300 lines
8.3 KiB
Makefile
# Makefile for gnattools
|
|
# Copyright 2003, 2004, 2009, 2010 Free Software Foundation, Inc.
|
|
#
|
|
# This file is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; see the file COPYING3. If not see
|
|
# <http://www.gnu.org/licenses/>.
|
|
|
|
# Default target; must be first.
|
|
all: gnattools
|
|
|
|
# Standard autoconf-set variables.
|
|
SHELL = @SHELL@
|
|
srcdir = @srcdir@
|
|
libdir = @libdir@
|
|
build = @build@
|
|
target = @target@
|
|
host = @host@
|
|
prefix = @prefix@
|
|
INSTALL = @INSTALL@
|
|
INSTALL_DATA = @INSTALL_DATA@
|
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
|
|
# Nonstandard autoconf-set variables.
|
|
LN_S=@LN_S@
|
|
target_noncanonical=@target_noncanonical@
|
|
host_noncanonical=@host_noncanonical@
|
|
|
|
# Variables for the user (or the top level) to override.
|
|
exeext = @EXEEXT@
|
|
objext=.o
|
|
TRACE=no
|
|
ADA_FOR_BUILD=
|
|
ADA_FOR_TARGET=
|
|
LDFLAGS=
|
|
PWD_COMMAND = $${PWDCMD-pwd}
|
|
|
|
# The tedious process of getting CFLAGS right.
|
|
CFLAGS=-g
|
|
GCC_WARN_CFLAGS = -W -Wall
|
|
WARN_CFLAGS = @warn_cflags@
|
|
|
|
ADA_CFLAGS=@ADA_CFLAGS@
|
|
|
|
# Variables for gnattools.
|
|
ADAFLAGS= -gnatpg -gnata
|
|
|
|
# For finding the GCC build dir, which is used far too much
|
|
GCC_DIR=../gcc
|
|
|
|
# Full path to top source directory
|
|
ftop_srcdir := $(shell cd $(srcdir)/..;${PWD_COMMAND})
|
|
|
|
# Absolute srcdir for gcc (why do we want absolute? I dunno)
|
|
fsrcdir := $(shell cd $(srcdir)/../gcc/; ${PWD_COMMAND})
|
|
|
|
# Useful "subroutines" for the excess includes
|
|
INCLUDES_FOR_SUBDIR = -iquote . -iquote .. -iquote ../.. \
|
|
-iquote $(fsrcdir)/ada -iquote $(fsrcdir)/config \
|
|
-iquote $(fsrcdir) -I$(ftop_srcdir)/include
|
|
ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)/ada
|
|
|
|
CXX_LFLAGS = \
|
|
-B../../../$(target_noncanonical)/libstdc++-v3/src/.libs \
|
|
-B../../../$(target_noncanonical)/libstdc++-v3/libsupc++/.libs \
|
|
-L../../../$(target_noncanonical)/libstdc++-v3/src/.libs \
|
|
-L../../../$(target_noncanonical)/libstdc++-v3/libsupc++/.libs
|
|
|
|
# Variables for gnattools, native
|
|
TOOLS_FLAGS_TO_PASS_NATIVE= \
|
|
"CC=../../xgcc -B../../" \
|
|
"CXX=../../xg++ -B../../ $(CXX_LFLAGS)" \
|
|
"CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
|
|
"LDFLAGS=$(LDFLAGS)" \
|
|
"ADAFLAGS=$(ADAFLAGS)" \
|
|
"ADA_CFLAGS=$(ADA_CFLAGS)" \
|
|
"INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
|
|
"ADA_INCLUDES=-I- -I../rts $(ADA_INCLUDES_FOR_SUBDIR)"\
|
|
"exeext=$(exeext)" \
|
|
"fsrcdir=$(fsrcdir)" \
|
|
"srcdir=$(fsrcdir)" \
|
|
"GNATMAKE=../../gnatmake" \
|
|
"GNATLINK=../../gnatlink" \
|
|
"GNATBIND=../../gnatbind" \
|
|
"TOOLSCASE=native"
|
|
|
|
# Variables for regnattools
|
|
TOOLS_FLAGS_TO_PASS_RE= \
|
|
"CC=../../xgcc -B../../" \
|
|
"CXX=../../xg++ -B../../ $(CXX_LFLAGS)" \
|
|
"CFLAGS=$(CFLAGS)" \
|
|
"LDFLAGS=$(LDFLAGS)" \
|
|
"ADAFLAGS=$(ADAFLAGS)" \
|
|
"ADA_CFLAGS=$(ADA_CFLAGS)" \
|
|
"INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
|
|
"ADA_INCLUDES=-I../rts $(ADA_INCLUDES_FOR_SUBDIR)"\
|
|
"exeext=$(exeext)" \
|
|
"fsrcdir=$(fsrcdir)" \
|
|
"srcdir=$(fsrcdir)" \
|
|
"GNATMAKE=../../gnatmake" \
|
|
"GNATLINK=../../gnatlink" \
|
|
"GNATBIND=../../gnatbind" \
|
|
"TOOLSCASE=cross"
|
|
|
|
# Variables for gnattools, cross
|
|
ifeq ($(build), $(host))
|
|
GNATMAKE_FOR_HOST=gnatmake
|
|
GNATLINK_FOR_HOST=gnatlink
|
|
GNATBIND_FOR_HOST=gnatbind
|
|
GNATLS_FOR_HOST=gnatls
|
|
else
|
|
GNATMAKE_FOR_HOST=$(host_noncanonical)-gnatmake
|
|
GNATLINK_FOR_HOST=$(host_noncanonical)-gnatlink
|
|
GNATBIND_FOR_HOST=$(host_noncanonical)-gnatbind
|
|
GNATLS_FOR_HOST=$(host_noncanonical)-gnatls
|
|
endif
|
|
|
|
# Put the host RTS dir first in the PATH to hide the default runtime
|
|
# files that are among the sources
|
|
RTS_DIR:=$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep adalib )))
|
|
|
|
TOOLS_FLAGS_TO_PASS_CROSS= \
|
|
"CC=$(CC)" \
|
|
"CXX=$(CXX)" \
|
|
"CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
|
|
"LDFLAGS=$(LDFLAGS)" \
|
|
"ADAFLAGS=$(ADAFLAGS)" \
|
|
"ADA_CFLAGS=$(ADA_CFLAGS)" \
|
|
"INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
|
|
"ADA_INCLUDES=-I$(RTS_DIR)/../adainclude -I$(RTS_DIR) $(ADA_INCLUDES_FOR_SUBDIR)" \
|
|
"exeext=$(exeext)" \
|
|
"fsrcdir=$(fsrcdir)" \
|
|
"srcdir=$(fsrcdir)" \
|
|
"GNATMAKE=$(GNATMAKE_FOR_HOST)" \
|
|
"GNATLINK=$(GNATLINK_FOR_HOST)" \
|
|
"GNATBIND=$(GNATBIND_FOR_HOST)" \
|
|
"TOOLSCASE=cross" \
|
|
"LIBGNAT="
|
|
|
|
# File lists
|
|
# ----------
|
|
|
|
# File associations set by configure
|
|
EXTRA_GNATTOOLS = @EXTRA_GNATTOOLS@
|
|
TOOLS_TARGET_PAIRS = @TOOLS_TARGET_PAIRS@
|
|
|
|
# Makefile targets
|
|
# ----------------
|
|
|
|
.PHONY: gnattools gnattools-native gnattools-cross regnattools
|
|
gnattools: @default_gnattools_target@
|
|
|
|
# Sanity check
|
|
$(GCC_DIR)/stamp-gnatlib-rts:
|
|
@if [ ! -f $(GCC_DIR)/stamp-gnatlib-rts ] ; \
|
|
then \
|
|
echo "Cannot build gnattools while gnatlib is out of date or unbuilt" ; \
|
|
false; \
|
|
else \
|
|
true; \
|
|
fi
|
|
|
|
|
|
# Build directory for the tools. We first need to copy the generated files,
|
|
# then the target-dependent sources using the same mechanism as for gnatlib.
|
|
|
|
GENERATED_FILES_FOR_TOOLS = \
|
|
einfo-entities.ads einfo-entities.adb sdefault.adb seinfo.ads \
|
|
sinfo-nodes.ads sinfo-nodes.adb snames.ads snames.adb
|
|
|
|
$(GCC_DIR)/stamp-tools:
|
|
-rm -rf $(GCC_DIR)/ada/tools
|
|
-mkdir -p $(GCC_DIR)/ada/tools
|
|
-(cd $(GCC_DIR)/ada/tools; $(foreach FILE,$(GENERATED_FILES_FOR_TOOLS), \
|
|
$(LN_S) ../$(FILE) $(FILE);))
|
|
-$(foreach PAIR,$(TOOLS_TARGET_PAIRS), \
|
|
rm -f $(GCC_DIR)/ada/tools/$(word 1,$(subst <, ,$(PAIR)));\
|
|
$(LN_S) $(fsrcdir)/ada/$(word 2,$(subst <, ,$(PAIR))) \
|
|
$(GCC_DIR)/ada/tools/$(word 1,$(subst <, ,$(PAIR)));)
|
|
touch $(GCC_DIR)/stamp-tools
|
|
|
|
# gnatmake/link tools cannot always be built with gnatmake/link for bootstrap
|
|
# reasons: gnatmake should be built with a recent compiler, a recent compiler
|
|
# may not generate ALI files compatible with an old gnatmake so it is important
|
|
# to be able to build gnatmake without a version of gnatmake around. Once
|
|
# everything has been compiled once, gnatmake can be recompiled with itself
|
|
# (see target regnattools)
|
|
gnattools-native: $(GCC_DIR)/stamp-tools $(GCC_DIR)/stamp-gnatlib-rts
|
|
# gnattools1
|
|
$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
|
|
$(TOOLS_FLAGS_TO_PASS_NATIVE) \
|
|
../../gnatmake$(exeext) ../../gnatlink$(exeext)
|
|
# gnattools2
|
|
$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
|
|
$(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools
|
|
|
|
# gnatmake/link can be built with recent gnatmake/link if they are available.
|
|
# This is especially convenient for building cross tools or for rebuilding
|
|
# the tools when the original bootstrap has already be done.
|
|
regnattools: $(GCC_DIR)/stamp-gnatlib-rts
|
|
# gnattools1-re
|
|
$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
|
|
$(TOOLS_FLAGS_TO_PASS_RE) INCLUDES="" \
|
|
gnatmake-re gnatlink-re
|
|
# gnattools2
|
|
$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
|
|
$(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools
|
|
|
|
gnattools-cross: $(GCC_DIR)/stamp-tools
|
|
# gnattools1-re
|
|
$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
|
|
$(TOOLS_FLAGS_TO_PASS_CROSS) INCLUDES="" \
|
|
gnatmake-re gnatlink-re
|
|
# gnattools2
|
|
$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
|
|
$(TOOLS_FLAGS_TO_PASS_CROSS) common-tools
|
|
|
|
# Other
|
|
# -----
|
|
|
|
# Check uninstalled version.
|
|
check:
|
|
|
|
# Check installed version.
|
|
installcheck:
|
|
|
|
# Build info (none here).
|
|
info:
|
|
|
|
# Build DVI (none here).
|
|
dvi:
|
|
|
|
# Build PDF (none here).
|
|
pdf:
|
|
|
|
# Build HTML (none here).
|
|
html:
|
|
|
|
.PHONY: check installcheck info dvi pdf html
|
|
|
|
# Build TAGS (none here).
|
|
TAGS:
|
|
|
|
# Installation rules.
|
|
install:
|
|
|
|
install-strip: install
|
|
|
|
install-info:
|
|
|
|
install-pdf:
|
|
|
|
install-html:
|
|
|
|
.PHONY: install install-strip install-info install-pdf install-html
|
|
|
|
# Cleaning rules.
|
|
mostlyclean:
|
|
|
|
clean:
|
|
|
|
distclean:
|
|
$(RM) Makefile config.status config.log config.cache
|
|
|
|
maintainer-clean:
|
|
|
|
.PHONY: mostlyclean clean distclean maintainer-clean
|
|
|
|
# Rules for rebuilding this Makefile.
|
|
Makefile: $(srcdir)/Makefile.in config.status
|
|
CONFIG_FILES=$@ ; \
|
|
CONFIG_HEADERS= ; \
|
|
$(SHELL) ./config.status
|
|
|
|
config.status: $(srcdir)/configure
|
|
$(SHELL) ./config.status --recheck
|
|
|
|
AUTOCONF = autoconf
|
|
configure_deps = \
|
|
$(srcdir)/configure.ac \
|
|
$(srcdir)/../config/acx.m4 \
|
|
$(srcdir)/../config/override.m4
|
|
|
|
$(srcdir)/configure: @MAINT@ $(configure_deps)
|
|
cd $(srcdir) && $(AUTOCONF)
|
|
|
|
# Don't export variables to the environment, in order to not confuse
|
|
# configure.
|
|
.NOEXPORT:
|
|
|