merge from gcc
[binutils-gdb.git] / Makefile.tpl
1 [+ AutoGen5 template -*- Mode: Makefile -*-
2 in
3 +]
4
5 # Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'.
6 #
7 # Makefile for directory with subdirs to build.
8 # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
9 # 1999, 2000, 2001, 2002 Free Software Foundation
10 #
11 # This file is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
15 #
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #
25
26 VPATH=@srcdir@
27 links=@configlinks@
28
29 build_alias=@build_alias@
30 build_cpu=@build_cpu@
31 build_vendor=@build_vendor@
32 build_os=@build_os@
33 build_canonical=@build_cpu@-@build_vendor@-@build_os@
34 host_alias=@host_alias@
35 host_cpu=@host_cpu@
36 host_vendor=@host_vendor@
37 host_os=@host_os@
38 host_canonical=@host_cpu@-@host_vendor@-@host_os@
39 target_alias=@target_alias@
40 target_cpu=@target_cpu@
41 target_vendor=@target_vendor@
42 target_os=@target_os@
43 target_canonical=@target_cpu@-@target_vendor@-@target_os@
44
45 enable_shared = @enable_shared@
46 enable_threads = @enable_threads@
47 enable_version_specific_runtime_libs = @enable_version_specific_runtime_libs@
48 # The file containing GCC's version number.
49 gcc_version_trigger = @gcc_version_trigger@
50 gcc_version = @gcc_version@
51
52 srcdir = @srcdir@
53
54 prefix = @prefix@
55 exec_prefix = @exec_prefix@
56
57 bindir = @bindir@
58 sbindir = @sbindir@
59 libexecdir = @libexecdir@
60 datadir = @datadir@
61 sysconfdir = @sysconfdir@
62 sharedstatedir = @sharedstatedir@
63 localstatedir = @localstatedir@
64 libdir = @libdir@
65 includedir = @includedir@
66 oldincludedir = @oldincludedir@
67 infodir = @infodir@
68 mandir = @mandir@
69 gxx_include_dir = @gxx_include_dir@
70 libstdcxx_incdir = @libstdcxx_incdir@
71
72 tooldir = @tooldir@
73 build_tooldir = @build_tooldir@
74
75 program_transform_name = @program_transform_name@
76
77 man1dir = $(mandir)/man1
78 man2dir = $(mandir)/man2
79 man3dir = $(mandir)/man3
80 man4dir = $(mandir)/man4
81 man5dir = $(mandir)/man5
82 man6dir = $(mandir)/man6
83 man7dir = $(mandir)/man7
84 man8dir = $(mandir)/man8
85 man9dir = $(mandir)/man9
86 # Directory in which the compiler finds executables, libraries, etc.
87 libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
88 GDB_NLM_DEPS =
89
90 SHELL = @config_shell@
91
92 # pwd command to use. Allow user to override default by setting PWDCMD in
93 # the environment to account for automounters. The make variable must not
94 # be called PWDCMD, otherwise the value set here is passed to make
95 # subprocesses and overrides the setting from the user's environment.
96 PWD = $${PWDCMD-pwd}
97
98 # INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
99 # cygwin host.
100 INSTALL_PROGRAM_ARGS =
101
102 INSTALL = $(SHELL) $$s/install-sh -c
103 INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
104 INSTALL_SCRIPT = $(INSTALL)
105 INSTALL_DATA = $(INSTALL) -m 644
106
107 AS = @AS@
108 AR = @AR@
109 AR_FLAGS = rc
110 CC = @CC@
111
112 # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
113 # here so that they can be overridden by Makefile fragments.
114 BUILD_CC = $(CC_FOR_BUILD)
115 BUILD_PREFIX = @BUILD_PREFIX@
116 BUILD_PREFIX_1 = @BUILD_PREFIX_1@
117
118 CFLAGS = @CFLAGS@
119 CXXFLAGS = @CXXFLAGS@
120
121 LDFLAGS =
122 LIBCFLAGS = $(CFLAGS)
123 CFLAGS_FOR_BUILD = $(CFLAGS)
124 # During gcc bootstrap, if we use some random cc for stage1 then
125 # CFLAGS will be just -g. We want to ensure that TARGET libraries
126 # (which we know are built with gcc) are built with optimizations so
127 # prepend -O2 when setting CFLAGS_FOR_TARGET.
128 CFLAGS_FOR_TARGET = -O2 $(CFLAGS)
129 LDFLAGS_FOR_TARGET =
130 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
131 PICFLAG =
132 PICFLAG_FOR_TARGET =
133
134 CXX = @CXX@
135
136 # Use -O2 to stress test the compiler.
137 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
138 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
139 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
140
141 DLLTOOL = @DLLTOOL@
142 WINDRES = @WINDRES@
143
144 NM = @NM@
145
146 LD = @LD@
147
148 # These values are substituted by configure.
149 DEFAULT_YACC = @DEFAULT_YACC@
150 DEFAULT_LEX = @DEFAULT_LEX@
151 DEFAULT_M4 = @DEFAULT_M4@
152
153 BISON=@BISON@
154 USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \
155 echo $$r/bison/bison -L $$s/bison/ ; \
156 else \
157 echo bison ; \
158 fi`
159
160 YACC=@YACC@
161 USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \
162 echo $$r/bison/bison -y -L $$s/bison/ ; \
163 elif [ -f $$r/byacc/byacc ] ; then \
164 echo $$r/byacc/byacc ; \
165 else \
166 echo ${DEFAULT_YACC} ; \
167 fi`
168
169 LEX=@LEX@
170 USUAL_LEX = `if [ -f $$r/flex/flex ] ; \
171 then echo $$r/flex/flex ; \
172 else echo ${DEFAULT_LEX} ; fi`
173
174 M4 = `if [ -f $$r/m4/m4 ] ; \
175 then echo $$r/m4/m4 ; \
176 else echo ${DEFAULT_M4} ; fi`
177
178 # For an installed makeinfo, we require it to be from texinfo 4 or
179 # higher, else we use the "missing" dummy.
180 MAKEINFO=@MAKEINFO@
181 USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
182 then echo $$r/texinfo/makeinfo/makeinfo ; \
183 else if (makeinfo --version \
184 | egrep 'texinfo[^0-9]*([1-3][0-9]|[4-9])') >/dev/null 2>&1; \
185 then echo makeinfo; else echo $$s/missing makeinfo; fi; fi`
186
187 # This just becomes part of the MAKEINFO definition passed down to
188 # sub-makes. It lets flags be given on the command line while still
189 # using the makeinfo from the object tree.
190 MAKEINFOFLAGS =
191
192 EXPECT = `if [ -f $$r/expect/expect ] ; \
193 then echo $$r/expect/expect ; \
194 else echo expect ; fi`
195
196 RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
197 then echo $$s/dejagnu/runtest ; \
198 else echo runtest ; fi`
199
200
201 # compilers to use to create programs which must be run in the build
202 # environment.
203 CC_FOR_BUILD = @CC_FOR_BUILD@
204 CXX_FOR_BUILD = $(CXX)
205
206 SUBDIRS = @configdirs@
207
208 # This is set by the configure script to the list of directories which
209 # should be built using the target tools.
210 TARGET_CONFIGDIRS = @target_configdirs@
211
212 # Target libraries are put under this directory:
213 # Changed by configure to $(target_alias) if cross.
214 TARGET_SUBDIR = @target_subdir@
215
216 BUILD_CONFIGDIRS = libiberty
217 BUILD_SUBDIR = @build_subdir@
218
219 # This is set by the configure script to the arguments to use when configuring
220 # directories built for the build system.
221 BUILD_CONFIGARGS = @build_configargs@
222
223 # This is set by the configure script to the arguments to use when configuring
224 # directories built for the host system.
225 HOST_CONFIGARGS = @host_configargs@
226
227 # This is set by the configure script to the arguments to use when configuring
228 # directories built for the target.
229 TARGET_CONFIGARGS = @target_configargs@
230
231 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
232 # was used.
233 SET_LIB_PATH = @SET_LIB_PATH@
234
235 # This is the name of the environment variable used for the path to
236 # the libraries. This may be changed by configure.in.
237 RPATH_ENVVAR = @RPATH_ENVVAR@
238
239 # This is the list of directories that may be needed in RPATH_ENVVAR
240 # so that programs built for the host machine work.
241 HOST_LIB_PATH = $$r/bfd:$$r/opcodes
242
243 # This is the list of directories that may be needed in RPATH_ENVVAR
244 # so that prorgams built for the target machine work.
245 TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
246
247 # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
248 # Some platforms don't like blank entries, so we remove duplicate,
249 # leading and trailing colons.
250 REALLY_SET_LIB_PATH = \
251 $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
252
253 # Should be substed by configure.in
254 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
255 CC_FOR_TARGET = @CC_FOR_TARGET@
256 CXX_FOR_TARGET = @CXX_FOR_TARGET@
257 RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@
258 CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
259 RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
260 GCJ_FOR_TARGET = @GCJ_FOR_TARGET@
261
262 # If GCC_FOR_TARGET is not overriden on the command line, then this
263 # variable is passed down to the gcc Makefile, where it is used to
264 # build libgcc2.a. We define it here so that it can itself be
265 # overridden on the command line.
266 GCC_FOR_TARGET=@GCC_FOR_TARGET@
267 USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
268
269 AS_FOR_TARGET=@AS_FOR_TARGET@
270 USUAL_AS_FOR_TARGET = ` \
271 if [ -f $$r/gas/as-new ] ; then \
272 echo $$r/gas/as-new ; \
273 elif [ -f $$r/gcc/xgcc ]; then \
274 $(CC_FOR_TARGET) -print-prog-name=as ; \
275 else \
276 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
277 echo $(AS); \
278 else \
279 echo as | sed '$(program_transform_name)' ; \
280 fi; \
281 fi`
282
283 LD_FOR_TARGET=@LD_FOR_TARGET@
284 USUAL_LD_FOR_TARGET = ` \
285 if [ -f $$r/ld/ld-new ] ; then \
286 echo $$r/ld/ld-new ; \
287 elif [ -f $$r/gcc/xgcc ]; then \
288 $(CC_FOR_TARGET) -print-prog-name=ld ; \
289 else \
290 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
291 echo $(LD); \
292 else \
293 echo ld | sed '$(program_transform_name)' ; \
294 fi; \
295 fi`
296
297 DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
298 USUAL_DLLTOOL_FOR_TARGET = ` \
299 if [ -f $$r/binutils/dlltool ] ; then \
300 echo $$r/binutils/dlltool ; \
301 else \
302 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
303 echo $(DLLTOOL); \
304 else \
305 echo dlltool | sed '$(program_transform_name)' ; \
306 fi; \
307 fi`
308
309 WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
310 USUAL_WINDRES_FOR_TARGET = ` \
311 if [ -f $$r/binutils/windres ] ; then \
312 echo $$r/binutils/windres ; \
313 else \
314 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
315 echo $(WINDRES); \
316 else \
317 echo windres | sed '$(program_transform_name)' ; \
318 fi; \
319 fi`
320
321 AR_FOR_TARGET=@AR_FOR_TARGET@
322 USUAL_AR_FOR_TARGET = ` \
323 if [ -f $$r/binutils/ar ] ; then \
324 echo $$r/binutils/ar ; \
325 else \
326 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
327 echo $(AR); \
328 else \
329 echo ar | sed '$(program_transform_name)' ; \
330 fi; \
331 fi`
332
333 RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
334 USUAL_RANLIB_FOR_TARGET = ` \
335 if [ -f $$r/binutils/ranlib ] ; then \
336 echo $$r/binutils/ranlib ; \
337 else \
338 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
339 if [ x'$(RANLIB)' != x ]; then \
340 echo $(RANLIB); \
341 else \
342 echo ranlib; \
343 fi; \
344 else \
345 echo ranlib | sed '$(program_transform_name)' ; \
346 fi; \
347 fi`
348
349 NM_FOR_TARGET=@NM_FOR_TARGET@
350 USUAL_NM_FOR_TARGET = ` \
351 if [ -f $$r/binutils/nm-new ] ; then \
352 echo $$r/binutils/nm-new ; \
353 elif [ -f $$r/gcc/xgcc ]; then \
354 $(CC_FOR_TARGET) -print-prog-name=nm ; \
355 else \
356 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
357 echo $(NM); \
358 else \
359 echo nm | sed '$(program_transform_name)' ; \
360 fi; \
361 fi`
362
363 # The first rule in the file had better be this one. Don't put any above it.
364 # This lives here to allow makefile fragments to contain dependencies.
365 all: all.normal
366 .PHONY: all
367
368 #### host and target specific makefile fragments come in here.
369 @target_makefile_frag@
370 @alphaieee_frag@
371 @ospace_frag@
372 @host_makefile_frag@
373 ###
374
375 # Flags to pass down to all sub-makes.
376 # Please keep these in alphabetical order.
377 BASE_FLAGS_TO_PASS = \
378 "AR_FLAGS=$(AR_FLAGS)" \
379 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
380 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
381 "BISON=$(BISON)" \
382 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
383 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
384 "CFLAGS=$(CFLAGS)" \
385 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
386 "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \
387 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
388 "CXXFLAGS=$(CXXFLAGS)" \
389 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
390 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
391 "DESTDIR=$(DESTDIR)" \
392 "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
393 "INSTALL=$(INSTALL)" \
394 "INSTALL_DATA=$(INSTALL_DATA)" \
395 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
396 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
397 "LDFLAGS=$(LDFLAGS)" \
398 "LEX=$(LEX)" \
399 "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
400 "LIBCFLAGS=$(LIBCFLAGS)" \
401 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
402 "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
403 "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
404 "M4=$(M4)" \
405 "MAKE=$(MAKE)" \
406 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
407 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
408 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
409 "RPATH_ENVVAR=$(RPATH_ENVVAR)" \
410 "SHELL=$(SHELL)" \
411 "EXPECT=$(EXPECT)" \
412 "RUNTEST=$(RUNTEST)" \
413 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
414 "TARGET_SUBDIR=$(TARGET_SUBDIR)" \
415 "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
416 "YACC=$(YACC)" \
417 "bindir=$(bindir)" \
418 "datadir=$(datadir)" \
419 "exec_prefix=$(exec_prefix)" \
420 "includedir=$(includedir)" \
421 "infodir=$(infodir)" \
422 "libdir=$(libdir)" \
423 "libexecdir=$(libexecdir)" \
424 "lispdir=$(lispdir)" \
425 "libstdcxx_incdir=$(libstdcxx_incdir)" \
426 "libsubdir=$(libsubdir)" \
427 "localstatedir=$(localstatedir)" \
428 "mandir=$(mandir)" \
429 "oldincludedir=$(oldincludedir)" \
430 "prefix=$(prefix)" \
431 "sbindir=$(sbindir)" \
432 "sharedstatedir=$(sharedstatedir)" \
433 "sysconfdir=$(sysconfdir)" \
434 "tooldir=$(tooldir)" \
435 "build_tooldir=$(build_tooldir)" \
436 "gxx_include_dir=$(gxx_include_dir)" \
437 "gcc_version=$(gcc_version)" \
438 "gcc_version_trigger=$(gcc_version_trigger)" \
439 "target_alias=$(target_alias)"
440
441 # For any flags above that may contain shell code that varies from one
442 # target library to another. When doing recursive invocations of the
443 # top-level Makefile, we don't want the outer make to evaluate them,
444 # so we pass these variables down unchanged. They must not contain
445 # single nor double quotes.
446 RECURSE_FLAGS = \
447 CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
448 RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
449
450 # Flags to pass down to most sub-makes, in which we're building with
451 # the host environment.
452 # If any variables are added here, they must be added to do-*, below.
453 EXTRA_HOST_FLAGS = \
454 'AR=$(AR)' \
455 'AS=$(AS)' \
456 'CC=$(CC)' \
457 'CXX=$(CXX)' \
458 'DLLTOOL=$(DLLTOOL)' \
459 'LD=$(LD)' \
460 'NM=$(NM)' \
461 "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
462 'WINDRES=$(WINDRES)'
463
464 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
465
466 # Flags that are concerned with the location of the X11 include files
467 # and library files
468 #
469 # NOTE: until the top-level is getting the values via autoconf, it only
470 # causes problems to have this top-level Makefile overriding the autoconf-set
471 # values in child directories. Only variables that don't conflict with
472 # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
473 #
474 X11_FLAGS_TO_PASS = \
475 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
476 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
477
478 # Flags to pass down to makes which are built with the target environment.
479 # The double $ decreases the length of the command line; the variables
480 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
481 # If any variables are added here, they must be added to do-*, below.
482 EXTRA_TARGET_FLAGS = \
483 'AR=$$(AR_FOR_TARGET)' \
484 'AS=$$(AS_FOR_TARGET)' \
485 'CC=$$(CC_FOR_TARGET)' \
486 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
487 'CXX=$$(CXX_FOR_TARGET)' \
488 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
489 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
490 'LD=$$(LD_FOR_TARGET)' \
491 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
492 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
493 'NM=$$(NM_FOR_TARGET)' \
494 'RANLIB=$$(RANLIB_FOR_TARGET)' \
495 'WINDRES=$$(WINDRES_FOR_TARGET)'
496
497 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
498
499 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
500 # unfortunately needs the native compiler and the target ar and
501 # ranlib.
502 # If any variables are added here, they must be added to do-*, below.
503 # The HOST_* variables are a special case, which are used for the gcc
504 # cross-building scheme.
505 EXTRA_GCC_FLAGS = \
506 'AR=$(AR)' \
507 'AS=$(AS)' \
508 'CC=$(CC)' \
509 'CXX=$(CXX)' \
510 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
511 'BUILD_CC=$(CC_FOR_BUILD)' \
512 'BUILD_PREFIX=$(BUILD_PREFIX)' \
513 'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
514 'NM=$(NM)' \
515 "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
516 'WINDRES=$$(WINDRES_FOR_TARGET)' \
517 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
518 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
519 "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \
520 "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \
521 "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \
522 "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
523 "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
524 "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
525 "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \
526 "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
527 "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
528
529 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
530
531 configure-host: @configure_host_modules@
532 configure-target: @configure_target_modules@
533
534 # This is a list of the targets for which we can do a clean-{target}.
535 CLEAN_MODULES =[+
536 FOR host_modules +][+
537 IF (not (or (exist? "no_clean") (exist? "with_x"))) +] \
538 clean-[+module+][+
539 ENDIF no_clean +][+
540 ENDFOR host_modules +]
541
542 # All of the target modules that can be cleaned
543 CLEAN_TARGET_MODULES =[+
544 FOR target_modules +][+
545 IF (not (exist? "no_clean")) +] \
546 clean-target-[+module+][+
547 ENDIF no_clean +][+
548 ENDFOR target_modules +]
549
550 # All of the x11 modules that can be cleaned
551 CLEAN_X11_MODULES = [+ FOR host_modules +][+ IF with_x +]\
552 clean-[+module+] [+ ENDIF with_x +][+ ENDFOR host_modules +]
553
554 # The target built for a native build.
555 # This list only includes modules actually being configured and built.
556 .PHONY: all.normal
557 all.normal: @all_build_modules@ \
558 @all_host_modules@ \
559 @all_target_modules@
560
561 all-host: @all_host_modules@
562 all-target: @all_target_modules@
563
564 # Do a target for all the subdirectories. A ``make do-X'' will do a
565 # ``make X'' in all subdirectories (because, in general, there is a
566 # dependency (below) of X upon do-X, a ``make X'' will also do this,
567 # but it may do additional work as well).
568 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
569 # because it is so large that it can easily overflow the command line
570 # length limit on some systems.
571 [+ FOR recursive_targets +]
572 .PHONY: do-[+target+]
573 do-[+target+]:
574 @r=`${PWD}`; export r; \
575 s=`cd $(srcdir); ${PWD}`; export s; \
576 $(SET_LIB_PATH) \
577 for i in $(SUBDIRS) -dummy-; do \
578 if [ -f ./$$i/Makefile ]; then \
579 case $$i in \
580 gcc) \
581 for flag in $(EXTRA_GCC_FLAGS); do \
582 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
583 done; \
584 ;; \
585 *) \
586 for flag in $(EXTRA_HOST_FLAGS); do \
587 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
588 done; \
589 ;; \
590 esac ; \
591 (cd ./$$i && \
592 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
593 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
594 "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
595 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
596 [+target+]) \
597 || exit 1; \
598 else true; fi; \
599 done
600 # Break into two pieces
601 r=`${PWD}`; export r; \
602 s=`cd $(srcdir); ${PWD}`; export s; \
603 $(SET_LIB_PATH) \
604 for i in $(TARGET_CONFIGDIRS) -dummy-; do \
605 if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
606 for flag in $(EXTRA_TARGET_FLAGS); do \
607 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
608 done; \
609 (cd $(TARGET_SUBDIR)/$$i && \
610 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
611 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
612 "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
613 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
614 [+target+]) \
615 || exit 1; \
616 else true; fi; \
617 done
618 [+ ENDFOR recursive_targets +]
619
620
621 # Here are the targets which correspond to the do-X targets.
622
623 .PHONY: info installcheck dvi install-info
624 .PHONY: clean distclean mostlyclean maintainer-clean realclean
625 .PHONY: local-clean local-distclean local-maintainer-clean
626 info: do-info
627 installcheck: do-installcheck
628 dvi: do-dvi
629
630 # Make sure makeinfo is built before we do a `make info', if we're
631 # in fact building texinfo.
632 do-info: maybe-all-texinfo
633
634 install-info: do-install-info dir.info
635 s=`cd $(srcdir); ${PWD}`; export s; \
636 if [ -f dir.info ] ; then \
637 $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \
638 else true ; fi
639
640 local-clean:
641 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
642
643 local-distclean:
644 -rm -f Makefile config.status config.cache mh-frag mt-frag
645 -rm -f multilib.out multilib.tmp maybedep.tmp serdep.tmp
646 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
647 rm -rf $(TARGET_SUBDIR); \
648 else true; fi
649 -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
650 -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
651 -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
652 -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
653 -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null
654
655 local-maintainer-clean:
656 @echo "This command is intended for maintainers to use;"
657 @echo "it deletes files that may require special tools to rebuild."
658
659 clean: do-clean local-clean
660 mostlyclean: do-mostlyclean local-clean
661 distclean: do-distclean local-clean local-distclean
662 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
663 maintainer-clean: local-distclean
664 realclean: maintainer-clean
665
666 # This rule is used to clean specific modules.
667 .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
668 $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
669 @dir=`echo $@ | sed -e 's/clean-//'`; \
670 if [ -f ./$${dir}/Makefile ] ; then \
671 r=`${PWD}`; export r; \
672 s=`cd $(srcdir); ${PWD}`; export s; \
673 $(SET_LIB_PATH) \
674 (cd $${dir} && $(MAKE) $(FLAGS_TO_PASS) clean); \
675 else \
676 true; \
677 fi
678
679 .PHONY: $(CLEAN_TARGET_MODULES)
680 $(CLEAN_TARGET_MODULES):
681 @dir=`echo $@ | sed -e 's/clean-target-//'`; \
682 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
683 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
684 r=`${PWD}`; export r; \
685 s=`cd $(srcdir); ${PWD}`; export s; \
686 $(SET_LIB_PATH) \
687 (cd $(TARGET_SUBDIR)/$${dir} && $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
688 else \
689 true; \
690 fi
691
692 clean-target: $(CLEAN_TARGET_MODULES) clean-target-libgcc
693 clean-target-libgcc:
694 test ! -d gcc/libgcc || \
695 (cd gcc/libgcc && find . -type d -print) | \
696 while read d; do rm -f gcc/$$d/libgcc.a || : ; done
697 -rm -rf gcc/libgcc
698
699 # Check target.
700
701 .PHONY: check do-check
702 check:
703 $(MAKE) do-check NOTPARALLEL=parallel-ok
704
705 # Only include modules actually being configured and built.
706 do-check: @check_host_modules@ \
707 @check_target_modules@
708
709 # Automated reporting of test results.
710
711 warning.log: build.log
712 $(srcdir)/contrib/warn_summary build.log > $@
713
714 mail-report.log:
715 if test x'$(BOOT_CFLAGS)' != x''; then \
716 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
717 fi; \
718 $(srcdir)/contrib/test_summary -t >$@
719 chmod +x $@
720 echo If you really want to send e-mail, run ./$@ now
721
722 mail-report-with-warnings.log: warning.log
723 if test x'$(BOOT_CFLAGS)' != x''; then \
724 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
725 fi; \
726 $(srcdir)/contrib/test_summary -t -i warning.log >$@
727 chmod +x $@
728 echo If you really want to send e-mail, run ./$@ now
729
730 # Installation targets.
731
732 .PHONY: install uninstall
733 install: installdirs @install_host_modules@ @install_target_modules@
734
735 install-target: @install_target_modules@
736
737 uninstall:
738 @echo "the uninstall target is not supported in this tree"
739
740 .PHONY: install.all
741 install.all: install-no-fixedincludes
742 @if [ -f ./gcc/Makefile ] ; then \
743 r=`${PWD}` ; export r ; \
744 $(SET_LIB_PATH) \
745 (cd ./gcc && \
746 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
747 else \
748 true ; \
749 fi
750
751 # install-no-fixedincludes is used because Cygnus can not distribute
752 # the fixed header files.
753 .PHONY: install-no-fixedincludes
754 install-no-fixedincludes: installdirs @install_host_modules_nogcc@ \
755 @install_target_modules@ gcc-no-fixedincludes
756
757 ### other supporting targets
758
759 MAKEDIRS= \
760 $(DESTDIR)$(prefix) \
761 $(DESTDIR)$(exec_prefix)
762 .PHONY: installdirs
763 installdirs: mkinstalldirs
764 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
765
766 dir.info: do-install-info
767 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
768 $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
769 mv -f dir.info.new dir.info ; \
770 else true ; \
771 fi
772
773 dist:
774 @echo "Building a full distribution of this tree isn't done"
775 @echo "via 'make dist'. Check out the etc/ subdirectory"
776
777 etags tags: TAGS
778
779 # Right now this just builds TAGS in each subdirectory. emacs19 has the
780 # ability to use several tags files at once, so there is probably no need
781 # to combine them into one big TAGS file (like CVS 1.3 does). We could
782 # (if we felt like it) have this Makefile write a piece of elisp which
783 # the user could load to tell emacs19 where all the TAGS files we just
784 # built are.
785 TAGS: do-TAGS
786
787 # --------------------------------------
788 # Modules which run on the build machine
789 # --------------------------------------
790 [+ FOR build_modules +]
791 .PHONY: configure-build-[+module+] maybe-configure-build-[+module+]
792 maybe-configure-build-[+module+]:
793 configure-build-[+module+]:
794 @test ! -f $(BUILD_SUBDIR)/[+module+]/Makefile || exit 0; \
795 [ -d $(BUILD_SUBDIR)/[+module+] ] || \
796 mkdir $(BUILD_SUBDIR)/[+module+];\
797 r=`${PWD}`; export r; \
798 s=`cd $(srcdir); ${PWD}`; export s; \
799 AR="$(AR_FOR_BUILD)"; export AR; \
800 AS="$(AS_FOR_BUILD)"; export AS; \
801 CC="$(CC_FOR_BUILD)"; export CC; \
802 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
803 CXX="$(CXX_FOR_BUILD)"; export CXX; \
804 CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
805 GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
806 DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
807 LD="$(LD_FOR_BUILD)"; export LD; \
808 LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
809 NM="$(NM_FOR_BUILD)"; export NM; \
810 RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
811 WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
812 echo Configuring in $(BUILD_SUBDIR)/[+module+]; \
813 cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \
814 case $(srcdir) in \
815 /* | [A-Za-z]:[\\/]*) \
816 topdir=$(srcdir) ;; \
817 *) \
818 case "$(BUILD_SUBDIR)" in \
819 .) topdir="../$(srcdir)" ;; \
820 *) topdir="../../$(srcdir)" ;; \
821 esac ;; \
822 esac; \
823 if [ "$(srcdir)" = "." ] ; then \
824 if [ "$(BUILD_SUBDIR)" != "." ] ; then \
825 if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \
826 if [ -f Makefile ]; then \
827 if $(MAKE) distclean; then \
828 true; \
829 else \
830 exit 1; \
831 fi; \
832 else \
833 true; \
834 fi; \
835 else \
836 exit 1; \
837 fi; \
838 else \
839 true; \
840 fi; \
841 srcdiroption="--srcdir=."; \
842 libsrcdir="."; \
843 else \
844 srcdiroption="--srcdir=$${topdir}/[+module+]"; \
845 libsrcdir="$$s/[+module+]"; \
846 fi; \
847 rm -f no-such-file || : ; \
848 CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
849 $(BUILD_CONFIGARGS) $${srcdiroption} \
850 --with-build-subdir="$(BUILD_SUBDIR)" \
851 || exit 1
852
853 .PHONY: all-build-[+module+] maybe-all-build-[+module+]
854 maybe-all-build-[+module+]:
855 all-build-[+module+]: configure-build-[+module+]
856 @r=`${PWD}`; export r; \
857 s=`cd $(srcdir); ${PWD}`; export s; \
858 (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all)
859 [+ ENDFOR build_modules +]
860
861 # --------------------------------------
862 # Modules which run on the host machine
863 # --------------------------------------
864 [+ FOR host_modules +]
865 .PHONY: configure-[+module+] maybe-configure-[+module+]
866 maybe-configure-[+module+]:
867 configure-[+module+]:
868 @test ! -f [+module+]/Makefile || exit 0; \
869 [ -d [+module+] ] || mkdir [+module+]; \
870 r=`${PWD}`; export r; \
871 s=`cd $(srcdir); ${PWD}`; export s; \
872 CC="$(CC)"; export CC; \
873 CFLAGS="$(CFLAGS)"; export CFLAGS; \
874 CXX="$(CXX)"; export CXX; \
875 CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
876 if [ z$(build_canonical) != z$(host_canoncial) ] ; then \
877 AR="$(AR)"; export AR; \
878 AS="$(AS)"; export AS; \
879 CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
880 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
881 LD="$(LD)"; export LD; \
882 NM="$(NM)"; export NM; \
883 RANLIB="$(RANLIB)"; export RANLIB; \
884 WINDRES="$(WINDRES)"; export WINDRES; \
885 OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
886 OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
887 fi; \
888 echo Configuring in [+module+]; \
889 cd [+module+] || exit 1; \
890 case $(srcdir) in \
891 \.) \
892 srcdiroption="--srcdir=."; \
893 libsrcdir=".";; \
894 /* | [A-Za-z]:[\\/]*) \
895 srcdiroption="--srcdir=$(srcdir)/[+module+]"; \
896 libsrcdir="$$s/[+module+]";; \
897 *) \
898 srcdiroption="--srcdir=../$(srcdir)/[+module+]"; \
899 libsrcdir="$$s/[+module+]";; \
900 esac; \
901 $(SHELL) $${libsrcdir}/configure \
902 $(HOST_CONFIGARGS) $${srcdiroption} \
903 || exit 1
904
905 .PHONY: all-[+module+] maybe-all-[+module+]
906 maybe-all-[+module+]:
907 all-[+module+]: configure-[+module+]
908 @r=`${PWD}`; export r; \
909 s=`cd $(srcdir); ${PWD}`; export s; \
910 $(SET_LIB_PATH) \
911 (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
912 IF with_x
913 +] $(X11_FLAGS_TO_PASS)[+
914 ENDIF with_x +] all)
915
916 [+ IF no_check +]
917 .PHONY: check-[+module+]
918 check-[+module+]:
919 [+ ELIF no_check_cross +]
920 .PHONY: check-[+module+]
921 # This module is only tested in a native toolchain.
922 check-[+module+]:
923 @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
924 r=`${PWD}`; export r; \
925 s=`cd $(srcdir); ${PWD}`; export s; \
926 $(SET_LIB_PATH) \
927 (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
928 IF with_x
929 +] $(X11_FLAGS_TO_PASS)[+
930 ENDIF with_x +] check); \
931 fi
932 [+ ELSE check +]
933 .PHONY: check-[+module+]
934 check-[+module+]:
935 @r=`${PWD}`; export r; \
936 s=`cd $(srcdir); ${PWD}`; export s; \
937 $(SET_LIB_PATH) \
938 (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
939 IF with_x
940 +] $(X11_FLAGS_TO_PASS)[+
941 ENDIF with_x +] check)
942 [+ ENDIF no_check +]
943
944 [+ IF no_install +]
945 .PHONY: install-[+module+] maybe-install-[+module+]
946 maybe-install-[+module+]:
947 install-[+module+]:
948 [+ ELSE install +]
949 .PHONY: install-[+module+] maybe-install-[+module+]
950 maybe-install-[+module+]:
951 install-[+module+]: installdirs
952 @r=`${PWD}`; export r; \
953 s=`cd $(srcdir); ${PWD}`; export s; \
954 $(SET_LIB_PATH) \
955 (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
956 IF with_x
957 +] $(X11_FLAGS_TO_PASS)[+
958 ENDIF with_x +] install)
959 [+ ENDIF no_install +]
960 [+ ENDFOR host_modules +]
961
962 # ---------------------------------------
963 # Modules which run on the target machine
964 # ---------------------------------------
965 [+ FOR target_modules +]
966 .PHONY: configure-target-[+module+] maybe-configure-target-[+module+]
967 maybe-configure-target-[+module+]:
968
969 # There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
970 $(TARGET_SUBDIR)/[+module+]/multilib.out: multilib.out
971 @[ -d $(TARGET_SUBDIR)/[+module+] ] || \
972 mkdir $(TARGET_SUBDIR)/[+module+]; \
973 rm -f $(TARGET_SUBDIR)/[+module+]/Makefile || : ; \
974 cp multilib.out $(TARGET_SUBDIR)/[+module+]/multilib.out
975
976 configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/multilib.out
977 @test ! -f $(TARGET_SUBDIR)/[+module+]/Makefile || exit 0; \
978 [ -d $(TARGET_SUBDIR)/[+module+] ] || \
979 mkdir $(TARGET_SUBDIR)/[+module+];\
980 r=`${PWD}`; export r; \
981 s=`cd $(srcdir); ${PWD}`; export s; \
982 $(SET_LIB_PATH) \
983 AR="$(AR_FOR_TARGET)"; export AR; \
984 AS="$(AS_FOR_TARGET)"; export AS; \
985 CC="$(CC_FOR_TARGET)"; export CC; \
986 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \[+
987 IF raw_cxx +]
988 CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
989 CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \[+
990 ELSE normal_cxx +]
991 CXX="$(CXX_FOR_TARGET)"; export CXX; \[+
992 ENDIF raw_cxx +]
993 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
994 GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
995 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
996 LD="$(LD_FOR_TARGET)"; export LD; \
997 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
998 NM="$(NM_FOR_TARGET)"; export NM; \
999 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1000 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
1001 echo Configuring in $(TARGET_SUBDIR)/[+module+]; \
1002 cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \
1003 case $(srcdir) in \
1004 /* | [A-Za-z]:[\\/]*) \
1005 topdir=$(srcdir) ;; \
1006 *) \
1007 case "$(TARGET_SUBDIR)" in \
1008 .) topdir="../$(srcdir)" ;; \
1009 *) topdir="../../$(srcdir)" ;; \
1010 esac ;; \
1011 esac; \
1012 if [ "$(srcdir)" = "." ] ; then \
1013 if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1014 if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \
1015 if [ -f Makefile ]; then \
1016 if $(MAKE) distclean; then \
1017 true; \
1018 else \
1019 exit 1; \
1020 fi; \
1021 else \
1022 true; \
1023 fi; \
1024 else \
1025 exit 1; \
1026 fi; \
1027 else \
1028 true; \
1029 fi; \
1030 srcdiroption="--srcdir=."; \
1031 libsrcdir="."; \
1032 else \
1033 srcdiroption="--srcdir=$${topdir}/[+module+]"; \
1034 libsrcdir="$$s/[+module+]"; \
1035 fi; \
1036 rm -f no-such-file || : ; \
1037 CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
1038 $(TARGET_CONFIGARGS) $${srcdiroption} \
1039 --with-target-subdir="$(TARGET_SUBDIR)" \
1040 || exit 1
1041
1042 .PHONY: all-target-[+module+] maybe-all-target-[+module+]
1043 maybe-all-target-[+module+]:
1044 all-target-[+module+]: configure-target-[+module+]
1045 @r=`${PWD}`; export r; \
1046 s=`cd $(srcdir); ${PWD}`; export s; \
1047 $(SET_LIB_PATH) \
1048 (cd $(TARGET_SUBDIR)/[+module+] && \
1049 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
1050 IF raw_cxx
1051 +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+
1052 ENDIF raw_cxx
1053 +] all)
1054 [+ IF no_check +]
1055 # Dummy target for uncheckable module.
1056 .PHONY: check-target-[+module+]
1057 check-target-[+module+]:
1058 [+ ELSE check +]
1059 .PHONY: check-target-[+module+]
1060 check-target-[+module+]:
1061 @r=`${PWD}`; export r; \
1062 s=`cd $(srcdir); ${PWD}`; export s; \
1063 $(SET_LIB_PATH) \
1064 (cd $(TARGET_SUBDIR)/[+module+] && \
1065 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
1066 IF raw_cxx
1067 +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+
1068 ENDIF raw_cxx
1069 +] check)
1070 [+ ENDIF no_check +]
1071 [+ IF no_install +]
1072 .PHONY: install-target-[+module+] maybe-install-target-[+module+]
1073 maybe-install-target-[+module+]:
1074 # Dummy target for uninstallable.
1075 install-target-[+module+]:
1076 [+ ELSE install +]
1077 .PHONY: install-target-[+module+] maybe-install-target-[+module+]
1078 maybe-install-target-[+module+]:
1079 install-target-[+module+]: installdirs
1080 @r=`${PWD}`; export r; \
1081 s=`cd $(srcdir); ${PWD}`; export s; \
1082 $(SET_LIB_PATH) \
1083 (cd $(TARGET_SUBDIR)/[+module+] && \
1084 $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
1085 [+ ENDIF no_install +]
1086 [+ ENDFOR target_modules +]
1087
1088 # ----------
1089 # GCC module
1090 # ----------
1091
1092 # Unfortunately, while gcc _should_ be a host module,
1093 # libgcc is a target module, and gen* programs are
1094 # build modules. So GCC is a sort of hybrid.
1095
1096 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1097 .PHONY: configure-gcc maybe-configure-gcc
1098 maybe-configure-gcc:
1099 configure-gcc:
1100 @test ! -f gcc/Makefile || exit 0; \
1101 [ -d gcc ] || mkdir gcc; \
1102 r=`${PWD}`; export r; \
1103 s=`cd $(srcdir); ${PWD}`; export s; \
1104 CC="$(CC)"; export CC; \
1105 CFLAGS="$(CFLAGS)"; export CFLAGS; \
1106 CXX="$(CXX)"; export CXX; \
1107 CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
1108 if [ z$(build_canonical) != z$(host_canoncial) ] ; then \
1109 AR="$(AR)"; export AR; \
1110 AS="$(AS)"; export AS; \
1111 CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
1112 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
1113 LD="$(LD)"; export LD; \
1114 NM="$(NM)"; export NM; \
1115 RANLIB="$(RANLIB)"; export RANLIB; \
1116 WINDRES="$(WINDRES)"; export WINDRES; \
1117 OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
1118 OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
1119 fi; \
1120 echo Configuring in gcc; \
1121 cd gcc || exit 1; \
1122 case $(srcdir) in \
1123 \.) \
1124 srcdiroption="--srcdir=."; \
1125 libsrcdir=".";; \
1126 /* | [A-Za-z]:[\\/]*) \
1127 srcdiroption="--srcdir=$(srcdir)/gcc"; \
1128 libsrcdir="$$s/gcc";; \
1129 *) \
1130 srcdiroption="--srcdir=../$(srcdir)/gcc"; \
1131 libsrcdir="$$s/gcc";; \
1132 esac; \
1133 $(SHELL) $${libsrcdir}/configure \
1134 $(HOST_CONFIGARGS) $${srcdiroption} \
1135 || exit 1
1136
1137 # Don't 'make all' in gcc if it's already been made by 'bootstrap'; that
1138 # causes trouble. This wart will be fixed eventually by moving
1139 # the bootstrap behavior to this file.
1140 .PHONY: all-gcc maybe-all-gcc
1141 maybe-all-gcc:
1142 all-gcc: configure-gcc
1143 @if [ -f gcc/stage_last ] ; then \
1144 r=`${PWD}`; export r; \
1145 s=`cd $(srcdir); ${PWD}`; export s; \
1146 $(SET_LIB_PATH) \
1147 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \
1148 else \
1149 r=`${PWD}`; export r; \
1150 s=`cd $(srcdir); ${PWD}`; export s; \
1151 $(SET_LIB_PATH) \
1152 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1153 fi
1154
1155 # Building GCC uses some tools for rebuilding "source" files
1156 # like texinfo, bison/byacc, etc. So we must depend on those.
1157 #
1158 # While building GCC, it may be necessary to run various target
1159 # programs like the assembler, linker, etc. So we depend on
1160 # those too.
1161 #
1162 # In theory, on an SMP all those dependencies can be resolved
1163 # in parallel.
1164 #
1165 .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap
1166 bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap: all-bootstrap configure-gcc
1167 @r=`${PWD}`; export r; \
1168 s=`cd $(srcdir); ${PWD}`; export s; \
1169 $(SET_LIB_PATH) \
1170 echo "Bootstrapping the compiler"; \
1171 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
1172 @r=`${PWD}`; export r; \
1173 s=`cd $(srcdir); ${PWD}`; export s; \
1174 case "$@" in \
1175 *bootstrap4-lean ) \
1176 msg="Comparing stage3 and stage4 of the compiler"; \
1177 compare=compare3-lean ;; \
1178 *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \
1179 compare=compare3 ;; \
1180 *-lean ) msg="Comparing stage2 and stage3 of the compiler"; \
1181 compare=compare-lean ;; \
1182 * ) msg="Comparing stage2 and stage3 of the compiler"; \
1183 compare=compare ;; \
1184 esac; \
1185 $(SET_LIB_PATH) \
1186 echo "$$msg"; \
1187 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
1188 @r=`${PWD}`; export r; \
1189 s=`cd $(srcdir); ${PWD}` ; export s; \
1190 $(SET_LIB_PATH) \
1191 echo "Building runtime libraries"; \
1192 $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
1193
1194 .PHONY: cross
1195 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1196 @r=`${PWD}`; export r; \
1197 s=`cd $(srcdir); ${PWD}`; export s; \
1198 $(SET_LIB_PATH) \
1199 echo "Building the C and C++ compiler"; \
1200 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1201 @r=`${PWD}`; export r; \
1202 s=`cd $(srcdir); ${PWD}` ; export s; \
1203 $(SET_LIB_PATH) \
1204 echo "Building runtime libraries"; \
1205 $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
1206 LANGUAGES="c c++" all
1207
1208 .PHONY: check-gcc
1209 check-gcc:
1210 @if [ -f ./gcc/Makefile ] ; then \
1211 r=`${PWD}`; export r; \
1212 s=`cd $(srcdir); ${PWD}`; export s; \
1213 $(SET_LIB_PATH) \
1214 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1215 else \
1216 true; \
1217 fi
1218
1219 .PHONY: check-gcc-c++
1220 check-gcc-c++:
1221 @if [ -f ./gcc/Makefile ] ; then \
1222 r=`${PWD}`; export r; \
1223 s=`cd $(srcdir); ${PWD}`; export s; \
1224 $(SET_LIB_PATH) \
1225 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
1226 else \
1227 true; \
1228 fi
1229
1230 .PHONY: check-c++
1231 check-c++: check-target-libstdc++-v3 check-gcc-c++
1232
1233 .PHONY: install-gcc maybe-install-gcc
1234 maybe-install-gcc:
1235 install-gcc:
1236 @if [ -f ./gcc/Makefile ] ; then \
1237 r=`${PWD}`; export r; \
1238 s=`cd $(srcdir); ${PWD}`; export s; \
1239 $(SET_LIB_PATH) \
1240 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1241 else \
1242 true; \
1243 fi
1244
1245 # Install the gcc headers files, but not the fixed include files,
1246 # which Cygnus is not allowed to distribute. This rule is very
1247 # dependent on the workings of the gcc Makefile.in.
1248 .PHONY: gcc-no-fixedincludes
1249 gcc-no-fixedincludes:
1250 @if [ -f ./gcc/Makefile ]; then \
1251 rm -rf gcc/tmp-include; \
1252 mv gcc/include gcc/tmp-include 2>/dev/null; \
1253 mkdir gcc/include; \
1254 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
1255 touch gcc/stmp-fixinc gcc/include/fixed; \
1256 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
1257 r=`${PWD}`; export r; \
1258 s=`cd $(srcdir); ${PWD}` ; export s; \
1259 $(SET_LIB_PATH) \
1260 (cd ./gcc && \
1261 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1262 rm -rf gcc/include; \
1263 mv gcc/tmp-include gcc/include 2>/dev/null; \
1264 else true; fi
1265
1266 # --------------------------------------
1267 # Dependencies between different modules
1268 # --------------------------------------
1269
1270 # There are two types of dependencies here: 'hard' dependencies, where one
1271 # module simply won't build without the other; and 'soft' dependencies, where
1272 # if the depended-on module is missing, the depending module will do without
1273 # or find a substitute somewhere (perhaps installed). Soft dependencies
1274 # are specified by depending on a 'maybe-' target. If you're not sure,
1275 # it's safer to use a soft dependency.
1276
1277 # Host modules specific to gcc.
1278 # GCC needs to identify certain tools.
1279 configure-gcc: maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex
1280 all-gcc: maybe-all-libiberty maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib
1281 # This is a slightly kludgy method of getting dependencies on
1282 # all-build-libiberty correct; it would be better to build it every time.
1283 all-gcc: maybe-all-build-libiberty
1284 all-bootstrap: maybe-all-libiberty maybe-all-texinfo maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib
1285
1286 # Host modules specific to gdb.
1287 # GDB needs to know that the simulator is being built.
1288 configure-gdb: maybe-configure-tcl maybe-configure-tk maybe-configure-sim
1289 GDB_TK = @GDB_TK@
1290 all-gdb: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-mmalloc maybe-all-readline maybe-all-bison maybe-all-byacc maybe-all-sim $(gdbnlmrequirements) $(GDB_TK)
1291 install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui
1292 configure-libgui: maybe-configure-tcl maybe-configure-tk
1293 all-libgui: maybe-all-tcl maybe-all-tk maybe-all-itcl
1294
1295 # Host modules specific to binutils.
1296 configure-bfd: configure-libiberty
1297 all-bfd: maybe-all-libiberty maybe-all-intl
1298 all-binutils: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-flex maybe-all-bison maybe-all-byacc maybe-all-intl
1299 # We put install-opcodes before install-binutils because the installed
1300 # binutils might be on PATH, and they might need the shared opcodes
1301 # library.
1302 install-binutils: maybe-install-opcodes
1303 all-gas: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-intl
1304 all-gprof: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-intl
1305 all-ld: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-intl
1306 all-opcodes: maybe-all-bfd maybe-all-libiberty
1307
1308 # Other host modules in the 'src' repository.
1309 all-dejagnu: maybe-all-tcl maybe-all-expect maybe-all-tk
1310 configure-expect: maybe-configure-tcl maybe-configure-tk
1311 all-expect: maybe-all-tcl maybe-all-tk
1312 configure-itcl: maybe-configure-tcl maybe-configure-tk
1313 all-itcl: maybe-all-tcl maybe-all-tk
1314 # We put install-tcl before install-itcl because itcl wants to run a
1315 # program on installation which uses the Tcl libraries.
1316 install-itcl: maybe-install-tcl
1317 all-sid: maybe-all-tcl maybe-all-tk
1318 install-sid: maybe-install-tcl maybe-install-tk
1319 all-sim: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-readline maybe-configure-gdb
1320 configure-tk: maybe-configure-tcl
1321 all-tk: maybe-all-tcl
1322 configure-tix: maybe-configure-tcl maybe-configure-tk
1323 all-tix: maybe-all-tcl maybe-all-tk
1324 all-texinfo: maybe-all-libiberty
1325
1326 # Other host modules. Warning, these are not well tested.
1327 all-autoconf: maybe-all-m4 maybe-all-texinfo
1328 all-automake: maybe-all-m4 maybe-all-texinfo
1329 all-bison: maybe-all-texinfo
1330 all-diff: maybe-all-libiberty
1331 all-fastjar: maybe-all-zlib maybe-all-libiberty
1332 all-fileutils: maybe-all-libiberty
1333 all-flex: maybe-all-libiberty maybe-all-bison maybe-all-byacc
1334 all-grep: maybe-all-libiberty
1335 all-gzip: maybe-all-libiberty
1336 all-hello: maybe-all-libiberty
1337 all-m4: maybe-all-libiberty maybe-all-texinfo
1338 all-make: maybe-all-libiberty
1339 all-patch: maybe-all-libiberty
1340 all-prms: maybe-all-libiberty
1341 all-recode: maybe-all-libiberty
1342 all-sed: maybe-all-libiberty
1343 all-send-pr: maybe-all-prms
1344 all-snavigator: maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-tix maybe-all-db maybe-all-grep maybe-all-libgui
1345 all-tar: maybe-all-libiberty
1346 all-uudecode: maybe-all-libiberty
1347
1348 ALL_GCC = maybe-all-gcc
1349 ALL_GCC_C = $(ALL_GCC) maybe-all-target-newlib maybe-all-target-libgloss
1350 ALL_GCC_CXX = $(ALL_GCC_C) maybe-all-target-libstdc++-v3
1351
1352 # Target modules specific to gcc.
1353 configure-target-boehm-gc: $(ALL_GCC_C) maybe-configure-target-qthreads
1354 configure-target-fastjar: maybe-configure-target-zlib
1355 all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty
1356 configure-target-libf2c: $(ALL_GCC_C)
1357 all-target-libf2c: maybe-all-target-libiberty
1358 configure-target-libffi: $(ALL_GCC_C)
1359 configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi
1360 all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi
1361 configure-target-libobjc: $(ALL_GCC_C)
1362 all-target-libobjc: maybe-all-target-libiberty
1363 configure-target-libstdc++-v3: $(ALL_GCC_C)
1364 all-target-libstdc++-v3: maybe-all-target-libiberty
1365 configure-target-zlib: $(ALL_GCC_C)
1366
1367 # Target modules in the 'src' repository.
1368 configure-target-examples: $(ALL_GCC_C)
1369 configure-target-libgloss: $(ALL_GCC)
1370 all-target-libgloss: maybe-configure-target-newlib
1371 configure-target-libiberty: $(ALL_GCC_C)
1372 configure-target-libtermcap: $(ALL_GCC_C)
1373 configure-target-newlib: $(ALL_GCC)
1374 configure-target-rda: $(ALL_GCC_C)
1375 configure-target-winsup: $(ALL_GCC_C)
1376 all-target-winsup: maybe-all-target-libiberty maybe-all-target-libtermcap
1377
1378 # Other target modules. Warning, these are not well tested.
1379 configure-target-gperf: $(ALL_GCC_CXX)
1380 all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3
1381 configure-target-qthreads: $(ALL_GCC_C)
1382
1383 # Dependencies of maybe-foo on foo. These are used because, for example,
1384 # all-gcc only depends on all-gas if gas is present and being configured.
1385 @maybe_dependencies@
1386
1387 # Serialization dependencies. Host configures don't work well in parallel to
1388 # each other, due to contention over config.cache. Target configures and
1389 # build configures are similar.
1390 @serialization_dependencies@
1391
1392 # --------------------------------
1393 # Regenerating top level configury
1394 # --------------------------------
1395
1396 # Multilib.out tells target dirs what multilibs they should build.
1397 # There is really only one copy. We use the 'timestamp' method to
1398 # work around various timestamp bugs on some systems.
1399 # We use move-if-change so that it's only considered updated when it
1400 # actually changes, because it has to depend on a phony target.
1401 multilib.out: maybe-all-gcc
1402 @r=`${PWD}`; export r; \
1403 echo "Checking multilib configuration..."; \
1404 $(CC_FOR_TARGET) --print-multi-lib > multilib.tmp 2> /dev/null ; \
1405 $(SHELL) $(srcdir)/move-if-change multilib.tmp multilib.out ; \
1406
1407 # Rebuilding Makefile.in, using autogen.
1408 AUTOGEN = autogen
1409 $(srcdir)/Makefile.in: # $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
1410 cd $(srcdir) && $(AUTOGEN) Makefile.def
1411
1412 # Rebuilding Makefile.
1413 Makefile: $(srcdir)/Makefile.in config.status
1414 CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
1415
1416 config.status: configure $(gcc_version_trigger)
1417 $(SHELL) ./config.status --recheck
1418
1419 # Rebuilding configure.
1420 AUTOCONF = autoconf
1421 $(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/config/acx.m4
1422 cd $(srcdir) && $(AUTOCONF)
1423 #
1424
1425 .NOEXPORT:
1426 MAKEOVERRIDES=
1427
1428 # Tell GNU make 3.79 not to run the top level in parallel. This
1429 # prevents contention for $builddir/$target/config.cache, as well
1430 # as minimizing scatter in file system caches.
1431 NOTPARALLEL = .NOTPARALLEL
1432 $(NOTPARALLEL):
1433
1434 # end of Makefile.in