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