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