2 # Copyright 2003, 2004, 2009, 2010 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 3 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; see the file COPYING3. If not see
16 # <http://www.gnu.org/licenses/>.
18 # Default target; must be first.
20 $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
24 ## Multilib support variables.
32 # Standard autoconf-set variables.
40 # Nonstandard autoconf-set variables.
41 enable_shared = @enable_shared@
47 LN_S_RECURSIVE = cp -pR
49 LN_S_RECURSIVE = $(LN_S)
52 # Variables for the user (or the top level) to override.
54 GNATLIBFLAGS= -W -Wall -gnatpg
59 # The tedious process of getting CFLAGS right.
61 LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
62 GCC_WARN_CFLAGS = $(LOOSE_WARN)
63 WARN_CFLAGS = @warn_cflags@
65 TARGET_LIBGCC2_CFLAGS=
67 GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
68 -DIN_RTS @have_getipinfo@
70 # Get target-specific overrides for TARGET_LIBGCC2_CFLAGS.
71 host_subdir = @host_subdir@
72 GCC_DIR=$(MULTIBUILDTOP)../../$(host_subdir)/gcc
73 include $(GCC_DIR)/libgcc.mvars
75 target_noncanonical:=@target_noncanonical@
76 version := $(shell cat $(srcdir)/../gcc/BASE-VER)
77 libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR)
78 ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR))
79 ADA_RTS_SUBDIR=./rts$(subst /,_,$(MULTISUBDIR))
81 # exeext should not be used because it's the *host* exeext. We're building
82 # a *target* library, aren't we?!? Likewise for CC. Still, provide bogus
83 # definitions just in case something slips through the safety net provided
84 # by recursive make invocations in gcc/ada/Makefile.in
85 LIBADA_FLAGS_TO_PASS = \
87 "LDFLAGS=$(LDFLAGS)" \
90 "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \
91 "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \
92 "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \
93 "TARGET_LIBGCC2_CFLAGS=$(TARGET_LIBGCC2_CFLAGS)" \
94 "THREAD_KIND=$(THREAD_KIND)" \
96 "MULTISUBDIR=$(MULTISUBDIR)" \
97 "libsubdir=$(libsubdir)" \
100 "exeext=.exeext.should.not.be.used " \
101 'CC=the.host.compiler.should.not.be.needed' \
102 "GCC_FOR_TARGET=$(CC)" \
103 "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)"
105 # Rules to build gnatlib.
106 .PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared osconstool
107 gnatlib: @default_gnatlib_target@
109 gnatlib-plain: osconstool $(GCC_DIR)/ada/Makefile
110 test -f stamp-libada || \
111 $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) gnatlib \
112 && touch stamp-libada
115 $(LN_S_RECURSIVE) $(ADA_RTS_DIR) adainclude
116 $(LN_S_RECURSIVE) $(ADA_RTS_DIR) adalib
118 gnatlib-sjlj gnatlib-zcx gnatlib-shared: osconstool $(GCC_DIR)/ada/Makefile
119 test -f stamp-libada || \
120 $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) $@ \
121 && touch stamp-libada
124 $(LN_S_RECURSIVE) $(ADA_RTS_DIR) adainclude
125 $(LN_S_RECURSIVE) $(ADA_RTS_DIR) adalib
128 $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) ./bldtools/oscons/xoscons
130 install-gnatlib: $(GCC_DIR)/ada/Makefile
131 $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) install-gnatlib
133 # Check uninstalled version.
136 # Check installed version.
139 # Build info (none here).
142 # Build DVI (none here).
145 # Build PDF (none here).
148 # Build html (none here).
151 # Build TAGS (none here).
154 .PHONY: check installcheck info dvi pdf html
156 # Installation rules.
157 install: install-gnatlib
158 $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
160 install-strip: install
168 .PHONY: install install-strip install-info install-pdf install-html
172 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE)
175 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE)
178 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE)
179 $(RM) Makefile config.status config.log
183 .PHONY: mostlyclean clean distclean maintainer-clean
185 # Rules for rebuilding this Makefile.
186 Makefile: $(srcdir)/Makefile.in config.status
189 $(SHELL) ./config.status
191 config.status: $(srcdir)/configure
192 $(SHELL) ./config.status --recheck
196 $(srcdir)/configure.ac \
197 $(srcdir)/../config/acx.m4 \
198 $(srcdir)/../config/override.m4 \
199 $(srcdir)/../config/multi.m4
201 $(srcdir)/configure: @MAINT@ $(configure_deps)
202 cd $(srcdir) && $(AUTOCONF)
204 # Don't export variables to the environment, in order to not confuse