2002-10-02 Nathanael Nerode <neroden@gcc.gnu.org>
[deliverable/binutils-gdb.git] / Makefile.tpl
1 [+ AutoGen5 template
2 in
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.
29 NOTPARALLEL = .NOTPARALLEL
30 $(NOTPARALLEL):
31
32 srcdir = @srcdir@
33
34 prefix = @prefix@
35 exec_prefix = @exec_prefix@
36
37 bindir = @bindir@
38 sbindir = @sbindir@
39 libexecdir = @libexecdir@
40 datadir = @datadir@
41 sysconfdir = @sysconfdir@
42 sharedstatedir = @sharedstatedir@
43 localstatedir = @localstatedir@
44 libdir = @libdir@
45 includedir = @includedir@
46 oldincludedir = @oldincludedir@
47 infodir = @infodir@
48 mandir = @mandir@
49 gxx_include_dir=@gxx_include_dir@
50
51 tooldir = @tooldir@
52 build_tooldir = @build_tooldir@
53
54 program_transform_name = @program_transform_name@
55
56 man1dir = $(mandir)/man1
57 man2dir = $(mandir)/man2
58 man3dir = $(mandir)/man3
59 man4dir = $(mandir)/man4
60 man5dir = $(mandir)/man5
61 man6dir = $(mandir)/man6
62 man7dir = $(mandir)/man7
63 man8dir = $(mandir)/man8
64 man9dir = $(mandir)/man9
65 # Directory in which the compiler finds executables, libraries, etc.
66 libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
67 GDB_NLM_DEPS =
68
69 SHELL = @config_shell@
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.
75 PWD = $${PWDCMD-pwd}
76
77 # INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
78 # cygwin host.
79 INSTALL_PROGRAM_ARGS =
80
81 INSTALL = $(SHELL) $$s/install-sh -c
82 INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
83 INSTALL_SCRIPT = $(INSTALL)
84 INSTALL_DATA = $(INSTALL) -m 644
85
86 INSTALL_DOSREL = install-dosrel-fake
87
88 AS = as
89 AR = ar
90 AR_FLAGS = rc
91 CC = 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.
95 HOST_CC = $(CC_FOR_BUILD)
96 BUILD_PREFIX =
97 BUILD_PREFIX_1 = loser-
98
99 # These flag values are normally overridden by the configure script.
100 CFLAGS = -g
101 CXXFLAGS = -g -O2
102
103 LDFLAGS =
104 LIBCFLAGS = $(CFLAGS)
105 CFLAGS_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.
110 CFLAGS_FOR_TARGET = -O2 $(CFLAGS)
111 LDFLAGS_FOR_TARGET =
112 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
113 PICFLAG =
114 PICFLAG_FOR_TARGET =
115
116 CXX = c++
117
118 # Use -O2 to stress test the compiler.
119 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
120 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
121 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
122
123 DLLTOOL = dlltool
124 WINDRES = windres
125
126 NM = nm
127
128 LD = ld
129
130 # These values are substituted by configure.
131 DEFAULT_YACC = @DEFAULT_YACC@
132 DEFAULT_LEX = @DEFAULT_LEX@
133 DEFAULT_M4 = @DEFAULT_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 = @configdirs@
185
186 # This is set by the configure script to the list of directories which
187 # should be built using the target tools.
188 TARGET_CONFIGDIRS = @target_configdirs@
189
190 # Target libraries are put under this directory:
191 # Changed by configure to $(target_alias) if cross.
192 TARGET_SUBDIR = @target_subdir@
193
194 BUILD_CONFIGDIRS = libiberty
195 BUILD_SUBDIR = @build_subdir@
196
197 # This is set by the configure script to the arguments to use when configuring
198 # directories built for the target.
199 TARGET_CONFIGARGS = @target_configargs@
200
201 # This is set by the configure script to the arguments to use when configuring
202 # directories built for the build system.
203 BUILD_CONFIGARGS = @build_configargs@
204
205 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
206 # was used.
207 SET_LIB_PATH =
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.
211 RPATH_ENVVAR = LD_LIBRARY_PATH
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.
215 HOST_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.
219 TARGET_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.
224 REALLY_SET_LIB_PATH = \
225 $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
226
227 ALL = all.normal
228 INSTALL_TARGET = installdirs \
229 install-gcc \
230 $(INSTALL_MODULES) \
231 $(INSTALL_TARGET_MODULES) \
232 $(INSTALL_X11_MODULES) \
233 $(INSTALL_DOSREL)
234
235 INSTALL_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
243 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
244 CC_FOR_TARGET = @CC_FOR_TARGET@
245 CXX_FOR_TARGET = @CXX_FOR_TARGET@
246 CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
247 GCJ_FOR_TARGET = @GCJ_FOR_TARGET@
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.
253 GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
254
255 AS_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
268 LD_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
281 DLLTOOL_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
292 WINDRES_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
303 AR_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
314 RANLIB_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
329 NM_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.
344 all: 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.
350 EXTRA_TARGET_HOST_ALL_MODULES =
351 EXTRA_TARGET_HOST_INSTALL_MODULES =
352 EXTRA_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.
359 BASE_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.
427 RECURSE_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.
433 EXTRA_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
444 FLAGS_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 #
454 X11_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.
462 EXTRA_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
477 TARGET_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.
485 EXTRA_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
509 GCC_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.
514 ALL_BUILD_MODULES_LIST = \
515 all-build-libiberty
516 ALL_BUILD_MODULES = @all_build_modules@
517
518 # This is a list of the configure targets for all of the modules which
519 # are compiled using the native tools.
520 CONFIGURE_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).
525 ALL_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.
535 NATIVE_CHECK_MODULES = \
536 check-bison \
537 check-byacc \
538 check-fastjar \
539 check-flex \
540 check-zip
541
542 CROSS_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
546 CHECK_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).
550 # We put install-opcodes before install-binutils because the installed
551 # binutils might be on PATH, and they might need the shared opcodes
552 # library.
553 # We put install-tcl before install-itcl because itcl wants to run a
554 # program on installation which uses the Tcl libraries.
555 INSTALL_MODULES = [+ FOR host_modules+][+ IF no_install +][+ ELSE no_install +]\
556 install-[+module+] [+ ENDIF no_install +][+ ENDFOR host_modules +]\
557 $(EXTRA_TARGET_HOST_INSTALL_MODULES)
558
559 # This is a list of the targets for all of the modules which are compiled
560 # using $(X11_FLAGS_TO_PASS).
561 ALL_X11_MODULES = \
562 all-gdb \
563 all-expect \
564 all-guile \
565 all-tclX \
566 all-tk \
567 all-tix
568
569 # This is a list of the check targets for all of the modules which are
570 # compiled using $(X11_FLAGS_TO_PASS).
571 CHECK_X11_MODULES = \
572 check-gdb \
573 check-guile \
574 check-expect \
575 check-tclX \
576 check-tk \
577 check-tix
578
579 # This is a list of the install targets for all the modules which are
580 # compiled using $(X11_FLAGS_TO_PASS).
581 INSTALL_X11_MODULES = \
582 install-gdb \
583 install-guile \
584 install-expect \
585 install-tclX \
586 install-tk \
587 install-tix
588
589 # This is a list of the targets for all of the modules which are compiled
590 # using $(TARGET_FLAGS_TO_PASS).
591 ALL_TARGET_MODULES = [+ FOR target_modules +]\
592 all-target-[+module+] [+ ENDFOR target_modules +]
593
594 # This is a list of the configure targets for all of the modules which
595 # are compiled using the target tools.
596 CONFIGURE_TARGET_MODULES = [+ FOR target_modules +]\
597 configure-target-[+module+] [+ ENDFOR target_modules +]
598
599 # This is a list of the check targets for all of the modules which are
600 # compiled using $(TARGET_FLAGS_TO_PASS).
601 CHECK_TARGET_MODULES = [+ FOR target_modules +][+ IF no_check +][+ ELSE check +]\
602 check-target-[+module+] [+ ENDIF no_check +][+ ENDFOR target_modules +]
603
604 # This is a list of the install targets for all of the modules which are
605 # compiled using $(TARGET_FLAGS_TO_PASS).
606 INSTALL_TARGET_MODULES = [+ FOR target_modules +][+ IF no_install +][+ ELSE install +]\
607 install-target-[+module+] [+ ENDIF no_install +][+ ENDFOR target_modules +]
608
609 # This is a list of the targets for which we can do a clean-{target}.
610 CLEAN_MODULES = [+ FOR host_modules +][+ IF no_clean +][+ ELSE no_clean +]\
611 clean-[+module+] [+ ENDIF no_clean +][+ ENDFOR host_modules +]
612
613 # All of the target modules that can be cleaned
614 CLEAN_TARGET_MODULES = [+ FOR target_modules +][+ IF no_clean +][+ ELSE clean +]\
615 clean-target-[+module+] [+ ENDIF no_clean +][+ ENDFOR target_modules +]
616
617 # All of the x11 modules that can be cleaned
618 CLEAN_X11_MODULES = \
619 clean-gdb \
620 clean-expect \
621 clean-guile \
622 clean-tclX \
623 clean-tk \
624 clean-tix
625
626 # The target built for a native build.
627 .PHONY: all.normal
628 all.normal: \
629 $(ALL_BUILD_MODULES) \
630 $(ALL_MODULES) \
631 $(ALL_X11_MODULES) \
632 $(ALL_TARGET_MODULES) \
633 all-gcc
634
635 # Do a target for all the subdirectories. A ``make do-X'' will do a
636 # ``make X'' in all subdirectories (because, in general, there is a
637 # dependency (below) of X upon do-X, a ``make X'' will also do this,
638 # but it may do additional work as well).
639 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
640 # because it is so large that it can easily overflow the command line
641 # length limit on some systems.
642 DO_X = \
643 do-clean \
644 do-distclean \
645 do-dvi \
646 do-info \
647 do-install-info \
648 do-installcheck \
649 do-mostlyclean \
650 do-maintainer-clean \
651 do-TAGS
652 .PHONY: $(DO_X)
653 $(DO_X):
654 @target=`echo $@ | sed -e 's/^do-//'`; \
655 r=`${PWD}`; export r; \
656 s=`cd $(srcdir); ${PWD}`; export s; \
657 $(SET_LIB_PATH) \
658 for i in $(SUBDIRS) -dummy-; do \
659 if [ -f ./$$i/Makefile ]; then \
660 case $$i in \
661 gcc) \
662 for flag in $(EXTRA_GCC_FLAGS); do \
663 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
664 done; \
665 ;; \
666 *) \
667 for flag in $(EXTRA_HOST_FLAGS); do \
668 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
669 done; \
670 ;; \
671 esac ; \
672 if (cd ./$$i; \
673 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
674 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
675 "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
676 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
677 $${target}); \
678 then true; else exit 1; fi; \
679 else true; fi; \
680 done
681 @target=`echo $@ | sed -e 's/^do-//'`; \
682 r=`${PWD}`; export r; \
683 s=`cd $(srcdir); ${PWD}`; export s; \
684 $(SET_LIB_PATH) \
685 for i in $(TARGET_CONFIGDIRS) -dummy-; do \
686 if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
687 for flag in $(EXTRA_TARGET_FLAGS); do \
688 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
689 done; \
690 if (cd $(TARGET_SUBDIR)/$$i; \
691 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
692 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
693 "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
694 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
695 $${target}); \
696 then true; else exit 1; fi; \
697 else true; fi; \
698 done
699
700 # Here are the targets which correspond to the do-X targets.
701
702 .PHONY: info installcheck dvi install-info
703 .PHONY: clean distclean mostlyclean maintainer-clean realclean
704 .PHONY: local-clean local-distclean local-maintainer-clean
705 info: do-info
706 installcheck: do-installcheck
707 dvi: do-dvi
708
709 # Make sure makeinfo is built before we do a `make info'.
710 do-info: all-texinfo
711
712 install-info: do-install-info dir.info
713 s=`cd $(srcdir); ${PWD}`; export s; \
714 if [ -f dir.info ] ; then \
715 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
716 else true ; fi
717
718 local-clean:
719 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
720
721 local-distclean:
722 -rm -f Makefile config.status config.cache mh-frag mt-frag
723 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
724 rm -rf $(TARGET_SUBDIR); \
725 else true; fi
726 -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
727 -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
728 -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
729 -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
730 -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null
731
732 local-maintainer-clean:
733 @echo "This command is intended for maintainers to use;"
734 @echo "it deletes files that may require special tools to rebuild."
735
736 clean: do-clean local-clean
737 mostlyclean: do-mostlyclean local-clean
738 distclean: do-distclean local-clean local-distclean
739 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
740 maintainer-clean: local-distclean
741 realclean: maintainer-clean
742
743 # This rule is used to clean specific modules.
744 .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
745 $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
746 @dir=`echo $@ | sed -e 's/clean-//'`; \
747 if [ -f ./$${dir}/Makefile ] ; then \
748 r=`${PWD}`; export r; \
749 s=`cd $(srcdir); ${PWD}`; export s; \
750 $(SET_LIB_PATH) \
751 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
752 else \
753 true; \
754 fi
755
756 .PHONY: $(CLEAN_TARGET_MODULES)
757 $(CLEAN_TARGET_MODULES):
758 @dir=`echo $@ | sed -e 's/clean-target-//'`; \
759 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
760 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
761 r=`${PWD}`; export r; \
762 s=`cd $(srcdir); ${PWD}`; export s; \
763 $(SET_LIB_PATH) \
764 (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
765 else \
766 true; \
767 fi
768
769 clean-target: $(CLEAN_TARGET_MODULES) clean-target-libgcc
770 clean-target-libgcc:
771 test ! -d gcc/libgcc || \
772 (cd gcc/libgcc && find . -type d -print) | \
773 while read d; do rm -f gcc/$$d/libgcc.a || : ; done
774 -rm -rf gcc/libgcc
775
776 # Check target.
777
778 .PHONY: check do-check
779 check:
780 $(MAKE) do-check NOTPARALLEL=parallel-ok
781
782 do-check: $(CHECK_MODULES) \
783 $(CHECK_TARGET_MODULES) \
784 $(CHECK_X11_MODULES) \
785 check-gcc
786
787 # Automated reporting of test results.
788
789 warning.log: build.log
790 $(srcdir)/contrib/warn_summary build.log > $@
791
792 mail-report.log:
793 if test x'$(BOOT_CFLAGS)' != x''; then \
794 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
795 fi; \
796 $(srcdir)/contrib/test_summary -t >$@
797 chmod +x $@
798 echo If you really want to send e-mail, run ./$@ now
799
800 mail-report-with-warnings.log: warning.log
801 if test x'$(BOOT_CFLAGS)' != x''; then \
802 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
803 fi; \
804 $(srcdir)/contrib/test_summary -t -i warning.log >$@
805 chmod +x $@
806 echo If you really want to send e-mail, run ./$@ now
807
808 # Installation targets.
809
810 .PHONY: install install-cross uninstall source-vault binary-vault vault-install
811 install: $(INSTALL_TARGET)
812 install-cross: $(INSTALL_TARGET_CROSS)
813
814 uninstall:
815 @echo "the uninstall target is not supported in this tree"
816
817 source-vault:
818 $(MAKE) -f ./release/Build-A-Release \
819 host=$(host_alias) source-vault
820
821 binary-vault:
822 $(MAKE) -f ./release/Build-A-Release \
823 host=$(host_alias) target=$(target_alias)
824
825 vault-install:
826 @if [ -f ./release/vault-install ] ; then \
827 ./release/vault-install $(host_alias) $(target_alias) ; \
828 else \
829 true ; \
830 fi
831
832 .PHONY: install.all
833 install.all: install-no-fixedincludes
834 @if [ -f ./gcc/Makefile ] ; then \
835 r=`${PWD}` ; export r ; \
836 $(SET_LIB_PATH) \
837 (cd ./gcc; \
838 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
839 else \
840 true ; \
841 fi
842
843 # install-no-fixedincludes is used because Cygnus can not distribute
844 # the fixed header files.
845 .PHONY: install-no-fixedincludes
846 install-no-fixedincludes: \
847 installdirs \
848 $(INSTALL_MODULES) \
849 $(INSTALL_TARGET_MODULES) \
850 $(INSTALL_X11_MODULES) \
851 gcc-no-fixedincludes
852
853 # Install the gcc headers files, but not the fixed include files,
854 # which Cygnus is not allowed to distribute. This rule is very
855 # dependent on the workings of the gcc Makefile.in.
856 .PHONY: gcc-no-fixedincludes
857 gcc-no-fixedincludes:
858 @if [ -f ./gcc/Makefile ]; then \
859 rm -rf gcc/tmp-include; \
860 mv gcc/include gcc/tmp-include 2>/dev/null; \
861 mkdir gcc/include; \
862 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
863 touch gcc/stmp-fixinc gcc/include/fixed; \
864 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
865 r=`${PWD}`; export r; \
866 s=`cd $(srcdir); ${PWD}` ; export s; \
867 $(SET_LIB_PATH) \
868 (cd ./gcc; \
869 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
870 rm -rf gcc/include; \
871 mv gcc/tmp-include gcc/include 2>/dev/null; \
872 else true; fi
873
874 # This rule is used to build the modules which are built with the
875 # build machine's native compiler.
876 .PHONY: $(ALL_BUILD_MODULES)
877 $(ALL_BUILD_MODULES):
878 dir=`echo $@ | sed -e 's/all-build-//'`; \
879 if [ -f ./$${dir}/Makefile ] ; then \
880 r=`${PWD}`; export r; \
881 s=`cd $(srcdir); ${PWD}`; export s; \
882 (cd $(BUILD_SUBDIR)/$${dir} && $(MAKE) all); \
883 else \
884 true; \
885 fi
886
887 # This rule is used to configure the modules which are built with the
888 # native tools.
889 .PHONY: $(CONFIGURE_BUILD_MODULES)
890 $(CONFIGURE_BUILD_MODULES):
891 @dir=`echo $@ | sed -e 's/configure-build-//'`; \
892 if [ ! -d $(BUILD_SUBDIR) ]; then \
893 true; \
894 elif [ -f $(BUILD_SUBDIR)/$${dir}/Makefile ] ; then \
895 true; \
896 elif echo " $(BUILD_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
897 if [ -d $(srcdir)/$${dir} ]; then \
898 [ -d $(BUILD_SUBDIR)/$${dir} ] || mkdir $(BUILD_SUBDIR)/$${dir};\
899 r=`${PWD}`; export r; \
900 s=`cd $(srcdir); ${PWD}`; export s; \
901 AR="$(AR_FOR_BUILD)"; export AR; \
902 AS="$(AS_FOR_BUILD)"; export AS; \
903 CC="$(CC_FOR_BUILD)"; export CC; \
904 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
905 CXX="$(CXX_FOR_BUILD)"; export CXX; \
906 CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
907 GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
908 DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
909 LD="$(LD_FOR_BUILD)"; export LD; \
910 LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
911 NM="$(NM_FOR_BUILD)"; export NM; \
912 RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
913 WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
914 echo Configuring in $(BUILD_SUBDIR)/$${dir}; \
915 cd "$(BUILD_SUBDIR)/$${dir}" || exit 1; \
916 case $(srcdir) in \
917 /* | [A-Za-z]:[\\/]*) \
918 topdir=$(srcdir) ;; \
919 *) \
920 case "$(BUILD_SUBDIR)" in \
921 .) topdir="../$(srcdir)" ;; \
922 *) topdir="../../$(srcdir)" ;; \
923 esac ;; \
924 esac; \
925 if [ "$(srcdir)" = "." ] ; then \
926 if [ "$(BUILD_SUBDIR)" != "." ] ; then \
927 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
928 if [ -f Makefile ]; then \
929 if $(MAKE) distclean; then \
930 true; \
931 else \
932 exit 1; \
933 fi; \
934 else \
935 true; \
936 fi; \
937 else \
938 exit 1; \
939 fi; \
940 else \
941 true; \
942 fi; \
943 srcdiroption="--srcdir=."; \
944 libsrcdir="."; \
945 else \
946 srcdiroption="--srcdir=$${topdir}/$${dir}"; \
947 libsrcdir="$$s/$${dir}"; \
948 fi; \
949 if [ -f $${libsrcdir}/configure ] ; then \
950 rm -f no-such-file skip-this-dir; \
951 CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
952 $(BUILD_CONFIGARGS) $${srcdiroption} \
953 --with-build-subdir="$(BUILD_SUBDIR)"; \
954 else \
955 rm -f no-such-file skip-this-dir; \
956 CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
957 $(BUILD_CONFIGARGS) $${srcdiroption} \
958 --with-build-subdir="$(BUILD_SUBDIR)"; \
959 fi || exit 1; \
960 if [ -f skip-this-dir ] ; then \
961 sh skip-this-dir; \
962 rm -f skip-this-dir; \
963 cd ..; rmdir $${dir} || true; \
964 else \
965 true; \
966 fi; \
967 else \
968 true; \
969 fi; \
970 else \
971 true; \
972 fi
973
974 # This rule is used to build the modules which use FLAGS_TO_PASS. To
975 # build a target all-X means to cd to X and make all.
976 #
977 # all-gui, and all-libproc are handled specially because
978 # they are still experimental, and if they fail to build, that
979 # shouldn't stop "make all".
980 .PHONY: $(ALL_MODULES) all-gui all-libproc
981 $(ALL_MODULES) all-gui all-libproc:
982 @dir=`echo $@ | sed -e 's/all-//'`; \
983 if [ -f ./$${dir}/Makefile ] ; then \
984 r=`${PWD}`; export r; \
985 s=`cd $(srcdir); ${PWD}`; export s; \
986 $(SET_LIB_PATH) \
987 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
988 else \
989 true; \
990 fi
991
992 # These rules are used to check the modules which use FLAGS_TO_PASS.
993 # To build a target check-X means to cd to X and make check. Some
994 # modules are only tested in a native toolchain.
995
996 .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
997 $(NATIVE_CHECK_MODULES):
998 @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
999 dir=`echo $@ | sed -e 's/check-//'`; \
1000 if [ -f ./$${dir}/Makefile ] ; then \
1001 r=`${PWD}`; export r; \
1002 s=`cd $(srcdir); ${PWD}`; export s; \
1003 $(SET_LIB_PATH) \
1004 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1005 else \
1006 true; \
1007 fi; \
1008 fi
1009
1010 $(CROSS_CHECK_MODULES):
1011 @dir=`echo $@ | sed -e 's/check-//'`; \
1012 if [ -f ./$${dir}/Makefile ] ; then \
1013 r=`${PWD}`; export r; \
1014 s=`cd $(srcdir); ${PWD}`; export s; \
1015 $(SET_LIB_PATH) \
1016 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1017 else \
1018 true; \
1019 fi
1020
1021 # This rule is used to install the modules which use FLAGS_TO_PASS.
1022 # To build a target install-X means to cd to X and make install.
1023 .PHONY: $(INSTALL_MODULES)
1024 $(INSTALL_MODULES): installdirs
1025 @dir=`echo $@ | sed -e 's/install-//'`; \
1026 if [ -f ./$${dir}/Makefile ] ; then \
1027 r=`${PWD}`; export r; \
1028 s=`cd $(srcdir); ${PWD}`; export s; \
1029 $(SET_LIB_PATH) \
1030 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1031 else \
1032 true; \
1033 fi
1034
1035 # This rule is used to configure the modules which are built with the
1036 # target tools.
1037 .PHONY: $(CONFIGURE_TARGET_MODULES)
1038 $(CONFIGURE_TARGET_MODULES):
1039 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1040 if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \
1041 r=`${PWD}`; export r; \
1042 $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \
1043 if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \
1044 if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \
1045 if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \
1046 rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1047 else \
1048 echo "Multilibs changed for $${dir}, reconfiguring"; \
1049 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \
1050 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1051 fi; \
1052 else \
1053 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1054 fi; \
1055 fi; \
1056 fi; exit 0 # break command into two pieces
1057 @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1058 if [ ! -d $(TARGET_SUBDIR) ]; then \
1059 true; \
1060 elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1061 true; \
1062 elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
1063 if [ -d $(srcdir)/$${dir} ]; then \
1064 [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
1065 r=`${PWD}`; export r; \
1066 s=`cd $(srcdir); ${PWD}`; export s; \
1067 $(SET_LIB_PATH) \
1068 AR="$(AR_FOR_TARGET)"; export AR; \
1069 AS="$(AS_FOR_TARGET)"; export AS; \
1070 CC="$(CC_FOR_TARGET)"; export CC; \
1071 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1072 CXX="$(CXX_FOR_TARGET)"; export CXX; \
1073 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
1074 GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
1075 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1076 LD="$(LD_FOR_TARGET)"; export LD; \
1077 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
1078 NM="$(NM_FOR_TARGET)"; export NM; \
1079 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1080 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
1081 echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
1082 cd "$(TARGET_SUBDIR)/$${dir}" || exit 1; \
1083 case $(srcdir) in \
1084 /* | [A-Za-z]:[\\/]*) \
1085 topdir=$(srcdir) ;; \
1086 *) \
1087 case "$(TARGET_SUBDIR)" in \
1088 .) topdir="../$(srcdir)" ;; \
1089 *) topdir="../../$(srcdir)" ;; \
1090 esac ;; \
1091 esac; \
1092 if [ "$(srcdir)" = "." ] ; then \
1093 if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1094 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
1095 if [ -f Makefile ]; then \
1096 if $(MAKE) distclean; then \
1097 true; \
1098 else \
1099 exit 1; \
1100 fi; \
1101 else \
1102 true; \
1103 fi; \
1104 else \
1105 exit 1; \
1106 fi; \
1107 else \
1108 true; \
1109 fi; \
1110 srcdiroption="--srcdir=."; \
1111 libsrcdir="."; \
1112 else \
1113 srcdiroption="--srcdir=$${topdir}/$${dir}"; \
1114 libsrcdir="$$s/$${dir}"; \
1115 fi; \
1116 if [ -f $${libsrcdir}/configure ] ; then \
1117 rm -f no-such-file skip-this-dir; \
1118 CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
1119 $(TARGET_CONFIGARGS) $${srcdiroption} \
1120 --with-target-subdir="$(TARGET_SUBDIR)"; \
1121 else \
1122 rm -f no-such-file skip-this-dir; \
1123 CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
1124 $(TARGET_CONFIGARGS) $${srcdiroption} \
1125 --with-target-subdir="$(TARGET_SUBDIR)"; \
1126 fi || exit 1; \
1127 if [ -f skip-this-dir ] ; then \
1128 sh skip-this-dir; \
1129 rm -f skip-this-dir; \
1130 cd ..; rmdir $${dir} || true; \
1131 else \
1132 true; \
1133 fi; \
1134 else \
1135 true; \
1136 fi; \
1137 else \
1138 true; \
1139 fi
1140
1141 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
1142 # To build a target all-X means to cd to X and make all.
1143 .PHONY: $(ALL_TARGET_MODULES)
1144 $(ALL_TARGET_MODULES):
1145 @dir=`echo $@ | sed -e 's/all-target-//'`; \
1146 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1147 r=`${PWD}`; export r; \
1148 s=`cd $(srcdir); ${PWD}`; export s; \
1149 $(SET_LIB_PATH) \
1150 (cd $(TARGET_SUBDIR)/$${dir}; \
1151 $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1152 else \
1153 true; \
1154 fi
1155
1156 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
1157 # To build a target install-X means to cd to X and make install.
1158 .PHONY: $(CHECK_TARGET_MODULES)
1159 $(CHECK_TARGET_MODULES):
1160 @dir=`echo $@ | sed -e 's/check-target-//'`; \
1161 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1162 r=`${PWD}`; export r; \
1163 s=`cd $(srcdir); ${PWD}`; export s; \
1164 $(SET_LIB_PATH) \
1165 (cd $(TARGET_SUBDIR)/$${dir}; \
1166 $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1167 else \
1168 true; \
1169 fi
1170
1171 # This rule is used to install the modules which use
1172 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
1173 # and make install.
1174 .PHONY: $(INSTALL_TARGET_MODULES)
1175 $(INSTALL_TARGET_MODULES): installdirs
1176 @dir=`echo $@ | sed -e 's/install-target-//'`; \
1177 if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1178 r=`${PWD}`; export r; \
1179 s=`cd $(srcdir); ${PWD}`; export s; \
1180 $(SET_LIB_PATH) \
1181 (cd $(TARGET_SUBDIR)/$${dir}; \
1182 $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1183 else \
1184 true; \
1185 fi
1186
1187 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
1188 # To build a target all-X means to cd to X and make all.
1189 .PHONY: $(ALL_X11_MODULES)
1190 $(ALL_X11_MODULES):
1191 @dir=`echo $@ | sed -e 's/all-//'`; \
1192 if [ -f ./$${dir}/Makefile ] ; then \
1193 r=`${PWD}`; export r; \
1194 s=`cd $(srcdir); ${PWD}`; export s; \
1195 $(SET_LIB_PATH) \
1196 (cd $${dir}; \
1197 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
1198 else \
1199 true; \
1200 fi
1201
1202 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
1203 # To build a target check-X means to cd to X and make all.
1204 .PHONY: $(CHECK_X11_MODULES)
1205 $(CHECK_X11_MODULES):
1206 @dir=`echo $@ | sed -e 's/check-//'`; \
1207 if [ -f ./$${dir}/Makefile ] ; then \
1208 r=`${PWD}`; export r; \
1209 s=`cd $(srcdir); ${PWD}`; export s; \
1210 $(SET_LIB_PATH) \
1211 (cd $${dir}; \
1212 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
1213 else \
1214 true; \
1215 fi
1216
1217 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
1218 # To build a target install-X means to cd to X and make install.
1219 .PHONY: $(INSTALL_X11_MODULES)
1220 $(INSTALL_X11_MODULES): installdirs
1221 @dir=`echo $@ | sed -e 's/install-//'`; \
1222 if [ -f ./$${dir}/Makefile ] ; then \
1223 r=`${PWD}`; export r; \
1224 s=`cd $(srcdir); ${PWD}`; export s; \
1225 $(SET_LIB_PATH) \
1226 (cd $${dir}; \
1227 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
1228 else \
1229 true; \
1230 fi
1231
1232 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1233 .PHONY: all-gcc
1234 all-gcc:
1235 @if [ -f ./gcc/Makefile ] ; then \
1236 r=`${PWD}`; export r; \
1237 s=`cd $(srcdir); ${PWD}`; export s; \
1238 $(SET_LIB_PATH) \
1239 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1240 else \
1241 true; \
1242 fi
1243
1244 # Building GCC uses some tools for rebuilding "source" files
1245 # like texinfo, bison/byacc, etc. So we must depend on those.
1246 #
1247 # While building GCC, it may be necessary to run various target
1248 # programs like the assembler, linker, etc. So we depend on
1249 # those too.
1250 #
1251 # In theory, on an SMP all those dependencies can be resolved
1252 # in parallel.
1253 #
1254 .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean
1255 bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean: all-bootstrap
1256 @r=`${PWD}`; export r; \
1257 s=`cd $(srcdir); ${PWD}`; export s; \
1258 $(SET_LIB_PATH) \
1259 echo "Bootstrapping the compiler"; \
1260 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
1261 @r=`${PWD}`; export r; \
1262 s=`cd $(srcdir); ${PWD}`; export s; \
1263 case "$@" in \
1264 *bootstrap4-lean ) \
1265 msg="Comparing stage3 and stage4 of the compiler"; \
1266 compare=compare3-lean ;; \
1267 *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \
1268 compare=compare3 ;; \
1269 *-lean ) msg="Comparing stage2 and stage3 of the compiler"; \
1270 compare=compare-lean ;; \
1271 * ) msg="Comparing stage2 and stage3 of the compiler"; \
1272 compare=compare ;; \
1273 esac; \
1274 $(SET_LIB_PATH) \
1275 echo "$$msg"; \
1276 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
1277 @r=`${PWD}`; export r; \
1278 s=`cd $(srcdir); ${PWD}` ; export s; \
1279 $(SET_LIB_PATH) \
1280 echo "Building runtime libraries"; \
1281 $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
1282
1283 .PHONY: cross
1284 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1285 @r=`${PWD}`; export r; \
1286 s=`cd $(srcdir); ${PWD}`; export s; \
1287 $(SET_LIB_PATH) \
1288 echo "Building the C and C++ compiler"; \
1289 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1290 @r=`${PWD}`; export r; \
1291 s=`cd $(srcdir); ${PWD}` ; export s; \
1292 $(SET_LIB_PATH) \
1293 echo "Building runtime libraries"; \
1294 $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
1295 LANGUAGES="c c++" all
1296
1297 .PHONY: check-gcc
1298 check-gcc:
1299 @if [ -f ./gcc/Makefile ] ; then \
1300 r=`${PWD}`; export r; \
1301 s=`cd $(srcdir); ${PWD}`; export s; \
1302 $(SET_LIB_PATH) \
1303 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1304 else \
1305 true; \
1306 fi
1307
1308 .PHONY: check-c++
1309 check-c++:
1310 @if [ -f ./gcc/Makefile ] ; then \
1311 r=`${PWD}`; export r; \
1312 s=`cd $(srcdir); ${PWD}`; export s; \
1313 $(SET_LIB_PATH) \
1314 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
1315 $(MAKE) check-target-libstdc++-v3; \
1316 else \
1317 true; \
1318 fi
1319
1320 .PHONY: install-gcc
1321 install-gcc:
1322 @if [ -f ./gcc/Makefile ] ; then \
1323 r=`${PWD}`; export r; \
1324 s=`cd $(srcdir); ${PWD}`; export s; \
1325 $(SET_LIB_PATH) \
1326 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1327 else \
1328 true; \
1329 fi
1330
1331 .PHONY: install-gcc-cross
1332 install-gcc-cross:
1333 @if [ -f ./gcc/Makefile ] ; then \
1334 r=`${PWD}`; export r; \
1335 s=`cd $(srcdir); ${PWD}`; export s; \
1336 $(SET_LIB_PATH) \
1337 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" install); \
1338 else \
1339 true; \
1340 fi
1341 # EXPERIMENTAL STUFF
1342 # This rule is used to install the modules which use FLAGS_TO_PASS.
1343 # To build a target install-X means to cd to X and make install.
1344 .PHONY: install-dosrel
1345 install-dosrel: installdirs info
1346 @dir=`echo $@ | sed -e 's/install-//'`; \
1347 if [ -f ./$${dir}/Makefile ] ; then \
1348 r=`${PWD}`; export r; \
1349 s=`cd $(srcdir); ${PWD}`; export s; \
1350 $(SET_LIB_PATH) \
1351 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1352 else \
1353 true; \
1354 fi
1355
1356 install-dosrel-fake:
1357
1358 ALL_GCC = all-gcc
1359 ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss
1360 ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++-v3
1361
1362 # This is a list of inter-dependencies among modules.
1363 all-ash:
1364 all-autoconf: all-m4 all-texinfo
1365 all-automake: all-m4 all-texinfo
1366 all-bash:
1367 all-bfd: all-libiberty all-intl
1368 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl
1369 all-bison: all-texinfo
1370 configure-target-boehm-gc: $(ALL_GCC_C) configure-target-qthreads
1371 all-byacc:
1372 all-bzip2:
1373 all-db:
1374 all-dejagnu: all-tcl all-expect all-tk
1375 all-diff: all-libiberty
1376 all-etc:
1377 configure-target-examples: $(ALL_GCC_C)
1378 all-expect: all-tcl all-tk
1379 all-fileutils: all-libiberty
1380 all-findutils:
1381 all-find:
1382 all-flex: all-libiberty all-bison all-byacc
1383 all-gas: all-libiberty all-opcodes all-bfd all-intl
1384 all-gawk:
1385 all-gcc: all-bison all-byacc all-binutils all-gas all-ld all-zlib
1386 all-bootstrap: all-libiberty all-texinfo all-bison all-byacc all-binutils all-gas all-ld all-zlib
1387 GDB_TK = @GDB_TK@
1388 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1389 all-gettext:
1390 all-gnuserv:
1391 configure-target-gperf: $(ALL_GCC_CXX)
1392 all-target-gperf: all-target-libiberty all-target-libstdc++-v3
1393 all-gprof: all-libiberty all-bfd all-opcodes all-intl
1394 all-grep: all-libiberty
1395 all-gui: all-gdb all-libproc
1396 all-guile:
1397 all-gzip: all-libiberty
1398 all-hello: all-libiberty
1399 all-indent:
1400 all-intl:
1401 all-itcl: all-tcl all-tk
1402 all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl
1403 configure-target-libgloss: $(ALL_GCC)
1404 all-target-libgloss: configure-target-newlib
1405 all-libgui: all-tcl all-tk all-itcl
1406 all-libiberty:
1407
1408 all-build-libiberty: configure-build-libiberty
1409
1410 configure-target-libffi: $(ALL_GCC_C)
1411 configure-target-libjava: $(ALL_GCC_C) configure-target-zlib configure-target-boehm-gc configure-target-qthreads configure-target-libffi
1412 all-target-libjava: all-fastjar all-target-zlib all-target-boehm-gc all-target-qthreads all-target-libffi
1413 configure-target-libstdc++-v3: $(ALL_GCC_C)
1414 all-target-libstdc++-v3: all-target-libiberty
1415 all-libtool:
1416 configure-target-libf2c: $(ALL_GCC_C)
1417 all-target-libf2c: all-target-libiberty
1418 configure-target-libobjc: $(ALL_GCC_C)
1419 all-target-libobjc: all-target-libiberty
1420 all-m4: all-libiberty all-texinfo
1421 all-make: all-libiberty
1422 all-mmalloc:
1423 configure-target-newlib: $(ALL_GCC)
1424 configure-target-libtermcap: $(ALL_GCC_C)
1425 all-opcodes: all-bfd all-libiberty
1426 all-patch: all-libiberty
1427 all-perl:
1428 all-prms: all-libiberty
1429 configure-target-qthreads: $(ALL_GCC_C)
1430 all-rcs:
1431 all-readline:
1432 all-recode: all-libiberty
1433 all-sed: all-libiberty
1434 all-send-pr: all-prms
1435 all-shellutils:
1436 all-sid: all-tcl all-tk
1437 all-sim: all-libiberty all-bfd all-opcodes all-readline
1438 all-snavigator: all-tcl all-tk all-itcl all-tix all-db all-grep all-libgui
1439 all-tar: all-libiberty
1440 all-tcl:
1441 all-tclX: all-tcl all-tk
1442 all-tk: all-tcl
1443 all-texinfo: all-libiberty
1444 all-textutils:
1445 all-time:
1446 all-tix: all-tcl all-tk
1447 all-wdiff:
1448 configure-target-winsup: $(ALL_GCC_C)
1449 all-target-winsup: all-target-libiberty all-target-libtermcap
1450 all-uudecode: all-libiberty
1451 all-zip:
1452 all-zlib:
1453 configure-target-zlib: $(ALL_GCC_C)
1454 all-fastjar: all-zlib all-libiberty
1455 configure-target-fastjar: configure-target-zlib
1456 all-target-fastjar: configure-target-fastjar all-target-zlib all-target-libiberty
1457 configure-target-libiberty: $(ALL_GCC_C)
1458 configure-target: $(CONFIGURE_TARGET_MODULES)
1459 all-target: $(ALL_TARGET_MODULES)
1460 install-target: $(INSTALL_TARGET_MODULES)
1461 install-gdb: install-tcl install-tk install-itcl install-tix install-libgui
1462 install-sid: install-tcl install-tk
1463
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
1468 ### other supporting targets
1469
1470 MAKEDIRS= \
1471 $(DESTDIR)$(prefix) \
1472 $(DESTDIR)$(exec_prefix)
1473 .PHONY: installdirs
1474 installdirs: mkinstalldirs
1475 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1476
1477 dir.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
1484 dist:
1485 @echo "Building a full distribution of this tree isn't done"
1486 @echo "via 'make dist'. Check out the etc/ subdirectory"
1487
1488 etags 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.
1496 TAGS: do-TAGS
1497
1498 # Rebuilding Makefile.in, using autogen.
1499 $(srcdir)/Makefile.in: # $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
1500 cd $(srcdir) && autogen Makefile.def
1501
1502 # with the gnu make, this is done automatically.
1503
1504 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag) $(gcc_version_trigger)
1505 $(SHELL) ./config.status
1506
1507 #
1508
1509 .NOEXPORT:
1510 MAKEOVERRIDES=
1511
1512 # end of Makefile.in
This page took 0.059958 seconds and 4 git commands to generate.