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.
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@
44 # Variables for the user (or the top level) to override.
46 GNATLIBFLAGS= -W -Wall -gnatpg
51 # The tedious process of getting CFLAGS right.
53 LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
54 GCC_WARN_CFLAGS = $(LOOSE_WARN)
55 WARN_CFLAGS = @warn_cflags@
57 TARGET_LIBGCC2_CFLAGS=
60 # Get target-specific overrides for TARGET_LIBGCC2_CFLAGS.
61 host_subdir = @host_subdir@
62 GCC_DIR=$(MULTIBUILDTOP)../../$(host_subdir)/gcc
63 include $(GCC_DIR)/libgcc.mvars
65 target_noncanonical:=@target_noncanonical@
66 version := $(shell cat $(srcdir)/../gcc/BASE-VER)
67 libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR)
68 ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR))
70 # exeext should not be used because it's the *host* exeext. We're building
71 # a *target* library, aren't we?!? Likewise for CC. Still, provide bogus
72 # definitions just in case something slips through the safety net provided
73 # by recursive make invocations in gcc/ada/Makefile.in
74 LIBADA_FLAGS_TO_PASS = \
76 "LDFLAGS=$(LDFLAGS)" \
79 "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \
80 "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \
81 "TARGET_LIBGCC2_CFLAGS=$(TARGET_LIBGCC2_CFLAGS)" \
82 "THREAD_KIND=$(THREAD_KIND)" \
84 "MULTISUBDIR=$(MULTISUBDIR)" \
85 "libsubdir=$(libsubdir)" \
88 "exeext=.exeext.should.not.be.used " \
89 'CC=the.host.compiler.should.not.be.needed' \
90 "GCC_FOR_TARGET=$(CC)" \
91 "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)"
93 # Rules to build gnatlib.
94 .PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared oscons
95 gnatlib: @default_gnatlib_target@
97 gnatlib-plain: oscons $(GCC_DIR)/ada/Makefile
98 test -f stamp-libada || \
99 $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) gnatlib \
100 && touch stamp-libada
101 $(LN_S) $(ADA_RTS_DIR) adainclude
102 $(LN_S) $(ADA_RTS_DIR) adalib
104 gnatlib-sjlj gnatlib-zcx gnatlib-shared: oscons $(GCC_DIR)/ada/Makefile
105 test -f stamp-libada || \
106 $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) $@ \
107 && touch stamp-libada
108 $(LN_S) $(ADA_RTS_DIR) adainclude
109 $(LN_S) $(ADA_RTS_DIR) adalib
112 $(MAKE) -C $(GCC_DIR) $(LIBADA_FLAGS_TO_PASS) ada/s-oscons.ads
114 install-gnatlib: $(GCC_DIR)/ada/Makefile
115 $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) install-gnatlib
117 # Check uninstalled version.
120 # Check installed version.
123 # Build info (none here).
126 # Build DVI (none here).
129 # Build PDF (none here).
132 # Build html (none here).
135 # Build TAGS (none here).
138 # Installation rules.
139 install: install-gnatlib
140 $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
150 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE)
153 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE)
156 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE)
157 $(RM) Makefile config.status config.log
161 # Rules for rebuilding this Makefile.
162 Makefile: $(srcdir)/Makefile.in config.status
165 $(SHELL) ./config.status
167 config.status: $(srcdir)/configure
168 $(SHELL) ./config.status --recheck
170 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac \
171 $(srcdir)/../config/acx.m4 $(srcdir)/../config/override.m4
172 cd $(srcdir) && autoconf
174 # Don't export variables to the environment, in order to not confuse