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