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