2 # Copyright 2003, 2004 Free Software Foundation, Inc.
4 # This file is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 # Default target; must be first.
21 # Standard autoconf-set variables.
28 # Nonstandard autoconf-set variables.
29 enable_shared = @enable_shared@
32 # Variables for the user (or the top level) to override.
34 GNATLIBFLAGS= -W -Wall -gnatpg
40 # The tedious process of getting CFLAGS right.
42 LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
43 GCC_WARN_CFLAGS = $(LOOSE_WARN) $(NOCOMMON_FLAG)
47 # HPPA is literally the only target which sets X_ADA_CFLAGS
48 X_ADA_CFLAGS=@x_ada_cflags@
49 ALL_ADA_CFLAGS=$(X_ADA_CFLAGS) $(T_ADA_CFLAGS) $(ADA_CFLAGS)
51 # For finding the GCC build dir, which is used far too much
52 GCC_DIR=../../$(HOST_SUBDIR)/gcc
53 # Include fragment generated by GCC configure.
54 include $(GCC_DIR)/libada-mk
56 TARGET_LIBGCC2_CFLAGS=
58 # Get target-specific overrides for TARGET_LIBGCC2_CFLAGS
59 # and possibly GNATLIBCFLAGS. Currently this uses files
60 # in gcc/config. The 'subst' call is used to rerelativize them
61 # from their gcc locations. This is hackery, but there isn't
62 # yet a better way to do this.
63 tmake_file=$(subst /config,/../gcc/config,$(gcc_tmake_file))
64 ifneq ($(tmake_file),)
70 "LDFLAGS=$(LDFLAGS)" \
76 "STAGE_PREFIX=$(STAGE_PREFIX)" \
77 "CC=$(host_cc_for_libada)" \
78 "GCC_FOR_TARGET=$(CC)" \
79 "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)"
81 # Rules to build gnatlib.
82 .PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared
83 gnatlib: @default_gnatlib_target@
85 gnatlib-plain: $(GCC_DIR)/ada/Makefile
86 test -f stamp-libada || \
87 $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
88 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
89 GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
90 TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
91 THREAD_KIND="$(THREAD_KIND)" \
96 gnatlib-sjlj gnatlib-zcx gnatlib-shared: $(GCC_DIR)/ada/Makefile
97 test -f stamp-libada || \
98 $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
99 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
100 GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
101 TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
102 THREAD_KIND="$(THREAD_KIND)" \
105 && touch stamp-libada
107 # Check uninstalled version.
110 # Check installed version.
113 # Build info (none here).
116 # Build DVI (none here).
119 # Build html (none here).
122 # Build TAGS (none here).
125 # Installation rules.
136 $(RM) Makefile config.status config.log
140 # Rules for rebuilding this Makefile.
141 Makefile: $(srcdir)/Makefile.in config.status
144 $(SHELL) ./config.status
146 config.status: $(srcdir)/configure
147 $(SHELL) ./config.status --recheck
149 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac
150 cd $(srcdir) && autoconf
152 # Don't export variables to the environment, in order to not confuse