]> gcc.gnu.org Git - gcc.git/blame - Makefile.tpl
Makefile.tpl: Remove bogus conditional.
[gcc.git] / Makefile.tpl
CommitLineData
d3ac17c9 1[+ AutoGen5 template -*- Mode: Makefile -*-
95ddd785
NN
2in
3+]
4
5# Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'.
6#
7# Makefile for directory with subdirs to build.
8# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
61b56b2e 9# 1999, 2000, 2001, 2002, 2003 Free Software Foundation
95ddd785
NN
10#
11# This file is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 2 of the License, or
14# (at your option) any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24#
25
df0f0674
NN
26# -------------------------------
27# Standard Autoconf-set variables
28# -------------------------------
4977bab6 29VPATH=@srcdir@
4977bab6
ZW
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
df0f0674 47program_transform_name = @program_transform_name@
0dffceed
NN
48
49prefix = @prefix@
50exec_prefix = @exec_prefix@
51
df0f0674
NN
52srcdir = @srcdir@
53
0dffceed
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@
95ddd785
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
95ddd785
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
df0f0674
NN
85# -------------------------------------------------
86# Miscellaneous non-standard autoconf-set variables
87# -------------------------------------------------
95ddd785 88
df0f0674 89links=@configlinks@
df0f0674
NN
90# The file containing GCC's version number.
91gcc_version_trigger = @gcc_version_trigger@
92gcc_version = @gcc_version@
95ddd785 93
df0f0674
NN
94# The gcc driver likes to know the arguments it was configured with.
95TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
95ddd785 96
df0f0674
NN
97gxx_include_dir = @gxx_include_dir@
98libstdcxx_incdir = @libstdcxx_incdir@
95ddd785 99
df0f0674
NN
100tooldir = @tooldir@
101build_tooldir = @build_tooldir@
95ddd785 102
df0f0674
NN
103# Directory in which the compiler finds executables, libraries, etc.
104libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
105GDB_NLM_DEPS =
95ddd785 106
df0f0674
NN
107# This is the name of the environment variable used for the path to
108# the libraries.
109RPATH_ENVVAR = @RPATH_ENVVAR@
95ddd785 110
df0f0674
NN
111# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
112# was used.
113SET_LIB_PATH = @SET_LIB_PATH@
95ddd785 114
df0f0674
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);
95ddd785 120
df0f0674
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@
95ddd785 168
4977bab6
ZW
169BISON=@BISON@
170USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \
95ddd785
NN
171 echo $$r/bison/bison -L $$s/bison/ ; \
172 else \
173 echo bison ; \
174 fi`
175
df0f0674 176DEFAULT_YACC = @DEFAULT_YACC@
4977bab6
ZW
177YACC=@YACC@
178USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \
95ddd785
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
df0f0674 186DEFAULT_LEX = @DEFAULT_LEX@
4977bab6
ZW
187LEX=@LEX@
188USUAL_LEX = `if [ -f $$r/flex/flex ] ; \
95ddd785
NN
189 then echo $$r/flex/flex ; \
190 else echo ${DEFAULT_LEX} ; fi`
191
df0f0674 192DEFAULT_M4 = @DEFAULT_M4@
95ddd785
NN
193M4 = `if [ -f $$r/m4/m4 ] ; \
194 then echo $$r/m4/m4 ; \
195 else echo ${DEFAULT_M4} ; fi`
196
de722255 197# For an installed makeinfo, we require it to be from texinfo 4.2 or
95ddd785 198# higher, else we use the "missing" dummy.
4977bab6
ZW
199MAKEINFO=@MAKEINFO@
200USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
95ddd785
NN
201 then echo $$r/texinfo/makeinfo/makeinfo ; \
202 else if (makeinfo --version \
de722255 203 | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \
95ddd785
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.
2f50999f
GP
209# (Default to avoid splitting info files by setting the threshold high.)
210MAKEINFOFLAGS = --split-size=5000000
95ddd785
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
df0f0674
NN
220# ---------------------------------------------
221# Programs producing files for the HOST machine
222# ---------------------------------------------
95ddd785 223
df0f0674
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
95ddd785 227
df0f0674 228AS = @AS@
95ddd785 229
df0f0674
NN
230AR = @AR@
231AR_FLAGS = rc
95ddd785 232
df0f0674
NN
233CC = @CC@
234CFLAGS = @CFLAGS@
235LIBCFLAGS = $(CFLAGS)
95ddd785 236
df0f0674
NN
237CXX = @CXX@
238CXXFLAGS = @CXXFLAGS@
239LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
95ddd785 240
df0f0674 241DLLTOOL = @DLLTOOL@
95ddd785 242
df0f0674 243NM = @NM@
4977bab6 244
df0f0674
NN
245LD = @LD@
246LDFLAGS =
4977bab6 247
df0f0674 248RANLIB = @RANLIB@
95ddd785 249
df0f0674 250WINDRES = @WINDRES@
95ddd785 251
df0f0674
NN
252PICFLAG =
253
254# -----------------------------------------------
255# Programs producing files for the TARGET machine
256# -----------------------------------------------
95ddd785
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
ec0461f6 262FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
95ddd785 263
df0f0674
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`
95ddd785 275
4977bab6
ZW
276AS_FOR_TARGET=@AS_FOR_TARGET@
277USUAL_AS_FOR_TARGET = ` \
95ddd785
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 \
e245b0ea 286 echo as | sed '$(program_transform_name)' ; \
95ddd785
NN
287 fi; \
288 fi`
289
df0f0674
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
95ddd785 310
4977bab6
ZW
311DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
312USUAL_DLLTOOL_FOR_TARGET = ` \
95ddd785
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 \
e245b0ea 319 echo dlltool | sed '$(program_transform_name)' ; \
95ddd785
NN
320 fi; \
321 fi`
322
df0f0674
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 ; \
95ddd785
NN
331 else \
332 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
df0f0674 333 echo $(LD); \
95ddd785 334 else \
df0f0674 335 echo ld | sed '$(program_transform_name)' ; \
95ddd785
NN
336 fi; \
337 fi`
338
df0f0674
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 ; \
95ddd785
NN
347 else \
348 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
df0f0674 349 echo $(NM); \
95ddd785 350 else \
df0f0674 351 echo nm | sed '$(program_transform_name)' ; \
95ddd785
NN
352 fi; \
353 fi`
354
4977bab6
ZW
355RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
356USUAL_RANLIB_FOR_TARGET = ` \
95ddd785
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 \
e245b0ea 367 echo ranlib | sed '$(program_transform_name)' ; \
95ddd785
NN
368 fi; \
369 fi`
370
df0f0674
NN
371WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
372USUAL_WINDRES_FOR_TARGET = ` \
373 if [ -f $$r/binutils/windres ] ; then \
374 echo $$r/binutils/windres ; \
95ddd785
NN
375 else \
376 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
df0f0674 377 echo $(WINDRES); \
95ddd785 378 else \
df0f0674 379 echo windres | sed '$(program_transform_name)' ; \
95ddd785
NN
380 fi; \
381 fi`
382
df0f0674
NN
383PICFLAG_FOR_TARGET =
384
385# ------------------------------------
386# Miscellaneous targets and flag lists
387# ------------------------------------
388
95ddd785
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
95ddd785 394#### host and target specific makefile fragments come in here.
671aa708
NN
395@target_makefile_frag@
396@alphaieee_frag@
397@ospace_frag@
398@host_makefile_frag@
95ddd785
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)" \
3fbe8e4a 417 "DESTDIR=$(DESTDIR)" \
95ddd785
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 = \
4977bab6
ZW
473 CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
474 RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
95ddd785
NN
475
476# Flags to pass down to most sub-makes, in which we're building with
477# the host environment.
95ddd785
NN
478EXTRA_HOST_FLAGS = \
479 'AR=$(AR)' \
480 'AS=$(AS)' \
481 'CC=$(CC)' \
482 'CXX=$(CXX)' \
483 'DLLTOOL=$(DLLTOOL)' \
484 'LD=$(LD)' \
485 'NM=$(NM)' \
c858bf1e 486 'RANLIB=$(RANLIB)' \
95ddd785
NN
487 'WINDRES=$(WINDRES)'
488
489FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
490
491# Flags that are concerned with the location of the X11 include files
492# and library files
493#
494# NOTE: until the top-level is getting the values via autoconf, it only
495# causes problems to have this top-level Makefile overriding the autoconf-set
496# values in child directories. Only variables that don't conflict with
497# autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
498#
499X11_FLAGS_TO_PASS = \
500 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
501 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
502
503# Flags to pass down to makes which are built with the target environment.
504# The double $ decreases the length of the command line; the variables
505# are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
95ddd785
NN
506EXTRA_TARGET_FLAGS = \
507 'AR=$$(AR_FOR_TARGET)' \
508 'AS=$$(AS_FOR_TARGET)' \
509 'CC=$$(CC_FOR_TARGET)' \
510 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
511 'CXX=$$(CXX_FOR_TARGET)' \
512 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
513 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
514 'LD=$$(LD_FOR_TARGET)' \
515 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
516 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
517 'NM=$$(NM_FOR_TARGET)' \
518 'RANLIB=$$(RANLIB_FOR_TARGET)' \
519 'WINDRES=$$(WINDRES_FOR_TARGET)'
520
521TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
522
523# Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
524# unfortunately needs the native compiler and the target ar and
525# ranlib.
526# If any variables are added here, they must be added to do-*, below.
1358ccea 527# The BUILD_* variables are a special case, which are used for the gcc
95ddd785
NN
528# cross-building scheme.
529EXTRA_GCC_FLAGS = \
530 'AR=$(AR)' \
531 'AS=$(AS)' \
532 'CC=$(CC)' \
533 'CXX=$(CXX)' \
534 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
4977bab6 535 'BUILD_CC=$(CC_FOR_BUILD)' \
95ddd785
NN
536 'BUILD_PREFIX=$(BUILD_PREFIX)' \
537 'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
538 'NM=$(NM)' \
c858bf1e 539 'RANLIB=$(RANLIB)' \
95ddd785
NN
540 'WINDRES=$$(WINDRES_FOR_TARGET)' \
541 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
542 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
543 "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \
544 "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \
545 "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \
546 "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
547 "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
548 "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
549 "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \
550 "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
551 "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
552
553GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
554
8b87bb96
NN
555.PHONY: configure-host
556configure-host: maybe-configure-gcc [+
557 FOR host_modules +] \
558 maybe-configure-[+module+][+
559 ENDFOR host_modules +]
560.PHONY: configure-target
561configure-target: [+
562 FOR target_modules +] \
563 maybe-configure-target-[+module+][+
564 ENDFOR target_modules +]
95ddd785 565
95ddd785
NN
566# The target built for a native build.
567.PHONY: all.normal
8b87bb96
NN
568all.normal: @all_build_modules@ all-host all-target
569
570.PHONY: all-host
571all-host: maybe-all-gcc [+
572 FOR host_modules +] \
573 maybe-all-[+module+][+
574 ENDFOR host_modules +]
575.PHONY: all-target
576all-target: [+
577 FOR target_modules +] \
578 maybe-all-target-[+module+][+
579 ENDFOR target_modules +]
95ddd785
NN
580
581# Do a target for all the subdirectories. A ``make do-X'' will do a
582# ``make X'' in all subdirectories (because, in general, there is a
583# dependency (below) of X upon do-X, a ``make X'' will also do this,
584# but it may do additional work as well).
4977bab6 585[+ FOR recursive_targets +]
1a1e6b96 586.PHONY: do-[+make_target+]
1358ccea
NN
587do-[+make_target+]: [+make_target+]-host [+make_target+]-target
588
589.PHONY: [+make_target+]-host
590[+make_target+]-host: maybe-[+make_target+]-gcc [+
591 FOR host_modules +] \
592 maybe-[+make_target+]-[+module+][+
593 ENDFOR host_modules +]
594
595.PHONY: [+make_target+]-target
596[+make_target+]-target: [+
597 FOR target_modules +] \
598 maybe-[+make_target+]-target-[+module+][+
599 ENDFOR target_modules +]
600
601# GCC, the eternal special case
602.PHONY: maybe-[+make_target+]-gcc [+make_target+]-gcc
603maybe-[+make_target+]-gcc:
604[+make_target+]-gcc: [+
605 FOR depend +]\
606 [+depend+]-gcc [+
607 ENDFOR depend +]
608 @[ -f ./gcc/Makefile ] || exit 0; \
609 r=`${PWD}`; export r; \
610 s=`cd $(srcdir); ${PWD}`; export s; \
611 $(SET_LIB_PATH) \
612 for flag in $(EXTRA_GCC_FLAGS); do \
613 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
614 done; \
615 echo "Doing [+make_target+] in gcc" ; \
616 (cd gcc && \
617 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
618 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
619 "RANLIB=$${RANLIB}" \
620 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
621 [+make_target+]) \
622 || exit 1
623
624# Host modules.
625[+ FOR host_modules +]
626.PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+]
627maybe-[+make_target+]-[+module+]:
628[+ IF (match-value? = "missing" (get "make_target") ) +]
629# [+module+] doesn't support [+make_target+].
630[+make_target+]-[+module+]:
631[+ ELSE +]
632[+make_target+]-[+module+]: [+
633 FOR depend +]\
634 [+depend+]-[+module+] [+
635 ENDFOR depend +]
636 @[ -f ./[+module+]/Makefile ] || exit 0; \
637 r=`${PWD}`; export r; \
95ddd785
NN
638 s=`cd $(srcdir); ${PWD}`; export s; \
639 $(SET_LIB_PATH) \
1358ccea
NN
640 for flag in $(EXTRA_HOST_FLAGS); do \
641 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
642 done; \
643 echo "Doing [+make_target+] in [+module+]" ; \
644 (cd [+module+] && \
645 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
646 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
647 "RANLIB=$${RANLIB}" \
648 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
649 [+make_target+]) \
650 || exit 1
651[+ ENDIF +]
652[+ ENDFOR host_modules +]
653
654# Target modules.
655[+ FOR target_modules +]
656.PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+]
657maybe-[+make_target+]-target-[+module+]:
658[+ IF (match-value? = "missing" (get "make_target") ) +]
659# [+module+] doesn't support [+make_target+].
660[+make_target+]-[+module+]:
661[+ ELSE +]
662[+make_target+]-target-[+module+]: [+
663 FOR depend +]\
664 [+depend+]-target-[+module+] [+
665 ENDFOR depend +]
666 @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0 ; \
95ddd785
NN
667 r=`${PWD}`; export r; \
668 s=`cd $(srcdir); ${PWD}`; export s; \
669 $(SET_LIB_PATH) \
1358ccea
NN
670 echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]" ; \
671 for flag in $(EXTRA_TARGET_FLAGS); do \
672 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
673 done; \
674 (cd $(TARGET_SUBDIR)/[+module+] && \
675 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
676 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
677 "RANLIB=$${RANLIB}" \
678 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
679 [+make_target+]) \
680 || exit 1
681[+ ENDIF +]
682[+ ENDFOR target_modules +]
4977bab6
ZW
683[+ ENDFOR recursive_targets +]
684
95ddd785
NN
685# Here are the targets which correspond to the do-X targets.
686
687.PHONY: info installcheck dvi install-info
688.PHONY: clean distclean mostlyclean maintainer-clean realclean
689.PHONY: local-clean local-distclean local-maintainer-clean
690info: do-info
691installcheck: do-installcheck
692dvi: do-dvi
693
212f6dd0
NN
694# Make sure makeinfo is built before we do a `make info', if we're
695# in fact building texinfo.
696do-info: maybe-all-texinfo
95ddd785
NN
697
698install-info: do-install-info dir.info
699 s=`cd $(srcdir); ${PWD}`; export s; \
700 if [ -f dir.info ] ; then \
3fbe8e4a 701 $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \
95ddd785
NN
702 else true ; fi
703
704local-clean:
705 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
706
707local-distclean:
708 -rm -f Makefile config.status config.cache mh-frag mt-frag
ade82b16 709 -rm -f multilib.out multilib.tmp maybedep.tmp serdep.tmp
95ddd785
NN
710 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
711 rm -rf $(TARGET_SUBDIR); \
712 else true; fi
0c227849 713 -rm -rf $(BUILD_SUBDIR)
95ddd785
NN
714 -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
715 -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
716 -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
717 -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
718 -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null
719
720local-maintainer-clean:
721 @echo "This command is intended for maintainers to use;"
722 @echo "it deletes files that may require special tools to rebuild."
723
724clean: do-clean local-clean
725mostlyclean: do-mostlyclean local-clean
726distclean: do-distclean local-clean local-distclean
727maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
728maintainer-clean: local-distclean
729realclean: maintainer-clean
730
1358ccea
NN
731# Extra dependency for clean-target, owing to the mixed nature of gcc
732clean-target: clean-target-libgcc
95ddd785
NN
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
4977bab6 745# Only include modules actually being configured and built.
7e2dbcef
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 +]
95ddd785
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
4977bab6 777.PHONY: install uninstall
8b87bb96
NN
778install: installdirs install-host install-target
779
7e2dbcef
NN
780.PHONY: install-host-nogcc
781install-host-nogcc: [+
782 FOR host_modules +] \
783 maybe-install-[+module+][+
784 ENDFOR host_modules +]
785
8b87bb96
NN
786.PHONY: install-host
787install-host: maybe-install-gcc [+
788 FOR host_modules +] \
789 maybe-install-[+module+][+
790 ENDFOR host_modules +]
7e2dbcef 791
8b87bb96
NN
792.PHONY: install-target
793install-target: [+
794 FOR target_modules +] \
795 maybe-install-target-[+module+][+
796 ENDFOR target_modules +]
95ddd785
NN
797
798uninstall:
799 @echo "the uninstall target is not supported in this tree"
800
95ddd785
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) \
88b5521b 806 (cd ./gcc && \
95ddd785
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
7e2dbcef 815install-no-fixedincludes: installdirs install-host-nogcc \
8b87bb96 816 install-target gcc-no-fixedincludes
95ddd785 817
4977bab6 818### other supporting targets
95ddd785 819
4977bab6
ZW
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 \
3fbe8e4a 829 $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
4977bab6
ZW
830 mv -f dir.info.new dir.info ; \
831 else true ; \
95ddd785
NN
832 fi
833
4977bab6
ZW
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
4977bab6
ZW
848# --------------------------------------
849# Modules which run on the build machine
850# --------------------------------------
851[+ FOR build_modules +]
852.PHONY: configure-build-[+module+] maybe-configure-build-[+module+]
853maybe-configure-build-[+module+]:
ade82b16
AO
854configure-build-[+module+]:
855 @test ! -f $(BUILD_SUBDIR)/[+module+]/Makefile || exit 0; \
3aa83176
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 \
95ddd785
NN
880 .) topdir="../$(srcdir)" ;; \
881 *) topdir="../../$(srcdir)" ;; \
3aa83176
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; \
95ddd785 893 else \
3aa83176 894 true; \
95ddd785 895 fi; \
95ddd785 896 else \
3aa83176 897 exit 1; \
95ddd785 898 fi; \
3aa83176
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
4977bab6
ZW
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; \
3aa83176
NN
918 s=`cd $(srcdir); ${PWD}`; export s; \
919 (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all)
4977bab6
ZW
920[+ ENDFOR build_modules +]
921
922# --------------------------------------
923# Modules which run on the host machine
924# --------------------------------------
925[+ FOR host_modules +]
926.PHONY: configure-[+module+] maybe-configure-[+module+]
927maybe-configure-[+module+]:
ade82b16
AO
928configure-[+module+]:
929 @test ! -f [+module+]/Makefile || exit 0; \
930 [ -d [+module+] ] || mkdir [+module+]; \
4977bab6
ZW
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; \
f7dae026
NN
937 AR="$(AR)"; export AR; \
938 AS="$(AS)"; export AS; \
939 CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
940 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
941 LD="$(LD)"; export LD; \
942 NM="$(NM)"; export NM; \
943 RANLIB="$(RANLIB)"; export RANLIB; \
944 WINDRES="$(WINDRES)"; export WINDRES; \
945 OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
946 OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
4977bab6
ZW
947 echo Configuring in [+module+]; \
948 cd [+module+] || exit 1; \
949 case $(srcdir) in \
950 \.) \
951 srcdiroption="--srcdir=."; \
952 libsrcdir=".";; \
953 /* | [A-Za-z]:[\\/]*) \
954 srcdiroption="--srcdir=$(srcdir)/[+module+]"; \
955 libsrcdir="$$s/[+module+]";; \
956 *) \
957 srcdiroption="--srcdir=../$(srcdir)/[+module+]"; \
958 libsrcdir="$$s/[+module+]";; \
959 esac; \
960 $(SHELL) $${libsrcdir}/configure \
961 $(HOST_CONFIGARGS) $${srcdiroption} \
962 || exit 1
95ddd785 963
4977bab6
ZW
964.PHONY: all-[+module+] maybe-all-[+module+]
965maybe-all-[+module+]:
966all-[+module+]: configure-[+module+]
967 @r=`${PWD}`; export r; \
3aa83176
NN
968 s=`cd $(srcdir); ${PWD}`; export s; \
969 $(SET_LIB_PATH) \
970 (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
971 IF with_x
972 +] $(X11_FLAGS_TO_PASS)[+
973 ENDIF with_x +] all)
4977bab6 974
7e2dbcef
NN
975.PHONY: check-[+module+] maybe-check-[+module+]
976maybe-check-[+module+]:
4977bab6 977[+ IF no_check +]
4977bab6
ZW
978check-[+module+]:
979[+ ELIF no_check_cross +]
4977bab6
ZW
980# This module is only tested in a native toolchain.
981check-[+module+]:
95ddd785 982 @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
3aa83176 983 r=`${PWD}`; export r; \
95ddd785
NN
984 s=`cd $(srcdir); ${PWD}`; export s; \
985 $(SET_LIB_PATH) \
88b5521b 986 (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
4977bab6
ZW
987 IF with_x
988 +] $(X11_FLAGS_TO_PASS)[+
3aa83176
NN
989 ENDIF with_x +] check); \
990 fi
991[+ ELSE check +]
3aa83176
NN
992check-[+module+]:
993 @r=`${PWD}`; export r; \
994 s=`cd $(srcdir); ${PWD}`; export s; \
995 $(SET_LIB_PATH) \
996 (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
997 IF with_x
998 +] $(X11_FLAGS_TO_PASS)[+
999 ENDIF with_x +] check)
4977bab6
ZW
1000[+ ENDIF no_check +]
1001
4977bab6
ZW
1002.PHONY: install-[+module+] maybe-install-[+module+]
1003maybe-install-[+module+]:
7e2dbcef 1004[+ IF no_install +]
4977bab6
ZW
1005install-[+module+]:
1006[+ ELSE install +]
4977bab6
ZW
1007install-[+module+]: installdirs
1008 @r=`${PWD}`; export r; \
3aa83176
NN
1009 s=`cd $(srcdir); ${PWD}`; export s; \
1010 $(SET_LIB_PATH) \
1011 (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
1012 IF with_x
1013 +] $(X11_FLAGS_TO_PASS)[+
1014 ENDIF with_x +] install)
4977bab6
ZW
1015[+ ENDIF no_install +]
1016[+ ENDFOR host_modules +]
1017
1018# ---------------------------------------
1019# Modules which run on the target machine
1020# ---------------------------------------
1021[+ FOR target_modules +]
1022.PHONY: configure-target-[+module+] maybe-configure-target-[+module+]
1023maybe-configure-target-[+module+]:
4977bab6 1024
88b5521b
NN
1025# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
1026$(TARGET_SUBDIR)/[+module+]/multilib.out: multilib.out
ade82b16 1027 @[ -d $(TARGET_SUBDIR)/[+module+] ] || \
3aa83176 1028 mkdir $(TARGET_SUBDIR)/[+module+]; \
ade82b16 1029 rm -f $(TARGET_SUBDIR)/[+module+]/Makefile || : ; \
88b5521b 1030 cp multilib.out $(TARGET_SUBDIR)/[+module+]/multilib.out
95ddd785 1031
ade82b16
AO
1032configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/multilib.out
1033 @test ! -f $(TARGET_SUBDIR)/[+module+]/Makefile || exit 0; \
3aa83176
NN
1034 [ -d $(TARGET_SUBDIR)/[+module+] ] || \
1035 mkdir $(TARGET_SUBDIR)/[+module+];\
1036 r=`${PWD}`; export r; \
1037 s=`cd $(srcdir); ${PWD}`; export s; \
1038 $(SET_LIB_PATH) \
1039 AR="$(AR_FOR_TARGET)"; export AR; \
1040 AS="$(AS_FOR_TARGET)"; export AS; \
1041 CC="$(CC_FOR_TARGET)"; export CC; \
1042 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1043 CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \[+
1044IF raw_cxx +]
1045 CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
1046 CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \[+
1047ELSE normal_cxx +]
1048 CXX="$(CXX_FOR_TARGET)"; export CXX; \[+
1049ENDIF raw_cxx +]
1050 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
1051 GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
1052 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1053 LD="$(LD_FOR_TARGET)"; export LD; \
1054 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
1055 NM="$(NM_FOR_TARGET)"; export NM; \
1056 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1057 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
1058 echo Configuring in $(TARGET_SUBDIR)/[+module+]; \
1059 cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \
1060 case $(srcdir) in \
1061 /* | [A-Za-z]:[\\/]*) \
1062 topdir=$(srcdir) ;; \
1063 *) \
1064 case "$(TARGET_SUBDIR)" in \
95ddd785
NN
1065 .) topdir="../$(srcdir)" ;; \
1066 *) topdir="../../$(srcdir)" ;; \
3aa83176
NN
1067 esac ;; \
1068 esac; \
1069 if [ "$(srcdir)" = "." ] ; then \
1070 if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1071 if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \
1072 if [ -f Makefile ]; then \
1073 if $(MAKE) distclean; then \
1074 true; \
1075 else \
1076 exit 1; \
1077 fi; \
95ddd785 1078 else \
3aa83176 1079 true; \
95ddd785 1080 fi; \
95ddd785 1081 else \
3aa83176 1082 exit 1; \
95ddd785 1083 fi; \
3aa83176
NN
1084 else \
1085 true; \
1086 fi; \
1087 srcdiroption="--srcdir=."; \
1088 libsrcdir="."; \
1089 else \
1090 srcdiroption="--srcdir=$${topdir}/[+module+]"; \
1091 libsrcdir="$$s/[+module+]"; \
1092 fi; \
1093 rm -f no-such-file || : ; \
1094 CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
1095 $(TARGET_CONFIGARGS) $${srcdiroption} \
1096 --with-target-subdir="$(TARGET_SUBDIR)" \
1097 || exit 1
4977bab6
ZW
1098
1099.PHONY: all-target-[+module+] maybe-all-target-[+module+]
1100maybe-all-target-[+module+]:
1101all-target-[+module+]: configure-target-[+module+]
1102 @r=`${PWD}`; export r; \
3aa83176
NN
1103 s=`cd $(srcdir); ${PWD}`; export s; \
1104 $(SET_LIB_PATH) \
1105 (cd $(TARGET_SUBDIR)/[+module+] && \
1106 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
1107 IF raw_cxx
1108 +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+
1109 ENDIF raw_cxx
1110 +] all)
7e2dbcef
NN
1111
1112.PHONY: check-target-[+module+] maybe-check-target-[+module+]
1113maybe-check-target-[+module+]:
4977bab6
ZW
1114[+ IF no_check +]
1115# Dummy target for uncheckable module.
4977bab6
ZW
1116check-target-[+module+]:
1117[+ ELSE check +]
4977bab6
ZW
1118check-target-[+module+]:
1119 @r=`${PWD}`; export r; \
3aa83176
NN
1120 s=`cd $(srcdir); ${PWD}`; export s; \
1121 $(SET_LIB_PATH) \
1122 (cd $(TARGET_SUBDIR)/[+module+] && \
1123 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
1124 IF raw_cxx
1125 +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+
1126 ENDIF raw_cxx
1127 +] check)
4977bab6 1128[+ ENDIF no_check +]
7e2dbcef 1129
4977bab6
ZW
1130.PHONY: install-target-[+module+] maybe-install-target-[+module+]
1131maybe-install-target-[+module+]:
7e2dbcef 1132[+ IF no_install +]
4977bab6
ZW
1133# Dummy target for uninstallable.
1134install-target-[+module+]:
1135[+ ELSE install +]
4977bab6
ZW
1136install-target-[+module+]: installdirs
1137 @r=`${PWD}`; export r; \
3aa83176
NN
1138 s=`cd $(srcdir); ${PWD}`; export s; \
1139 $(SET_LIB_PATH) \
1140 (cd $(TARGET_SUBDIR)/[+module+] && \
1141 $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
4977bab6
ZW
1142[+ ENDIF no_install +]
1143[+ ENDFOR target_modules +]
95ddd785 1144
4977bab6
ZW
1145# ----------
1146# GCC module
1147# ----------
95ddd785 1148
4977bab6
ZW
1149# Unfortunately, while gcc _should_ be a host module,
1150# libgcc is a target module, and gen* programs are
1151# build modules. So GCC is a sort of hybrid.
95ddd785
NN
1152
1153# gcc is the only module which uses GCC_FLAGS_TO_PASS.
4977bab6
ZW
1154.PHONY: configure-gcc maybe-configure-gcc
1155maybe-configure-gcc:
ade82b16
AO
1156configure-gcc:
1157 @test ! -f gcc/Makefile || exit 0; \
1158 [ -d gcc ] || mkdir gcc; \
4977bab6
ZW
1159 r=`${PWD}`; export r; \
1160 s=`cd $(srcdir); ${PWD}`; export s; \
1161 CC="$(CC)"; export CC; \
1162 CFLAGS="$(CFLAGS)"; export CFLAGS; \
1163 CXX="$(CXX)"; export CXX; \
1164 CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
3dfabf63 1165 TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
f7dae026
NN
1166 AR="$(AR)"; export AR; \
1167 AS="$(AS)"; export AS; \
1168 CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
1169 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
1170 LD="$(LD)"; export LD; \
1171 NM="$(NM)"; export NM; \
1172 RANLIB="$(RANLIB)"; export RANLIB; \
1173 WINDRES="$(WINDRES)"; export WINDRES; \
1174 OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
1175 OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
4977bab6
ZW
1176 echo Configuring in gcc; \
1177 cd gcc || exit 1; \
1178 case $(srcdir) in \
1179 \.) \
1180 srcdiroption="--srcdir=."; \
1181 libsrcdir=".";; \
1182 /* | [A-Za-z]:[\\/]*) \
1183 srcdiroption="--srcdir=$(srcdir)/gcc"; \
1184 libsrcdir="$$s/gcc";; \
1185 *) \
1186 srcdiroption="--srcdir=../$(srcdir)/gcc"; \
1187 libsrcdir="$$s/gcc";; \
1188 esac; \
1189 $(SHELL) $${libsrcdir}/configure \
1190 $(HOST_CONFIGARGS) $${srcdiroption} \
1191 || exit 1
1192
5ecf91d1
JM
1193# Don't 'make all' in gcc if it's already been made by 'bootstrap'; that
1194# causes trouble. This wart will be fixed eventually by moving
4977bab6
ZW
1195# the bootstrap behavior to this file.
1196.PHONY: all-gcc maybe-all-gcc
1197maybe-all-gcc:
1198all-gcc: configure-gcc
5ecf91d1
JM
1199 @if [ -f gcc/stage_last ] ; then \
1200 r=`${PWD}`; export r; \
1201 s=`cd $(srcdir); ${PWD}`; export s; \
1202 $(SET_LIB_PATH) \
88b5521b 1203 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \
4977bab6 1204 else \
95ddd785
NN
1205 r=`${PWD}`; export r; \
1206 s=`cd $(srcdir); ${PWD}`; export s; \
1207 $(SET_LIB_PATH) \
88b5521b 1208 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
95ddd785
NN
1209 fi
1210
1211# Building GCC uses some tools for rebuilding "source" files
1212# like texinfo, bison/byacc, etc. So we must depend on those.
1213#
1214# While building GCC, it may be necessary to run various target
1215# programs like the assembler, linker, etc. So we depend on
1216# those too.
1217#
1218# In theory, on an SMP all those dependencies can be resolved
1219# in parallel.
1220#
1ca4c6e1
PE
1221GCC_STRAP_TARGETS = bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap
1222.PHONY: $(GCC_STRAP_TARGETS)
1223$(GCC_STRAP_TARGETS): all-bootstrap configure-gcc
95ddd785
NN
1224 @r=`${PWD}`; export r; \
1225 s=`cd $(srcdir); ${PWD}`; export s; \
1226 $(SET_LIB_PATH) \
1227 echo "Bootstrapping the compiler"; \
1228 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
1229 @r=`${PWD}`; export r; \
1230 s=`cd $(srcdir); ${PWD}`; export s; \
1231 case "$@" in \
1232 *bootstrap4-lean ) \
3aa83176
NN
1233 msg="Comparing stage3 and stage4 of the compiler"; \
1234 compare=compare3-lean ;; \
1235 *bootstrap4 ) \
1236 msg="Comparing stage3 and stage4 of the compiler"; \
1237 compare=compare3 ;; \
1238 *-lean ) \
1239 msg="Comparing stage2 and stage3 of the compiler"; \
1240 compare=compare-lean ;; \
1241 * ) \
1242 msg="Comparing stage2 and stage3 of the compiler"; \
1243 compare=compare ;; \
95ddd785
NN
1244 esac; \
1245 $(SET_LIB_PATH) \
1246 echo "$$msg"; \
1247 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
1248 @r=`${PWD}`; export r; \
1249 s=`cd $(srcdir); ${PWD}` ; export s; \
1250 $(SET_LIB_PATH) \
1251 echo "Building runtime libraries"; \
1252 $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
1253
8f231b5d
JH
1254profiledbootstrap: all-bootstrap configure-gcc
1255 @r=`${PWD}`; export r; \
1256 s=`cd $(srcdir); ${PWD}`; export s; \
1257 $(SET_LIB_PATH) \
1258 echo "Bootstrapping the compiler"; \
1259 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build
1260 @r=`${PWD}`; export r; \
1261 s=`cd $(srcdir); ${PWD}` ; export s; \
1262 $(SET_LIB_PATH) \
1263 echo "Building runtime libraries and training compiler"; \
1264 $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
1265 @r=`${PWD}`; export r; \
1266 s=`cd $(srcdir); ${PWD}`; export s; \
1267 $(SET_LIB_PATH) \
1268 echo "Building feedback based compiler"; \
1269 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build
1270
95ddd785
NN
1271.PHONY: cross
1272cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1273 @r=`${PWD}`; export r; \
1274 s=`cd $(srcdir); ${PWD}`; export s; \
1275 $(SET_LIB_PATH) \
1276 echo "Building the C and C++ compiler"; \
1277 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1278 @r=`${PWD}`; export r; \
1279 s=`cd $(srcdir); ${PWD}` ; export s; \
1280 $(SET_LIB_PATH) \
1281 echo "Building runtime libraries"; \
1282 $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
1283 LANGUAGES="c c++" all
1284
afc2b62d 1285.PHONY: check-gcc maybe-check-gcc
862fced8 1286maybe-check-gcc:
95ddd785
NN
1287check-gcc:
1288 @if [ -f ./gcc/Makefile ] ; then \
1289 r=`${PWD}`; export r; \
1290 s=`cd $(srcdir); ${PWD}`; export s; \
1291 $(SET_LIB_PATH) \
88b5521b 1292 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
95ddd785
NN
1293 else \
1294 true; \
1295 fi
1296
6248218a
JM
1297.PHONY: check-gcc-c++
1298check-gcc-c++:
95ddd785
NN
1299 @if [ -f ./gcc/Makefile ] ; then \
1300 r=`${PWD}`; export r; \
1301 s=`cd $(srcdir); ${PWD}`; export s; \
1302 $(SET_LIB_PATH) \
88b5521b 1303 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
95ddd785
NN
1304 else \
1305 true; \
6248218a
JM
1306 fi
1307
1308.PHONY: check-c++
30db8e17
JM
1309check-c++:
1310 $(MAKE) check-target-libstdc++-v3 check-gcc-c++ NOTPARALLEL=parallel-ok
95ddd785 1311
4977bab6
ZW
1312.PHONY: install-gcc maybe-install-gcc
1313maybe-install-gcc:
95ddd785
NN
1314install-gcc:
1315 @if [ -f ./gcc/Makefile ] ; then \
1316 r=`${PWD}`; export r; \
1317 s=`cd $(srcdir); ${PWD}`; export s; \
1318 $(SET_LIB_PATH) \
88b5521b 1319 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
95ddd785
NN
1320 else \
1321 true; \
1322 fi
1323
4977bab6
ZW
1324# Install the gcc headers files, but not the fixed include files,
1325# which Cygnus is not allowed to distribute. This rule is very
1326# dependent on the workings of the gcc Makefile.in.
1327.PHONY: gcc-no-fixedincludes
1328gcc-no-fixedincludes:
1329 @if [ -f ./gcc/Makefile ]; then \
1330 rm -rf gcc/tmp-include; \
1331 mv gcc/include gcc/tmp-include 2>/dev/null; \
1332 mkdir gcc/include; \
1333 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
1334 touch gcc/stmp-fixinc gcc/include/fixed; \
1335 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
95ddd785 1336 r=`${PWD}`; export r; \
4977bab6 1337 s=`cd $(srcdir); ${PWD}` ; export s; \
95ddd785 1338 $(SET_LIB_PATH) \
88b5521b 1339 (cd ./gcc && \
4977bab6
ZW
1340 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1341 rm -rf gcc/include; \
1342 mv gcc/tmp-include gcc/include 2>/dev/null; \
1343 else true; fi
95ddd785 1344
4977bab6
ZW
1345# --------------------------------------
1346# Dependencies between different modules
1347# --------------------------------------
1348
1349# There are two types of dependencies here: 'hard' dependencies, where one
1350# module simply won't build without the other; and 'soft' dependencies, where
1351# if the depended-on module is missing, the depending module will do without
1352# or find a substitute somewhere (perhaps installed). Soft dependencies
1353# are specified by depending on a 'maybe-' target. If you're not sure,
1354# it's safer to use a soft dependency.
1355
1356# Host modules specific to gcc.
1357# GCC needs to identify certain tools.
1358configure-gcc: maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex
1359all-gcc: maybe-all-libiberty maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib
1360# This is a slightly kludgy method of getting dependencies on
1361# all-build-libiberty correct; it would be better to build it every time.
1362all-gcc: maybe-all-build-libiberty
1363all-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
1364
1365# Host modules specific to gdb.
1366# GDB needs to know that the simulator is being built.
1367configure-gdb: maybe-configure-tcl maybe-configure-tk maybe-configure-sim
0dffceed 1368GDB_TK = @GDB_TK@
4977bab6
ZW
1369all-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)
1370install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui
79308c5d 1371configure-libgui: maybe-configure-tcl maybe-configure-tk
4977bab6
ZW
1372all-libgui: maybe-all-tcl maybe-all-tk maybe-all-itcl
1373
1374# Host modules specific to binutils.
1375configure-bfd: configure-libiberty
1376all-bfd: maybe-all-libiberty maybe-all-intl
1377all-binutils: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-flex maybe-all-bison maybe-all-byacc maybe-all-intl
f5e0c73c
NN
1378# We put install-opcodes before install-binutils because the installed
1379# binutils might be on PATH, and they might need the shared opcodes
1380# library.
4977bab6 1381install-binutils: maybe-install-opcodes
c3969745
AS
1382# libopcodes depends on libbfd
1383install-opcodes: maybe-install-bfd
4977bab6
ZW
1384all-gas: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-intl
1385all-gprof: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-intl
1386all-ld: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-intl
1387all-opcodes: maybe-all-bfd maybe-all-libiberty
1388
1389# Other host modules in the 'src' repository.
1390all-dejagnu: maybe-all-tcl maybe-all-expect maybe-all-tk
1391configure-expect: maybe-configure-tcl maybe-configure-tk
1392all-expect: maybe-all-tcl maybe-all-tk
1393configure-itcl: maybe-configure-tcl maybe-configure-tk
1394all-itcl: maybe-all-tcl maybe-all-tk
f5e0c73c
NN
1395# We put install-tcl before install-itcl because itcl wants to run a
1396# program on installation which uses the Tcl libraries.
4977bab6 1397install-itcl: maybe-install-tcl
ba49f6f1 1398all-sid: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-tcl maybe-all-tk
4977bab6
ZW
1399install-sid: maybe-install-tcl maybe-install-tk
1400all-sim: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-readline maybe-configure-gdb
1401configure-tk: maybe-configure-tcl
1402all-tk: maybe-all-tcl
1403configure-tix: maybe-configure-tcl maybe-configure-tk
1404all-tix: maybe-all-tcl maybe-all-tk
1405all-texinfo: maybe-all-libiberty
1406
1407# Other host modules. Warning, these are not well tested.
1408all-autoconf: maybe-all-m4 maybe-all-texinfo
1409all-automake: maybe-all-m4 maybe-all-texinfo
1410all-bison: maybe-all-texinfo
1411all-diff: maybe-all-libiberty
1412all-fastjar: maybe-all-zlib maybe-all-libiberty
1413all-fileutils: maybe-all-libiberty
1414all-flex: maybe-all-libiberty maybe-all-bison maybe-all-byacc
4977bab6
ZW
1415all-gzip: maybe-all-libiberty
1416all-hello: maybe-all-libiberty
1417all-m4: maybe-all-libiberty maybe-all-texinfo
1418all-make: maybe-all-libiberty
1419all-patch: maybe-all-libiberty
1420all-prms: maybe-all-libiberty
1421all-recode: maybe-all-libiberty
1422all-sed: maybe-all-libiberty
1423all-send-pr: maybe-all-prms
4977bab6
ZW
1424all-tar: maybe-all-libiberty
1425all-uudecode: maybe-all-libiberty
1426
1427ALL_GCC = maybe-all-gcc
1428ALL_GCC_C = $(ALL_GCC) maybe-all-target-newlib maybe-all-target-libgloss
1429ALL_GCC_CXX = $(ALL_GCC_C) maybe-all-target-libstdc++-v3
1430
1431# Target modules specific to gcc.
1432configure-target-boehm-gc: $(ALL_GCC_C) maybe-configure-target-qthreads
1433configure-target-fastjar: maybe-configure-target-zlib
1434all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty
1435configure-target-libf2c: $(ALL_GCC_C)
1436all-target-libf2c: maybe-all-target-libiberty
1437configure-target-libffi: $(ALL_GCC_C)
1438configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi
1439all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi
1440configure-target-libobjc: $(ALL_GCC_C)
1441all-target-libobjc: maybe-all-target-libiberty
1442configure-target-libstdc++-v3: $(ALL_GCC_C)
1443all-target-libstdc++-v3: maybe-all-target-libiberty
1444configure-target-zlib: $(ALL_GCC_C)
95ddd785 1445
4977bab6
ZW
1446# Target modules in the 'src' repository.
1447configure-target-examples: $(ALL_GCC_C)
1448configure-target-libgloss: $(ALL_GCC)
1449all-target-libgloss: maybe-configure-target-newlib
2eb98e5d 1450configure-target-libiberty: $(ALL_GCC)
4977bab6
ZW
1451configure-target-libtermcap: $(ALL_GCC_C)
1452configure-target-newlib: $(ALL_GCC)
1453configure-target-rda: $(ALL_GCC_C)
1454configure-target-winsup: $(ALL_GCC_C)
1455all-target-winsup: maybe-all-target-libiberty maybe-all-target-libtermcap
95ddd785 1456
4977bab6
ZW
1457# Other target modules. Warning, these are not well tested.
1458configure-target-gperf: $(ALL_GCC_CXX)
1459all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3
1460configure-target-qthreads: $(ALL_GCC_C)
95ddd785 1461
4977bab6
ZW
1462# Dependencies of maybe-foo on foo. These are used because, for example,
1463# all-gcc only depends on all-gas if gas is present and being configured.
1464@maybe_dependencies@
95ddd785 1465
4977bab6
ZW
1466# Serialization dependencies. Host configures don't work well in parallel to
1467# each other, due to contention over config.cache. Target configures and
1468# build configures are similar.
1469@serialization_dependencies@
95ddd785 1470
4977bab6
ZW
1471# --------------------------------
1472# Regenerating top level configury
1473# --------------------------------
95ddd785 1474
88b5521b
NN
1475# Multilib.out tells target dirs what multilibs they should build.
1476# There is really only one copy. We use the 'timestamp' method to
1477# work around various timestamp bugs on some systems.
1478# We use move-if-change so that it's only considered updated when it
1479# actually changes, because it has to depend on a phony target.
ade82b16 1480multilib.out: maybe-all-gcc
88b5521b
NN
1481 @r=`${PWD}`; export r; \
1482 echo "Checking multilib configuration..."; \
1483 $(CC_FOR_TARGET) --print-multi-lib > multilib.tmp 2> /dev/null ; \
1484 $(SHELL) $(srcdir)/move-if-change multilib.tmp multilib.out ; \
88b5521b 1485
95ddd785 1486# Rebuilding Makefile.in, using autogen.
e245b0ea 1487AUTOGEN = autogen
ee03dc5e 1488$(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
e245b0ea 1489 cd $(srcdir) && $(AUTOGEN) Makefile.def
95ddd785 1490
671aa708 1491# Rebuilding Makefile.
e245b0ea
AO
1492Makefile: $(srcdir)/Makefile.in config.status
1493 CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
1494
1495config.status: configure $(gcc_version_trigger)
671aa708 1496 $(SHELL) ./config.status --recheck
95ddd785 1497
671aa708 1498# Rebuilding configure.
e245b0ea 1499AUTOCONF = autoconf
ee03dc5e 1500$(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4
e245b0ea 1501 cd $(srcdir) && $(AUTOCONF)
95ddd785 1502
93c834b7
NN
1503# ------------------------------
1504# Special directives to GNU Make
1505# ------------------------------
1506
e245b0ea
AO
1507# Tell GNU make 3.79 not to run the top level in parallel. This
1508# prevents contention for $builddir/$target/config.cache, as well
1509# as minimizing scatter in file system caches.
1510NOTPARALLEL = .NOTPARALLEL
1511$(NOTPARALLEL):
1512
93c834b7
NN
1513# Don't pass command-line variables to submakes.
1514.NOEXPORT:
1515MAKEOVERRIDES=
1516
95ddd785 1517# end of Makefile.in
This page took 0.265673 seconds and 5 git commands to generate.