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