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.
19 all: gnatlib gnattools
21 # Standard autoconf-set variables.
28 INSTALL_DATA
= @INSTALL_DATA@
29 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
31 # Nonstandard autoconf-set variables.
32 enable_shared
= @enable_shared@
34 target_noncanonical
=@target_noncanonical@
36 # Variables for the user (or the top level) to override.
38 GNATLIBFLAGS
= -W
-Wall
-gnatpg
47 # The tedious process of getting CFLAGS right.
49 LOOSE_WARN
= -W
-Wall
-Wwrite-strings
-Wstrict-prototypes
-Wmissing-prototypes
50 GCC_WARN_CFLAGS
= $(LOOSE_WARN
) $(NOCOMMON_FLAG
)
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
)
58 # Variables for gnattools.
59 ADAFLAGS
= -gnatpg
-gnata
60 ADA_INCLUDE_DIR
= $(libsubdir
)/adainclude
61 ADA_RTL_OBJ_DIR
= $(libsubdir
)/adalib
63 # For finding the GCC build dir, which is used far too much
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
)
70 TARGET_LIBGCC2_CFLAGS
=
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
),)
82 # Get possible host-specific override for libsubdir (ick).
83 xmake_file
=$(subst /config
,/..
/gcc
/config
,$(gcc_xmake_file
))
84 ifneq ($(xmake_file
),)
90 "LDFLAGS=$(LDFLAGS)" \
96 "STAGE_PREFIX=$(STAGE_PREFIX)" \
97 "CC=$(cc_set_by_configure)" \
98 "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)"
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)"
110 ADA_TOOLS_FLAGS_TO_PASS
=\
111 "CC=../../xgcc -B../../" \
114 "ADAFLAGS=$(ADAFLAGS)" \
115 "ADA_INCLUDES=-I../rts" \
116 "GNATMAKE=../../gnatmake" \
117 "GNATLINK=../../gnatlink" \
118 "GNATBIND=../../gnatbind"
123 # Rules to build gnatlib.
124 .PHONY
: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-shared
125 gnatlib
: @default_gnatlib_target@
128 $(MAKE
) -C
$(GCC_DIR
)/ada
$(FLAGS_TO_PASS
) \
129 GNATLIBFLAGS
="$(GNATLIBFLAGS)" \
130 GNATLIBCFLAGS
="$(GNATLIBCFLAGS)" \
131 TARGET_LIBGCC2_CFLAGS
="$(TARGET_LIBGCC2_CFLAGS)" \
132 THREAD_KIND
="$(THREAD_KIND)" \
137 $(MAKE
) -C
$(GCC_DIR
)/ada
$(FLAGS_TO_PASS
) \
138 GNATLIBFLAGS
="$(GNATLIBFLAGS)" \
139 GNATLIBCFLAGS
="$(GNATLIBCFLAGS)" \
140 TARGET_LIBGCC2_CFLAGS
="$(TARGET_LIBGCC2_CFLAGS)" \
141 THREAD_KIND
="$(THREAD_KIND)" \
146 $(MAKE
) -C
$(GCC_DIR
)/ada
$(FLAGS_TO_PASS
) \
147 GNATLIBFLAGS
="$(GNATLIBFLAGS)" \
148 GNATLIBCFLAGS
="$(GNATLIBCFLAGS)" \
149 GNATLIBLDFLAGS
="$(GNATLIBLDFLAGS)" \
150 TARGET_LIBGCC2_CFLAGS
="$(TARGET_LIBGCC2_CFLAGS)" \
151 THREAD_KIND
="$(THREAD_KIND)" \
155 .PHONY
: rts-zfp rts-ravenscar
157 $(MAKE
) -C
$(GCC_DIR
)/ada
$(FLAGS_TO_PASS
) \
158 GNATMAKE
=..
/gnatmake-cross \
162 $(MAKE
) -C
$(GCC_DIR
)/ada
$(FLAGS_TO_PASS
) \
163 GNATMAKE
=..
/gnatmake-cross \
166 # Rules to build gnattools.
167 # For cross builds of gnattools,
168 # put the host RTS dir first in the PATH to hide the default runtime
169 # files that are among the sources
170 RTS_DIR
:=$(strip $(subst \
,/,$(shell gnatls
-v | grep adalib
)))
171 .PHONY
: gnattools regnattools
173 if
test $(build
) = $(target
) ; then \
174 $(MAKE
) -C
$(GCC_DIR
)/ada
$(FLAGS_TO_PASS
) $(ADA_FLAGS_TO_PASS
) \
175 ADA_INCLUDES
="-I- -I../rts" \
176 CC
="../../xgcc -B../../" STAGE_PREFIX
=..
/..
/ gnattools1
; \
177 $(MAKE
) -C
$(GCC_DIR
)/ada
$(ADA_TOOLS_FLAGS_TO_PASS
) gnattools2
; \
178 $(MAKE
) -C
$(GCC_DIR
)/ada
$(ADA_TOOLS_FLAGS_TO_PASS
) gnattools3
; \
180 $(MAKE
) -C
$(GCC_DIR
)/ada
$(FLAGS_TO_PASS
) $(ADA_FLAGS_TO_PASS
) \
181 ADA_INCLUDES
="-I$(RTS_DIR)../adainclude -I$(RTS_DIR)" \
182 GNATMAKE
="gnatmake" \
183 GNATBIND
="gnatbind" \
184 GNATLINK
="gnatlink" \
186 gnattools1-re gnattools2 gnattools4
; \
187 $(MAKE
) $(FLAGS_TO_PASS
) ada.
all.cross
; \
191 $(MAKE
) -C
$(GCC_DIR
)/ada
$(ADA_TOOLS_FLAGS_TO_PASS
) gnattools1-re
192 $(MAKE
) -C
$(GCC_DIR
)/ada
$(ADA_TOOLS_FLAGS_TO_PASS
) gnattools2
193 $(MAKE
) -C
$(GCC_DIR
)/ada
$(ADA_TOOLS_FLAGS_TO_PASS
) gnattools3
195 # It's unclear whether this is even needed, and if so whether it should run
196 # *before* the rest of crossgnattools or *after* it.
198 if
[ -f
$(GCC_DIR
)/gnatbind
$(exeext
) ] ; then \
199 mv
$(GCC_DIR
)/gnatbind
$(exeext
) $(GCC_DIR
)/gnatbind-cross
$(exeext
); \
201 if
[ -f
$(GCC_DIR
)/gnatbl
$(exeext
) ] ; then \
202 mv
$(GCC_DIR
)/gnatbl
$(exeext
) $(GCC_DIR
)/gnatbl-cross
$(exeext
); \
204 if
[ -f
$(GCC_DIR
)/gnatchop
$(exeext
) ] ; then \
205 mv
$(GCC_DIR
)/gnatchop
$(exeext
) $(GCC_DIR
)/gnatchop-cross
$(exeext
); \
207 if
[ -f
$(GCC_DIR
)/gnat
$(exeext
) ] ; then \
208 mv
$(GCC_DIR
)/gnat
$(exeext
) $(GCC_DIR
)/gnat-cross
$(exeext
); \
210 if
[ -f
$(GCC_DIR
)/gnatkr
$(exeext
) ] ; then \
211 mv
$(GCC_DIR
)/gnatkr
$(exeext
) $(GCC_DIR
)/gnatkr-cross
$(exeext
); \
213 if
[ -f
$(GCC_DIR
)/gnatlink
$(exeext
) ] ; then \
214 mv
$(GCC_DIR
)/gnatlink
$(exeext
) $(GCC_DIR
)/gnatlink-cross
$(exeext
); \
216 if
[ -f
$(GCC_DIR
)/gnatls
$(exeext
) ] ; then \
217 mv
$(GCC_DIR
)/gnatls
$(exeext
) $(GCC_DIR
)/gnatls-cross
$(exeext
); \
219 if
[ -f
$(GCC_DIR
)/gnatmake
$(exeext
) ] ; then \
220 mv
$(GCC_DIR
)/gnatmake
$(exeext
) $(GCC_DIR
)/gnatmake-cross
$(exeext
); \
222 if
[ -f
$(GCC_DIR
)/gnatmem
$(exeext
) ] ; then \
223 mv
$(GCC_DIR
)/gnatmem
$(exeext
) $(GCC_DIR
)/gnatmem-cross
$(exeext
); \
225 if
[ -f
$(GCC_DIR
)/gnatname
$(exeext
) ] ; then \
226 mv
$(GCC_DIR
)/gnatname
$(exeext
) $(GCC_DIR
)/gnatname-cross
$(exeext
); \
228 if
[ -f
$(GCC_DIR
)/gnatprep
$(exeext
) ] ; then \
229 mv
$(GCC_DIR
)/gnatprep
$(exeext
) $(GCC_DIR
)/gnatprep-cross
$(exeext
); \
231 if
[ -f
$(GCC_DIR
)/gnatxref
$(exeext
) ] ; then \
232 mv
$(GCC_DIR
)/gnatxref
$(exeext
) $(GCC_DIR
)/gnatxref-cross
$(exeext
); \
234 if
[ -f
$(GCC_DIR
)/gnatfind
$(exeext
) ] ; then \
235 mv
$(GCC_DIR
)/gnatfind
$(exeext
) $(GCC_DIR
)/gnatfind-cross
$(exeext
); \
237 if
[ -f
$(GCC_DIR
)/gnatclean
$(exeext
) ] ; then \
238 mv
$(GCC_DIR
)/gnatclean
$(exeext
) $(GCC_DIR
)/gnatclean-cross
$(exeext
); \
240 if
[ -f
$(GCC_DIR
)/gnatsym
$(exeext
) ] ; then \
241 mv
$(GCC_DIR
)/gnatsym
$(exeext
) $(GCC_DIR
)/gnatsym-cross
$(exeext
); \
243 if
[ -f
$(GCC_DIR
)/gpr2make
$(exeext
) ] ; then \
244 mv
$(GCC_DIR
)/gpr2make
$(exeext
) $(GCC_DIR
)/gpr2make-cross
$(exeext
); \
246 if
[ -f
$(GCC_DIR
)/gprcmd
$(exeext
) ] ; then \
247 mv
$(GCC_DIR
)/gprcmd
$(exeext
) $(GCC_DIR
)/gprcmd-cross
$(exeext
); \
250 # Check uninstalled version.
253 # Check installed version.
256 # Build info (none here).
259 # Build DVI (none here).
262 # Build TAGS (none here).
265 # Installation rules.
276 $(RM
) Makefile config.status config.log
280 # Rules for rebuilding this Makefile.
281 Makefile
: $(srcdir)/Makefile.in config.status
284 $(SHELL
) .
/config.status
286 config.status
: $(srcdir)/configure
287 $(SHELL
) .
/config.status
--recheck
289 $(srcdir)/configure
: @MAINT@
$(srcdir)/configure.in
290 cd
$(srcdir) && autoconf