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