OSDN Git Service

* Makefile.in: Fix errors introduced in previous change (in particular,
[pf3gnuchains/gcc-fork.git] / libada / Makefile.in
1 # Makefile for libada.
2 #   Copyright 2003, 2004 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 2 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; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 # Default target; must be first.
19 all: gnatlib gnattools
20
21 # Standard autoconf-set variables.
22 SHELL = @SHELL@
23 srcdir = @srcdir@
24 build = @build@
25 target = @target@
26 prefix = @prefix@
27 INSTALL = @INSTALL@
28 INSTALL_DATA = @INSTALL_DATA@
29 INSTALL_PROGRAM = @INSTALL_PROGRAM@
30
31 # Nonstandard autoconf-set variables.
32 enable_shared = @enable_shared@
33 LN_S=@LN_S@
34 target_noncanonical=@target_noncanonical@
35
36 # Variables for the user (or the top level) to override.
37 objext=.o
38 GNATLIBFLAGS= -W -Wall -gnatpg
39 THREAD_KIND=native
40 TRACE=no
41 GNATLIBLDFLAGS=
42 ADA_FOR_BUILD=
43 ADA_FOR_TARGET=
44 LDFLAGS=
45 STAGE_PREFIX=
46
47 # The tedious process of getting CFLAGS right.
48 CFLAGS=-g
49 LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
50 GCC_WARN_CFLAGS = $(LOOSE_WARN) $(NOCOMMON_FLAG)
51
52 ADA_CFLAGS=
53 T_ADA_CFLAGS=
54 # HPPA is literally the only target which sets X_ADA_CFLAGS
55 X_ADA_CFLAGS=@x_ada_cflags@
56 ALL_ADA_CFLAGS=$(X_ADA_CFLAGS) $(T_ADA_CFLAGS) $(ADA_CFLAGS)
57
58 # Variables for gnattools.
59 ADAFLAGS= -gnatpg -gnata
60 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
61 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
62
63 # For finding the GCC build dir, which is used far too much
64 GCC_DIR=../../gcc
65 # Include fragment generated by GCC configure.
66 include $(GCC_DIR)/libada-mk
67 # Variables based on those gleaned from the GCC makefile.  :-P
68 libsubdir=$(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
69
70 TARGET_LIBGCC2_CFLAGS=
71 GNATLIBCFLAGS= -g -O2
72 # Get target-specific overrides for TARGET_LIBGCC2_CFLAGS
73 # and possibly GNATLIBCFLAGS.  Currently this uses files
74 # in gcc/config.  The 'subst' call is used to rerelativize them
75 # from their gcc locations.  This is hackery, but there isn't
76 # yet a better way to do this.
77 tmake_file=$(subst /config,/../gcc/config,$(gcc_tmake_file))
78 ifneq ($(tmake_file),)
79 include $(tmake_file)
80 endif
81
82 # Get possible host-specific override for libsubdir (ick).
83 xmake_file=$(subst /config,/../gcc/config,$(gcc_xmake_file))
84 ifneq ($(xmake_file),)
85 include $(xmake_file)
86 endif
87
88 FLAGS_TO_PASS = \
89         "MAKEOVERRIDES=" \
90         "LDFLAGS=$(LDFLAGS)" \
91         "LN_S=$(LN_S)" \
92         "SHELL=$(SHELL)" \
93         "exeext=$(exeext)" \
94         "objext=$(objext)" \
95         "prefix=$(prefix)" \
96         "STAGE_PREFIX=$(STAGE_PREFIX)" \
97         "CC=$(cc_set_by_configure)" \
98         "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)"
99
100 ADA_FLAGS_TO_PASS = \
101         "ADA_FOR_BUILD=$(ADA_FOR_BUILD)"        \
102         "ADA_INCLUDE_DIR=$(ADA_INCLUDE_DIR)"    \
103         "ADA_RTL_OBJ_DIR=$(ADA_RTL_OBJ_DIR)"    \
104         "ADAFLAGS=$(ADAFLAGS)"                  \
105         "ADA_FOR_TARGET=$(ADA_FOR_TARGET)"      \
106         "INSTALL=$(INSTALL)"                    \
107         "INSTALL_DATA=$(INSTALL_DATA)"          \
108         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
109
110 ADA_TOOLS_FLAGS_TO_PASS=\
111         "CC=../../xgcc -B../../"        \
112         "CFLAGS=$(CFLAGS)"              \
113         "exeext=$(exeext)"              \
114         "ADAFLAGS=$(ADAFLAGS)"          \
115         "ADA_INCLUDES=-I../rts"         \
116         "GNATMAKE=../../gnatmake"       \
117         "GNATLINK=../../gnatlink"       \
118         "GNATBIND=../../gnatbind"
119
120 # Rules to build gnatlib.
121 .PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared
122 gnatlib: @default_gnatlib_target@
123
124 gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared:
125         $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
126           GNATLIBFLAGS="$(GNATLIBFLAGS)" \
127           GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
128           TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
129           THREAD_KIND="$(THREAD_KIND)" \
130           TRACE="$(TRACE)" $@
131
132 .PHONY: rts-zfp rts-ravenscar
133 rts-zfp rts-ravenscar:
134         $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
135           GNATMAKE=../gnatmake-cross $@
136
137 # Rules to build gnattools.
138 # For cross builds of gnattools,
139 # put the host RTS dir first in the PATH to hide the default runtime
140 # files that are among the sources
141 RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib )))
142
143 ifeq ($(build),$(target))
144   GNATTOOLS = gnattools-native
145 else
146   GNATTOOLS = gnattools-cross
147 endif
148
149 .PHONY: gnattools regnattools
150 gnattools: $(GNATTOOLS)
151
152 gnattools-native: gnatlib
153         $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
154           ADA_INCLUDES="-I- -I../rts" \
155           CC="../../xgcc -B../../" STAGE_PREFIX=../../ gnattools1
156         $(MAKE) -C $(GCC_DIR)/ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools2
157         $(MAKE) -C $(GCC_DIR)/ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools3
158
159 regnattools:
160         $(MAKE) -C $(GCC_DIR)/ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools1-re
161         $(MAKE) -C $(GCC_DIR)/ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools2
162         $(MAKE) -C $(GCC_DIR)/ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools3
163
164 gnattools-cross: gnatlib
165         $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
166           ADA_INCLUDES="-I$(RTS_DIR)../adainclude -I$(RTS_DIR)" \
167           GNATMAKE="gnatmake" \
168           GNATBIND="gnatbind" \
169           GNATLINK="gnatlink" \
170           LIBGNAT="" \
171           gnattools1-re gnattools2 gnattools4
172         # rename cross tools, as expected by the GCC makefile when installing
173         if [ -f $(GCC_DIR)/gnatbind$(exeext) ] ; then \
174           mv $(GCC_DIR)/gnatbind$(exeext) $(GCC_DIR)/gnatbind-cross$(exeext); \
175         fi
176         if [ -f $(GCC_DIR)/gnatbl$(exeext) ] ; then \
177           mv $(GCC_DIR)/gnatbl$(exeext) $(GCC_DIR)/gnatbl-cross$(exeext); \
178         fi
179         if [ -f $(GCC_DIR)/gnatchop$(exeext) ] ; then \
180           mv $(GCC_DIR)/gnatchop$(exeext) $(GCC_DIR)/gnatchop-cross$(exeext); \
181         fi
182         if [ -f $(GCC_DIR)/gnat$(exeext) ] ; then \
183           mv $(GCC_DIR)/gnat$(exeext) $(GCC_DIR)/gnat-cross$(exeext); \
184         fi
185         if [ -f $(GCC_DIR)/gnatkr$(exeext) ] ; then \
186           mv $(GCC_DIR)/gnatkr$(exeext) $(GCC_DIR)/gnatkr-cross$(exeext); \
187         fi
188         if [ -f $(GCC_DIR)/gnatlink$(exeext) ] ; then \
189           mv $(GCC_DIR)/gnatlink$(exeext) $(GCC_DIR)/gnatlink-cross$(exeext); \
190         fi
191         if [ -f $(GCC_DIR)/gnatls$(exeext) ] ; then \
192           mv $(GCC_DIR)/gnatls$(exeext) $(GCC_DIR)/gnatls-cross$(exeext); \
193         fi
194         if [ -f $(GCC_DIR)/gnatmake$(exeext) ] ; then \
195           mv $(GCC_DIR)/gnatmake$(exeext) $(GCC_DIR)/gnatmake-cross$(exeext); \
196         fi
197         if [ -f $(GCC_DIR)/gnatmem$(exeext) ] ; then \
198           mv $(GCC_DIR)/gnatmem$(exeext) $(GCC_DIR)/gnatmem-cross$(exeext); \
199         fi
200         if [ -f $(GCC_DIR)/gnatname$(exeext) ] ; then \
201           mv $(GCC_DIR)/gnatname$(exeext) $(GCC_DIR)/gnatname-cross$(exeext); \
202         fi
203         if [ -f $(GCC_DIR)/gnatprep$(exeext) ] ; then \
204           mv $(GCC_DIR)/gnatprep$(exeext) $(GCC_DIR)/gnatprep-cross$(exeext); \
205         fi
206         if [ -f $(GCC_DIR)/gnatxref$(exeext) ] ; then \
207           mv $(GCC_DIR)/gnatxref$(exeext) $(GCC_DIR)/gnatxref-cross$(exeext); \
208         fi
209         if [ -f $(GCC_DIR)/gnatfind$(exeext) ] ; then \
210           mv $(GCC_DIR)/gnatfind$(exeext) $(GCC_DIR)/gnatfind-cross$(exeext); \
211         fi
212         if [ -f $(GCC_DIR)/gnatclean$(exeext) ] ; then \
213           mv $(GCC_DIR)/gnatclean$(exeext) $(GCC_DIR)/gnatclean-cross$(exeext); \
214         fi
215         if [ -f $(GCC_DIR)/gnatsym$(exeext) ] ; then \
216           mv $(GCC_DIR)/gnatsym$(exeext) $(GCC_DIR)/gnatsym-cross$(exeext); \
217         fi
218         if [ -f $(GCC_DIR)/gpr2make$(exeext) ] ; then \
219           mv $(GCC_DIR)/gpr2make$(exeext) $(GCC_DIR)/gpr2make-cross$(exeext); \
220         fi
221         if [ -f $(GCC_DIR)/gprcmd$(exeext) ] ; then \
222           mv $(GCC_DIR)/gprcmd$(exeext) $(GCC_DIR)/gprcmd-cross$(exeext); \
223         fi
224
225 # Check uninstalled version.
226 check:
227
228 # Check installed version.
229 installcheck:
230
231 # Build info (none here).
232 info:
233
234 # Build DVI (none here).
235 dvi:
236
237 # Build TAGS (none here).
238 TAGS:
239
240 # Installation rules.
241 install:
242
243 install-info:
244
245 # Cleaning rules.
246 mostlyclean:
247
248 clean:
249
250 distclean:
251         $(RM) Makefile config.status config.log
252
253 maintainer-clean:
254
255 # Rules for rebuilding this Makefile.
256 Makefile: $(srcdir)/Makefile.in config.status
257         CONFIG_FILES=$@ ; \
258         CONFIG_HEADERS= ; \
259         $(SHELL) ./config.status
260
261 config.status: $(srcdir)/configure
262         $(SHELL) ./config.status --recheck
263
264 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.in
265         cd $(srcdir) && autoconf