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