re PR ada/58239 (pretty-print.c:789: undefined reference to `operator delete(void*)')
[platform/upstream/gcc.git] / gnattools / Makefile.in
1 # Makefile for gnattools
2 #   Copyright 2003, 2004, 2009, 2010 Free Software Foundation, Inc.
3 #
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.
13
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/>.
17
18 # Default target; must be first.
19 all: gnattools
20
21 # Standard autoconf-set variables.
22 SHELL = @SHELL@
23 srcdir = @srcdir@
24 libdir = @libdir@
25 build = @build@
26 target = @target@
27 prefix = @prefix@
28 INSTALL = @INSTALL@
29 INSTALL_DATA = @INSTALL_DATA@
30 INSTALL_PROGRAM = @INSTALL_PROGRAM@
31
32 # Nonstandard autoconf-set variables.
33 LN_S=@LN_S@
34 target_noncanonical=@target_noncanonical@
35
36 # Variables for the user (or the top level) to override.
37 exeext = @EXEEXT@
38 objext=.o
39 TRACE=no
40 ADA_FOR_BUILD=
41 ADA_FOR_TARGET=
42 LDFLAGS=
43 PWD_COMMAND = $${PWDCMD-pwd}
44
45 # The tedious process of getting CFLAGS right.
46 CFLAGS=-g
47 GCC_WARN_CFLAGS = -W -Wall
48 WARN_CFLAGS = @warn_cflags@
49
50 ADA_CFLAGS=@ADA_CFLAGS@
51
52 # Variables for gnattools.
53 ADAFLAGS= -gnatpg -gnata
54
55 # For finding the GCC build dir, which is used far too much
56 GCC_DIR=../gcc
57
58 # Absolute srcdir for gcc (why do we want absolute?  I dunno)
59 fsrcdir := $(shell cd $(srcdir)/../gcc/; ${PWD_COMMAND})
60
61 # Useful "subroutines" for the excess includes
62 INCLUDES_FOR_SUBDIR = -I. -I.. -I../.. -I$(fsrcdir)/ada -I$(fsrcdir)/config \
63         -I$(fsrcdir)/../include -I$(fsrcdir)
64 ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)/ada
65
66 CXX_LFLAGS = \
67  -B../../../$(target_noncanonical)/libstdc++-v3/src/.libs \
68  -B../../../$(target_noncanonical)/libstdc++-v3/libsupc++/.libs \
69  -L../../../$(target_noncanonical)/libstdc++-v3/src/.libs \
70  -L../../../$(target_noncanonical)/libstdc++-v3/libsupc++/.libs
71
72 # Variables for gnattools, native
73 TOOLS_FLAGS_TO_PASS_NATIVE= \
74         "CC=../../xgcc -B../../" \
75         "CXX=../../xg++ -B../../ $(CXX_LFLAGS)" \
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"
89
90 # Variables for regnattools
91 TOOLS_FLAGS_TO_PASS_RE= \
92         "CC=../../xgcc -B../../" \
93         "CXX=../../xg++ -B../../ $(CXX_LFLAGS)" \
94         "CFLAGS=$(CFLAGS)" \
95         "ADAFLAGS=$(ADAFLAGS)" \
96         "ADA_CFLAGS=$(ADA_CFLAGS)" \
97         "INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
98         "ADA_INCLUDES=-I../rts $(ADA_INCLUDES_FOR_SUBDIR)"\
99         "exeext=$(exeext)" \
100         "fsrcdir=$(fsrcdir)" \
101         "srcdir=$(fsrcdir)" \
102         "GNATMAKE=../../gnatmake" \
103         "GNATLINK=../../gnatlink" \
104         "GNATBIND=../../gnatbind" \
105         "TOOLSCASE=cross"
106
107 # Variables for gnattools, cross
108 TOOLS_FLAGS_TO_PASS_CROSS= \
109         "CC=$(CC)" \
110         "CXX=$(CXX)" \
111         "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
112         "LDFLAGS=$(LDFLAGS)" \
113         "ADAFLAGS=$(ADAFLAGS)"  \
114         "ADA_CFLAGS=$(ADA_CFLAGS)" \
115         "INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
116         "ADA_INCLUDES=-I$(RTS_DIR)../adainclude -I$(RTS_DIR) $(ADA_INCLUDES_FOR_SUBDIR)" \
117         "exeext=$(exeext)" \
118         "fsrcdir=$(fsrcdir)" \
119         "srcdir=$(fsrcdir)" \
120         "GNATMAKE=gnatmake" \
121         "GNATLINK=gnatlink" \
122         "GNATBIND=gnatbind" \
123         "TOOLSCASE=cross" \
124         "LIBGNAT="
125
126 # File lists
127 # ----------
128
129 # File associations set by configure
130 EXTRA_GNATTOOLS = @EXTRA_GNATTOOLS@
131 TOOLS_TARGET_PAIRS = @TOOLS_TARGET_PAIRS@
132
133 # Makefile targets
134 # ----------------
135
136 .PHONY: gnattools gnattools-native gnattools-cross regnattools
137 gnattools: @default_gnattools_target@
138
139 # Sanity check
140 $(GCC_DIR)/stamp-gnatlib-rts:
141         @if [ ! -f $(GCC_DIR)/stamp-gnatlib-rts ] ; \
142         then \
143           echo "Cannot build gnattools while gnatlib is out of date or unbuilt" ; \
144           false; \
145         else \
146           true; \
147         fi
148
149
150 # Build directory for the tools. Let's copy the target-dependent
151 # sources using the same mechanism as for gnatlib. The other sources are
152 # accessed using the vpath directive in ada/Makefile.in
153
154 $(GCC_DIR)/stamp-tools:
155         -rm -rf $(GCC_DIR)/ada/tools
156         -mkdir -p $(GCC_DIR)/ada/tools
157         -(cd $(GCC_DIR)/ada/tools; $(LN_S) ../sdefault.adb ../snames.ads ../snames.adb .)
158         -$(foreach PAIR,$(TOOLS_TARGET_PAIRS), \
159                   rm -f $(GCC_DIR)/ada/tools/$(word 1,$(subst <, ,$(PAIR)));\
160                   $(LN_S) $(fsrcdir)/ada/$(word 2,$(subst <, ,$(PAIR))) \
161                         $(GCC_DIR)/ada/tools/$(word 1,$(subst <, ,$(PAIR)));)
162         touch $(GCC_DIR)/stamp-tools
163
164 # gnatmake/link tools cannot always be built with gnatmake/link for bootstrap 
165 # reasons: gnatmake should be built with a recent compiler, a recent compiler
166 # may not generate ALI files compatible with an old gnatmake so it is important
167 # to be able to build gnatmake without a version of gnatmake around. Once 
168 # everything has been compiled once, gnatmake can be recompiled with itself 
169 # (see target regnattools) 
170 gnattools-native: $(GCC_DIR)/stamp-tools $(GCC_DIR)/stamp-gnatlib-rts
171         # gnattools1
172         $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
173           $(TOOLS_FLAGS_TO_PASS_NATIVE) \
174           ../../gnatmake$(exeext) ../../gnatlink$(exeext)
175         # gnattools2
176         $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
177           $(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools
178
179 # gnatmake/link can be built with recent gnatmake/link if they are available.
180 # This is especially convenient for building cross tools or for rebuilding
181 # the tools when the original bootstrap has already be done.
182 regnattools: $(GCC_DIR)/stamp-gnatlib-rts
183         # gnattools1-re
184         $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
185           $(TOOLS_FLAGS_TO_PASS_RE) INCLUDES="" \
186           gnatmake-re gnatlink-re
187         # gnattools2
188         $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
189           $(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools
190
191 # For cross builds of gnattools,
192 # put the host RTS dir first in the PATH to hide the default runtime
193 # files that are among the sources
194 # FIXME: This should be done in configure.
195 RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib )))
196 gnattools-cross: $(GCC_DIR)/stamp-tools
197         # gnattools1-re
198         $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
199           $(TOOLS_FLAGS_TO_PASS_CROSS) INCLUDES="" \
200           gnatmake-re gnatlink-re
201         # gnattools2
202         $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
203           $(TOOLS_FLAGS_TO_PASS_CROSS) common-tools
204         # Rename cross tools to where the GCC makefile wants them when
205         # installing.  FIXME: installation should be done elsewhere.
206         if [ -f $(GCC_DIR)/gnatbind$(exeext) ] ; then \
207           mv $(GCC_DIR)/gnatbind$(exeext) $(GCC_DIR)/gnatbind-cross$(exeext); \
208         fi
209         if [ -f $(GCC_DIR)/gnatchop$(exeext) ] ; then \
210           mv $(GCC_DIR)/gnatchop$(exeext) $(GCC_DIR)/gnatchop-cross$(exeext); \
211         fi
212         if [ -f $(GCC_DIR)/gnat$(exeext) ] ; then \
213           mv $(GCC_DIR)/gnat$(exeext) $(GCC_DIR)/gnat-cross$(exeext); \
214         fi
215         if [ -f $(GCC_DIR)/gnatkr$(exeext) ] ; then \
216           mv $(GCC_DIR)/gnatkr$(exeext) $(GCC_DIR)/gnatkr-cross$(exeext); \
217         fi
218         if [ -f $(GCC_DIR)/gnatlink$(exeext) ] ; then \
219           mv $(GCC_DIR)/gnatlink$(exeext) $(GCC_DIR)/gnatlink-cross$(exeext); \
220         fi
221         if [ -f $(GCC_DIR)/gnatls$(exeext) ] ; then \
222           mv $(GCC_DIR)/gnatls$(exeext) $(GCC_DIR)/gnatls-cross$(exeext); \
223         fi
224         if [ -f $(GCC_DIR)/gnatmake$(exeext) ] ; then \
225           mv $(GCC_DIR)/gnatmake$(exeext) $(GCC_DIR)/gnatmake-cross$(exeext); \
226         fi
227         if [ -f $(GCC_DIR)/gnatmem$(exeext) ] ; then \
228           mv $(GCC_DIR)/gnatmem$(exeext) $(GCC_DIR)/gnatmem-cross$(exeext); \
229         fi
230         if [ -f $(GCC_DIR)/gnatname$(exeext) ] ; then \
231           mv $(GCC_DIR)/gnatname$(exeext) $(GCC_DIR)/gnatname-cross$(exeext); \
232         fi
233         if [ -f $(GCC_DIR)/gnatprep$(exeext) ] ; then \
234           mv $(GCC_DIR)/gnatprep$(exeext) $(GCC_DIR)/gnatprep-cross$(exeext); \
235         fi
236         if [ -f $(GCC_DIR)/gnatxref$(exeext) ] ; then \
237           mv $(GCC_DIR)/gnatxref$(exeext) $(GCC_DIR)/gnatxref-cross$(exeext); \
238         fi
239         if [ -f $(GCC_DIR)/gnatfind$(exeext) ] ; then \
240           mv $(GCC_DIR)/gnatfind$(exeext) $(GCC_DIR)/gnatfind-cross$(exeext); \
241         fi
242         if [ -f $(GCC_DIR)/gnatclean$(exeext) ] ; then \
243           mv $(GCC_DIR)/gnatclean$(exeext) $(GCC_DIR)/gnatclean-cross$(exeext); \
244         fi
245         if [ -f $(GCC_DIR)/gnatsym$(exeext) ] ; then \
246           mv $(GCC_DIR)/gnatsym$(exeext) $(GCC_DIR)/gnatsym-cross$(exeext); \
247         fi
248
249 # Other
250 # -----
251
252 # Check uninstalled version.
253 check:
254
255 # Check installed version.
256 installcheck:
257
258 # Build info (none here).
259 info:
260
261 # Build DVI (none here).
262 dvi:
263
264 # Build PDF (none here).
265 pdf:
266
267 # Build HTML (none here).
268 html:
269
270 .PHONY: check installcheck info dvi pdf html
271
272 # Build TAGS (none here).
273 TAGS:
274
275 # Installation rules.
276 install:
277
278 install-strip: install
279
280 install-info:
281
282 install-pdf:
283
284 install-html:
285
286 .PHONY: install install-strip install-info install-pdf install-html
287
288 # Cleaning rules.
289 mostlyclean:
290
291 clean:
292
293 distclean:
294         $(RM) Makefile config.status config.log
295
296 maintainer-clean:
297
298 .PHONY: mostlyclean clean distclean maintainer-clean
299
300 # Rules for rebuilding this Makefile.
301 Makefile: $(srcdir)/Makefile.in config.status
302         CONFIG_FILES=$@ ; \
303         CONFIG_HEADERS= ; \
304         $(SHELL) ./config.status
305
306 config.status: $(srcdir)/configure
307         $(SHELL) ./config.status --recheck
308
309 AUTOCONF = autoconf
310 configure_deps = \
311         $(srcdir)/configure.ac \
312         $(srcdir)/../config/acx.m4 \
313         $(srcdir)/../config/override.m4
314
315 $(srcdir)/configure: @MAINT@ $(configure_deps)
316         cd $(srcdir) && $(AUTOCONF)
317
318 # Don't export variables to the environment, in order to not confuse
319 # configure.
320 .NOEXPORT:
321