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