d90c1a660cd0a8f476264651a4812a0126b90bb9
[binutils-gdb.git] / Makefile.in
1 #
2 # Makefile for directory with subdirs to build.
3 # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
4 # 1999, 2000, 2001, 2002 Free Software Foundation
5 #
6 # This file is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 #
20
21 # Tell GNU make 3.79 not to run the top level in parallel. This
22 # prevents contention for $builddir/$target/config.cache, as well
23 # as minimizing scatter in file system caches.
24 NOTPARALLEL = .NOTPARALLEL
25 $(NOTPARALLEL):
26
27 srcdir = .
28
29 prefix = /usr/local
30 exec_prefix = $(prefix)
31
32 bindir=${exec_prefix}/bin
33 sbindir=${exec_prefix}/sbin
34 libexecdir=${exec_prefix}/libexec
35 datadir=${prefix}/share
36 sysconfdir=${prefix}/etc
37 sharedstatedir=${prefix}/com
38 localstatedir=${prefix}/var
39 libdir=${exec_prefix}/lib
40 includedir=${prefix}/include
41 oldincludedir=/usr/include
42 infodir=${prefix}/info
43 mandir=${prefix}/man
44 gxx_include_dir=${includedir}/g++
45
46 tooldir = $(exec_prefix)/$(target_alias)
47 build_tooldir = $(exec_prefix)/$(target_alias)
48
49 program_transform_name =
50
51 man1dir = $(mandir)/man1
52 man2dir = $(mandir)/man2
53 man3dir = $(mandir)/man3
54 man4dir = $(mandir)/man4
55 man5dir = $(mandir)/man5
56 man6dir = $(mandir)/man6
57 man7dir = $(mandir)/man7
58 man8dir = $(mandir)/man8
59 man9dir = $(mandir)/man9
60 infodir = $(prefix)/info
61 includedir = $(prefix)/include
62 # Directory in which the compiler finds executables, libraries, etc.
63 libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
64 GDB_NLM_DEPS =
65
66 SHELL = /bin/sh
67
68 # pwd command to use. Allow user to override default by setting PWDCMD in
69 # the environment to account for automounters. The make variable must not
70 # be called PWDCMD, otherwise the value set here is passed to make
71 # subprocesses and overrides the setting from the user's environment.
72 PWD = $${PWDCMD-pwd}
73
74 # INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
75 # cygwin host.
76 INSTALL_PROGRAM_ARGS =
77
78 INSTALL = $(SHELL) $$s/install-sh -c
79 INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
80 INSTALL_SCRIPT = $(INSTALL)
81 INSTALL_DATA = $(INSTALL) -m 644
82
83 INSTALL_DOSREL = install-dosrel-fake
84
85 AS = as
86 AR = ar
87 AR_FLAGS = rc
88 CC = cc
89
90 # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
91 # here so that they can be overridden by Makefile fragments.
92 HOST_CC = $(CC_FOR_BUILD)
93 BUILD_PREFIX =
94 BUILD_PREFIX_1 = loser-
95
96 # These flag values are normally overridden by the configure script.
97 CFLAGS = -g
98 CXXFLAGS = -g -O2
99
100 LDFLAGS =
101 LIBCFLAGS = $(CFLAGS)
102 CFLAGS_FOR_BUILD = $(CFLAGS)
103 # During gcc bootstrap, if we use some random cc for stage1 then
104 # CFLAGS will be just -g. We want to ensure that TARGET libraries
105 # (which we know are built with gcc) are built with optimizations so
106 # prepend -O2 when setting CFLAGS_FOR_TARGET.
107 CFLAGS_FOR_TARGET = -O2 $(CFLAGS)
108 LDFLAGS_FOR_TARGET =
109 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
110 PICFLAG =
111 PICFLAG_FOR_TARGET =
112
113 CXX = c++
114
115 # Use -O2 to stress test the compiler.
116 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
117 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
118 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
119
120 DLLTOOL = dlltool
121 WINDRES = windres
122
123 NM = nm
124
125 LD = ld
126
127 BZIPPROG = bzip2
128 MD5PROG = md5sum
129
130 # These values are substituted by configure.
131 DEFAULT_YACC = yacc
132 DEFAULT_LEX = lex
133 DEFAULT_M4 = m4
134
135 BISON = `if [ -f $$r/bison/bison ] ; then \
136 echo $$r/bison/bison -L $$s/bison/ ; \
137 else \
138 echo bison ; \
139 fi`
140
141 YACC = `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
149 LEX = `if [ -f $$r/flex/flex ] ; \
150 then echo $$r/flex/flex ; \
151 else echo ${DEFAULT_LEX} ; fi`
152
153 M4 = `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.
159 MAKEINFO = `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.
168 MAKEINFOFLAGS =
169
170 EXPECT = `if [ -f $$r/expect/expect ] ; \
171 then echo $$r/expect/expect ; \
172 else echo expect ; fi`
173
174 RUNTEST = `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.
181 CC_FOR_BUILD = $(CC)
182 CXX_FOR_BUILD = $(CXX)
183
184 SUBDIRS = "this is set via configure, don't edit this"
185 OTHERS =
186
187 # This is set by the configure script to the list of directories which
188 # should be built using the target tools.
189 TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib winsup opcodes libf2c libobjc
190
191 # Target libraries are put under this directory:
192 # Changed by configure to $(target_alias) if cross.
193 TARGET_SUBDIR = .
194
195 BUILD_CONFIGDIRS = libiberty
196 BUILD_SUBDIR = .
197
198 # This is set by the configure script to the arguments to use when configuring
199 # directories built for the target.
200 TARGET_CONFIGARGS =
201
202 # This is set by the configure script to the arguments to use when configuring
203 # directories built for the build system.
204 BUILD_CONFIGARGS =
205
206 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
207 # was used.
208 SET_LIB_PATH =
209
210 # This is the name of the environment variable used for the path to
211 # the libraries. This may be changed by configure.in.
212 RPATH_ENVVAR = LD_LIBRARY_PATH
213
214 # This is the list of directories that may be needed in RPATH_ENVVAR
215 # so that programs built for the host machine work.
216 HOST_LIB_PATH = $$r/bfd:$$r/opcodes
217
218 # This is the list of directories that may be needed in RPATH_ENVVAR
219 # so that prorgams built for the target machine work.
220 TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
221
222 # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
223 # Some platforms don't like blank entries, so we remove duplicate,
224 # leading and trailing colons.
225 REALLY_SET_LIB_PATH = \
226 $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
227
228 ALL = all.normal
229 INSTALL_TARGET = installdirs \
230 install-gcc \
231 $(INSTALL_MODULES) \
232 $(INSTALL_TARGET_MODULES) \
233 $(INSTALL_X11_MODULES) \
234 $(INSTALL_DOSREL)
235
236 INSTALL_TARGET_CROSS = installdirs \
237 install-gcc-cross \
238 $(INSTALL_MODULES) \
239 $(INSTALL_TARGET_MODULES) \
240 $(INSTALL_X11_MODULES) \
241 $(INSTALL_DOSREL)
242
243 # Should be substed by configure.in
244 FLAGS_FOR_TARGET =
245 CC_FOR_TARGET =
246 CXX_FOR_TARGET =
247 CXX_FOR_TARGET_FOR_RECURSIVE_MAKE =
248 GCJ_FOR_TARGET =
249
250 # If GCC_FOR_TARGET is not overriden on the command line, then this
251 # variable is passed down to the gcc Makefile, where it is used to
252 # build libgcc2.a. We define it here so that it can itself be
253 # overridden on the command line.
254 GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
255
256 AS_FOR_TARGET = ` \
257 if [ -f $$r/gas/as-new ] ; then \
258 echo $$r/gas/as-new ; \
259 elif [ -f $$r/gcc/xgcc ]; then \
260 $(CC_FOR_TARGET) -print-prog-name=as ; \
261 else \
262 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
263 echo $(AS); \
264 else \
265 t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
266 fi; \
267 fi`
268
269 LD_FOR_TARGET = ` \
270 if [ -f $$r/ld/ld-new ] ; then \
271 echo $$r/ld/ld-new ; \
272 elif [ -f $$r/gcc/xgcc ]; then \
273 $(CC_FOR_TARGET) -print-prog-name=ld ; \
274 else \
275 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
276 echo $(LD); \
277 else \
278 t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
279 fi; \
280 fi`
281
282 DLLTOOL_FOR_TARGET = ` \
283 if [ -f $$r/binutils/dlltool ] ; then \
284 echo $$r/binutils/dlltool ; \
285 else \
286 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
287 echo $(DLLTOOL); \
288 else \
289 t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
290 fi; \
291 fi`
292
293 WINDRES_FOR_TARGET = ` \
294 if [ -f $$r/binutils/windres ] ; then \
295 echo $$r/binutils/windres ; \
296 else \
297 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
298 echo $(WINDRES); \
299 else \
300 t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \
301 fi; \
302 fi`
303
304 AR_FOR_TARGET = ` \
305 if [ -f $$r/binutils/ar ] ; then \
306 echo $$r/binutils/ar ; \
307 else \
308 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
309 echo $(AR); \
310 else \
311 t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
312 fi; \
313 fi`
314
315 RANLIB_FOR_TARGET = ` \
316 if [ -f $$r/binutils/ranlib ] ; then \
317 echo $$r/binutils/ranlib ; \
318 else \
319 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
320 if [ x'$(RANLIB)' != x ]; then \
321 echo $(RANLIB); \
322 else \
323 echo ranlib; \
324 fi; \
325 else \
326 t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
327 fi; \
328 fi`
329
330 NM_FOR_TARGET = ` \
331 if [ -f $$r/binutils/nm-new ] ; then \
332 echo $$r/binutils/nm-new ; \
333 elif [ -f $$r/gcc/xgcc ]; then \
334 $(CC_FOR_TARGET) -print-prog-name=nm ; \
335 else \
336 if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
337 echo $(NM); \
338 else \
339 t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
340 fi; \
341 fi`
342
343 # The first rule in the file had better be this one. Don't put any above it.
344 # This lives here to allow makefile fragments to contain dependencies.
345 all: all.normal
346 .PHONY: all
347
348 # These can be overridden by config/mt-*.
349 # The _TARGET_ is because they're specified in mt-foo.
350 # The _HOST_ is because they're programs that run on the host.
351 EXTRA_TARGET_HOST_ALL_MODULES =
352 EXTRA_TARGET_HOST_INSTALL_MODULES =
353 EXTRA_TARGET_HOST_CHECK_MODULES =
354
355 #### host and target specific makefile fragments come in here.
356 ###
357
358 # Flags to pass down to all sub-makes.
359 # Please keep these in alphabetical order.
360 BASE_FLAGS_TO_PASS = \
361 "AR_FLAGS=$(AR_FLAGS)" \
362 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
363 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
364 "BISON=$(BISON)" \
365 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
366 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
367 "CFLAGS=$(CFLAGS)" \
368 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
369 "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \
370 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
371 "CXXFLAGS=$(CXXFLAGS)" \
372 "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
373 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
374 "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
375 "INSTALL=$(INSTALL)" \
376 "INSTALL_DATA=$(INSTALL_DATA)" \
377 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
378 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
379 "LDFLAGS=$(LDFLAGS)" \
380 "LEX=$(LEX)" \
381 "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
382 "LIBCFLAGS=$(LIBCFLAGS)" \
383 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
384 "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
385 "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
386 "M4=$(M4)" \
387 "MAKE=$(MAKE)" \
388 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
389 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
390 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
391 "RPATH_ENVVAR=$(RPATH_ENVVAR)" \
392 "SHELL=$(SHELL)" \
393 "EXPECT=$(EXPECT)" \
394 "RUNTEST=$(RUNTEST)" \
395 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
396 "TARGET_SUBDIR=$(TARGET_SUBDIR)" \
397 "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
398 "YACC=$(YACC)" \
399 "bindir=$(bindir)" \
400 "datadir=$(datadir)" \
401 "exec_prefix=$(exec_prefix)" \
402 "includedir=$(includedir)" \
403 "infodir=$(infodir)" \
404 "libdir=$(libdir)" \
405 "libexecdir=$(libexecdir)" \
406 "lispdir=$(lispdir)" \
407 "libstdcxx_incdir=$(libstdcxx_incdir)" \
408 "libsubdir=$(libsubdir)" \
409 "localstatedir=$(localstatedir)" \
410 "mandir=$(mandir)" \
411 "oldincludedir=$(oldincludedir)" \
412 "prefix=$(prefix)" \
413 "sbindir=$(sbindir)" \
414 "sharedstatedir=$(sharedstatedir)" \
415 "sysconfdir=$(sysconfdir)" \
416 "tooldir=$(tooldir)" \
417 "build_tooldir=$(build_tooldir)" \
418 "gxx_include_dir=$(gxx_include_dir)" \
419 "gcc_version=$(gcc_version)" \
420 "gcc_version_trigger=$(gcc_version_trigger)" \
421 "target_alias=$(target_alias)"
422
423 # For any flags above that may contain shell code that varies from one
424 # target library to another. When doing recursive invocations of the
425 # top-level Makefile, we don't want the outer make to evaluate them,
426 # so we pass these variables down unchanged. They must not contain
427 # single nor double quotes.
428 RECURSE_FLAGS = \
429 CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)'
430
431 # Flags to pass down to most sub-makes, in which we're building with
432 # the host environment.
433 # If any variables are added here, they must be added to do-*, below.
434 EXTRA_HOST_FLAGS = \
435 'AR=$(AR)' \
436 'AS=$(AS)' \
437 'CC=$(CC)' \
438 'CXX=$(CXX)' \
439 'DLLTOOL=$(DLLTOOL)' \
440 'LD=$(LD)' \
441 'NM=$(NM)' \
442 "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
443 'WINDRES=$(WINDRES)'
444
445 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
446
447 # Flags that are concerned with the location of the X11 include files
448 # and library files
449 #
450 # NOTE: until the top-level is getting the values via autoconf, it only
451 # causes problems to have this top-level Makefile overriding the autoconf-set
452 # values in child directories. Only variables that don't conflict with
453 # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
454 #
455 X11_FLAGS_TO_PASS = \
456 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
457 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
458
459 # Flags to pass down to makes which are built with the target environment.
460 # The double $ decreases the length of the command line; the variables
461 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
462 # If any variables are added here, they must be added to do-*, below.
463 EXTRA_TARGET_FLAGS = \
464 'AR=$$(AR_FOR_TARGET)' \
465 'AS=$$(AS_FOR_TARGET)' \
466 'CC=$$(CC_FOR_TARGET)' \
467 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
468 'CXX=$$(CXX_FOR_TARGET)' \
469 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
470 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
471 'LD=$$(LD_FOR_TARGET)' \
472 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
473 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
474 'NM=$$(NM_FOR_TARGET)' \
475 'RANLIB=$$(RANLIB_FOR_TARGET)' \
476 'WINDRES=$$(WINDRES_FOR_TARGET)'
477
478 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
479
480 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
481 # unfortunately needs the native compiler and the target ar and
482 # ranlib.
483 # If any variables are added here, they must be added to do-*, below.
484 # The HOST_* variables are a special case, which are used for the gcc
485 # cross-building scheme.
486 EXTRA_GCC_FLAGS = \
487 'AR=$(AR)' \
488 'AS=$(AS)' \
489 'CC=$(CC)' \
490 'CXX=$(CXX)' \
491 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
492 'HOST_CC=$(CC_FOR_BUILD)' \
493 'BUILD_PREFIX=$(BUILD_PREFIX)' \
494 'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
495 'NM=$(NM)' \
496 "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
497 'WINDRES=$$(WINDRES_FOR_TARGET)' \
498 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
499 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
500 "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \
501 "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \
502 "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \
503 "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
504 "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
505 "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
506 "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \
507 "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
508 "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
509
510 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
511
512 # This is a list of the targets for all of the modules which are compiled
513 # using the build machine's native compiler. Configure edits the second
514 # macro for build!=host builds.
515 ALL_BUILD_MODULES_LIST = \
516 all-build-libiberty
517 ALL_BUILD_MODULES =
518
519 # This is a list of the configure targets for all of the modules which
520 # are compiled using the native tools.
521 CONFIGURE_BUILD_MODULES = \
522 configure-build-libiberty
523
524 # This is a list of the targets for all of the modules which are compiled
525 # using $(FLAGS_TO_PASS).
526 ALL_MODULES = \
527 all-ash \
528 all-autoconf \
529 all-automake \
530 all-bash \
531 all-bfd \
532 all-binutils \
533 all-bison \
534 all-byacc \
535 all-bzip2 \
536 all-db \
537 all-dejagnu \
538 all-diff \
539 all-dosutils \
540 all-etc \
541 all-fastjar \
542 all-fileutils \
543 all-findutils \
544 all-find \
545 all-flex \
546 all-gas \
547 all-gawk \
548 all-gettext \
549 all-gnuserv \
550 all-gprof \
551 all-grep \
552 all-grez \
553 all-gzip \
554 all-hello \
555 all-indent \
556 all-intl \
557 all-itcl \
558 all-ld \
559 all-libgui \
560 all-libiberty \
561 all-libtool \
562 all-m4 \
563 all-make \
564 all-mmalloc \
565 all-opcodes \
566 all-patch \
567 all-perl \
568 all-prms \
569 all-rcs \
570 all-readline \
571 all-release \
572 all-recode \
573 all-sed \
574 all-send-pr \
575 all-shellutils \
576 all-sid \
577 all-sim \
578 all-snavigator \
579 all-tar \
580 all-tcl \
581 all-texinfo \
582 all-textutils \
583 all-time \
584 all-uudecode \
585 all-wdiff \
586 all-zip \
587 all-zlib \
588 $(EXTRA_TARGET_HOST_ALL_MODULES)
589
590 # This is a list of the check targets for all of the modules which are
591 # compiled using $(FLAGS_TO_PASS).
592 #
593 # The list is in two parts. The first lists those tools which
594 # are tested as part of the host's native tool-chain, and not
595 # tested in a cross configuration.
596 NATIVE_CHECK_MODULES = \
597 check-bison \
598 check-byacc \
599 check-fastjar \
600 check-flex \
601 check-zip
602
603 CROSS_CHECK_MODULES = \
604 check-ash \
605 check-autoconf \
606 check-automake \
607 check-bash \
608 check-bfd \
609 check-binutils \
610 check-bzip2 \
611 check-db \
612 check-dejagnu \
613 check-diff \
614 check-etc \
615 check-fileutils \
616 check-findutils \
617 check-find \
618 check-gas \
619 check-gawk \
620 check-gettext \
621 check-gnuserv \
622 check-gprof \
623 check-grep \
624 check-gzip \
625 check-hello \
626 check-indent \
627 check-intl \
628 check-itcl \
629 check-ld \
630 check-libgui \
631 check-libiberty \
632 check-libtool \
633 check-m4 \
634 check-make \
635 check-mmcheckoc \
636 check-opcodes \
637 check-patch \
638 check-perl \
639 check-prms \
640 check-rcs \
641 check-readline \
642 check-recode \
643 check-sed \
644 check-send-pr \
645 check-shellutils \
646 check-snavigator \
647 check-sid \
648 check-sim \
649 check-tar \
650 check-tcl \
651 check-texinfo \
652 check-textutils \
653 check-time \
654 check-uudecode \
655 check-wdiff \
656 $(EXTRA_TARGET_HOST_CHECK_MODULES)
657
658 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
659
660 # This is a list of the install targets for all of the modules which are
661 # compiled using $(FLAGS_TO_PASS).
662 # We put install-opcodes before install-binutils because the installed
663 # binutils might be on PATH, and they might need the shared opcodes
664 # library.
665 # We put install-tcl before install-itcl because itcl wants to run a
666 # program on installation which uses the Tcl libraries.
667 INSTALL_MODULES = \
668 install-ash \
669 install-autoconf \
670 install-automake \
671 install-bash \
672 install-bfd \
673 install-bzip2 \
674 install-opcodes \
675 install-binutils \
676 install-bison \
677 install-byacc \
678 install-db \
679 install-dejagnu \
680 install-diff \
681 install-dosutils \
682 install-etc \
683 install-fastjar \
684 install-fileutils \
685 install-findutils \
686 install-find \
687 install-flex \
688 install-gas \
689 install-gawk \
690 install-gettext \
691 install-gnuserv \
692 install-gprof \
693 install-grep \
694 install-grez \
695 install-gzip \
696 install-hello \
697 install-indent \
698 install-intl \
699 install-tcl \
700 install-itcl \
701 install-ld \
702 install-libgui \
703 install-libiberty \
704 install-libtool \
705 install-m4 \
706 install-make \
707 install-mmalloc \
708 install-patch \
709 install-perl \
710 install-prms \
711 install-rcs \
712 install-readline \
713 install-recode \
714 install-sed \
715 install-send-pr \
716 install-shellutils \
717 install-sid \
718 install-sim \
719 install-snavigator \
720 install-tar \
721 install-textutils \
722 install-time \
723 install-uudecode \
724 install-wdiff \
725 install-zip \
726 $(EXTRA_TARGET_HOST_INSTALL_MODULES)
727
728 # This is a list of the targets for all of the modules which are compiled
729 # using $(X11_FLAGS_TO_PASS).
730 ALL_X11_MODULES = \
731 all-gdb \
732 all-expect \
733 all-guile \
734 all-tclX \
735 all-tk \
736 all-tix
737
738 # This is a list of the check targets for all of the modules which are
739 # compiled using $(X11_FLAGS_TO_PASS).
740 CHECK_X11_MODULES = \
741 check-gdb \
742 check-guile \
743 check-expect \
744 check-tclX \
745 check-tk \
746 check-tix
747
748 # This is a list of the install targets for all the modules which are
749 # compiled using $(X11_FLAGS_TO_PASS).
750 INSTALL_X11_MODULES = \
751 install-gdb \
752 install-guile \
753 install-expect \
754 install-tclX \
755 install-tk \
756 install-tix
757
758 # This is a list of the targets for all of the modules which are compiled
759 # using $(TARGET_FLAGS_TO_PASS).
760 ALL_TARGET_MODULES = \
761 all-target-libstdc++-v3 \
762 all-target-newlib \
763 all-target-libf2c \
764 all-target-libobjc \
765 all-target-libtermcap \
766 all-target-winsup \
767 all-target-libgloss \
768 all-target-libiberty \
769 all-target-gperf \
770 all-target-examples \
771 all-target-libffi \
772 all-target-libjava \
773 all-target-zlib \
774 all-target-boehm-gc \
775 all-target-qthreads
776
777 # This is a list of the configure targets for all of the modules which
778 # are compiled using the target tools.
779 CONFIGURE_TARGET_MODULES = \
780 configure-target-libstdc++-v3 \
781 configure-target-newlib \
782 configure-target-libf2c \
783 configure-target-libobjc \
784 configure-target-libtermcap \
785 configure-target-winsup \
786 configure-target-libgloss \
787 configure-target-libiberty \
788 configure-target-gperf \
789 configure-target-examples \
790 configure-target-libffi \
791 configure-target-libjava \
792 configure-target-zlib \
793 configure-target-boehm-gc \
794 configure-target-qthreads
795
796 # This is a list of the check targets for all of the modules which are
797 # compiled using $(TARGET_FLAGS_TO_PASS).
798 CHECK_TARGET_MODULES = \
799 check-target-libstdc++-v3 \
800 check-target-newlib \
801 check-target-libf2c \
802 check-target-libobjc \
803 check-target-winsup \
804 check-target-libiberty \
805 check-target-libffi \
806 check-target-libjava \
807 check-target-zlib \
808 check-target-boehm-gc \
809 check-target-qthreads \
810 check-target-gperf
811
812 # This is a list of the install targets for all of the modules which are
813 # compiled using $(TARGET_FLAGS_TO_PASS).
814 INSTALL_TARGET_MODULES = \
815 install-target-libstdc++-v3 \
816 install-target-newlib \
817 install-target-libf2c \
818 install-target-libobjc \
819 install-target-libtermcap \
820 install-target-winsup \
821 install-target-libgloss \
822 install-target-libiberty \
823 install-target-libjava \
824 install-target-zlib \
825 install-target-boehm-gc \
826 install-target-qthreads \
827 install-target-gperf
828
829 # This is a list of the targets for which we can do a clean-{target}.
830 CLEAN_MODULES = \
831 clean-ash \
832 clean-autoconf \
833 clean-automake \
834 clean-bash \
835 clean-bfd \
836 clean-binutils \
837 clean-bison \
838 clean-byacc \
839 clean-bzip2 \
840 clean-db \
841 clean-dejagnu \
842 clean-diff \
843 clean-dosutils \
844 clean-etc \
845 clean-fastjar \
846 clean-fileutils \
847 clean-findutils \
848 clean-find \
849 clean-flex \
850 clean-gas \
851 clean-gawk \
852 clean-gettext \
853 clean-gnuserv \
854 clean-gprof \
855 clean-grep \
856 clean-grez \
857 clean-gzip \
858 clean-hello \
859 clean-indent \
860 clean-intl \
861 clean-itcl \
862 clean-ld \
863 clean-libgui \
864 clean-libiberty \
865 clean-libtool \
866 clean-m4 \
867 clean-make \
868 clean-mmalloc \
869 clean-opcodes \
870 clean-patch \
871 clean-perl \
872 clean-prms \
873 clean-rcs \
874 clean-readline \
875 clean-release \
876 clean-recode \
877 clean-sed \
878 clean-send-pr \
879 clean-shellutils \
880 clean-sid \
881 clean-sim \
882 clean-snavigator \
883 clean-tar \
884 clean-tcl \
885 clean-texinfo \
886 clean-textutils \
887 clean-time \
888 clean-uudecode \
889 clean-wdiff \
890 clean-zip \
891 clean-zlib
892
893 # All of the target modules that can be cleaned
894 CLEAN_TARGET_MODULES = \
895 clean-target-libstdc++-v3 \
896 clean-target-newlib \
897 clean-target-libf2c \
898 clean-target-libobjc \
899 clean-target-winsup \
900 clean-target-libgloss \
901 clean-target-libiberty \
902 clean-target-gperf \
903 clean-target-examples \
904 clean-target-libffi \
905 clean-target-libjava \
906 clean-target-zlib \
907 clean-target-boehm-gc \
908 clean-target-qthreads
909
910 # All of the x11 modules that can be cleaned
911 CLEAN_X11_MODULES = \
912 clean-gdb \
913 clean-expect \
914 clean-guile \
915 clean-tclX \
916 clean-tk \
917 clean-tix
918
919 # The target built for a native build.
920 .PHONY: all.normal
921 all.normal: \
922 $(ALL_BUILD_MODULES) \
923 $(ALL_MODULES) \
924 $(ALL_X11_MODULES) \
925 $(ALL_TARGET_MODULES) \
926 all-gcc
927
928 # Do a target for all the subdirectories. A ``make do-X'' will do a
929 # ``make X'' in all subdirectories (because, in general, there is a
930 # dependency (below) of X upon do-X, a ``make X'' will also do this,
931 # but it may do additional work as well).
932 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
933 # because it is so large that it can easily overflow the command line
934 # length limit on some systems.
935 DO_X = \
936 do-clean \
937 do-distclean \
938 do-dvi \
939 do-info \
940 do-install-info \
941 do-installcheck \
942 do-mostlyclean \
943 do-maintainer-clean \
944 do-TAGS
945 .PHONY: $(DO_X)
946 $(DO_X):
947 @target=`echo $@ | sed -e 's/^do-//'`; \
948 r=`${PWD}`; export r; \
949 s=`cd $(srcdir); ${PWD}`; export s; \
950 $(SET_LIB_PATH) \
951 for i in $(SUBDIRS) -dummy-; do \
952 if [ -f ./$$i/Makefile ]; then \
953 case $$i in \
954 gcc) \
955 for flag in $(EXTRA_GCC_FLAGS); do \
956 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
957 done; \
958 ;; \
959 *) \
960 for flag in $(EXTRA_HOST_FLAGS); do \
961 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
962 done; \
963 ;; \
964 esac ; \
965 if (cd ./$$i; \
966 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
967 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
968 "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
969 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
970 $${target}); \
971 then true; else exit 1; fi; \
972 else true; fi; \
973 done
974 @target=`echo $@ | sed -e 's/^do-//'`; \
975 r=`${PWD}`; export r; \
976 s=`cd $(srcdir); ${PWD}`; export s; \
977 $(SET_LIB_PATH) \
978 for i in $(TARGET_CONFIGDIRS) -dummy-; do \
979 if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
980 for flag in $(EXTRA_TARGET_FLAGS); do \
981 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
982 done; \
983 if (cd $(TARGET_SUBDIR)/$$i; \
984 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
985 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
986 "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
987 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
988 $${target}); \
989 then true; else exit 1; fi; \
990 else true; fi; \
991 done
992
993 # Here are the targets which correspond to the do-X targets.
994
995 .PHONY: info installcheck dvi install-info
996 .PHONY: clean distclean mostlyclean maintainer-clean realclean
997 .PHONY: local-clean local-distclean local-maintainer-clean
998 info: do-info
999 installcheck: do-installcheck
1000 dvi: do-dvi
1001
1002 # Make sure makeinfo is built before we do a `make info'.
1003 do-info: all-texinfo
1004
1005 install-info: do-install-info dir.info
1006 s=`cd $(srcdir); ${PWD}`; export s; \
1007 if [ -f dir.info ] ; then \
1008 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
1009 else true ; fi
1010
1011 local-clean:
1012 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
1013
1014 local-distclean:
1015 -rm -f Makefile config.status config.cache mh-frag mt-frag
1016 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
1017 rm -rf $(TARGET_SUBDIR); \
1018 else true; fi
1019 -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
1020 -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
1021 -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
1022 -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
1023 -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null
1024
1025 local-maintainer-clean:
1026 @echo "This command is intended for maintainers to use;"
1027 @echo "it deletes files that may require special tools to rebuild."
1028
1029 clean: do-clean local-clean
1030 mostlyclean: do-mostlyclean local-clean
1031 distclean: do-distclean local-clean local-distclean
1032 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
1033 maintainer-clean: local-distclean
1034 realclean: maintainer-clean
1035
1036 # This rule is used to clean specific modules.
1037 .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
1038 $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
1039 @dir=`echo $@ | sed -e 's/clean-//'`; \
1040 if [ -f ./$${dir}/Makefile ] ; then \
1041 r=`${PWD}`; export r; \
1042 s=`cd $(srcdir); ${PWD}`; export s; \
1043 $(SET_LIB_PATH) \
1044 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
1045 else \
1046 true; \
1047 fi
1048
1049 .PHONY: $(CLEAN_TARGET_MODULES)
1050 $(CLEAN_TARGET_MODULES):
1051 @dir=`echo $@ | sed -e 's/clean-target-//'`; \
1052 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1053 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1054 r=`${PWD}`; export r; \
1055 s=`cd $(srcdir); ${PWD}`; export s; \
1056 $(SET_LIB_PATH) \
1057 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
1058 else \
1059 true; \
1060 fi
1061
1062 clean-target: $(CLEAN_TARGET_MODULES) clean-target-libgcc
1063 clean-target-libgcc:
1064 test ! -d gcc/libgcc || \
1065 (cd gcc/libgcc && find . -type d -print) | \
1066 while read d; do rm -f gcc/$$d/libgcc.a || : ; done
1067 -rm -rf gcc/libgcc
1068
1069 # Check target.
1070
1071 .PHONY: check do-check
1072 check:
1073 $(MAKE) do-check NOTPARALLEL=parallel-ok
1074
1075 do-check: $(CHECK_MODULES) \
1076 $(CHECK_TARGET_MODULES) \
1077 $(CHECK_X11_MODULES) \
1078 check-gcc
1079
1080 # Automated reporting of test results.
1081
1082 warning.log: build.log
1083 $(srcdir)/contrib/warn_summary build.log > $@
1084
1085 mail-report.log:
1086 if test x'$(BOOT_CFLAGS)' != x''; then \
1087 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
1088 fi; \
1089 $(srcdir)/contrib/test_summary -t >$@
1090 chmod +x $@
1091 echo If you really want to send e-mail, run ./$@ now
1092
1093 mail-report-with-warnings.log: warning.log
1094 if test x'$(BOOT_CFLAGS)' != x''; then \
1095 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
1096 fi; \
1097 $(srcdir)/contrib/test_summary -t -i warning.log >$@
1098 chmod +x $@
1099 echo If you really want to send e-mail, run ./$@ now
1100
1101 # Installation targets.
1102
1103 .PHONY: install install-cross uninstall source-vault binary-vault vault-install
1104 install: $(INSTALL_TARGET)
1105 install-cross: $(INSTALL_TARGET_CROSS)
1106
1107 uninstall:
1108 @echo "the uninstall target is not supported in this tree"
1109
1110 source-vault:
1111 $(MAKE) -f ./release/Build-A-Release \
1112 host=$(host_alias) source-vault
1113
1114 binary-vault:
1115 $(MAKE) -f ./release/Build-A-Release \
1116 host=$(host_alias) target=$(target_alias)
1117
1118 vault-install:
1119 @if [ -f ./release/vault-install ] ; then \
1120 ./release/vault-install $(host_alias) $(target_alias) ; \
1121 else \
1122 true ; \
1123 fi
1124
1125 .PHONY: install.all
1126 install.all: install-no-fixedincludes
1127 @if [ -f ./gcc/Makefile ] ; then \
1128 r=`${PWD}` ; export r ; \
1129 $(SET_LIB_PATH) \
1130 (cd ./gcc; \
1131 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
1132 else \
1133 true ; \
1134 fi
1135
1136 # install-no-fixedincludes is used because Cygnus can not distribute
1137 # the fixed header files.
1138 .PHONY: install-no-fixedincludes
1139 install-no-fixedincludes: \
1140 installdirs \
1141 $(INSTALL_MODULES) \
1142 $(INSTALL_TARGET_MODULES) \
1143 $(INSTALL_X11_MODULES) \
1144 gcc-no-fixedincludes
1145
1146 # Install the gcc headers files, but not the fixed include files,
1147 # which Cygnus is not allowed to distribute. This rule is very
1148 # dependent on the workings of the gcc Makefile.in.
1149 .PHONY: gcc-no-fixedincludes
1150 gcc-no-fixedincludes:
1151 @if [ -f ./gcc/Makefile ]; then \
1152 rm -rf gcc/tmp-include; \
1153 mv gcc/include gcc/tmp-include 2>/dev/null; \
1154 mkdir gcc/include; \
1155 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
1156 touch gcc/stmp-fixinc gcc/include/fixed; \
1157 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
1158 r=`${PWD}`; export r; \
1159 s=`cd $(srcdir); ${PWD}` ; export s; \
1160 $(SET_LIB_PATH) \
1161 (cd ./gcc; \
1162 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1163 rm -rf gcc/include; \
1164 mv gcc/tmp-include gcc/include 2>/dev/null; \
1165 else true; fi
1166
1167 # This rule is used to build the modules which are built with the
1168 # build machine's native compiler.
1169 .PHONY: $(ALL_BUILD_MODULES)
1170 $(ALL_BUILD_MODULES):
1171 dir=`echo $@ | sed -e 's/all-build-//'`; \
1172 if [ -f ./$${dir}/Makefile ] ; then \
1173 r=`${PWD}`; export r; \
1174 s=`cd $(srcdir); ${PWD}`; export s; \
1175 (cd $(BUILD_SUBDIR)/$${dir} && $(MAKE) all); \
1176 else \
1177 true; \
1178 fi
1179
1180 # This rule is used to configure the modules which are built with the
1181 # native tools.
1182 .PHONY: $(CONFIGURE_BUILD_MODULES)
1183 $(CONFIGURE_BUILD_MODULES):
1184 @dir=`echo $@ | sed -e 's/configure-build-//'`; \
1185 if [ ! -d $(BUILD_SUBDIR) ]; then \
1186 true; \
1187 elif [ -f $(BUILD_SUBDIR)/$${dir}/Makefile ] ; then \
1188 true; \
1189 elif echo " $(BUILD_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
1190 if [ -d $(srcdir)/$${dir} ]; then \
1191 [ -d $(BUILD_SUBDIR)/$${dir} ] || mkdir $(BUILD_SUBDIR)/$${dir};\
1192 r=`${PWD}`; export r; \
1193 s=`cd $(srcdir); ${PWD}`; export s; \
1194 AR="$(AR_FOR_BUILD)"; export AR; \
1195 AS="$(AS_FOR_BUILD)"; export AS; \
1196 CC="$(CC_FOR_BUILD)"; export CC; \
1197 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
1198 CXX="$(CXX_FOR_BUILD)"; export CXX; \
1199 CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
1200 GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
1201 DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
1202 LD="$(LD_FOR_BUILD)"; export LD; \
1203 LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
1204 NM="$(NM_FOR_BUILD)"; export NM; \
1205 RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
1206 WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
1207 echo Configuring in $(BUILD_SUBDIR)/$${dir}; \
1208 cd "$(BUILD_SUBDIR)/$${dir}" || exit 1; \
1209 case $(srcdir) in \
1210 /* | [A-Za-z]:[\\/]*) \
1211 topdir=$(srcdir) ;; \
1212 *) \
1213 case "$(BUILD_SUBDIR)" in \
1214 .) topdir="../$(srcdir)" ;; \
1215 *) topdir="../../$(srcdir)" ;; \
1216 esac ;; \
1217 esac; \
1218 if [ "$(srcdir)" = "." ] ; then \
1219 if [ "$(BUILD_SUBDIR)" != "." ] ; then \
1220 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
1221 if [ -f Makefile ]; then \
1222 if $(MAKE) distclean; then \
1223 true; \
1224 else \
1225 exit 1; \
1226 fi; \
1227 else \
1228 true; \
1229 fi; \
1230 else \
1231 exit 1; \
1232 fi; \
1233 else \
1234 true; \
1235 fi; \
1236 srcdiroption="--srcdir=."; \
1237 libsrcdir="."; \
1238 else \
1239 srcdiroption="--srcdir=$${topdir}/$${dir}"; \
1240 libsrcdir="$$s/$${dir}"; \
1241 fi; \
1242 if [ -f $${libsrcdir}/configure ] ; then \
1243 rm -f no-such-file skip-this-dir; \
1244 CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
1245 $(BUILD_CONFIGARGS) $${srcdiroption} \
1246 --with-build-subdir="$(BUILD_SUBDIR)"; \
1247 else \
1248 rm -f no-such-file skip-this-dir; \
1249 CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
1250 $(BUILD_CONFIGARGS) $${srcdiroption} \
1251 --with-build-subdir="$(BUILD_SUBDIR)"; \
1252 fi || exit 1; \
1253 if [ -f skip-this-dir ] ; then \
1254 sh skip-this-dir; \
1255 rm -f skip-this-dir; \
1256 cd ..; rmdir $${dir} || true; \
1257 else \
1258 true; \
1259 fi; \
1260 else \
1261 true; \
1262 fi; \
1263 else \
1264 true; \
1265 fi
1266
1267 # This rule is used to build the modules which use FLAGS_TO_PASS. To
1268 # build a target all-X means to cd to X and make all.
1269 #
1270 # all-gui, and all-libproc are handled specially because
1271 # they are still experimental, and if they fail to build, that
1272 # shouldn't stop "make all".
1273 .PHONY: $(ALL_MODULES) all-gui all-libproc
1274 $(ALL_MODULES) all-gui all-libproc:
1275 @dir=`echo $@ | sed -e 's/all-//'`; \
1276 if [ -f ./$${dir}/Makefile ] ; then \
1277 r=`${PWD}`; export r; \
1278 s=`cd $(srcdir); ${PWD}`; export s; \
1279 $(SET_LIB_PATH) \
1280 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
1281 else \
1282 true; \
1283 fi
1284
1285 # These rules are used to check the modules which use FLAGS_TO_PASS.
1286 # To build a target check-X means to cd to X and make check. Some
1287 # modules are only tested in a native toolchain.
1288
1289 .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
1290 $(NATIVE_CHECK_MODULES):
1291 @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
1292 dir=`echo $@ | sed -e 's/check-//'`; \
1293 if [ -f ./$${dir}/Makefile ] ; then \
1294 r=`${PWD}`; export r; \
1295 s=`cd $(srcdir); ${PWD}`; export s; \
1296 $(SET_LIB_PATH) \
1297 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1298 else \
1299 true; \
1300 fi; \
1301 fi
1302
1303 $(CROSS_CHECK_MODULES):
1304 @dir=`echo $@ | sed -e 's/check-//'`; \
1305 if [ -f ./$${dir}/Makefile ] ; then \
1306 r=`${PWD}`; export r; \
1307 s=`cd $(srcdir); ${PWD}`; export s; \
1308 $(SET_LIB_PATH) \
1309 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1310 else \
1311 true; \
1312 fi
1313
1314 # This rule is used to install the modules which use FLAGS_TO_PASS.
1315 # To build a target install-X means to cd to X and make install.
1316 .PHONY: $(INSTALL_MODULES)
1317 $(INSTALL_MODULES): installdirs
1318 @dir=`echo $@ | sed -e 's/install-//'`; \
1319 if [ -f ./$${dir}/Makefile ] ; then \
1320 r=`${PWD}`; export r; \
1321 s=`cd $(srcdir); ${PWD}`; export s; \
1322 $(SET_LIB_PATH) \
1323 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1324 else \
1325 true; \
1326 fi
1327
1328 # This rule is used to configure the modules which are built with the
1329 # target tools.
1330 .PHONY: $(CONFIGURE_TARGET_MODULES)
1331 $(CONFIGURE_TARGET_MODULES):
1332 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1333 if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \
1334 r=`${PWD}`; export r; \
1335 $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \
1336 if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \
1337 if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \
1338 if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \
1339 rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1340 else \
1341 echo "Multilibs changed for $${dir}, reconfiguring"; \
1342 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \
1343 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1344 fi; \
1345 else \
1346 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1347 fi; \
1348 fi; \
1349 fi; exit 0 # break command into two pieces
1350 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1351 if [ ! -d $(TARGET_SUBDIR) ]; then \
1352 true; \
1353 elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1354 true; \
1355 elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
1356 if [ -d $(srcdir)/$${dir} ]; then \
1357 [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
1358 r=`${PWD}`; export r; \
1359 s=`cd $(srcdir); ${PWD}`; export s; \
1360 $(SET_LIB_PATH) \
1361 AR="$(AR_FOR_TARGET)"; export AR; \
1362 AS="$(AS_FOR_TARGET)"; export AS; \
1363 CC="$(CC_FOR_TARGET)"; export CC; \
1364 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1365 CXX="$(CXX_FOR_TARGET)"; export CXX; \
1366 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
1367 GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
1368 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1369 LD="$(LD_FOR_TARGET)"; export LD; \
1370 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
1371 NM="$(NM_FOR_TARGET)"; export NM; \
1372 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1373 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
1374 echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
1375 cd "$(TARGET_SUBDIR)/$${dir}" || exit 1; \
1376 case $(srcdir) in \
1377 /* | [A-Za-z]:[\\/]*) \
1378 topdir=$(srcdir) ;; \
1379 *) \
1380 case "$(TARGET_SUBDIR)" in \
1381 .) topdir="../$(srcdir)" ;; \
1382 *) topdir="../../$(srcdir)" ;; \
1383 esac ;; \
1384 esac; \
1385 if [ "$(srcdir)" = "." ] ; then \
1386 if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1387 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
1388 if [ -f Makefile ]; then \
1389 if $(MAKE) distclean; then \
1390 true; \
1391 else \
1392 exit 1; \
1393 fi; \
1394 else \
1395 true; \
1396 fi; \
1397 else \
1398 exit 1; \
1399 fi; \
1400 else \
1401 true; \
1402 fi; \
1403 srcdiroption="--srcdir=."; \
1404 libsrcdir="."; \
1405 else \
1406 srcdiroption="--srcdir=$${topdir}/$${dir}"; \
1407 libsrcdir="$$s/$${dir}"; \
1408 fi; \
1409 if [ -f $${libsrcdir}/configure ] ; then \
1410 rm -f no-such-file skip-this-dir; \
1411 CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
1412 $(TARGET_CONFIGARGS) $${srcdiroption} \
1413 --with-target-subdir="$(TARGET_SUBDIR)"; \
1414 else \
1415 rm -f no-such-file skip-this-dir; \
1416 CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
1417 $(TARGET_CONFIGARGS) $${srcdiroption} \
1418 --with-target-subdir="$(TARGET_SUBDIR)"; \
1419 fi || exit 1; \
1420 if [ -f skip-this-dir ] ; then \
1421 sh skip-this-dir; \
1422 rm -f skip-this-dir; \
1423 cd ..; rmdir $${dir} || true; \
1424 else \
1425 true; \
1426 fi; \
1427 else \
1428 true; \
1429 fi; \
1430 else \
1431 true; \
1432 fi
1433
1434 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
1435 # To build a target all-X means to cd to X and make all.
1436 .PHONY: $(ALL_TARGET_MODULES)
1437 $(ALL_TARGET_MODULES):
1438 @dir=`echo $@ | sed -e 's/all-target-//'`; \
1439 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1440 r=`${PWD}`; export r; \
1441 s=`cd $(srcdir); ${PWD}`; export s; \
1442 $(SET_LIB_PATH) \
1443 (cd $(TARGET_SUBDIR)/$${dir}; \
1444 $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1445 else \
1446 true; \
1447 fi
1448
1449 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
1450 # To build a target install-X means to cd to X and make install.
1451 .PHONY: $(CHECK_TARGET_MODULES)
1452 $(CHECK_TARGET_MODULES):
1453 @dir=`echo $@ | sed -e 's/check-target-//'`; \
1454 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1455 r=`${PWD}`; export r; \
1456 s=`cd $(srcdir); ${PWD}`; export s; \
1457 $(SET_LIB_PATH) \
1458 (cd $(TARGET_SUBDIR)/$${dir}; \
1459 $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1460 else \
1461 true; \
1462 fi
1463
1464 # This rule is used to install the modules which use
1465 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
1466 # and make install.
1467 .PHONY: $(INSTALL_TARGET_MODULES)
1468 $(INSTALL_TARGET_MODULES): installdirs
1469 @dir=`echo $@ | sed -e 's/install-target-//'`; \
1470 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1471 r=`${PWD}`; export r; \
1472 s=`cd $(srcdir); ${PWD}`; export s; \
1473 $(SET_LIB_PATH) \
1474 (cd $(TARGET_SUBDIR)/$${dir}; \
1475 $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1476 else \
1477 true; \
1478 fi
1479
1480 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
1481 # To build a target all-X means to cd to X and make all.
1482 .PHONY: $(ALL_X11_MODULES)
1483 $(ALL_X11_MODULES):
1484 @dir=`echo $@ | sed -e 's/all-//'`; \
1485 if [ -f ./$${dir}/Makefile ] ; then \
1486 r=`${PWD}`; export r; \
1487 s=`cd $(srcdir); ${PWD}`; export s; \
1488 $(SET_LIB_PATH) \
1489 (cd $${dir}; \
1490 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
1491 else \
1492 true; \
1493 fi
1494
1495 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
1496 # To build a target check-X means to cd to X and make all.
1497 .PHONY: $(CHECK_X11_MODULES)
1498 $(CHECK_X11_MODULES):
1499 @dir=`echo $@ | sed -e 's/check-//'`; \
1500 if [ -f ./$${dir}/Makefile ] ; then \
1501 r=`${PWD}`; export r; \
1502 s=`cd $(srcdir); ${PWD}`; export s; \
1503 $(SET_LIB_PATH) \
1504 (cd $${dir}; \
1505 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
1506 else \
1507 true; \
1508 fi
1509
1510 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
1511 # To build a target install-X means to cd to X and make install.
1512 .PHONY: $(INSTALL_X11_MODULES)
1513 $(INSTALL_X11_MODULES): installdirs
1514 @dir=`echo $@ | sed -e 's/install-//'`; \
1515 if [ -f ./$${dir}/Makefile ] ; then \
1516 r=`${PWD}`; export r; \
1517 s=`cd $(srcdir); ${PWD}`; export s; \
1518 $(SET_LIB_PATH) \
1519 (cd $${dir}; \
1520 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
1521 else \
1522 true; \
1523 fi
1524
1525 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1526 .PHONY: all-gcc
1527 all-gcc:
1528 @if [ -f ./gcc/Makefile ] ; then \
1529 r=`${PWD}`; export r; \
1530 s=`cd $(srcdir); ${PWD}`; export s; \
1531 $(SET_LIB_PATH) \
1532 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1533 else \
1534 true; \
1535 fi
1536
1537 # Building GCC uses some tools for rebuilding "source" files
1538 # like texinfo, bison/byacc, etc. So we must depend on those.
1539 #
1540 # While building GCC, it may be necessary to run various target
1541 # programs like the assembler, linker, etc. So we depend on
1542 # those too.
1543 #
1544 # In theory, on an SMP all those dependencies can be resolved
1545 # in parallel.
1546 #
1547 .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean
1548 bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean: all-bootstrap
1549 @r=`${PWD}`; export r; \
1550 s=`cd $(srcdir); ${PWD}`; export s; \
1551 $(SET_LIB_PATH) \
1552 echo "Bootstrapping the compiler"; \
1553 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
1554 @r=`${PWD}`; export r; \
1555 s=`cd $(srcdir); ${PWD}`; export s; \
1556 case "$@" in \
1557 *bootstrap4-lean ) \
1558 msg="Comparing stage3 and stage4 of the compiler"; \
1559 compare=compare3-lean ;; \
1560 *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \
1561 compare=compare3 ;; \
1562 *-lean ) msg="Comparing stage2 and stage3 of the compiler"; \
1563 compare=compare-lean ;; \
1564 * ) msg="Comparing stage2 and stage3 of the compiler"; \
1565 compare=compare ;; \
1566 esac; \
1567 $(SET_LIB_PATH) \
1568 echo "$$msg"; \
1569 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
1570 @r=`${PWD}`; export r; \
1571 s=`cd $(srcdir); ${PWD}` ; export s; \
1572 $(SET_LIB_PATH) \
1573 echo "Building runtime libraries"; \
1574 $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
1575
1576 .PHONY: cross
1577 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1578 @r=`${PWD}`; export r; \
1579 s=`cd $(srcdir); ${PWD}`; export s; \
1580 $(SET_LIB_PATH) \
1581 echo "Building the C and C++ compiler"; \
1582 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1583 @r=`${PWD}`; export r; \
1584 s=`cd $(srcdir); ${PWD}` ; export s; \
1585 $(SET_LIB_PATH) \
1586 echo "Building runtime libraries"; \
1587 $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
1588 LANGUAGES="c c++" all
1589
1590 .PHONY: check-gcc
1591 check-gcc:
1592 @if [ -f ./gcc/Makefile ] ; then \
1593 r=`${PWD}`; export r; \
1594 s=`cd $(srcdir); ${PWD}`; export s; \
1595 $(SET_LIB_PATH) \
1596 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1597 else \
1598 true; \
1599 fi
1600
1601 .PHONY: check-c++
1602 check-c++:
1603 @if [ -f ./gcc/Makefile ] ; then \
1604 r=`${PWD}`; export r; \
1605 s=`cd $(srcdir); ${PWD}`; export s; \
1606 $(SET_LIB_PATH) \
1607 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
1608 $(MAKE) check-target-libstdc++-v3; \
1609 else \
1610 true; \
1611 fi
1612
1613 .PHONY: install-gcc
1614 install-gcc:
1615 @if [ -f ./gcc/Makefile ] ; then \
1616 r=`${PWD}`; export r; \
1617 s=`cd $(srcdir); ${PWD}`; export s; \
1618 $(SET_LIB_PATH) \
1619 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1620 else \
1621 true; \
1622 fi
1623
1624 .PHONY: install-gcc-cross
1625 install-gcc-cross:
1626 @if [ -f ./gcc/Makefile ] ; then \
1627 r=`${PWD}`; export r; \
1628 s=`cd $(srcdir); ${PWD}`; export s; \
1629 $(SET_LIB_PATH) \
1630 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" install); \
1631 else \
1632 true; \
1633 fi
1634 # EXPERIMENTAL STUFF
1635 # This rule is used to install the modules which use FLAGS_TO_PASS.
1636 # To build a target install-X means to cd to X and make install.
1637 .PHONY: install-dosrel
1638 install-dosrel: installdirs info
1639 @dir=`echo $@ | sed -e 's/install-//'`; \
1640 if [ -f ./$${dir}/Makefile ] ; then \
1641 r=`${PWD}`; export r; \
1642 s=`cd $(srcdir); ${PWD}`; export s; \
1643 $(SET_LIB_PATH) \
1644 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1645 else \
1646 true; \
1647 fi
1648
1649 install-dosrel-fake:
1650
1651 ALL_GCC = all-gcc
1652 ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss
1653 ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++-v3
1654
1655 # This is a list of inter-dependencies among modules.
1656 all-ash:
1657 all-autoconf: all-m4 all-texinfo
1658 all-automake: all-m4 all-texinfo
1659 all-bash:
1660 all-bfd: all-libiberty all-intl
1661 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl
1662 all-bison: all-texinfo
1663 configure-target-boehm-gc: $(ALL_GCC_C) configure-target-qthreads
1664 all-target-boehm-gc: configure-target-boehm-gc
1665 all-byacc:
1666 all-bzip2:
1667 all-db:
1668 all-dejagnu: all-tcl all-expect all-tk
1669 all-diff: all-libiberty
1670 all-etc:
1671 configure-target-examples: $(ALL_GCC_C)
1672 all-target-examples: configure-target-examples
1673 all-expect: all-tcl all-tk
1674 all-fileutils: all-libiberty
1675 all-findutils:
1676 all-find:
1677 all-flex: all-libiberty all-bison all-byacc
1678 all-gas: all-libiberty all-opcodes all-bfd all-intl
1679 all-gawk:
1680 all-gcc: all-bison all-byacc all-binutils all-gas all-ld all-zlib
1681 all-bootstrap: all-libiberty all-texinfo all-bison all-byacc all-binutils all-gas all-ld all-zlib
1682 GDB_TK = all-tk all-tcl all-itcl all-tix all-libgui
1683 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1684 all-gettext:
1685 all-gnuserv:
1686 configure-target-gperf: $(ALL_GCC_CXX)
1687 all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++-v3
1688 all-gprof: all-libiberty all-bfd all-opcodes all-intl
1689 all-grep: all-libiberty
1690 all-grez: all-libiberty all-bfd all-opcodes
1691 all-gui: all-gdb all-libproc
1692 all-guile:
1693 all-gzip: all-libiberty
1694 all-hello: all-libiberty
1695 all-indent:
1696 all-intl:
1697 all-itcl: all-tcl all-tk
1698 all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl
1699 configure-target-libgloss: $(ALL_GCC)
1700 all-target-libgloss: configure-target-libgloss configure-target-newlib
1701 all-libgui: all-tcl all-tk all-itcl
1702 all-libiberty:
1703
1704 all-build-libiberty: configure-build-libiberty
1705
1706 configure-target-libffi: $(ALL_GCC_C)
1707 all-target-libffi: configure-target-libffi
1708 configure-target-libjava: $(ALL_GCC_C) configure-target-zlib configure-target-boehm-gc configure-target-qthreads configure-target-libffi
1709 all-target-libjava: configure-target-libjava all-fastjar all-target-zlib all-target-boehm-gc all-target-qthreads all-target-libffi
1710 configure-target-libstdc++-v3: $(ALL_GCC_C)
1711 all-target-libstdc++-v3: configure-target-libstdc++-v3 all-target-libiberty
1712 all-libtool:
1713 configure-target-libf2c: $(ALL_GCC_C)
1714 all-target-libf2c: configure-target-libf2c all-target-libiberty
1715 configure-target-libobjc: $(ALL_GCC_C)
1716 all-target-libobjc: configure-target-libobjc all-target-libiberty
1717 all-m4: all-libiberty all-texinfo
1718 all-make: all-libiberty
1719 all-mmalloc:
1720 configure-target-newlib: $(ALL_GCC)
1721 all-target-newlib: configure-target-newlib
1722 configure-target-libtermcap: $(ALL_GCC_C)
1723 all-target-libtermcap: configure-target-libtermcap
1724 all-opcodes: all-bfd all-libiberty
1725 all-patch: all-libiberty
1726 all-perl:
1727 all-prms: all-libiberty
1728 configure-target-qthreads: $(ALL_GCC_C)
1729 all-target-qthreads: configure-target-qthreads
1730 all-rcs:
1731 all-readline:
1732 all-recode: all-libiberty
1733 all-sed: all-libiberty
1734 all-send-pr: all-prms
1735 all-shellutils:
1736 all-sid: all-tcl all-tk
1737 all-sim: all-libiberty all-bfd all-opcodes all-readline
1738 all-snavigator: all-tcl all-tk all-itcl all-tix all-db all-grep all-libgui
1739 all-tar: all-libiberty
1740 all-tcl:
1741 all-tclX: all-tcl all-tk
1742 all-tk: all-tcl
1743 all-texinfo: all-libiberty
1744 all-textutils:
1745 all-time:
1746 all-tix: all-tcl all-tk
1747 all-wdiff:
1748 configure-target-winsup: $(ALL_GCC_C)
1749 all-target-winsup: all-target-libiberty all-target-libtermcap configure-target-winsup
1750 all-uudecode: all-libiberty
1751 all-zip:
1752 all-zlib:
1753 configure-target-zlib: $(ALL_GCC_C)
1754 all-target-zlib: configure-target-zlib
1755 all-fastjar: all-zlib all-libiberty
1756 configure-target-fastjar: configure-target-zlib
1757 all-target-fastjar: configure-target-fastjar all-target-zlib all-target-libiberty
1758 configure-target-libiberty: $(ALL_GCC_C)
1759 all-target-libiberty: configure-target-libiberty
1760 all-target: $(ALL_TARGET_MODULES)
1761 install-target: $(INSTALL_TARGET_MODULES)
1762 install-gdb: install-tcl install-tk install-itcl install-tix install-libgui
1763 install-sid: install-tcl install-tk
1764 ### other supporting targets
1765
1766 MAKEDIRS= \
1767 $(DESTDIR)$(prefix) \
1768 $(DESTDIR)$(exec_prefix)
1769 .PHONY: installdirs
1770 installdirs: mkinstalldirs
1771 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1772
1773 dir.info: do-install-info
1774 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1775 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1776 mv -f dir.info.new dir.info ; \
1777 else true ; \
1778 fi
1779
1780 dist:
1781 @echo "Building a full distribution of this tree isn't done"
1782 @echo "via 'make dist'. Check out the etc/ subdirectory"
1783
1784 etags tags: TAGS
1785
1786 # Right now this just builds TAGS in each subdirectory. emacs19 has the
1787 # ability to use several tags files at once, so there is probably no need
1788 # to combine them into one big TAGS file (like CVS 1.3 does). We could
1789 # (if we felt like it) have this Makefile write a piece of elisp which
1790 # the user could load to tell emacs19 where all the TAGS files we just
1791 # built are.
1792 TAGS: do-TAGS
1793
1794 # with the gnu make, this is done automatically.
1795
1796 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag) $(gcc_version_trigger)
1797 $(SHELL) ./config.status
1798
1799 #
1800 # Support for building net releases
1801
1802 # Files in devo used in any net release.
1803 # ChangeLog omitted because it may refer to files which are not in this
1804 # distribution (perhaps it would be better to include it anyway).
1805 DEVO_SUPPORT= README Makefile.in configure configure.in \
1806 config.guess config.if config.sub config move-if-change \
1807 mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
1808 COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
1809 mkinstalldirs ltconfig ltmain.sh missing ylwrap \
1810 libtool.m4 gettext.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh
1811
1812 # Files in devo/etc used in any net release.
1813 # ChangeLog omitted because it may refer to files which are not in this
1814 # distribution (perhaps it would be better to include it anyway).
1815 ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
1816 make-stds.texi standards.info* configure.texi configure.info* \
1817 configbuild.* configdev.*
1818
1819
1820 # When you use `make setup-dirs' or `make taz' you should always redefine
1821 # this macro.
1822 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1823
1824 # NOTE: No double quotes in the below. It is used within shell script
1825 # as VER="$(VER)"
1826 VER = ` if grep 'AM_INIT_AUTOMAKE.*BFD_VERSION' $(TOOL)/configure.in >/dev/null 2>&1; then \
1827 sed < bfd/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
1828 elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
1829 sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
1830 elif test -f $(TOOL)/version.in; then \
1831 head -1 $(TOOL)/version.in; \
1832 elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
1833 sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
1834 else \
1835 echo VERSION; \
1836 fi`
1837 PACKAGE = $(TOOL)
1838
1839 .PHONY: taz
1840 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1841 $(MAKE) -f Makefile.in do-proto-toplev \
1842 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1843 MD5PROG="$(MD5PROG)" \
1844 SUPPORT_FILES="$(SUPPORT_FILES)"
1845 $(MAKE) -f Makefile.in do-md5sum \
1846 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1847 MD5PROG="$(MD5PROG)" \
1848 SUPPORT_FILES="$(SUPPORT_FILES)"
1849 $(MAKE) -f Makefile.in do-tar \
1850 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1851 MD5PROG="$(MD5PROG)" \
1852 SUPPORT_FILES="$(SUPPORT_FILES)"
1853 $(MAKE) -f Makefile.in do-bz2 \
1854 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1855 MD5PROG="$(MD5PROG)" \
1856 SUPPORT_FILES="$(SUPPORT_FILES)"
1857
1858 .PHONY: gdb-tar
1859 gdb-tar: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1860 $(MAKE) -f Makefile.in do-proto-toplev \
1861 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1862 MD5PROG="$(MD5PROG)" \
1863 SUPPORT_FILES="$(SUPPORT_FILES)"
1864 $(MAKE) -f Makefile.in do-md5sum \
1865 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1866 MD5PROG="$(MD5PROG)" \
1867 SUPPORT_FILES="$(SUPPORT_FILES)"
1868 $(MAKE) -f Makefile.in do-djunpack \
1869 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1870 MD5PROG="$(MD5PROG)" \
1871 SUPPORT_FILES="$(SUPPORT_FILES)"
1872 $(MAKE) -f Makefile.in do-tar \
1873 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1874 MD5PROG="$(MD5PROG)" \
1875 SUPPORT_FILES="$(SUPPORT_FILES)"
1876
1877 .PHONY: gdb-taz
1878 gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1879 $(MAKE) -f Makefile.in gdb-tar \
1880 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1881 MD5PROG="$(MD5PROG)" \
1882 SUPPORT_FILES="$(SUPPORT_FILES)"
1883 $(MAKE) -f Makefile.in do-bz2 \
1884 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1885 MD5PROG="$(MD5PROG)" \
1886 SUPPORT_FILES="$(SUPPORT_FILES)"
1887
1888 .PHONY: do-proto-toplev
1889 do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1890 echo "==> Making $(PACKAGE)-$(VER)/"
1891 # Take out texinfo from a few places.
1892 sed -e '/^all\.normal: /s/\all-texinfo //' \
1893 -e '/^ install-texinfo /d' \
1894 <Makefile.in >tmp
1895 mv -f tmp Makefile.in
1896 #
1897 ./configure sun4
1898 [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1899 || $(MAKE) $(CONFIGURE_TARGET_MODULES) \
1900 ALL_GCC="" ALL_GCC_C="" ALL_GCC_CXX="" \
1901 CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
1902 # Make links, and run "make diststuff" or "make info" when needed.
1903 rm -rf proto-toplev ; mkdir proto-toplev
1904 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1905 for d in $$dirs ; do \
1906 if [ -d $$d ]; then \
1907 if [ ! -f $$d/Makefile ] ; then true ; \
1908 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1909 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
1910 elif grep '^info:' $$d/Makefile >/dev/null ; then \
1911 (cd $$d ; $(MAKE) info ) || exit 1 ; \
1912 fi ; \
1913 if [ -d $$d/proto-$$d.dir ]; then \
1914 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1915 else \
1916 ln -s ../$$d proto-toplev/$$d ; \
1917 fi ; \
1918 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1919 done
1920 cd etc && $(MAKE) info
1921 $(MAKE) distclean
1922 #
1923 mkdir proto-toplev/etc
1924 (cd proto-toplev/etc; \
1925 for i in $(ETC_SUPPORT); do \
1926 ln -s ../../etc/$$i . ; \
1927 done)
1928 #
1929 # Take out texinfo from configurable dirs
1930 rm proto-toplev/configure.in
1931 sed -e '/^host_tools=/s/texinfo //' \
1932 <configure.in >proto-toplev/configure.in
1933 #
1934 mkdir proto-toplev/texinfo
1935 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1936 if test -r texinfo/util/tex3patch ; then \
1937 mkdir proto-toplev/texinfo/util && \
1938 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
1939 else true; fi
1940 chmod -R og=u . || chmod og=u `find . -print`
1941 #
1942 # Create .gmo files from .po files.
1943 for f in `find . -name '*.po' -type f -print`; do \
1944 msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
1945 done
1946 #
1947 -rm -f $(PACKAGE)-$(VER)
1948 ln -s proto-toplev $(PACKAGE)-$(VER)
1949
1950 .PHONY: do-tar
1951 do-tar:
1952 echo "==> Making $(PACKAGE)-$(VER).tar"
1953 -rm -f $(PACKAGE)-$(VER).tar
1954 find $(PACKAGE)-$(VER) -follow -name CVS -prune -o -type f -print \
1955 | tar cTfh - $(PACKAGE)-$(VER).tar
1956
1957 .PHONY: do-bz2
1958 do-bz2:
1959 echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2"
1960 -rm -f $(PACKAGE)-$(VER).tar.bz2
1961 $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
1962
1963 .PHONY: do-md5sum
1964 do-md5sum:
1965 echo "==> Adding md5 checksum to top-level directory"
1966 cd proto-toplev && find * -follow -name CVS -prune -o -type f -print \
1967 | xargs $(MD5PROG) > ../md5.sum
1968 mv md5.sum proto-toplev
1969
1970 .PHONY: do-djunpack
1971 do-djunpack:
1972 echo "==> Adding updated djunpack.bat to top-level directory"
1973 echo - 's /gdb-[0-9\.]*/gdb-'"$(VER)"'/'
1974 sed < djunpack.bat > djunpack.new \
1975 -e 's/gdb-[0-9][0-9\.]*/gdb-'"$(VER)"'/'
1976 mv djunpack.new djunpack.bat
1977 -rm -f proto-toplev/djunpack.bat
1978 ln -s ../djunpack.bat proto-toplev/djunpack.bat
1979
1980 TEXINFO_SUPPORT= texinfo/texinfo.tex
1981 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1982
1983 .PHONY: gas.tar.bz2
1984 GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
1985 gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1986 $(MAKE) -f Makefile.in taz TOOL=gas \
1987 MD5PROG="$(MD5PROG)" \
1988 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1989
1990 # The FSF "binutils" release includes gprof and ld.
1991 .PHONY: binutils.tar.bz2
1992 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep
1993 binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1994 $(MAKE) -f Makefile.in taz TOOL=binutils \
1995 MD5PROG="$(MD5PROG)" \
1996 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
1997
1998 .PHONY: gas+binutils.tar.bz2
1999 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
2000 gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
2001 $(MAKE) -f Makefile.in taz TOOL=gas \
2002 MD5PROG="$(MD5PROG)" \
2003 SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
2004
2005 GNATS_SUPPORT_DIRS=include libiberty send-pr
2006 gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
2007 $(MAKE) -f Makefile.in taz TOOL=gnats \
2008 MD5PROG="$(MD5PROG)" \
2009 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
2010
2011 .PHONY: gdb.tar.bz2
2012 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl
2013 gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
2014 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb \
2015 MD5PROG="$(MD5PROG)" \
2016 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
2017 .PHONY: gdb.tar
2018 gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
2019 $(MAKE) -f Makefile.in gdb-tar TOOL=gdb \
2020 MD5PROG="$(MD5PROG)" \
2021 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
2022
2023 DEJAGNU_SUPPORT_DIRS= tcl expect libiberty
2024 .PHONY: dejagnu.tar.bz2
2025 dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu
2026 $(MAKE) -f Makefile.in taz TOOL=dejagnu \
2027 MD5PROG="$(MD5PROG)" \
2028 SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)"
2029
2030 .PHONY: gdb+dejagnu.tar.bz2
2031 GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu
2032 gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
2033 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \
2034 MD5PROG="$(MD5PROG)" \
2035 SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
2036 .PHONY: gdb+dejagnu.tar
2037 gdb+dejagnu.tar: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
2038 $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE=gdb+dejagnu \
2039 MD5PROG="$(MD5PROG)" \
2040 SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
2041
2042 .PHONY: insight.tar.bz2
2043 INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl tix libgui
2044 insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
2045 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=insight \
2046 MD5PROG="$(MD5PROG)" \
2047 SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
2048 .PHONY: insight.tar
2049 insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
2050 $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE=insight \
2051 MD5PROG="$(MD5PROG)" \
2052 SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
2053
2054 .PHONY: insight+dejagnu.tar.bz2
2055 INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu
2056 insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
2057 $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE="insight+dejagnu" \
2058 MD5PROG="$(MD5PROG)" \
2059 SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
2060 .PHONY: insight+dejagnu.tar
2061 insight+dejagnu.tar: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
2062 $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE="insight+dejagnu" \
2063 MD5PROG="$(MD5PROG)" \
2064 SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
2065
2066 .PHONY: newlib.tar.bz2
2067 NEWLIB_SUPPORT_DIRS=libgloss
2068 # taz configures for the sun4 target which won't configure newlib.
2069 # We need newlib configured so that the .info files are made.
2070 # Unfortunately, it is not enough to just configure newlib separately:
2071 # taz will build the .info files but since SUBDIRS won't contain newlib,
2072 # distclean won't be run (leaving Makefile, config.status, and the tmp files
2073 # used in building the .info files, eg: *.def, *.ref).
2074 # The problem isn't solvable however without a lot of extra work because
2075 # target libraries are built in subdir $(target_alias) which gets nuked during
2076 # the make distclean. For now punt on the issue of shipping newlib info files
2077 # with newlib net releases and wait for a day when some native target (sun4?)
2078 # supports newlib (if only minimally).
2079 newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
2080 $(MAKE) -f Makefile.in taz TOOL=newlib \
2081 MD5PROG="$(MD5PROG)" \
2082 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
2083 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
2084
2085 .NOEXPORT:
2086 MAKEOVERRIDES=
2087
2088 # end of Makefile.in