re PR target/81550 (gcc.target/powerpc/loop_align.c fails starting with r250482)
[official-gcc.git] / gnattools / Makefile.in
blobd19147fe5d74753249d9b9d8dceab79da72b1537
1 # Makefile for gnattools
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.
8 #
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.
19 all: gnattools
21 # Standard autoconf-set variables.
22 SHELL = @SHELL@
23 srcdir = @srcdir@
24 libdir = @libdir@
25 build = @build@
26 target = @target@
27 host = @host@
28 prefix = @prefix@
29 INSTALL = @INSTALL@
30 INSTALL_DATA = @INSTALL_DATA@
31 INSTALL_PROGRAM = @INSTALL_PROGRAM@
33 # Nonstandard autoconf-set variables.
34 LN_S=@LN_S@
35 target_noncanonical=@target_noncanonical@
36 host_noncanonical=@host_noncanonical@
38 # Variables for the user (or the top level) to override.
39 exeext = @EXEEXT@
40 objext=.o
41 TRACE=no
42 ADA_FOR_BUILD=
43 ADA_FOR_TARGET=
44 LDFLAGS=
45 PWD_COMMAND = $${PWDCMD-pwd}
47 # The tedious process of getting CFLAGS right.
48 CFLAGS=-g
49 GCC_WARN_CFLAGS = -W -Wall
50 WARN_CFLAGS = @warn_cflags@
52 ADA_CFLAGS=@ADA_CFLAGS@
54 # Variables for gnattools.
55 ADAFLAGS= -gnatpg -gnata
57 # For finding the GCC build dir, which is used far too much
58 GCC_DIR=../gcc
60 # Full path to top source directory
61 ftop_srcdir := $(shell cd $(srcdir)/..;${PWD_COMMAND})
63 # Absolute srcdir for gcc (why do we want absolute? I dunno)
64 fsrcdir := $(shell cd $(srcdir)/../gcc/; ${PWD_COMMAND})
66 # Useful "subroutines" for the excess includes
67 INCLUDES_FOR_SUBDIR = -iquote . -iquote .. -iquote ../.. \
68 -iquote $(fsrcdir)/ada -iquote $(fsrcdir)/config \
69 -iquote $(fsrcdir) -I$(ftop_srcdir)/include
70 ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)/ada
72 # Variables for gnattools, native
73 TOOLS_FLAGS_TO_PASS_NATIVE= \
74 "CC=../../xgcc -B../../" \
75 "CXX=$(CXX)" \
76 "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
77 "LDFLAGS=$(LDFLAGS)" \
78 "ADAFLAGS=$(ADAFLAGS)" \
79 "ADA_CFLAGS=$(ADA_CFLAGS)" \
80 "INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
81 "ADA_INCLUDES=-I- -I../rts $(ADA_INCLUDES_FOR_SUBDIR)"\
82 "exeext=$(exeext)" \
83 "fsrcdir=$(fsrcdir)" \
84 "srcdir=$(fsrcdir)" \
85 "GNATMAKE=../../gnatmake" \
86 "GNATLINK=../../gnatlink" \
87 "GNATBIND=../../gnatbind" \
88 "TOOLSCASE=native"
90 # Variables for regnattools
91 TOOLS_FLAGS_TO_PASS_RE= \
92 "CC=../../xgcc -B../../" \
93 "CXX=$(CXX)" \
94 "CFLAGS=$(CFLAGS)" \
95 "LDFLAGS=$(LDFLAGS)" \
96 "ADAFLAGS=$(ADAFLAGS)" \
97 "ADA_CFLAGS=$(ADA_CFLAGS)" \
98 "INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
99 "ADA_INCLUDES=-I../rts $(ADA_INCLUDES_FOR_SUBDIR)"\
100 "exeext=$(exeext)" \
101 "fsrcdir=$(fsrcdir)" \
102 "srcdir=$(fsrcdir)" \
103 "GNATMAKE=../../gnatmake" \
104 "GNATLINK=../../gnatlink" \
105 "GNATBIND=../../gnatbind" \
106 "TOOLSCASE=cross"
108 # Variables for gnattools, cross
109 ifeq ($(build), $(host))
110 GNATMAKE_FOR_HOST=gnatmake
111 GNATLINK_FOR_HOST=gnatlink
112 GNATBIND_FOR_HOST=gnatbind
113 GNATLS_FOR_HOST=gnatls
114 else
115 GNATMAKE_FOR_HOST=$(host_noncanonical)-gnatmake
116 GNATLINK_FOR_HOST=$(host_noncanonical)-gnatlink
117 GNATBIND_FOR_HOST=$(host_noncanonical)-gnatbind
118 GNATLS_FOR_HOST=$(host_noncanonical)-gnatls
119 endif
121 # Put the host RTS dir first in the PATH to hide the default runtime
122 # files that are among the sources
123 RTS_DIR:=$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep adalib )))
125 TOOLS_FLAGS_TO_PASS_CROSS= \
126 "CC=$(CC)" \
127 "CXX=$(CXX)" \
128 "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
129 "LDFLAGS=$(LDFLAGS)" \
130 "ADAFLAGS=$(ADAFLAGS)" \
131 "ADA_CFLAGS=$(ADA_CFLAGS)" \
132 "INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
133 "ADA_INCLUDES=-I$(RTS_DIR)/../adainclude -I$(RTS_DIR) $(ADA_INCLUDES_FOR_SUBDIR)" \
134 "exeext=$(exeext)" \
135 "fsrcdir=$(fsrcdir)" \
136 "srcdir=$(fsrcdir)" \
137 "GNATMAKE=$(GNATMAKE_FOR_HOST)" \
138 "GNATLINK=$(GNATLINK_FOR_HOST)" \
139 "GNATBIND=$(GNATBIND_FOR_HOST)" \
140 "TOOLSCASE=cross" \
141 "LIBGNAT="
143 # File lists
144 # ----------
146 # File associations set by configure
147 EXTRA_GNATTOOLS = @EXTRA_GNATTOOLS@
148 TOOLS_TARGET_PAIRS = @TOOLS_TARGET_PAIRS@
150 # Makefile targets
151 # ----------------
153 .PHONY: gnattools gnattools-native gnattools-cross regnattools
154 gnattools: @default_gnattools_target@
156 # Sanity check
157 $(GCC_DIR)/stamp-gnatlib-rts:
158 @if [ ! -f $(GCC_DIR)/stamp-gnatlib-rts ] ; \
159 then \
160 echo "Cannot build gnattools while gnatlib is out of date or unbuilt" ; \
161 false; \
162 else \
163 true; \
167 # Build directory for the tools. Let's copy the target-dependent
168 # sources using the same mechanism as for gnatlib. The other sources are
169 # accessed using the vpath directive in ada/Makefile.in
171 $(GCC_DIR)/stamp-tools:
172 -rm -rf $(GCC_DIR)/ada/tools
173 -mkdir -p $(GCC_DIR)/ada/tools
174 -(cd $(GCC_DIR)/ada/tools; $(LN_S) ../sdefault.adb ../snames.ads ../snames.adb .)
175 -$(foreach PAIR,$(TOOLS_TARGET_PAIRS), \
176 rm -f $(GCC_DIR)/ada/tools/$(word 1,$(subst <, ,$(PAIR)));\
177 $(LN_S) $(fsrcdir)/ada/$(word 2,$(subst <, ,$(PAIR))) \
178 $(GCC_DIR)/ada/tools/$(word 1,$(subst <, ,$(PAIR)));)
179 touch $(GCC_DIR)/stamp-tools
181 # gnatmake/link tools cannot always be built with gnatmake/link for bootstrap
182 # reasons: gnatmake should be built with a recent compiler, a recent compiler
183 # may not generate ALI files compatible with an old gnatmake so it is important
184 # to be able to build gnatmake without a version of gnatmake around. Once
185 # everything has been compiled once, gnatmake can be recompiled with itself
186 # (see target regnattools)
187 gnattools-native: $(GCC_DIR)/stamp-tools $(GCC_DIR)/stamp-gnatlib-rts
188 # gnattools1
189 $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
190 $(TOOLS_FLAGS_TO_PASS_NATIVE) \
191 ../../gnatmake$(exeext) ../../gnatlink$(exeext)
192 # gnattools2
193 $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
194 $(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools
196 # gnatmake/link can be built with recent gnatmake/link if they are available.
197 # This is especially convenient for building cross tools or for rebuilding
198 # the tools when the original bootstrap has already be done.
199 regnattools: $(GCC_DIR)/stamp-gnatlib-rts
200 # gnattools1-re
201 $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
202 $(TOOLS_FLAGS_TO_PASS_RE) INCLUDES="" \
203 gnatmake-re gnatlink-re
204 # gnattools2
205 $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
206 $(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools
208 gnattools-cross: $(GCC_DIR)/stamp-tools
209 # gnattools1-re
210 $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
211 $(TOOLS_FLAGS_TO_PASS_CROSS) INCLUDES="" \
212 gnatmake-re gnatlink-re
213 # gnattools2
214 $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
215 $(TOOLS_FLAGS_TO_PASS_CROSS) common-tools
217 # Other
218 # -----
220 # Check uninstalled version.
221 check:
223 # Check installed version.
224 installcheck:
226 # Build info (none here).
227 info:
229 # Build DVI (none here).
230 dvi:
232 # Build PDF (none here).
233 pdf:
235 # Build HTML (none here).
236 html:
238 .PHONY: check installcheck info dvi pdf html
240 # Build TAGS (none here).
241 TAGS:
243 # Installation rules.
244 install:
246 install-strip: install
248 install-info:
250 install-pdf:
252 install-html:
254 .PHONY: install install-strip install-info install-pdf install-html
256 # Cleaning rules.
257 mostlyclean:
259 clean:
261 distclean:
262 $(RM) Makefile config.status config.log config.cache
264 maintainer-clean:
266 .PHONY: mostlyclean clean distclean maintainer-clean
268 # Rules for rebuilding this Makefile.
269 Makefile: $(srcdir)/Makefile.in config.status
270 CONFIG_FILES=$@ ; \
271 CONFIG_HEADERS= ; \
272 $(SHELL) ./config.status
274 config.status: $(srcdir)/configure
275 $(SHELL) ./config.status --recheck
277 AUTOCONF = autoconf
278 configure_deps = \
279 $(srcdir)/configure.ac \
280 $(srcdir)/../config/acx.m4 \
281 $(srcdir)/../config/override.m4
283 $(srcdir)/configure: @MAINT@ $(configure_deps)
284 cd $(srcdir) && $(AUTOCONF)
286 # Don't export variables to the environment, in order to not confuse
287 # configure.
288 .NOEXPORT: