OSDN Git Service

2008-03-26 Ed Schonberg <schonberg@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / Makefile.in
1 # Makefile for GNU Compiler Collection
2 # Run 'configure' to generate Makefile from Makefile.in
3
4 # Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
5 # 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
6 # 2008 Free Software Foundation, Inc.
7
8 #This file is part of GCC.
9
10 #GCC is free software; you can redistribute it and/or modify
11 #it under the terms of the GNU General Public License as published by
12 #the Free Software Foundation; either version 3, or (at your option)
13 #any later version.
14
15 #GCC is distributed in the hope that it will be useful,
16 #but WITHOUT ANY WARRANTY; without even the implied warranty of
17 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 #GNU General Public License for more details.
19
20 #You should have received a copy of the GNU General Public License
21 #along with GCC; see the file COPYING3.  If not see
22 #<http://www.gnu.org/licenses/>.
23
24 # The targets for external use include:
25 # all, doc, proto, install, install-cross, install-cross-rest,
26 # uninstall, TAGS, mostlyclean, clean, distclean, maintainer-clean.
27
28 # This is the default target.
29 # Set by autoconf to "all.internal" for a native build, or
30 # "all.cross" to build a cross compiler.
31 all: @ALL@
32
33 # Depend on this to specify a phony target portably.
34 force:
35
36 # This tells GNU make version 3 not to export the variables
37 # defined in this file into the environment (and thus recursive makes).
38 .NOEXPORT:
39 # And this tells it not to automatically pass command-line variables
40 # to recursive makes.
41 MAKEOVERRIDES =
42
43 # Suppress smart makes who think they know how to automake yacc and flex file
44 .y.c:
45 .l.c:
46
47 # The only suffixes we want for implicit rules are .c and .o, so clear
48 # the list and add them.  This speeds up GNU Make, and allows -r to work.
49 # For i18n support, we also need .gmo, .po, .pox.
50 # This must come before the language makefile fragments to allow them to
51 # add suffixes and rules of their own.
52 .SUFFIXES:
53 .SUFFIXES: .c .o .po .pox .gmo
54
55 # -------------------------------
56 # Standard autoconf-set variables
57 # -------------------------------
58
59 build=@build@
60 host=@host@
61 target=@target@
62 target_noncanonical:=@target_noncanonical@
63
64 # Sed command to transform gcc to installed name.
65 program_transform_name := @program_transform_name@
66
67 # -----------------------------
68 # Directories used during build
69 # -----------------------------
70
71 # Directory where sources are, from where we are.
72 srcdir = @srcdir@
73 gcc_docdir = @srcdir@/doc
74
75 # Directory where sources are, absolute.
76 abs_srcdir = @abs_srcdir@
77 abs_docdir = @abs_srcdir@/doc
78
79 # Top build directory for this package, relative to here.
80 top_builddir = .
81
82 # objdir is set by configure.
83 # It's normally the absolute path to the current directory.
84 objdir = @objdir@
85
86 host_subdir=@host_subdir@
87 build_subdir=@build_subdir@
88 target_subdir=@target_subdir@
89 build_libsubdir=@build_libsubdir@
90
91 # Top build directory for the "Cygnus tree", relative to $(top_builddir).
92 ifeq ($(host_subdir),.)
93 toplevel_builddir := ..
94 else
95 toplevel_builddir := ../..
96 endif
97
98 build_objdir := $(toplevel_builddir)/$(build_subdir)
99 build_libobjdir := $(toplevel_builddir)/$(build_libsubdir)
100 target_objdir := $(toplevel_builddir)/$(target_subdir)
101
102 # --------
103 # Defined vpaths
104 # --------
105
106 # Directory where sources are, from where we are.
107 VPATH = @srcdir@
108
109 # We define a vpath for the sources of the .texi files here because they
110 # are split between multiple directories and we would rather use one implicit
111 # pattern rule for everything.
112 # This vpath could be extended within the Make-lang fragments.
113
114 vpath %.texi $(gcc_docdir)
115 vpath %.texi $(gcc_docdir)/include
116
117 # ----
118 # Default values for variables overridden in Makefile fragments.
119 # These need to be quite early in the Makefile so as to avoid
120 # trouble induced by changes in fragment ordering.
121 # ----
122
123 # For ada/Make-lang.in; overridden in, for example, config/pa/x-ada.
124 X_ADA_CFLAGS =
125 T_ADA_CFLAGS =
126 X_ADAFLAGS =
127 T_ADAFLAGS =
128
129 # --------
130 # UNSORTED
131 # --------
132
133 # Variables that exist for you to override.
134 # See below for how to change them for certain systems.
135
136 # List of language subdirectories.
137 SUBDIRS =@subdirs@ build
138
139 # Selection of languages to be made.
140 CONFIG_LANGUAGES = @all_selected_languages@
141 LANGUAGES = c gcov$(exeext) gcov-dump$(exeext) $(CONFIG_LANGUAGES)
142
143 # Various ways of specifying flags for compilations:
144 # CFLAGS is for the user to override to, e.g., do a cross build with -O2.
145 # XCFLAGS is used for most compilations but not when using the GCC just built.
146 # TCFLAGS is used for compilations with the GCC just built.
147 XCFLAGS =
148 TCFLAGS =
149 CFLAGS = @CFLAGS@
150 LDFLAGS = @LDFLAGS@
151
152 # Flags to determine code coverage. When coverage is disabled, this will
153 # contain the optimization flags, as you normally want code coverage
154 # without optimization.
155 COVERAGE_FLAGS = @coverage_flags@
156 coverageexts = .{gcda,gcno}
157
158 # The warning flags are separate from CFLAGS because people tend to
159 # override optimization flags and we'd like them to still have warnings
160 # turned on.  These flags are also used to pass other stage dependent
161 # flags from configure.  The user is free to explicitly turn these flags
162 # off if they wish.
163 # LOOSE_WARN are the warning flags to use when compiling something
164 # which is only compiled with gcc, such as libgcc and the frontends
165 # other than C.
166 # STRICT_WARN are the additional warning flags to
167 # apply to the back end and the C front end, which may be compiled
168 # with other compilers.
169 # CXX_COMPAT_WARN are C++ source compatibility warnings.
170 LOOSE_WARN = @loose_warn@
171 STRICT_WARN = @strict_warn@
172 CXX_COMPAT_WARN = @cxx_compat_warn@
173
174 # This is set by --enable-checking.  The idea is to catch forgotten
175 # "extern" tags in header files.
176 NOCOMMON_FLAG = @nocommon_flag@
177
178 # This is set by --disable-maintainer-mode (default) to "#"
179 MAINT := @MAINT@
180
181 # These are set by --enable-checking=valgrind.
182 RUN_GEN = @valgrind_command@
183 VALGRIND_DRIVER_DEFINES = @valgrind_path_defines@
184
185 # This is how we control whether or not the additional warnings are applied.
186 .-warn = $(STRICT_WARN)
187 build-warn = $(STRICT_WARN)
188 GCC_WARN_CFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn)
189
190 # These files are to have specific diagnostics suppressed, or are not to
191 # be subject to -Werror:
192 # flex output may yield harmless "no previous prototype" warnings
193 build/gengtype-lex.o-warn = -Wno-error
194 # SYSCALLS.c misses prototypes
195 SYSCALLS.c.X-warn = -Wno-strict-prototypes -Wno-error
196
197 # All warnings have to be shut off in stage1 if the compiler used then
198 # isn't gcc; configure determines that.  WARN_CFLAGS will be either
199 # $(GCC_WARN_CFLAGS), or nothing.
200 WARN_CFLAGS = @warn_cflags@
201
202 CPPFLAGS = @CPPFLAGS@
203
204 # These exists to be overridden by the x-* and t-* files, respectively.
205 X_CFLAGS =
206 T_CFLAGS =
207
208 X_CPPFLAGS =
209 T_CPPFLAGS =
210
211 AWK = @AWK@
212 CC = @CC@
213 BISON = @BISON@
214 BISONFLAGS =
215 FLEX = @FLEX@
216 FLEXFLAGS =
217 AR = @AR@
218 AR_FLAGS = rc
219 NM = @NM@
220 RANLIB = @RANLIB@
221 RANLIB_FLAGS = @ranlib_flags@
222
223 # -------------------------------------------
224 # Programs which operate on the build machine
225 # -------------------------------------------
226
227 SHELL = @SHELL@
228 # pwd command to use.  Allow user to override default by setting PWDCMD in
229 # the environment to account for automounters.  The make variable must not
230 # be called PWDCMD, otherwise the value set here is passed to make
231 # subprocesses and overrides the setting from the user's environment.
232 # Don't use PWD since it is a common shell environment variable and we
233 # don't want to corrupt it.
234 PWD_COMMAND = $${PWDCMD-pwd}
235 # on sysV, define this as cp.
236 INSTALL = @INSTALL@
237 # Some systems may be missing symbolic links, regular links, or both.
238 # Allow configure to check this and use "ln -s", "ln", or "cp" as appropriate.
239 LN=@LN@
240 LN_S=@LN_S@
241 # These permit overriding just for certain files.
242 INSTALL_PROGRAM = @INSTALL_PROGRAM@
243 INSTALL_DATA = @INSTALL_DATA@
244 INSTALL_SCRIPT = @INSTALL@
245 MAKEINFO = @MAKEINFO@
246 MAKEINFOFLAGS = --no-split
247 TEXI2DVI = texi2dvi
248 TEXI2PDF = texi2pdf
249 TEXI2HTML = $(MAKEINFO) --html
250 TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl
251 POD2MAN = pod2man --center="GNU" --release="gcc-$(version)"
252 # Some versions of `touch' (such as the version on Solaris 2.8)
253 # do not correctly set the timestamp due to buggy versions of `utime'
254 # in the kernel.  So, we use `echo' instead.
255 STAMP = echo timestamp >
256 # If necessary (e.g., when using the MSYS shell on Microsoft Windows)
257 # translate the shell's notion of absolute pathnames to the native
258 # spelling.
259 build_file_translate = @build_file_translate@
260
261 # Make sure the $(MAKE) variable is defined.
262 @SET_MAKE@
263
264 # Locate mkinstalldirs.
265 mkinstalldirs=$(SHELL) $(srcdir)/../mkinstalldirs
266
267 # --------
268 # UNSORTED
269 # --------
270
271 # Dependency tracking stuff.
272 CCDEPMODE = @CCDEPMODE@
273 DEPDIR = @DEPDIR@
274 depcomp = $(SHELL) $(srcdir)/../depcomp
275 BUILD_DEPMODE = @BUILD_DEPMODE@
276
277 # Some compilers can't handle cc -c blah.c -o foo/blah.o.
278 # In stage2 and beyond, we force this to "-o $@" since we know we're using gcc.
279 OUTPUT_OPTION = @OUTPUT_OPTION@
280
281 # This is where we get zlib from.  zlibdir is -L../zlib and zlibinc is
282 # -I../zlib, unless we were configured with --with-system-zlib, in which
283 # case both are empty.
284 ZLIB = @zlibdir@ -lz
285 ZLIBINC = @zlibinc@
286
287 # How to find GMP
288 GMPLIBS = @GMPLIBS@
289 GMPINC = @GMPINC@
290
291 CPPLIB = ../libcpp/libcpp.a
292 CPPINC = -I$(srcdir)/../libcpp/include
293
294 # Where to find decNumber
295 enable_decimal_float = @enable_decimal_float@
296 DECNUM = $(srcdir)/../libdecnumber
297 DECNUMFMT = $(srcdir)/../libdecnumber/$(enable_decimal_float)
298 DECNUMINC = -I$(DECNUM) -I$(DECNUMFMT) -I../libdecnumber
299 LIBDECNUMBER = ../libdecnumber/libdecnumber.a
300
301 # Substitution type for target's getgroups 2nd arg.
302 TARGET_GETGROUPS_T = @TARGET_GETGROUPS_T@
303
304 # Target to use when installing include directory.  Either
305 # install-headers-tar, install-headers-cpio or install-headers-cp.
306 INSTALL_HEADERS_DIR = @build_install_headers_dir@
307
308 # Header files that are made available under the same name
309 # to programs compiled with GCC.
310 USER_H = $(srcdir)/ginclude/float.h \
311          $(srcdir)/ginclude/iso646.h \
312          $(srcdir)/ginclude/stdarg.h \
313          $(srcdir)/ginclude/stdbool.h \
314          $(srcdir)/ginclude/stddef.h \
315          $(srcdir)/ginclude/varargs.h \
316          $(srcdir)/ginclude/stdfix.h \
317          $(EXTRA_HEADERS)
318
319 UNWIND_H = $(srcdir)/unwind-generic.h
320
321 # The GCC to use for compiling crt*.o.
322 # Usually the one we just built.
323 # Don't use this as a dependency--use $(GCC_PASSES).
324 GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld
325
326 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
327 # It omits XCFLAGS, and specifies -B./.
328 # It also specifies -isystem ./include to find, e.g., stddef.h.
329 GCC_CFLAGS=$(CFLAGS_FOR_TARGET) $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) -Wold-style-definition $($@-warn) -isystem ./include $(TCFLAGS)
330
331 # ---------------------------------------------------
332 # Programs which produce files for the target machine
333 # ---------------------------------------------------
334
335 AR_FOR_TARGET := $(shell \
336   if [ -f $(objdir)/../binutils/ar ] ; then \
337     echo $(objdir)/../binutils/ar ; \
338   else \
339     if [ "$(host)" = "$(target)" ] ; then \
340       echo $(AR); \
341     else \
342        t='$(program_transform_name)'; echo ar | sed -e $$t ; \
343     fi; \
344   fi)
345 AR_FLAGS_FOR_TARGET =
346 AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc
347 AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x
348 LIPO_FOR_TARGET = lipo
349 ORIGINAL_AS_FOR_TARGET = @ORIGINAL_AS_FOR_TARGET@
350 RANLIB_FOR_TARGET := $(shell \
351   if [ -f $(objdir)/../binutils/ranlib ] ; then \
352     echo $(objdir)/../binutils/ranlib ; \
353   else \
354     if [ "$(host)" = "$(target)" ] ; then \
355       echo $(RANLIB); \
356     else \
357        t='$(program_transform_name)'; echo ranlib | sed -e $$t ; \
358     fi; \
359   fi)
360 ORIGINAL_LD_FOR_TARGET = @ORIGINAL_LD_FOR_TARGET@
361 ORIGINAL_NM_FOR_TARGET = @ORIGINAL_NM_FOR_TARGET@
362 NM_FOR_TARGET = ./nm
363 STRIP_FOR_TARGET := $(shell \
364   if [ -f $(objdir)/../binutils/strip ] ; then \
365     echo $(objdir)/../binutils/strip ; \
366   else \
367     if [ "$(host)" = "$(target)" ] ; then \
368       echo strip; \
369     else \
370        t='$(program_transform_name)'; echo strip | sed -e $$t ; \
371     fi; \
372   fi)
373
374 # --------
375 # UNSORTED
376 # --------
377
378 # Where to find some libiberty headers.
379 HASHTAB_H   = $(srcdir)/../include/hashtab.h
380 SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h
381
382 # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
383 NATIVE_SYSTEM_HEADER_DIR = /usr/include
384 # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
385 CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
386
387 # autoconf sets SYSTEM_HEADER_DIR to one of the above.
388 # Purge it of unneccessary internal relative paths
389 # to directories that might not exist yet.
390 # The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta.
391 # Use single quotes here to avoid nested double- and backquotes, this
392 # macro is also used in a double-quoted context.
393 SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`
394
395 # Control whether to run fixproto and fixincludes.
396 STMP_FIXPROTO = @STMP_FIXPROTO@
397 STMP_FIXINC = @STMP_FIXINC@
398
399 # Test to see whether <limits.h> exists in the system header files.
400 LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
401
402 # Directory for prefix to system directories, for
403 # each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
404 TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
405
406 xmake_file=@xmake_file@
407 tmake_file=@tmake_file@
408 out_file=$(srcdir)/config/@out_file@
409 out_object_file=@out_object_file@
410 md_file=$(srcdir)/config/@md_file@
411 tm_file_list=@tm_file_list@
412 tm_include_list=@tm_include_list@
413 tm_defines=@tm_defines@
414 tm_p_file_list=@tm_p_file_list@
415 tm_p_include_list=@tm_p_include_list@
416 build_xm_file_list=@build_xm_file_list@
417 build_xm_include_list=@build_xm_include_list@
418 build_xm_defines=@build_xm_defines@
419 host_xm_file_list=@host_xm_file_list@
420 host_xm_include_list=@host_xm_include_list@
421 host_xm_defines=@host_xm_defines@
422 xm_file_list=@xm_file_list@
423 xm_include_list=@xm_include_list@
424 xm_defines=@xm_defines@
425 lang_checks=check-gcc
426 lang_opt_files=@lang_opt_files@ $(srcdir)/c.opt $(srcdir)/common.opt
427 lang_specs_files=@lang_specs_files@
428 lang_tree_files=@lang_tree_files@
429 target_cpu_default=@target_cpu_default@
430 GCC_THREAD_FILE=@thread_file@
431 OBJC_BOEHM_GC=@objc_boehm_gc@
432 GTHREAD_FLAGS=@gthread_flags@
433 extra_modes_file=@extra_modes_file@
434 extra_opt_files=@extra_opt_files@
435 host_hook_obj=@out_host_hook_obj@
436
437 # ------------------------
438 # Installation directories
439 # ------------------------
440
441 # Common prefix for installation directories.
442 # NOTE: This directory must exist when you start installation.
443 prefix = @prefix@
444 # Directory in which to put localized header files. On the systems with
445 # gcc as the native cc, `local_prefix' may not be `prefix' which is
446 # `/usr'.
447 # NOTE: local_prefix *should not* default from prefix.
448 local_prefix = @local_prefix@
449 # Directory in which to put host dependent programs and libraries
450 exec_prefix = @exec_prefix@
451 # Directory in which to put the executable for the command `gcc'
452 bindir = @bindir@
453 # Directory in which to put the directories used by the compiler.
454 libdir = @libdir@
455 # Directory in which GCC puts its executables.
456 libexecdir = @libexecdir@
457
458 # --------
459 # UNSORTED
460 # --------
461
462 # Directory in which the compiler finds libraries etc.
463 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version)
464 # Directory in which the compiler finds executables
465 libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(version)
466 # Used to produce a relative $(gcc_tooldir) in gcc.o
467 unlibsubdir = ../../..
468 # $(prefix), expressed as a path relative to $(libsubdir).
469 #
470 # An explanation of the sed strings:
471 #  -e 's|^$(prefix)||'   matches and eliminates 'prefix' from 'exec_prefix'
472 #  -e 's|/$$||'          match a trailing forward slash and eliminates it
473 #  -e 's|^[^/]|/|'       forces the string to start with a forward slash (*)
474 #  -e 's|/[^/]*|../|g'   replaces each occurrence of /<directory> with ../
475 #
476 # (*) Note this pattern overwrites the first character of the string
477 # with a forward slash if one is not already present.  This is not a
478 # problem because the exact names of the sub-directories concerned is
479 # unimportant, just the number of them matters.
480 #
481 # The practical upshot of these patterns is like this:
482 #
483 #  prefix     exec_prefix        result
484 #  ------     -----------        ------
485 #   /foo        /foo/bar          ../
486 #   /foo/       /foo/bar          ../
487 #   /foo        /foo/bar/         ../
488 #   /foo/       /foo/bar/         ../
489 #   /foo        /foo/bar/ugg      ../../
490 libsubdir_to_prefix := \
491   $(unlibsubdir)/$(shell echo "$(libdir)" | \
492     sed -e 's|^$(prefix)||' -e 's|/$$||' -e 's|^[^/]|/|' \
493         -e 's|/[^/]*|../|g')
494 # $(exec_prefix), expressed as a path relative to $(prefix).
495 prefix_to_exec_prefix := \
496   $(shell echo "$(exec_prefix)" | \
497     sed -e 's|^$(prefix)||' -e 's|^/||' -e '/./s|$$|/|')
498 # Directory in which to find other cross-compilation tools and headers.
499 dollar = @dollar@
500 # Used in install-cross.
501 gcc_tooldir = @gcc_tooldir@
502 # Used to install the shared libgcc.
503 slibdir = @slibdir@
504 # Since gcc_tooldir does not exist at build-time, use -B$(build_tooldir)/bin/
505 build_tooldir = $(exec_prefix)/$(target_noncanonical)
506 # Directory in which the compiler finds target-independent g++ includes.
507 gcc_gxx_include_dir = @gcc_gxx_include_dir@
508 # Directory to search for site-specific includes.
509 local_includedir = $(local_prefix)/include
510 includedir = $(prefix)/include
511 # where the info files go
512 infodir = @infodir@
513 # Where cpp should go besides $prefix/bin if necessary
514 cpp_install_dir = @cpp_install_dir@
515 # where the locale files go
516 datadir = @datadir@
517 localedir = $(datadir)/locale
518 # Extension (if any) to put in installed man-page filename.
519 man1ext = .1
520 man7ext = .7
521 objext = .o
522 exeext = @host_exeext@
523 build_exeext = @build_exeext@
524
525 # Directory in which to put man pages.
526 mandir = @mandir@
527 man1dir = $(mandir)/man1
528 man7dir = $(mandir)/man7
529 # Dir for temp files.
530 tmpdir = /tmp
531
532 datarootdir = @datarootdir@
533 docdir = @docdir@
534 # Directory in which to build HTML
535 build_htmldir = $(objdir)/HTML/gcc-$(version)
536 # Directory in which to put HTML
537 htmldir = @htmldir@
538
539 # Whether we were configured with NLS.
540 USE_NLS = @USE_NLS@
541
542 # Internationalization library.
543 LIBINTL = @LIBINTL@
544 LIBINTL_DEP = @LIBINTL_DEP@
545
546 # Character encoding conversion library.
547 LIBICONV = @LIBICONV@
548 LIBICONV_DEP = @LIBICONV_DEP@
549
550 # The GC method to be used on this system.
551 GGC=@GGC@.o
552
553 # If a supplementary library is being used for the GC.
554 GGC_LIB=
555
556 # "true" if the target C library headers are unavailable; "false"
557 # otherwise.
558 inhibit_libc = @inhibit_libc@
559 ifeq ($(inhibit_libc),true)
560 INHIBIT_LIBC_CFLAGS = -Dinhibit_libc
561 endif
562
563 # Options to use when compiling libgcc2.a.
564 #
565 LIBGCC2_DEBUG_CFLAGS = -g
566 LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) \
567                  $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) \
568                  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \
569                  $(INHIBIT_LIBC_CFLAGS)
570
571 # Additional options to use when compiling libgcc2.a.
572 # Some targets override this to -isystem include
573 LIBGCC2_INCLUDES =
574
575 # Additional target-dependent options for compiling libgcc2.a.
576 TARGET_LIBGCC2_CFLAGS =
577
578 # Options to use when compiling crtbegin/end.
579 CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
580   -finhibit-size-directive -fno-inline-functions -fno-exceptions \
581   -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
582   $(INHIBIT_LIBC_CFLAGS)
583
584 # Additional sources to handle exceptions; overridden by targets as needed.
585 LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
586    $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
587 LIB2ADDEHSTATIC = $(LIB2ADDEH)
588 LIB2ADDEHSHARED = $(LIB2ADDEH)
589 LIB2ADDEHDEP = $(UNWIND_H) unwind-pe.h unwind.inc unwind-dw2-fde.h unwind-dw2.h
590
591 # Don't build libunwind by default.
592 LIBUNWIND =
593 LIBUNWINDDEP =
594 SHLIBUNWIND_LINK =
595 SHLIBUNWIND_INSTALL =
596
597 # nm flags to list global symbols in libgcc object files.
598 SHLIB_NM_FLAGS = -pg
599
600 # List of extra executables that should be compiled for this target machine
601 # that are used for compiling from source code to object code.
602 # The rules for compiling them should be in the t-* file for the machine.
603 EXTRA_PASSES =@extra_passes@
604
605 # Like EXTRA_PASSES, but these are used when linking.
606 EXTRA_PROGRAMS = @extra_programs@
607
608 # List of extra object files that should be compiled for this target machine.
609 # The rules for compiling them should be in the t-* file for the machine.
610 EXTRA_PARTS = @extra_parts@
611
612 # List of extra object files that should be compiled and linked with
613 # compiler proper (cc1, cc1obj, cc1plus).
614 EXTRA_OBJS = @extra_objs@
615
616 # List of extra object files that should be compiled and linked with
617 # the gcc driver.
618 EXTRA_GCC_OBJS =@extra_gcc_objs@
619
620 # List of additional header files to install.
621 EXTRA_HEADERS =@extra_headers_list@
622
623 # The configure script will set this to collect2$(exeext), except on a
624 # (non-Unix) host which can not build collect2, for which it will be
625 # set to empty.
626 COLLECT2 = @collect2@
627
628 # List of extra C and assembler files to add to static and shared libgcc2.
629 # Assembler files should have names ending in `.asm'.
630 LIB2FUNCS_EXTRA =
631
632 # List of extra C and assembler files to add to static libgcc2.
633 # Assembler files should have names ending in `.asm'.
634 LIB2FUNCS_STATIC_EXTRA =
635
636 # List of functions not to build from libgcc2.c.
637 LIB2FUNCS_EXCLUDE =
638
639 # Target sfp-machine.h file.
640 SFP_MACHINE =
641
642 # Program to convert libraries.
643 LIBCONVERT =
644
645 # Control whether header files are installed.
646 INSTALL_HEADERS=install-headers install-mkheaders
647
648 # Control whether Info documentation is built and installed.
649 BUILD_INFO = @BUILD_INFO@
650
651 # Control whether manpages generated by texi2pod.pl can be rebuilt.
652 GENERATED_MANPAGES = @GENERATED_MANPAGES@
653
654 # Additional directories of header files to run fixincludes on.
655 # These should be directories searched automatically by default
656 # just as /usr/include is.
657 # *Do not* use this for directories that happen to contain
658 # header files, but are not searched automatically by default.
659 # On most systems, this is empty.
660 OTHER_FIXINCLUDES_DIRS=
661
662 # A list of all the language-specific executables.
663 COMPILERS = cc1$(exeext) @all_compilers@
664
665 # List of things which should already be built whenever we try to use xgcc
666 # to compile anything (without linking).
667 GCC_PASSES=xgcc$(exeext) cc1$(exeext) specs $(EXTRA_PASSES)
668
669 # Directory to link to, when using the target `maketest'.
670 DIR = ../gcc
671
672 # Native compiler for the build machine and its switches.
673 CC_FOR_BUILD = @CC_FOR_BUILD@
674 BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE
675
676 # Native linker and preprocessor flags.  For x-fragment overrides.
677 BUILD_LDFLAGS=$(LDFLAGS)
678 BUILD_CPPFLAGS=$(ALL_CPPFLAGS)
679
680 # Actual name to use when installing a native compiler.
681 GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
682 GCC_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcc|sed '$(program_transform_name)')
683 CPP_INSTALL_NAME := $(shell echo cpp|sed '$(program_transform_name)')
684 PROTOIZE_INSTALL_NAME := $(shell echo protoize|sed '$(program_transform_name)')
685 UNPROTOIZE_INSTALL_NAME := $(shell echo unprotoize|sed '$(program_transform_name)')
686 GCOV_INSTALL_NAME := $(shell echo gcov|sed '$(program_transform_name)')
687 GCCBUG_INSTALL_NAME := $(shell echo gccbug|sed '$(program_transform_name)')
688
689 # Setup the testing framework, if you have one
690 EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
691             echo $${rootme}/../expect/expect ; \
692           else echo expect ; fi`
693
694 RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
695                echo $${srcdir}/../dejagnu/runtest ; \
696             else echo runtest; fi`
697 RUNTESTFLAGS =
698
699 # Extra symbols for fixproto to define when parsing headers.
700 FIXPROTO_DEFINES =
701
702 # Extra flags to use when compiling crt{begin,end}.o.
703 CRTSTUFF_T_CFLAGS =
704
705 # Extra flags to use when compiling [m]crt0.o.
706 CRT0STUFF_T_CFLAGS =
707
708 # "t" or nothing, for building multilibbed versions of, say, crtbegin.o.
709 T =
710
711 # Should T contain a `=', libgcc/Makefile will make T_TARGET, setting
712 # $(T_TARGET) to the name of the actual target filename.
713 T_TARGET =
714 T_TARGET : $(T_TARGET)
715
716 # This should name the specs file that we're going to install.  Target
717 # Makefiles may override it and name another file to be generated from
718 # the built-in specs and installed as the default spec, as long as
719 # they also introduce a rule to generate a file name specs, to be used
720 # at build time.
721 SPECS = specs
722
723 # End of variables for you to override.
724
725 # GTM_H lists the config files that the generator files depend on,
726 # while TM_H lists the ones ordinary gcc files depend on, which
727 # includes several files generated by those generators.
728 CONFIG_H  = config.h  $(host_xm_file_list)
729 TCONFIG_H = tconfig.h $(xm_file_list)
730 TM_P_H    = tm_p.h    $(tm_p_file_list)
731 GTM_H     = tm.h      $(tm_file_list)
732 TM_H      = $(GTM_H) insn-constants.h insn-flags.h options.h
733
734 # All generated headers which might be needed while building xgcc
735 # itself.  Generated headers needed by build tools and the like should
736 # not be mentioned here.
737 simple_generated_h = insn-attr.h insn-codes.h insn-config.h insn-flags.h
738
739 simple_generated_c = insn-attrtab.c insn-automata.c insn-emit.c \
740                      insn-extract.c insn-opinit.c insn-output.c \
741                      insn-peep.c insn-recog.c
742
743 generated_files = config.h tm.h $(TM_P_H) $(TM_H) multilib.h \
744         $(simple_generated_h) $(simple_generated_c) specs.h \
745         tree-check.h genrtl.h insn-modes.h tm-preds.h tm-constrs.h \
746         $(ALL_GTFILES_H) gtype-desc.c gtype-desc.h gcov-iov.h
747
748
749 # Variables for version information.
750 BASEVER     := $(srcdir)/BASE-VER  # 4.x.y
751 DEVPHASE    := $(srcdir)/DEV-PHASE # experimental, prerelease, ""
752 DATESTAMP   := $(srcdir)/DATESTAMP # YYYYMMDD or empty
753 REVISION    := $(srcdir)/REVISION  # [BRANCH revision XXXXXX]
754
755 BASEVER_c   := $(shell cat $(BASEVER))
756 DEVPHASE_c  := $(shell cat $(DEVPHASE))
757 DATESTAMP_c := $(shell cat $(DATESTAMP))
758
759 ifeq (,$(wildcard $(REVISION)))
760 REVISION_c  :=
761 else
762 REVISION_c  := $(shell cat $(REVISION))
763 endif
764
765 version     := $(BASEVER_c)
766
767 # For use in version.c - double quoted strings, with appropriate
768 # surrounding punctuation and spaces, and with the datestamp and
769 # development phase collapsed to the empty string in release mode
770 # (i.e. if DEVPHASE_c is empty).  The space immediately after the
771 # comma in the $(if ...) constructs is significant - do not remove it.
772 BASEVER_s   := "\"$(BASEVER_c)\""
773 DEVPHASE_s  := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\""
774 DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\""
775 PKGVERSION_s:= "\"@PKGVERSION@\""
776 BUGURL_s    := "\"@REPORT_BUGS_TO@\""
777
778 PKGVERSION  := @PKGVERSION@
779 BUGURL_TEXI := @REPORT_BUGS_TEXI@
780
781 ifdef REVISION_c
782 REVISION_s  := "\"$(if $(DEVPHASE_c), $(REVISION_c))\""
783 else
784 REVISION_s  :=
785 endif
786
787 CPPLIB_H = $(srcdir)/../libcpp/include/line-map.h \
788         $(srcdir)/../libcpp/include/cpplib.h
789 CPP_ID_DATA_H = $(CPPLIB_H) $(srcdir)/../libcpp/include/cpp-id-data.h
790
791 #\f
792 # Now figure out from those variables how to compile and link.
793
794 # IN_GCC distinguishes between code compiled into GCC itself and other
795 # programs built during a bootstrap.
796 # autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a
797 # cross compiler which does not use the native headers and libraries.
798 INTERNAL_CFLAGS = -DIN_GCC @CROSS@
799
800 # This is the variable actually used when we compile. If you change this,
801 # you probably want to update BUILD_CFLAGS in configure.ac
802 ALL_CFLAGS = $(X_CFLAGS) $(T_CFLAGS) \
803   $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@
804
805 # Likewise.  Put INCLUDES at the beginning: this way, if some autoconf macro
806 # puts -I options in CPPFLAGS, our include files in the srcdir will always
807 # win against random include files in /usr/include.
808 ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
809
810 # Build and host support libraries.
811 LIBIBERTY = ../libiberty/libiberty.a
812 BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
813
814 # Dependencies on the intl and portability libraries.
815 LIBDEPS= $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) $(LIBDECNUMBER)
816
817 # Likewise, for use in the tools that must run on this machine
818 # even if we are cross-building GCC.
819 BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
820
821 # How to link with both our special library facilities
822 # and the system's installed libraries.
823 LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER)
824
825 # Any system libraries needed just for GNAT.
826 SYSLIBS = @GNAT_LIBEXC@
827
828 # Libs needed (at present) just for jcf-dump.
829 LDEXP_LIB = @LDEXP_LIB@
830
831 # Likewise, for use in the tools that must run on this machine
832 # even if we are cross-building GCC.
833 BUILD_LIBS = $(BUILD_LIBIBERTY)
834
835 BUILD_RTL = build/rtl.o build/read-rtl.o build/ggc-none.o build/vec.o \
836             build/min-insn-modes.o build/gensupport.o build/print-rtl.o
837 BUILD_ERRORS = build/errors.o
838
839 # Specify the directories to be searched for header files.
840 # Both . and srcdir are used, in that order,
841 # so that *config.h will be found in the compilation
842 # subdirectory rather than in the source directory.
843 # -I$(@D) and -I$(srcdir)/$(@D) cause the subdirectory of the file
844 # currently being compiled, in both source trees, to be examined as well.
845 # libintl.h will be found in ../intl if we are using the included libintl.
846 INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
847            -I$(srcdir)/../include @INCINTL@ \
848            $(CPPINC) $(GMPINC) $(DECNUMINC)
849
850 COMPILE.base = $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) -o $@
851 ifeq ($(CCDEPMODE),depmode=gcc3)
852 COMPILE = $(COMPILE.base) -MT $@ -MMD -MP -MF $(*D)/$(DEPDIR)/$(*F).Po
853 else
854 COMPILE = source='$<' object='$@' libtool=no \
855     DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) $(COMPILE.base)
856 endif
857
858 %.o: %.c
859         $(COMPILE) $<
860
861 #\f
862 # Support for additional languages (other than C).
863 # C can be supported this way too (leave for later).
864
865 LANG_MAKEFRAGS = @all_lang_makefrags@
866 LANG_MAKEFILES = @all_lang_makefiles@
867
868 # Flags to pass to recursive makes.
869 # CC is set by configure.
870 # ??? The choices here will need some experimenting with.
871
872 export AR_FOR_TARGET
873 export AR_CREATE_FOR_TARGET
874 export AR_FLAGS_FOR_TARGET
875 export AR_EXTRACT_FOR_TARGET
876 export AWK
877 export DESTDIR
878 export GCC_FOR_TARGET
879 export INCLUDES
880 export INSTALL_DATA
881 export LIB1ASMSRC
882 export LIBGCC2_CFLAGS
883 export LIPO_FOR_TARGET
884 export MACHMODE_H
885 export NM_FOR_TARGET
886 export STRIP_FOR_TARGET
887 export RANLIB_FOR_TARGET
888 export libsubdir
889 export slibdir
890
891 FLAGS_TO_PASS = \
892         "BISON=$(BISON)" \
893         "BISONFLAGS=$(BISONFLAGS)" \
894         "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
895         "LDFLAGS=$(LDFLAGS)" \
896         "FLEX=$(FLEX)" \
897         "FLEXFLAGS=$(FLEXFLAGS)" \
898         "LN=$(LN)" \
899         "LN_S=$(LN_S)" \
900         "MAKEINFO=$(MAKEINFO)" \
901         "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
902         "MAKEOVERRIDES=" \
903         "SHELL=$(SHELL)" \
904         "exeext=$(exeext)" \
905         "build_exeext=$(build_exeext)" \
906         "objext=$(objext)" \
907         "exec_prefix=$(exec_prefix)" \
908         "prefix=$(prefix)" \
909         "local_prefix=$(local_prefix)" \
910         "gxx_include_dir=$(gcc_gxx_include_dir)" \
911         "build_tooldir=$(build_tooldir)" \
912         "gcc_tooldir=$(gcc_tooldir)" \
913         "bindir=$(bindir)" \
914         "libexecsubdir=$(libsubdir)" \
915         "datadir=$(datadir)" \
916         "localedir=$(localedir)"
917 #\f
918 # Lists of files for various purposes.
919
920 # All option source files
921 ALL_OPT_FILES=$(lang_opt_files) $(extra_opt_files)
922
923 # Target specific, C specific object file
924 C_TARGET_OBJS=@c_target_objs@
925
926 # Target specific, C++ specific object file
927 CXX_TARGET_OBJS=@cxx_target_objs@
928
929 # Object files for gcc driver.
930 GCC_OBJS = gcc.o opts-common.o gcc-options.o
931
932 # Language-specific object files for C and Objective C.
933 C_AND_OBJC_OBJS = attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o \
934   c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o \
935   c-incpath.o cppdefault.o c-ppoutput.o c-cppbuiltin.o prefix.o \
936   c-objc-common.o c-dump.o c-pch.o c-parser.o $(C_TARGET_OBJS) \
937   c-gimplify.o tree-mudflap.o c-pretty-print.o c-omp.o
938
939 # Language-specific object files for C.
940 C_OBJS = c-lang.o stub-objc.o $(C_AND_OBJC_OBJS)
941
942 # Language-independent object files.
943 # We put the insn-*.o files first so that a parallel make will build
944 # them sooner, because they are large and otherwise tend to be the
945 # last objects to finish building.
946 OBJS-common = \
947         insn-attrtab.o \
948         insn-automata.o \
949         insn-emit.o \
950         insn-extract.o \
951         insn-modes.o \
952         insn-opinit.o \
953         insn-output.o \
954         insn-peep.o \
955         insn-preds.o \
956         insn-recog.o \
957         $(GGC) \
958         alias.o \
959         alloc-pool.o \
960         auto-inc-dec.o \
961         bb-reorder.o \
962         bitmap.o \
963         bt-load.o \
964         builtins.o \
965         caller-save.o \
966         calls.o \
967         cfg.o \
968         cfganal.o \
969         cfgbuild.o \
970         cfgcleanup.o \
971         cfgexpand.o \
972         cfghooks.o \
973         cfglayout.o \
974         cfgloop.o \
975         cfgloopanal.o \
976         cfgloopmanip.o \
977         cfgrtl.o \
978         combine.o \
979         combine-stack-adj.o \
980         convert.o \
981         coverage.o \
982         cse.o \
983         cselib.o \
984         dbxout.o \
985         dbgcnt.o \
986         dce.o \
987         ddg.o \
988         debug.o \
989         df-core.o \
990         df-problems.o \
991         df-scan.o \
992         dfp.o \
993         diagnostic.o \
994         dojump.o \
995         dominance.o \
996         domwalk.o \
997         double-int.o \
998         dse.o \
999         dwarf2asm.o \
1000         dwarf2out.o \
1001         ebitmap.o \
1002         emit-rtl.o \
1003         et-forest.o \
1004         except.o \
1005         explow.o \
1006         expmed.o \
1007         expr.o \
1008         final.o \
1009         fixed-value.o \
1010         fold-const.o \
1011         function.o \
1012         fwprop.o \
1013         gcse.o \
1014         genrtl.o \
1015         ggc-common.o \
1016         gimple-low.o \
1017         gimplify.o \
1018         global.o \
1019         graph.o \
1020         graphds.o \
1021         gtype-desc.o \
1022         haifa-sched.o \
1023         hooks.o \
1024         ifcvt.o \
1025         init-regs.o \
1026         integrate.o \
1027         intl.o \
1028         jump.o \
1029         lambda-code.o \
1030         lambda-mat.o \
1031         lambda-trans.o \
1032         langhooks.o \
1033         lcm.o \
1034         lists.o \
1035         local-alloc.o \
1036         loop-doloop.o \
1037         loop-init.o \
1038         loop-invariant.o \
1039         loop-iv.o \
1040         loop-unroll.o \
1041         loop-unswitch.o \
1042         lower-subreg.o \
1043         mode-switching.o \
1044         modulo-sched.o \
1045         omega.o \
1046         omp-low.o \
1047         optabs.o \
1048         options.o \
1049         opts-common.o \
1050         opts.o \
1051         params.o \
1052         passes.o \
1053         pointer-set.o \
1054         postreload-gcse.o \
1055         postreload.o \
1056         predict.o \
1057         pretty-print.o \
1058         print-rtl.o \
1059         print-tree.o \
1060         profile.o \
1061         ra-conflict.o \
1062         real.o \
1063         recog.o \
1064         reg-stack.o \
1065         regclass.o \
1066         regmove.o \
1067         regrename.o \
1068         regstat.o \
1069         reload.o \
1070         reload1.o \
1071         reorg.o \
1072         resource.o \
1073         rtl-error.o \
1074         rtl-factoring.o \
1075         rtl.o \
1076         rtlanal.o \
1077         rtlhooks.o \
1078         sbitmap.o \
1079         sched-deps.o \
1080         sched-ebb.o \
1081         sched-rgn.o \
1082         sched-vis.o \
1083         sdbout.o \
1084         see.o \
1085         simplify-rtx.o \
1086         sparseset.o \
1087         sreal.o \
1088         stack-ptr-mod.o \
1089         stmt.o \
1090         stor-layout.o \
1091         stringpool.o \
1092         targhooks.o \
1093         timevar.o \
1094         toplev.o \
1095         tracer.o \
1096         tree-affine.o \
1097         tree-cfg.o \
1098         tree-cfgcleanup.o \
1099         tree-chrec.o \
1100         tree-complex.o \
1101         tree-data-ref.o \
1102         tree-dfa.o \
1103         tree-dump.o \
1104         tree-eh.o \
1105         tree-gimple.o \
1106         tree-if-conv.o \
1107         tree-into-ssa.o \
1108         tree-iterator.o \
1109         tree-loop-distribution.o \
1110         tree-loop-linear.o \
1111         tree-nested.o \
1112         tree-nrv.o \
1113         tree-object-size.o \
1114         tree-optimize.o \
1115         tree-outof-ssa.o \
1116         tree-parloops.o \
1117         tree-phinodes.o \
1118         tree-predcom.o \
1119         tree-pretty-print.o \
1120         tree-profile.o \
1121         tree-scalar-evolution.o \
1122         tree-sra.o \
1123         tree-ssa-address.o \
1124         tree-ssa-alias.o \
1125         tree-ssa-alias-warnings.o \
1126         tree-ssa-ccp.o \
1127         tree-ssa-coalesce.o \
1128         tree-ssa-copy.o \
1129         tree-ssa-copyrename.o \
1130         tree-ssa-dce.o \
1131         tree-ssa-dom.o \
1132         tree-ssa-dse.o \
1133         tree-ssa-forwprop.o \
1134         tree-ssa-ifcombine.o \
1135         tree-ssa-live.o \
1136         tree-ssa-loop-ch.o \
1137         tree-ssa-loop-im.o \
1138         tree-ssa-loop-ivcanon.o \
1139         tree-ssa-loop-ivopts.o \
1140         tree-ssa-loop-manip.o \
1141         tree-ssa-loop-niter.o \
1142         tree-ssa-loop-prefetch.o \
1143         tree-ssa-loop-unswitch.o \
1144         tree-ssa-loop.o \
1145         tree-ssa-math-opts.o \
1146         tree-ssa-operands.o \
1147         tree-ssa-phiopt.o \
1148         tree-ssa-phiprop.o \
1149         tree-ssa-pre.o \
1150         tree-ssa-propagate.o \
1151         tree-ssa-reassoc.o \
1152         tree-ssa-sccvn.o \
1153         tree-ssa-sink.o \
1154         tree-ssa-structalias.o \
1155         tree-ssa-ter.o \
1156         tree-ssa-threadedge.o \
1157         tree-ssa-threadupdate.o \
1158         tree-ssa-uncprop.o \
1159         tree-ssa.o \
1160         tree-ssanames.o \
1161         tree-stdarg.o \
1162         tree-tailcall.o \
1163         tree-vect-analyze.o \
1164         tree-vect-generic.o \
1165         tree-vect-patterns.o \
1166         tree-vect-transform.o \
1167         tree-vectorizer.o \
1168         tree-vn.o \
1169         tree-vrp.o \
1170         tree.o \
1171         value-prof.o \
1172         var-tracking.o \
1173         varasm.o \
1174         varray.o \
1175         vec.o \
1176         version.o \
1177         vmsdbgout.o \
1178         web.o \
1179         xcoffout.o
1180
1181 # Target object files.
1182 OBJS-md = $(out_object_file)
1183
1184 # Language independent object files which are not used by all languages.
1185 OBJS-archive = \
1186         $(EXTRA_OBJS) \
1187         $(host_hook_obj) \
1188         cgraph.o \
1189         cgraphbuild.o \
1190         cgraphunit.o \
1191         ipa-cp.o \
1192         ipa-inline.o \
1193         ipa-prop.o \
1194         ipa-pure-const.o \
1195         ipa-reference.o \
1196         ipa-struct-reorg.o \
1197         ipa-type-escape.o \
1198         ipa-utils.o \
1199         ipa.o \
1200         matrix-reorg.o \
1201         tree-inline.o \
1202         tree-nomudflap.o \
1203         varpool.o
1204
1205 OBJS = $(OBJS-common) $(OBJS-md) $(OBJS-archive)
1206
1207 OBJS-onestep = libbackend.o $(OBJS-archive)
1208
1209 # This lists all host object files, whether they are included in this
1210 # compilation or not.  This is used for dependency tracking.
1211 ALL_HOST_OBJS = $(GCC_OBJS) $(C_OBJS) $(OBJS) libbackend.o \
1212   @TREEBROWSER@ main.o gccspec.o version.o intl.o prefix.o cppspec.o \
1213   $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS)) \
1214   $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) \
1215   mips-tfile.o mips-tdump.o \
1216   $(PROTO_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS)
1217
1218 BACKEND = main.o @TREEBROWSER@ libbackend.a $(CPPLIB) $(LIBDECNUMBER)
1219
1220 MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \
1221  insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
1222  insn-attr.h insn-attrtab.c insn-opinit.c insn-preds.c insn-constants.h \
1223  tm-preds.h tm-constrs.h \
1224  tree-check.h min-insn-modes.c insn-modes.c insn-modes.h \
1225  genrtl.c genrtl.h gt-*.h gtype-*.h gtype-desc.c gtyp-input.list \
1226  xgcc$(exeext) cpp$(exeext) cc1$(exeext) cc1*-dummy$(exeext) $(EXTRA_PASSES) \
1227  $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
1228  protoize$(exeext) unprotoize$(exeext) \
1229  $(SPECS) collect2$(exeext) \
1230  gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
1231  *.[0-9][0-9].* *.[si] *-checksum.c libbackend.a libgcc.mk
1232
1233 # Defined in libgcc2.c, included only in the static library.
1234 LIB2FUNCS_ST = _eprintf __gcc_bcmp
1235
1236 # Defined in libgcov.c, included only in gcov library
1237 LIBGCOV = _gcov _gcov_merge_add _gcov_merge_single _gcov_merge_delta \
1238     _gcov_fork _gcov_execl _gcov_execlp _gcov_execle \
1239     _gcov_execv _gcov_execvp _gcov_execve \
1240     _gcov_interval_profiler _gcov_pow2_profiler _gcov_one_value_profiler \
1241     _gcov_indirect_call_profiler _gcov_average_profiler _gcov_ior_profiler \
1242     _gcov_merge_ior
1243
1244 FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
1245     _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
1246     _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
1247     _sf_to_df _sf_to_tf _thenan_sf _sf_to_usi _usi_to_sf
1248
1249 DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
1250     _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \
1251     _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \
1252     _df_to_sf _df_to_tf _thenan_df _df_to_usi _usi_to_df
1253
1254 TPBIT_FUNCS = _pack_tf _unpack_tf _addsub_tf _mul_tf _div_tf \
1255     _fpcmp_parts_tf _compare_tf _eq_tf _ne_tf _gt_tf _ge_tf \
1256     _lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \
1257     _tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf
1258
1259 D32PBIT_FUNCS = _addsub_sd _div_sd _mul_sd _plus_sd _minus_sd \
1260         _eq_sd _ne_sd _lt_sd _gt_sd _le_sd _ge_sd \
1261         _sd_to_si _sd_to_di _sd_to_usi _sd_to_udi \
1262         _si_to_sd _di_to_sd _usi_to_sd _udi_to_sd \
1263         _sd_to_sf _sd_to_df _sd_to_xf _sd_to_tf \
1264         _sf_to_sd _df_to_sd _xf_to_sd _tf_to_sd \
1265         _sd_to_dd _sd_to_td _unord_sd _conv_sd
1266
1267 D64PBIT_FUNCS = _addsub_dd _div_dd _mul_dd _plus_dd _minus_dd \
1268         _eq_dd _ne_dd _lt_dd _gt_dd _le_dd _ge_dd \
1269         _dd_to_si _dd_to_di _dd_to_usi _dd_to_udi \
1270         _si_to_dd _di_to_dd _usi_to_dd _udi_to_dd \
1271         _dd_to_sf _dd_to_df _dd_to_xf _dd_to_tf \
1272         _sf_to_dd _df_to_dd _xf_to_dd _tf_to_dd \
1273         _dd_to_sd _dd_to_td _unord_dd _conv_dd
1274
1275 D128PBIT_FUNCS = _addsub_td _div_td _mul_td _plus_td _minus_td \
1276         _eq_td _ne_td _lt_td _gt_td _le_td _ge_td \
1277         _td_to_si _td_to_di _td_to_usi _td_to_udi \
1278         _si_to_td _di_to_td _usi_to_td _udi_to_td \
1279         _td_to_sf _td_to_df _td_to_xf _td_to_tf \
1280         _sf_to_td _df_to_td _xf_to_td _tf_to_td \
1281         _td_to_sd _td_to_dd _unord_td _conv_td
1282
1283 # These might cause a divide overflow trap and so are compiled with
1284 # unwinder info.
1285 LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
1286
1287 #\f
1288 # Language makefile fragments.
1289
1290 # The following targets define the interface between us and the languages.
1291 #
1292 # all.cross, start.encap, rest.encap,
1293 # install-common, install-info, install-man,
1294 # uninstall,
1295 # mostlyclean, clean, distclean, maintainer-clean,
1296 #
1297 # Each language is linked in with a series of hooks.  The name of each
1298 # hooked is "lang.${target_name}" (eg: lang.info).  Configure computes
1299 # and adds these here.  We use double-colon rules for some of the hooks;
1300 # double-colon rules should be preferred for any new hooks.
1301
1302 # language hooks, generated by configure
1303 @language_hooks@
1304
1305 # per-language makefile fragments
1306 ifneq ($(LANG_MAKEFRAGS),)
1307 include $(LANG_MAKEFRAGS)
1308 endif
1309
1310 # target and host overrides must follow the per-language makefile fragments
1311 # so they can override or augment language-specific variables
1312
1313 # target overrides
1314 ifneq ($(tmake_file),)
1315 include $(tmake_file)
1316 endif
1317
1318 # host overrides
1319 ifneq ($(xmake_file),)
1320 include $(xmake_file)
1321 endif
1322
1323 #\f
1324
1325 # -----------------------------
1326 # Rebuilding this configuration
1327 # -----------------------------
1328
1329 # On the use of stamps:
1330 # Consider the example of tree-check.h. It is constructed with build/gencheck.
1331 # A simple rule to build tree-check.h would be
1332 # tree-check.h: build/gencheck$(build_exeext)
1333 #       $(RUN_GEN) build/gencheck$(build_exeext) > tree-check.h
1334 #
1335 # but tree-check.h doesn't change every time gencheck changes. It would the
1336 # nice if targets that depend on tree-check.h wouldn't be rebuilt
1337 # unnecessarily when tree-check.h is unchanged. To make this, tree-check.h
1338 # must not be overwritten with a identical copy. One solution is to use a
1339 # temporary file
1340 # tree-check.h: build/gencheck$(build_exeext)
1341 #       $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
1342 #       $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
1343 #
1344 # This solution has a different problem. Since the time stamp of tree-check.h
1345 # is unchanged, make will try to update tree-check.h every time it runs.
1346 # To prevent this, one can add a stamp
1347 # tree-check.h: s-check
1348 # s-check : build/gencheck$(build_exeext)
1349 #       $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
1350 #       $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
1351 #       $(STAMP) s-check
1352 #
1353 # The problem with this solution is that make thinks that tree-check.h is
1354 # always unchanged. Make must be deceived into thinking that tree-check.h is
1355 # rebuild by the "tree-check.h: s-check" rule. To do this, add a dummy command:
1356 # tree-check.h: s-check; @true
1357 # s-check : build/gencheck$(build_exeext)
1358 #       $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
1359 #       $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
1360 #       $(STAMP) s-check
1361 #
1362 # This is what is done in this makefile. Note that mkconfig.sh has a
1363 # move-if-change built-in
1364
1365 Makefile: config.status $(srcdir)/Makefile.in $(LANG_MAKEFRAGS)
1366         LANGUAGES="$(CONFIG_LANGUAGES)" \
1367         CONFIG_HEADERS= \
1368         CONFIG_SHELL="$(SHELL)" \
1369         CONFIG_FILES=$@ $(SHELL) config.status
1370
1371 config.h: cs-config.h ; @true
1372 bconfig.h: cs-bconfig.h ; @true
1373 tconfig.h: cs-tconfig.h ; @true
1374 tm.h: cs-tm.h ; @true
1375 tm_p.h: cs-tm_p.h ; @true
1376
1377 cs-config.h: Makefile
1378         TARGET_CPU_DEFAULT="" \
1379         HEADERS="$(host_xm_include_list)" DEFINES="$(host_xm_defines)" \
1380         $(SHELL) $(srcdir)/mkconfig.sh config.h
1381
1382 cs-bconfig.h: Makefile
1383         TARGET_CPU_DEFAULT="" \
1384         HEADERS="$(build_xm_include_list)" DEFINES="$(build_xm_defines)" \
1385         $(SHELL) $(srcdir)/mkconfig.sh bconfig.h
1386
1387 cs-tconfig.h: Makefile
1388         TARGET_CPU_DEFAULT="" \
1389         HEADERS="$(xm_include_list)" DEFINES="USED_FOR_TARGET $(xm_defines)" \
1390         $(SHELL) $(srcdir)/mkconfig.sh tconfig.h
1391
1392 cs-tm.h: Makefile
1393         TARGET_CPU_DEFAULT="$(target_cpu_default)" \
1394         HEADERS="$(tm_include_list)" DEFINES="$(tm_defines)" \
1395         $(SHELL) $(srcdir)/mkconfig.sh tm.h
1396
1397 cs-tm_p.h: Makefile
1398         TARGET_CPU_DEFAULT="" \
1399         HEADERS="$(tm_p_include_list)" DEFINES="" \
1400         $(SHELL) $(srcdir)/mkconfig.sh tm_p.h
1401
1402 # Don't automatically run autoconf, since configure.ac might be accidentally
1403 # newer than configure.  Also, this writes into the source directory which
1404 # might be on a read-only file system.  If configured for maintainer mode
1405 # then do allow autoconf to be run.
1406
1407 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/aclocal.m4 \
1408   $(srcdir)/acinclude.m4
1409         (cd $(srcdir) && autoconf)
1410
1411 gccbug: $(srcdir)/gccbug.in
1412         CONFIG_FILES=gccbug CONFIG_HEADERS= ./config.status
1413
1414 # cstamp-h.in controls rebuilding of config.in.
1415 # It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't
1416 # delete it.  A stamp file is needed as autoheader won't update the file if
1417 # nothing has changed.
1418 # It remains in the source directory and is part of the distribution.
1419 # This follows what is done in shellutils, fileutils, etc.
1420 # "echo timestamp" is used instead of touch to be consistent with other
1421 # packages that use autoconf (??? perhaps also to avoid problems with patch?).
1422 # ??? Newer versions have a maintainer mode that may be useful here.
1423
1424 # Don't run autoheader automatically either.
1425 # Only run it if maintainer mode is enabled.
1426 @MAINT@ $(srcdir)/config.in: $(srcdir)/cstamp-h.in
1427 @MAINT@ $(srcdir)/cstamp-h.in: $(srcdir)/configure.ac
1428 @MAINT@ (cd $(srcdir) && autoheader)
1429 @MAINT@ @rm -f $(srcdir)/cstamp-h.in
1430 @MAINT@ echo timestamp > $(srcdir)/cstamp-h.in
1431 auto-host.h: cstamp-h ; @true
1432 cstamp-h: config.in config.status
1433         CONFIG_HEADERS=auto-host.h:config.in \
1434         CONFIG_FILES= \
1435         LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status
1436
1437 # Really, really stupid make features, such as SUN's KEEP_STATE, may force
1438 # a target to build even if it is up-to-date.  So we must verify that
1439 # config.status does not exist before failing.
1440 config.status: $(srcdir)/configure $(srcdir)/config.gcc
1441         @if [ ! -f config.status ] ; then \
1442           echo You must configure gcc.  Look at http://gcc.gnu.org/install/ for details.; \
1443           false; \
1444         else \
1445           LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status --recheck; \
1446         fi
1447
1448 # --------
1449 # UNSORTED
1450 # --------
1451
1452 # Provide quickstrap as a target that people can type into the gcc directory,
1453 # and that fails if you're not into it.
1454 quickstrap: all
1455         cd $(toplevel_builddir) && $(MAKE) all-target-libgcc
1456
1457 all.internal: start.encap rest.encap doc
1458 # This is what to compile if making a cross-compiler.
1459 all.cross: native gcc-cross$(exeext) cpp$(exeext) specs \
1460         libgcc-support lang.all.cross doc @GENINSRC@ srcextra
1461 # This is what must be made before installing GCC and converting libraries.
1462 start.encap: native xgcc$(exeext) cpp$(exeext) specs \
1463         libgcc-support lang.start.encap @GENINSRC@ srcextra
1464 # These can't be made until after GCC can run.
1465 rest.encap: $(STMP_FIXPROTO) lang.rest.encap
1466 # This is what is made with the host's compiler
1467 # whether making a cross compiler or not.
1468 native: config.status auto-host.h build-@POSUB@ $(LANGUAGES) \
1469         $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(COLLECT2)
1470
1471 # Define the names for selecting languages in LANGUAGES.
1472 c: cc1$(exeext)
1473
1474 # Tell GNU make these are phony targets.
1475 .PHONY: c proto
1476
1477 # On the target machine, finish building a cross compiler.
1478 # This does the things that can't be done on the host machine.
1479 rest.cross: specs
1480
1481 # Recompile all the language-independent object files.
1482 # This is used only if the user explicitly asks for it.
1483 compilations: $(BACKEND)
1484
1485 # This archive is strictly for the host.
1486 libbackend.a: $(OBJS@onestep@)
1487         -rm -rf libbackend.a
1488         $(AR) $(AR_FLAGS) libbackend.a $(OBJS@onestep@)
1489         -$(RANLIB) $(RANLIB_FLAGS) libbackend.a
1490
1491 # We call this executable `xgcc' rather than `gcc'
1492 # to avoid confusion if the current directory is in the path
1493 # and CC is `gcc'.  It is renamed to `gcc' when it is installed.
1494 xgcc$(exeext): $(GCC_OBJS) gccspec.o version.o intl.o prefix.o \
1495    $(LIBDEPS) $(EXTRA_GCC_OBJS)
1496         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) gccspec.o \
1497           intl.o prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
1498
1499 # cpp is to cpp0 as gcc is to cc1.
1500 # The only difference from xgcc is that it's linked with cppspec.o
1501 # instead of gccspec.o.
1502 cpp$(exeext): $(GCC_OBJS) cppspec.o version.o intl.o prefix.o \
1503    $(LIBDEPS) $(EXTRA_GCC_OBJS)
1504         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) cppspec.o \
1505           intl.o prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
1506
1507 # Dump a specs file to make -B./ read these specs over installed ones.
1508 $(SPECS): xgcc$(exeext)
1509         $(GCC_FOR_TARGET) -dumpspecs > tmp-specs
1510         mv tmp-specs $(SPECS)
1511
1512 # We do want to create an executable named `xgcc', so we can use it to
1513 # compile libgcc2.a.
1514 # Also create gcc-cross, so that install-common will install properly.
1515 gcc-cross$(exeext): xgcc$(exeext)
1516         cp xgcc$(exeext) gcc-cross$(exeext)
1517
1518 cc1-dummy$(exeext): $(C_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS)
1519         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) dummy-checksum.o \
1520           $(BACKEND) $(LIBS) $(GMPLIBS)
1521
1522 cc1-checksum.c : cc1-dummy$(exeext) build/genchecksum$(build_exeext)
1523         build/genchecksum$(build_exeext) cc1-dummy$(exeext) > $@
1524
1525 cc1$(exeext): $(C_OBJS) cc1-checksum.o $(BACKEND) $(LIBDEPS)
1526         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) cc1-checksum.o \
1527           $(BACKEND) $(LIBS) $(GMPLIBS)
1528
1529 #\f
1530 # Build libgcc.a.
1531
1532 LIB2ADD = $(LIB2FUNCS_EXTRA)
1533 LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA)
1534
1535 # All source files for libgcc are either in the source directory (in
1536 # which case they will start with $(srcdir)), or generated into the build
1537 # directory (in which case they will be relative paths).
1538 srcdirify = $(patsubst $(srcdir)%,$$(gcc_srcdir)%,$(filter $(srcdir)%,$(1))) \
1539             $(patsubst %,$$(gcc_objdir)/%,$(filter-out $(srcdir)%,$(1)))
1540
1541 # The distinction between these two variables is no longer relevant,
1542 # so we combine them.  Sort removes duplicates.
1543 GCC_EXTRA_PARTS := $(sort $(EXTRA_MULTILIB_PARTS) $(EXTRA_PARTS))
1544
1545 libgcc-support: libgcc.mvars stmp-int-hdrs $(STMP_FIXPROTO) $(TCONFIG_H) \
1546         $(MACHMODE_H) $(FPBIT) $(DPBIT) $(TPBIT) $(LIB2ADD) \
1547         $(LIB2ADD_ST) $(LIB2ADDEH) $(srcdir)/emutls.c gcov-iov.h $(SFP_MACHINE)
1548
1549 libgcc.mvars: config.status Makefile $(LIB2ADD) $(LIB2ADD_ST) specs \
1550                 xgcc$(exeext)
1551         : > tmp-libgcc.mvars
1552         echo LIB1ASMFUNCS = '$(LIB1ASMFUNCS)' >> tmp-libgcc.mvars
1553         echo LIB1ASMSRC = '$(LIB1ASMSRC)' >> tmp-libgcc.mvars
1554         echo LIB2FUNCS_ST = '$(LIB2FUNCS_ST)' >> tmp-libgcc.mvars
1555         echo LIB2FUNCS_EXCLUDE = '$(LIB2FUNCS_EXCLUDE)' >> tmp-libgcc.mvars
1556         echo LIBGCOV = '$(LIBGCOV)' >> tmp-libgcc.mvars
1557         echo LIB2ADD = '$(call srcdirify,$(LIB2ADD))' >> tmp-libgcc.mvars
1558         echo LIB2ADD_ST = '$(call srcdirify,$(LIB2ADD_ST))' >> tmp-libgcc.mvars
1559         echo LIB2ADDEH = '$(call srcdirify,$(LIB2ADDEH) $(srcdir)/emutls.c)' >> tmp-libgcc.mvars
1560         echo LIB2ADDEHSTATIC = '$(call srcdirify,$(LIB2ADDEHSTATIC) $(srcdir)/emutls.c)' >> tmp-libgcc.mvars
1561         echo LIB2ADDEHSHARED = '$(call srcdirify,$(LIB2ADDEHSHARED) $(srcdir)/emutls.c)' >> tmp-libgcc.mvars
1562         echo LIB2_SIDITI_CONV_FUNCS = '$(LIB2_SIDITI_CONV_FUNCS)' >> tmp-libgcc.mvars
1563         echo LIBUNWIND = '$(call srcdirify,$(LIBUNWIND))' >> tmp-libgcc.mvars
1564         echo SHLIBUNWIND_LINK = '$(SHLIBUNWIND_LINK)' >> tmp-libgcc.mvars
1565         echo SHLIBUNWIND_INSTALL = '$(SHLIBUNWIND_INSTALL)' >> tmp-libgcc.mvars
1566         echo FPBIT = '$(FPBIT)' >> tmp-libgcc.mvars
1567         echo FPBIT_FUNCS = '$(FPBIT_FUNCS)' >> tmp-libgcc.mvars
1568         echo LIB2_DIVMOD_FUNCS = '$(LIB2_DIVMOD_FUNCS)' >> tmp-libgcc.mvars
1569         echo DPBIT = '$(DPBIT)' >> tmp-libgcc.mvars
1570         echo DPBIT_FUNCS = '$(DPBIT_FUNCS)' >> tmp-libgcc.mvars
1571         echo TPBIT = '$(TPBIT)' >> tmp-libgcc.mvars
1572         echo TPBIT_FUNCS = '$(TPBIT_FUNCS)' >> tmp-libgcc.mvars
1573         echo DFP_ENABLE = '$(DFP_ENABLE)' >> tmp-libgcc.mvars
1574         echo DFP_CFLAGS='$(DFP_CFLAGS)' >> tmp-libgcc.mvars
1575         echo D32PBIT='$(D32PBIT)' >> tmp-libgcc.mvars
1576         echo D32PBIT_FUNCS='$(D32PBIT_FUNCS)' >> tmp-libgcc.mvars
1577         echo D64PBIT='$(D64PBIT)' >> tmp-libgcc.mvars
1578         echo D64PBIT_FUNCS='$(D64PBIT_FUNCS)' >> tmp-libgcc.mvars
1579         echo D128PBIT='$(D128PBIT)' >> tmp-libgcc.mvars
1580         echo D128PBIT_FUNCS='$(D128PBIT_FUNCS)' >> tmp-libgcc.mvars
1581         echo GCC_EXTRA_PARTS = '$(GCC_EXTRA_PARTS)' >> tmp-libgcc.mvars
1582         echo SHLIB_LINK = '$(subst $(GCC_FOR_TARGET),$$(GCC_FOR_TARGET),$(SHLIB_LINK))' >> tmp-libgcc.mvars
1583         echo SHLIB_INSTALL = '$(SHLIB_INSTALL)' >> tmp-libgcc.mvars
1584         echo SHLIB_EXT = '$(SHLIB_EXT)' >> tmp-libgcc.mvars
1585         echo SHLIB_MKMAP = '$(call srcdirify,$(SHLIB_MKMAP))' >> tmp-libgcc.mvars
1586         echo SHLIB_MKMAP_OPTS = '$(SHLIB_MKMAP_OPTS)' >> tmp-libgcc.mvars
1587         echo SHLIB_MAPFILES = '$(call srcdirify,$(SHLIB_MAPFILES))' >> tmp-libgcc.mvars
1588         echo SHLIB_NM_FLAGS = '$(SHLIB_NM_FLAGS)' >> tmp-libgcc.mvars
1589         echo LIBGCC2_CFLAGS = '$(LIBGCC2_CFLAGS)' >> tmp-libgcc.mvars
1590         echo CRTSTUFF_CFLAGS = '$(CRTSTUFF_CFLAGS)' >> tmp-libgcc.mvars
1591         echo CRTSTUFF_T_CFLAGS = '$(CRTSTUFF_T_CFLAGS)' >> tmp-libgcc.mvars
1592         echo CRTSTUFF_T_CFLAGS_S = '$(CRTSTUFF_T_CFLAGS_S)' >> tmp-libgcc.mvars
1593
1594         mv tmp-libgcc.mvars libgcc.mvars
1595
1596 # Use the genmultilib shell script to generate the information the gcc
1597 # driver program needs to select the library directory based on the
1598 # switches.
1599 multilib.h: s-mlib; @true
1600 s-mlib: $(srcdir)/genmultilib Makefile
1601         if test @enable_multilib@ = yes \
1602            || test -n "$(MULTILIB_OSDIRNAMES)"; then \
1603           $(SHELL) $(srcdir)/genmultilib \
1604             "$(MULTILIB_OPTIONS)" \
1605             "$(MULTILIB_DIRNAMES)" \
1606             "$(MULTILIB_MATCHES)" \
1607             "$(MULTILIB_EXCEPTIONS)" \
1608             "$(MULTILIB_EXTRA_OPTS)" \
1609             "$(MULTILIB_EXCLUSIONS)" \
1610             "$(MULTILIB_OSDIRNAMES)" \
1611             "@enable_multilib@" \
1612             > tmp-mlib.h; \
1613         else \
1614           $(SHELL) $(srcdir)/genmultilib '' '' '' '' '' '' '' no \
1615             > tmp-mlib.h; \
1616         fi
1617         $(SHELL) $(srcdir)/../move-if-change tmp-mlib.h multilib.h
1618         $(STAMP) s-mlib
1619
1620 # Compile two additional files that are linked with every program
1621 # linked using GCC on systems using COFF or ELF, for the sake of C++
1622 # constructors.
1623 $(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
1624   gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
1625         $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
1626           -c $(srcdir)/crtstuff.c -DCRT_BEGIN \
1627           -o $(T)crtbegin$(objext)
1628
1629 $(T)crtend.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
1630   gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
1631         $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
1632           -c $(srcdir)/crtstuff.c -DCRT_END \
1633           -o $(T)crtend$(objext)
1634
1635 # These are versions of crtbegin and crtend for shared libraries.
1636 $(T)crtbeginS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
1637   gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
1638         $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
1639           -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O \
1640           -o $(T)crtbeginS$(objext)
1641
1642 $(T)crtendS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
1643   gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
1644         $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
1645           -c $(srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O \
1646           -o $(T)crtendS$(objext)
1647
1648 # This is a version of crtbegin for -static links.
1649 $(T)crtbeginT.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
1650   gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
1651         $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
1652           -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O \
1653           -o $(T)crtbeginT$(objext)
1654
1655 # Compile the start modules crt0.o and mcrt0.o that are linked with
1656 # every program
1657 $(T)crt0.o: s-crt0 ; @true
1658 $(T)mcrt0.o: s-crt0; @true
1659
1660 s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
1661         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
1662           -o $(T)crt0.o -c $(CRT0_S)
1663         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
1664           -o $(T)mcrt0.o -c $(MCRT0_S)
1665         $(STAMP) s-crt0
1666 #\f
1667 # Compiling object files from source files.
1668
1669 srcextra: gcc.srcextra lang.srcextra
1670
1671 gcc.srcextra: gengtype-lex.c
1672         -cp -p $^ $(srcdir)
1673
1674 COLLECT2_OBJS = collect2.o tlink.o intl.o version.o
1675 COLLECT2_LIBS = @COLLECT2_LIBS@
1676 collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS)
1677 # Don't try modifying collect2 (aka ld) in place--it might be linking this.
1678         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o T$@ \
1679                 $(COLLECT2_OBJS) $(LIBS) $(COLLECT2_LIBS)
1680         mv -f T$@ $@
1681
1682 # Language-independent files.
1683
1684 ifneq ($(SHLIB_LINK),)
1685 ifeq (@enable_shared@,yes)
1686 DRIVER_SHLIB = -DENABLE_SHARED_LIBGCC
1687 else
1688 DRIVER_SHLIB =
1689 endif
1690 else
1691 DRIVER_SHLIB =
1692 endif
1693
1694 DRIVER_DEFINES = \
1695   -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
1696   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
1697   -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \
1698   -DDEFAULT_TARGET_VERSION=\"$(version)\" \
1699   -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \
1700   -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
1701   -DTOOLDIR_BASE_PREFIX=\"$(libsubdir_to_prefix)$(prefix_to_exec_prefix)\" \
1702   @TARGET_SYSTEM_ROOT_DEFINE@ \
1703   $(VALGRIND_DRIVER_DEFINES) \
1704   $(DRIVER_SHLIB)
1705
1706 gencheck.h : s-gencheck ; @true
1707 s-gencheck : Makefile
1708         ltf="$(lang_tree_files)"; for f in $$ltf; do \
1709             echo "#include \"$$f\""; \
1710         done | sed 's|$(srcdir)/||' > tmp-gencheck.h
1711         $(SHELL) $(srcdir)/../move-if-change tmp-gencheck.h gencheck.h
1712         $(STAMP) s-gencheck
1713
1714 specs.h : s-specs ; @true
1715 s-specs : Makefile
1716         lsf="$(lang_specs_files)"; for f in $$lsf; do \
1717             echo "#include \"$$f\""; \
1718         done | sed 's|$(srcdir)/||' > tmp-specs.h
1719         $(SHELL) $(srcdir)/../move-if-change tmp-specs.h specs.h
1720         $(STAMP) s-specs
1721
1722 optionlist: s-options ; @true
1723 s-options: $(ALL_OPT_FILES) Makefile $(srcdir)/opt-gather.awk
1724         $(AWK) -f $(srcdir)/opt-gather.awk $(ALL_OPT_FILES) > tmp-optionlist
1725         $(SHELL) $(srcdir)/../move-if-change tmp-optionlist optionlist
1726         $(STAMP) s-options
1727
1728 options.c: optionlist $(srcdir)/opt-functions.awk $(srcdir)/optc-gen.awk
1729         $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/optc-gen.awk \
1730                -v header_name="config.h system.h coretypes.h tm.h" < $< > $@
1731
1732 options.h: s-options-h ; @true
1733 s-options-h: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opth-gen.awk
1734         $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opth-gen.awk \
1735                < $< > tmp-options.h
1736         $(SHELL) $(srcdir)/../move-if-change tmp-options.h options.h
1737         $(STAMP) $@
1738
1739 dumpvers: dumpvers.c
1740
1741 # Build auxiliary files that support ecoff format.
1742 mips-tfile: mips-tfile.o version.o $(LIBDEPS)
1743         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
1744
1745 mips-tdump: mips-tdump.o version.o $(LIBDEPS)
1746         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS)
1747
1748 #\f
1749 # Generate header and source files from the machine description,
1750 # and compile them.
1751
1752 .PRECIOUS: insn-config.h insn-flags.h insn-codes.h insn-constants.h \
1753   insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
1754   insn-attr.h insn-attrtab.c insn-preds.c
1755
1756 # Dependencies for the md file.  The first time through, we just assume
1757 # the md file itself and the generated dependency file (in order to get
1758 # it built).  The second time through we have the dependency file.
1759 -include mddeps.mk
1760 MD_DEPS = s-mddeps $(md_file) $(MD_INCLUDES)
1761
1762 s-mddeps: $(md_file) $(MD_INCLUDES) build/genmddeps$(build_exeext)
1763         $(RUN_GEN) build/genmddeps$(build_exeext) $(md_file) > tmp-mddeps
1764         $(SHELL) $(srcdir)/../move-if-change tmp-mddeps mddeps.mk
1765         $(STAMP) s-mddeps
1766
1767 # For each of the files generated by running a generator program over
1768 # the machine description, the following pair of static pattern rules
1769 # runs the generator program only if the machine description has changed,
1770 # but touches the target file only when its contents actually change.
1771 # The "; @true" construct forces Make to recheck the timestamp on the
1772 # target file.
1773
1774 simple_generated_h = insn-attr.h insn-codes.h insn-config.h insn-flags.h
1775
1776 simple_generated_c = insn-attrtab.c insn-automata.c insn-emit.c \
1777                      insn-extract.c insn-opinit.c insn-output.c \
1778                      insn-peep.c insn-recog.c
1779
1780 $(simple_generated_h): insn-%.h: s-%; @true
1781
1782 $(simple_generated_h:insn-%.h=s-%): s-%: build/gen%$(build_exeext) \
1783   $(MD_DEPS) insn-conditions.md
1784         $(RUN_GEN) build/gen$*$(build_exeext) $(md_file) \
1785           insn-conditions.md > tmp-$*.h
1786         $(SHELL) $(srcdir)/../move-if-change tmp-$*.h insn-$*.h
1787         $(STAMP) s-$*
1788
1789 $(simple_generated_c): insn-%.c: s-%; @true
1790 $(simple_generated_c:insn-%.c=s-%): s-%: build/gen%$(build_exeext) \
1791   $(MD_DEPS) insn-conditions.md
1792         $(RUN_GEN) build/gen$*$(build_exeext) $(md_file) \
1793           insn-conditions.md > tmp-$*.c
1794         $(SHELL) $(srcdir)/../move-if-change tmp-$*.c insn-$*.c
1795         $(STAMP) s-$*
1796
1797 # genconstants needs to run before insn-conditions.md is available
1798 # (because the constants may be used in the conditions).
1799 insn-constants.h: s-constants; @true
1800 s-constants: build/genconstants$(build_exeext) $(MD_DEPS)
1801         $(RUN_GEN) build/genconstants$(build_exeext) $(md_file) \
1802           > tmp-constants.h
1803         $(SHELL) $(srcdir)/../move-if-change tmp-constants.h insn-constants.h
1804         $(STAMP) s-constants
1805
1806 # gencheck doesn't read the machine description, and the file produced
1807 # doesn't use the insn-* convention.
1808 tree-check.h: s-check ; @true
1809 s-check : build/gencheck$(build_exeext)
1810         $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
1811         $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
1812         $(STAMP) s-check
1813
1814 # gencondmd doesn't use the standard naming convention.
1815 gencondmd.c: s-conditions; @true
1816 s-conditions: $(MD_DEPS) build/genconditions$(build_exeext)
1817         $(RUN_GEN) build/genconditions$(build_exeext) $(md_file) > tmp-condmd.c
1818         $(SHELL) $(srcdir)/../move-if-change tmp-condmd.c gencondmd.c
1819         $(STAMP) s-conditions
1820
1821 insn-conditions.md: s-condmd; @true
1822 s-condmd: build/gencondmd$(build_exeext)
1823         $(RUN_GEN) build/gencondmd$(build_exeext) > tmp-cond.md
1824         $(SHELL) $(srcdir)/../move-if-change tmp-cond.md insn-conditions.md
1825         $(STAMP) s-condmd
1826
1827
1828 # These files are generated by running the same generator more than
1829 # once with different options, so they have custom rules.  The
1830 # stampfile idiom is the same.
1831 genrtl.c: s-genrtl; @true
1832 genrtl.h: s-genrtl-h; @true
1833
1834 s-genrtl: build/gengenrtl$(build_exeext)
1835         $(RUN_GEN) build/gengenrtl$(build_exeext) > tmp-genrtl.c
1836         $(SHELL) $(srcdir)/../move-if-change tmp-genrtl.c genrtl.c
1837         $(STAMP) s-genrtl
1838
1839 s-genrtl-h: build/gengenrtl$(build_exeext)
1840         $(RUN_GEN) build/gengenrtl$(build_exeext) -h > tmp-genrtl.h
1841         $(SHELL) $(srcdir)/../move-if-change tmp-genrtl.h genrtl.h
1842         $(STAMP) s-genrtl-h
1843
1844 insn-modes.c: s-modes; @true
1845 insn-modes.h: s-modes-h; @true
1846 min-insn-modes.c: s-modes-m; @true
1847
1848 s-modes: build/genmodes$(build_exeext)
1849         $(RUN_GEN) build/genmodes$(build_exeext) > tmp-modes.c
1850         $(SHELL) $(srcdir)/../move-if-change tmp-modes.c insn-modes.c
1851         $(STAMP) s-modes
1852
1853 s-modes-h: build/genmodes$(build_exeext)
1854         $(RUN_GEN) build/genmodes$(build_exeext) -h > tmp-modes.h
1855         $(SHELL) $(srcdir)/../move-if-change tmp-modes.h insn-modes.h
1856         $(STAMP) s-modes-h
1857
1858 s-modes-m: build/genmodes$(build_exeext)
1859         $(RUN_GEN) build/genmodes$(build_exeext) -m > tmp-min-modes.c
1860         $(SHELL) $(srcdir)/../move-if-change tmp-min-modes.c min-insn-modes.c
1861         $(STAMP) s-modes-m
1862
1863 insn-preds.c: s-preds; @true
1864 tm-preds.h: s-preds-h; @true
1865 tm-constrs.h: s-constrs-h; @true
1866
1867 s-preds: $(MD_DEPS) build/genpreds$(build_exeext)
1868         $(RUN_GEN) build/genpreds$(build_exeext) $(md_file) > tmp-preds.c
1869         $(SHELL) $(srcdir)/../move-if-change tmp-preds.c insn-preds.c
1870         $(STAMP) s-preds
1871
1872 s-preds-h: $(MD_DEPS) build/genpreds$(build_exeext)
1873         $(RUN_GEN) build/genpreds$(build_exeext) -h $(md_file) > tmp-preds.h
1874         $(SHELL) $(srcdir)/../move-if-change tmp-preds.h tm-preds.h
1875         $(STAMP) s-preds-h
1876
1877 s-constrs-h: $(MD_DEPS) build/genpreds$(build_exeext)
1878         $(RUN_GEN) build/genpreds$(build_exeext) -c $(md_file) > tmp-constrs.h
1879         $(SHELL) $(srcdir)/../move-if-change tmp-constrs.h tm-constrs.h
1880         $(STAMP) s-constrs-h
1881
1882 GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
1883   $(host_xm_file_list) \
1884   $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \
1885   $(srcdir)/alias.h $(srcdir)/coverage.c $(srcdir)/rtl.h \
1886   $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/function.h \
1887   $(srcdir)/libfuncs.h $(srcdir)/../libcpp/include/symtab.h \
1888   $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \
1889   $(srcdir)/fixed-value.h \
1890   $(srcdir)/ipa-reference.h $(srcdir)/output.h $(srcdir)/cfgloop.h \
1891   $(srcdir)/cselib.h $(srcdir)/basic-block.h  $(srcdir)/cgraph.h \
1892   $(srcdir)/reload.h $(srcdir)/caller-save.c \
1893   $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \
1894   $(srcdir)/ipa-prop.c $(srcdir)/ipa-cp.c $(srcdir)/ipa-inline.c $(srcdir)/matrix-reorg.c \
1895   $(srcdir)/dbxout.c $(srcdir)/ipa-struct-reorg.c $(srcdir)/dwarf2out.c $(srcdir)/dwarf2asm.c \
1896   $(srcdir)/dojump.c \
1897   $(srcdir)/emit-rtl.c $(srcdir)/except.c $(srcdir)/explow.c $(srcdir)/expr.c \
1898   $(srcdir)/function.c $(srcdir)/except.h \
1899   $(srcdir)/gcse.c $(srcdir)/integrate.c $(srcdir)/lists.c $(srcdir)/optabs.c \
1900   $(srcdir)/profile.c $(srcdir)/regclass.c \
1901   $(srcdir)/reg-stack.c $(srcdir)/cfglayout.c $(srcdir)/cfglayout.h \
1902   $(srcdir)/sdbout.c $(srcdir)/stor-layout.c \
1903   $(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
1904   $(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h $(srcdir)/tree-scalar-evolution.c \
1905   $(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \
1906   $(srcdir)/tree-phinodes.c $(srcdir)/tree-cfg.c \
1907   $(srcdir)/tree-dfa.c $(srcdir)/tree-ssa-propagate.c \
1908   $(srcdir)/tree-iterator.c $(srcdir)/gimplify.c \
1909   $(srcdir)/tree-chrec.h $(srcdir)/tree-vect-generic.c \
1910   $(srcdir)/tree-ssa-operands.h \
1911   $(srcdir)/tree-profile.c $(srcdir)/tree-nested.c \
1912   $(srcdir)/ipa-reference.c $(srcdir)/tree-ssa-structalias.h \
1913   $(srcdir)/tree-ssa-structalias.c $(srcdir)/tree-parloops.c \
1914   $(srcdir)/omp-low.c $(srcdir)/varpool.c \
1915   $(srcdir)/targhooks.c $(out_file) $(srcdir)/passes.c $(srcdir)/cgraphunit.c \
1916   @all_gtfiles@
1917
1918 GTFILES_H = $(subst /,-, $(patsubst $(srcdir)/%,gt-%, $(patsubst %.c,%.h, \
1919                   $(filter %.c, $(GTFILES)))))
1920
1921 GTFILES_LANG_H = $(patsubst [%], gtype-%.h, $(filter [%], $(GTFILES)))
1922 ALL_GTFILES_H := $(sort $(GTFILES_H) $(GTFILES_LANG_H))
1923
1924 # $(GTFILES) may be too long to put on a command line, so we have to
1925 # write it out to a file (taking care not to do that in a way that
1926 # overflows a command line!) and then have gengtype read the file in.
1927 # The extra blank line in this definition is crucial: it makes the
1928 # $(foreach ...) below expand to many lines instead of one.
1929
1930 define echo_to_gi.list
1931 echo '$(gtyp)' >> tmp-gi.list
1932
1933 endef
1934
1935 $(ALL_GTFILES_H) gtype-desc.c gtype-desc.h : s-gtype ; @true
1936
1937 gtyp-input.list: s-gtyp-input ; @true
1938 s-gtyp-input: Makefile
1939         $(foreach gtyp, $(GTFILES), $(echo_to_gi.list))
1940         $(SHELL) $(srcdir)/../move-if-change tmp-gi.list gtyp-input.list
1941         $(STAMP) s-gtyp-input
1942
1943 s-gtype: build/gengtype$(build_exeext) $(filter-out [%], $(GTFILES)) \
1944          gtyp-input.list
1945         $(RUN_GEN) build/gengtype$(build_exeext) $(srcdir) gtyp-input.list
1946         $(STAMP) s-gtype
1947
1948 #\f
1949 # How to compile object files to run on the build machine.
1950
1951 BUILDCOMPILE.base = $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -o $@
1952 ifeq ($(BUILD_DEPMODE),depmode=gcc3)
1953 BUILDCOMPILE = $(BUILDCOMPILE.base) -MT $@ -MMD -MP -MF build/$(DEPDIR)/$(*F).Po
1954 else
1955 BUILDCOMPILE = source='$<' object='$@' libtool=no \
1956     DEPDIR=$(DEPDIR) $(BUILD_DEPMODE) $(depcomp) $(BUILDCOMPILE.base)
1957 endif
1958
1959 ALL_BUILD_OBJS = $(BUILD_RTL) $(BUILD_ERRORS) \
1960         build/gencondmd.o build/genattr.o build/genattrtab.o \
1961         build/genautomata.o build/gencheck.o build/genconstants.o \
1962         build/genemit.o build/genextract.o build/genflags.o \
1963         build/gengenrtl.o build/gengtype-lex.o build/gengtype-parse.o \
1964         build/gengtype.o build/genmddeps.o build/genmodes.o \
1965         build/genopinit.o build/genoutput.o build/genpeep.o \
1966         build/genpreds.o build/genrecog.o \
1967         build/gcov-iov.o build/gen-protos.o build/scan.o \
1968         build/fix-header.o build/scan-decls.o
1969
1970 build/%.o : %.c bconfig.h
1971         $(BUILDCOMPILE) $<
1972
1973 # Dependencies on generated headers for various build/ objects.
1974 build/gensupport.o: $(GTM_H) insn-modes.h
1975 build/ggc-none.o: gtype-desc.h
1976 build/min-insn-modes.o: insn-modes.h
1977 build/print-rtl.o: $(GTM_H) insn-modes.h
1978 build/read-rtl.o: $(GTM_H) insn-modes.h
1979 build/rtl.o: $(GTM_H) insn-modes.h gtype-desc.h
1980 build/vec.o: gtype-desc.h
1981 build/gencondmd.o: gencondmd.c $(GTM_H) insn-constants.h $(TM_P_H) \
1982         tm-constrs.h options.h gtype-desc.h genrtl.h tree-check.h
1983 build/genattr.o: $(GTM_H) insn-modes.h
1984 build/genattrtab.o: $(GTM_H) gtype-desc.h insn-modes.h
1985 build/genautomata.o: insn-modes.h $(GTM_H)
1986 build/gencheck.o: $(GTM_H) gencheck.h
1987 build/gencodes.o: $(GTM_H) insn-modes.h
1988 build/genconditions.o: insn-modes.h
1989 build/genconfig.o: $(GTM_H) insn-modes.h
1990 build/genconstants.o: $(GTM_H) insn-modes.h
1991 build/genemit.o: $(GTM_H) insn-modes.h
1992 build/genextract.o: $(GTM_H) insn-modes.h
1993 build/genflags.o: $(GTM_H) insn-modes.h
1994 build/genmddeps.o: $(GTM_H) insn-modes.h
1995 build/genopinit.o: insn-modes.h $(GTM_H)
1996 build/genoutput.o: insn-modes.h $(GTM_H)
1997 build/genpeep.o: insn-modes.h $(GTM_H)
1998 build/genpreds.o: insn-modes.h $(GTM_H)
1999 build/genrecog.o: insn-modes.h $(GTM_H)
2000 build/gcov-iov.o: $(GTM_H) $(TM_H)
2001 build/gen-protos.o: $(GTM_H)
2002 build/scan.o: $(GTM_H)
2003 build/fix-header.o: xsys-protos.h $(GTM_H)
2004 build/scan-decls.o: $(GTM_H)
2005
2006 # This pulls in tm-pred.h which contains inline functions wrapping up
2007 # predicates from the back-end so those functions must be discarded.
2008 # No big deal since gencondmd.c is a dummy file for non-GCC compilers.
2009 build/gencondmd.o : \
2010   BUILD_CFLAGS := $(filter-out -fkeep-inline-functions, $(BUILD_CFLAGS))
2011
2012 # Compile the programs that generate insn-* from the machine description.
2013 # They are compiled with $(CC_FOR_BUILD), and associated libraries,
2014 # since they need to run on this machine
2015 # even if GCC is being compiled to run on some other machine.
2016
2017 # As a general rule...
2018 build/gen%$(build_exeext): build/gen%.o $(BUILD_LIBDEPS)
2019         $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
2020             $(filter-out $(BUILD_LIBDEPS), $^) $(BUILD_LIBS)
2021
2022 # All these programs use the MD reader ($(BUILD_RTL)).
2023 genprogmd = attr attrtab automata codes conditions config constants emit \
2024             extract flags mddeps opinit output peep preds recog
2025 $(genprogmd:%=build/gen%$(build_exeext)): $(BUILD_RTL) $(BUILD_ERRORS)
2026
2027 # These programs need libs over and above what they get from the above list.
2028 build/genautomata$(build_exeext) : BUILD_LIBS += -lm
2029
2030 # These programs are not linked with the MD reader.
2031 build/gengenrtl$(build_exeext) : $(BUILD_ERRORS)
2032 build/genmodes$(build_exeext) : $(BUILD_ERRORS)
2033 build/gengtype$(build_exeext) : build/gengtype-lex.o build/gengtype-parse.o \
2034                                 $(BUILD_ERRORS)
2035
2036 # Generated source files for gengtype.
2037 gengtype-lex.c : gengtype-lex.l
2038         -$(FLEX) $(FLEXFLAGS) -o$@ $<
2039
2040 #\f
2041 # Remake cpp and protoize.
2042
2043 PREPROCESSOR_DEFINES = \
2044   -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
2045   -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
2046   -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
2047   -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
2048   -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
2049   -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
2050   -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
2051   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
2052   -DPREFIX=\"$(prefix)/\" \
2053   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
2054   @TARGET_SYSTEM_ROOT_DEFINE@
2055
2056 # Note for the stamp targets, we run the program `true' instead of
2057 # having an empty command (nothing following the semicolon).
2058
2059 proto: config.status protoize$(exeext) unprotoize$(exeext) SYSCALLS.c.X
2060
2061 PROTO_OBJS = intl.o version.o cppdefault.o errors.o
2062
2063 protoize$(exeext): protoize.o $(PROTO_OBJS) $(LIBDEPS)
2064         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ protoize.o $(PROTO_OBJS) $(LIBS)
2065
2066 unprotoize$(exeext): unprotoize.o $(PROTO_OBJS) $(LIBDEPS)
2067         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ unprotoize.o $(PROTO_OBJS) $(LIBS)
2068
2069 # This info describes the target machine, so compile with GCC just built.
2070 SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) \
2071    stmp-int-hdrs
2072         -rm -f SYSCALLS.c tmp-SYSCALLS.s
2073         sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \
2074           $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c
2075         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) \
2076           -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c
2077         -rm -f SYSCALLS.c tmp-SYSCALLS.s
2078
2079
2080 test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
2081         -rm -f tmp-proto.[cso]
2082         cp $(srcdir)/protoize.c tmp-proto.c
2083         chmod u+w tmp-proto.c
2084         ./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \
2085           $(GCC_CFLAGS) $(INCLUDES) \
2086           -DGCC_INCLUDE_DIR=0 \
2087           -DFIXED_INCLUDE_DIR=0 \
2088           -DGPLUSPLUS_INCLUDE_DIR=0 \
2089           -DCROSS_INCLUDE_DIR=0 \
2090           -DTOOL_INCLUDE_DIR=0 \
2091           -DSTANDARD_EXEC_PREFIX=0 \
2092           -DDEFAULT_TARGET_MACHINE=0 \
2093           -DDEFAULT_TARGET_VERSION=0" tmp-proto.c
2094         @echo '**********' Expect 400 lines of differences.
2095         -diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff
2096         -wc -l tmp-proto.diff
2097         ./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \
2098           $(GCC_CFLAGS) $(INCLUDES) \
2099           -DGCC_INCLUDE_DIR=0 \
2100           -DFIXED_INCLUDE_DIR=0 \
2101           -DGPLUSPLUS_INCLUDE_DIR=0 \
2102           -DCROSS_INCLUDE_DIR=0 \
2103           -DTOOL_INCLUDE_DIR=0 \
2104           -DSTANDARD_EXEC_PREFIX=0 \
2105           -DDEFAULT_TARGET_MACHINE=0 \
2106           -DDEFAULT_TARGET_VERSION=0" tmp-proto.c
2107         @echo Expect zero differences.
2108         diff $(srcdir)/protoize.c tmp-proto.c | cat
2109         -rm -f tmp-proto.[cs] tmp-proto$(objext)
2110
2111 build/gcov-iov$(build_exeext): build/gcov-iov.o
2112         $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) build/gcov-iov.o -o $@
2113
2114 gcov-iov.h: s-iov
2115 s-iov: build/gcov-iov$(build_exeext) $(BASEVER) $(DEVPHASE)
2116         build/gcov-iov$(build_exeext) '$(BASEVER_c)' '$(DEVPHASE_c)' \
2117             > tmp-gcov-iov.h
2118         $(SHELL) $(srcdir)/../move-if-change tmp-gcov-iov.h gcov-iov.h
2119         $(STAMP) s-iov
2120
2121 GCOV_OBJS = gcov.o intl.o version.o errors.o
2122 gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
2123         $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
2124 GCOV_DUMP_OBJS = gcov-dump.o version.o errors.o
2125 gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS)
2126         $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) $(LIBS) -o $@
2127 #\f
2128 # Build the include directories.  The stamp files are stmp-* rather than
2129 # s-* so that mostlyclean does not force the include directory to
2130 # be rebuilt.
2131
2132 # Build the include directories.
2133 stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) $(UNWIND_H) fixinc_list
2134 # Copy in the headers provided with gcc.
2135 # The sed command gets just the last file name component;
2136 # this is necessary because VPATH could add a dirname.
2137 # Using basename would be simpler, but some systems don't have it.
2138 # The touch command is here to workaround an AIX/Linux NFS bug.
2139         -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
2140         -if [ -d include-fixed ] ; then true; else mkdir include-fixed; chmod a+rx include-fixed; fi
2141         for file in .. $(USER_H); do \
2142           if [ X$$file != X.. ]; then \
2143             realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
2144             $(STAMP) include/$$realfile; \
2145             rm -f include/$$realfile; \
2146             cp $$file include; \
2147             chmod a+r include/$$realfile; \
2148           fi; \
2149         done
2150         rm -f include/unwind.h
2151         cp $(UNWIND_H) include/unwind.h
2152         set -e; for ml in `cat fixinc_list`; do \
2153           sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
2154           multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
2155           fix_dir=include-fixed$${multi_dir}; \
2156           if $(LIMITS_H_TEST) ; then \
2157             cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-xlimits.h; \
2158           else \
2159             cat $(srcdir)/glimits.h > tmp-xlimits.h; \
2160           fi; \
2161           $(mkinstalldirs) $${fix_dir}; \
2162           chmod a+rx $${fix_dir} || true; \
2163           rm -f $${fix_dir}/limits.h; \
2164           mv tmp-xlimits.h $${fix_dir}/limits.h; \
2165           chmod a+r $${fix_dir}/limits.h; \
2166         done
2167 # Install the README
2168         rm -f include-fixed/README
2169         cp $(srcdir)/../fixincludes/README-fixinc include-fixed/README
2170         chmod a+r include-fixed/README
2171         $(STAMP) $@
2172
2173 .PHONY: install-gcc-tooldir
2174 install-gcc-tooldir:
2175         $(mkinstalldirs) $(DESTDIR)$(gcc_tooldir)
2176
2177 macro_list: s-macro_list; @true
2178 s-macro_list : $(GCC_PASSES)
2179         echo | $(GCC_FOR_TARGET) -E -dM - | \
2180           sed -n -e 's/^#define \([^_][a-zA-Z0-9_]*\).*/\1/p' \
2181                  -e 's/^#define \(_[^_A-Z][a-zA-Z0-9_]*\).*/\1/p' | \
2182           sort -u > tmp-macro_list
2183         $(SHELL) $(srcdir)/../move-if-change tmp-macro_list macro_list
2184         $(STAMP) s-macro_list
2185
2186 fixinc_list: s-fixinc_list; @true
2187 s-fixinc_list : $(GCC_PASSES)
2188 # Build up a list of multilib directories and corresponding sysroot
2189 # suffixes, in form sysroot;multilib.
2190         if $(GCC_FOR_TARGET) -print-sysroot-headers-suffix > /dev/null 2>&1; then \
2191           set -e; for ml in `$(GCC_FOR_TARGET) -print-multi-lib`; do \
2192             multi_dir=`echo $${ml} | sed -e 's/;.*$$//'`; \
2193             flags=`echo $${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
2194             sfx=`$(GCC_FOR_TARGET) $${flags} -print-sysroot-headers-suffix`; \
2195             if [ "$${multi_dir}" = "." ]; \
2196               then multi_dir=""; \
2197             else \
2198               multi_dir=/$${multi_dir}; \
2199             fi; \
2200             echo "$${sfx};$${multi_dir}"; \
2201           done; \
2202         else \
2203           echo ";"; \
2204         fi > tmp-fixinc_list
2205         $(SHELL) $(srcdir)/../move-if-change tmp-fixinc_list fixinc_list
2206         $(STAMP) s-fixinc_list
2207
2208 # The line below is supposed to avoid accidentally matching the
2209 # built-in suffix rule `.o:' to build fixincl out of fixincl.o.  You'd
2210 # expect fixincl to be newer than fixincl.o, such that this situation
2211 # would never come up.  As it turns out, if you use ccache with
2212 # CCACHE_HARDLINK enabled, the compiler doesn't embed the current
2213 # working directory in object files (-g absent, or -fno-working-dir
2214 # present), and build and host are the same, fixincl for the host will
2215 # build after fixincl for the build machine, getting a cache hit,
2216 # thereby updating the timestamp of fixincl.o in the host tree.
2217 # Because of CCACHE_HARDLINK, this will also update the timestamp in
2218 # the build tree, and so fixincl in the build tree will appear to be
2219 # out of date.  Yuck.
2220 ../$(build_subdir)/fixincludes/fixincl: ; @ :
2221
2222 # Build fixed copies of system files.
2223 # Abort if no system headers available, unless building a crosscompiler.
2224 # FIXME: abort unless building --without-headers would be more accurate and less ugly
2225 stmp-fixinc: gsyslimits.h macro_list fixinc_list \
2226   $(build_objdir)/fixincludes/fixincl \
2227   $(build_objdir)/fixincludes/fixinc.sh
2228         rm -rf include-fixed; mkdir include-fixed
2229         -chmod a+rx include-fixed
2230         if [ -d ../prev-gcc ]; then \
2231           cd ../prev-gcc && \
2232           $(MAKE) real-$(INSTALL_HEADERS_DIR) DESTDIR=`pwd`/../gcc/ \
2233             libsubdir=. ; \
2234         else \
2235           set -e; for ml in `cat fixinc_list`; do \
2236             sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
2237             multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
2238             fix_dir=include-fixed$${multi_dir}; \
2239             if ! $(inhibit_libc) && test ! -d ${SYSTEM_HEADER_DIR}; then \
2240               echo The directory that should contain system headers does not exist: >&2 ; \
2241               echo "  ${SYSTEM_HEADER_DIR}" >&2 ; \
2242               tooldir_sysinc=`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`; \
2243               if test "x${SYSTEM_HEADER_DIR}" = "x$${tooldir_sysinc}"; \
2244               then sleep 1; else exit 1; fi; \
2245             fi; \
2246             $(mkinstalldirs) $${fix_dir}; \
2247             chmod a+rx $${fix_dir} || true; \
2248             (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \
2249               SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \
2250               export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
2251               cd $(build_objdir)/fixincludes && \
2252               $(SHELL) ./fixinc.sh ../../gcc/$${fix_dir} \
2253                 $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
2254             rm -f $${fix_dir}/syslimits.h; \
2255             if [ -f $${fix_dir}/limits.h ]; then \
2256               mv $${fix_dir}/limits.h $${fix_dir}/syslimits.h; \
2257             else \
2258               cp $(srcdir)/gsyslimits.h $${fix_dir}/syslimits.h; \
2259             fi; \
2260             chmod a+r $${fix_dir}/syslimits.h; \
2261           done; \
2262         fi
2263         $(STAMP) stmp-fixinc
2264
2265 # Files related to the fixproto script.
2266 # gen-protos and fix-header are compiled with CC_FOR_BUILD, but they are only
2267 # used in native and host-x-target builds, so it's safe to link them with
2268 # libiberty.a.
2269
2270 deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs
2271         if [ -d "$(SYSTEM_HEADER_DIR)" ]; \
2272         then \
2273           CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -I. -I$(srcdir) -isystem include -isystem ${SYSTEM_HEADER_DIR}"; \
2274           export CC; \
2275           $(SHELL) $(srcdir)/scan-types.sh "$(srcdir)" >tmp-deduced.h; \
2276           mv tmp-deduced.h deduced.h; \
2277         else \
2278           $(STAMP) deduced.h; \
2279         fi
2280
2281 GEN_PROTOS_OBJS = build/gen-protos.o build/scan.o $(BUILD_ERRORS)
2282 build/gen-protos$(build_exeext): $(GEN_PROTOS_OBJS)
2283         ${CC_FOR_BUILD} $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
2284           $(GEN_PROTOS_OBJS) $(BUILD_LIBS)
2285
2286 xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h \
2287   build/gen-protos$(build_exeext) Makefile
2288         sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \
2289           deduced.h $(srcdir)/sys-protos.h > tmp-fixtmp.c
2290         mv tmp-fixtmp.c fixtmp.c
2291         $(GCC_FOR_TARGET) fixtmp.c -w -U__SIZE_TYPE__ -U__PTRDIFF_TYPE__ -U__WCHAR_TYPE__ -E \
2292           | sed -e 's/  / /g' -e 's/ *(/ (/g' -e 's/ [ ]*/ /g' -e 's/( )/()/' \
2293           | $(RUN_GEN) build/gen-protos >xsys-protos.hT
2294         mv xsys-protos.hT xsys-protos.h
2295         rm -rf fixtmp.c
2296
2297 # This is nominally a 'build' program, but it's run only when host==build,
2298 # so we can (indeed, must) use $(LIBDEPS) and $(LIBS).
2299 build/fix-header$(build_exeext): build/fix-header.o build/scan-decls.o \
2300   build/scan.o xsys-protos.h c-incpath.o cppdefault.o prefix.o \
2301   $(BUILD_ERRORS) $(LIBDEPS)
2302         $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
2303          build/fix-header.o c-incpath.o cppdefault.o build/scan-decls.o prefix.o \
2304          build/scan.o $(BUILD_ERRORS) $(LIBS)
2305
2306 # stmp-fixproto depends on this, not on fix-header directly.
2307 # The idea is to make sure fix-header gets built,
2308 # but not rerun fixproto after each stage
2309 # just because fix-header's mtime has changed.
2310 fixhdr.ready: build/fix-header$(build_exeext)
2311         -if [ -f fixhdr.ready ] ; then \
2312                 true; \
2313         else \
2314                 $(STAMP) fixhdr.ready; \
2315         fi
2316
2317 # stmp-int-hdrs is to make sure fixincludes has already finished.
2318 # The if statement is so that we don't run fixproto a second time
2319 # if it has already been run on the files in `include-fixed'.
2320 stmp-fixproto: fixhdr.ready fixproto fixinc_list stmp-int-hdrs
2321         set -e; for ml in `cat fixinc_list`; do \
2322           sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
2323           multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
2324           fix_dir=include-fixed$${multi_dir}; \
2325           if [ -f $${fix_dir}/fixed ] ; then true; \
2326           else \
2327             : This line works around a 'make' bug in BSDI 1.1.; \
2328             FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"; export FIXPROTO_DEFINES; \
2329             FIX_HEADER="build/fix-header$(build_exeext)"; export FIX_HEADER; \
2330             mkinstalldirs="$(mkinstalldirs)"; \
2331               export mkinstalldirs; \
2332             if [ -d "$(SYSTEM_HEADER_DIR)" ]; then \
2333               $(SHELL) ${srcdir}/fixproto $${fix_dir} $${fix_dir} $(SYSTEM_HEADER_DIR); \
2334               if [ $$? -eq 0 ] ; then true ; else exit 1 ; fi ; \
2335             else true; fi; \
2336             $(STAMP) $${fix_dir}/fixed; \
2337           fi; \
2338         done
2339         $(STAMP) stmp-fixproto
2340
2341 # We can't run fixproto (it's being built for a different host), but we still
2342 # need to install it so that the user can run it when the compiler is
2343 # installed.
2344 stmp-install-fixproto: fixproto
2345         $(STAMP) $@
2346 #\f
2347 # Remake the info files.
2348
2349 doc: $(BUILD_INFO) $(GENERATED_MANPAGES) gccbug
2350
2351 INFOFILES = doc/cpp.info doc/gcc.info doc/gccint.info \
2352             doc/gccinstall.info doc/cppinternals.info
2353
2354 info: $(INFOFILES) lang.info @GENINSRC@ srcinfo lang.srcinfo
2355
2356 srcinfo: $(INFOFILES)
2357         -cp -p $^ $(srcdir)/doc
2358
2359 TEXI_CPP_FILES = cpp.texi fdl.texi cppenv.texi cppopts.texi             \
2360          gcc-common.texi gcc-vers.texi
2361
2362 TEXI_GCC_FILES = gcc.texi gcc-common.texi gcc-vers.texi frontends.texi  \
2363          standards.texi invoke.texi extend.texi md.texi objc.texi       \
2364          gcov.texi trouble.texi bugreport.texi service.texi             \
2365          contribute.texi compat.texi funding.texi gnu.texi gpl.texi     \
2366          fdl.texi contrib.texi cppenv.texi cppopts.texi                 \
2367          implement-c.texi arm-neon-intrinsics.texi
2368
2369 TEXI_GCCINT_FILES = gccint.texi gcc-common.texi gcc-vers.texi           \
2370          contribute.texi makefile.texi configterms.texi options.texi    \
2371          portability.texi interface.texi passes.texi c-tree.texi        \
2372          rtl.texi md.texi tm.texi hostconfig.texi fragments.texi        \
2373          configfiles.texi collect2.texi headerdirs.texi funding.texi    \
2374          gnu.texi gpl.texi fdl.texi contrib.texi languages.texi         \
2375          sourcebuild.texi gty.texi libgcc.texi cfg.texi tree-ssa.texi   \
2376          loop.texi
2377
2378 TEXI_GCCINSTALL_FILES = install.texi install-old.texi fdl.texi          \
2379          gcc-common.texi gcc-vers.texi
2380
2381 TEXI_CPPINT_FILES = cppinternals.texi gcc-common.texi gcc-vers.texi
2382
2383 # gcc-vers.texi is generated from the version files.
2384 gcc-vers.texi: $(BASEVER) $(DEVPHASE)
2385         (echo "@set version-GCC $(BASEVER_c)"; \
2386          if [ "$(DEVPHASE_c)" = "experimental" ]; \
2387          then echo "@set DEVELOPMENT"; \
2388          else echo "@clear DEVELOPMENT"; \
2389          fi) > $@T
2390         $(build_file_translate) echo @set srcdir $(abs_srcdir) >> $@T
2391         if [ -n "$(PKGVERSION)" ]; then \
2392           echo "@set VERSION_PACKAGE $(PKGVERSION)" >> $@T; \
2393         fi
2394         echo "@set BUGURL $(BUGURL_TEXI)" >> $@T; \
2395         mv -f $@T $@
2396
2397
2398 # The *.1, *.7, *.info, *.dvi, and *.pdf files are being generated from implicit
2399 # patterns.  To use them, put each of the specific targets with its
2400 # specific dependencies but no build commands.
2401
2402 doc/cpp.info: $(TEXI_CPP_FILES)
2403 doc/gcc.info: $(TEXI_GCC_FILES)
2404 doc/gccint.info: $(TEXI_GCCINT_FILES)
2405 doc/cppinternals.info: $(TEXI_CPPINT_FILES)
2406
2407 doc/%.info: %.texi
2408         if [ x$(BUILD_INFO) = xinfo ]; then \
2409                 $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \
2410                         -I $(gcc_docdir)/include -o $@ $<; \
2411         fi
2412
2413 # Duplicate entry to handle renaming of gccinstall.info
2414 doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES)
2415         if [ x$(BUILD_INFO) = xinfo ]; then \
2416                 $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
2417                         -I $(gcc_docdir)/include -o $@ $<; \
2418         fi
2419
2420 doc/cpp.dvi: $(TEXI_CPP_FILES)
2421 doc/gcc.dvi: $(TEXI_GCC_FILES)
2422 doc/gccint.dvi: $(TEXI_GCCINT_FILES)
2423 doc/cppinternals.dvi: $(TEXI_CPPINT_FILES)
2424
2425 doc/cpp.pdf: $(TEXI_CPP_FILES)
2426 doc/gcc.pdf: $(TEXI_GCC_FILES)
2427 doc/gccint.pdf: $(TEXI_GCCINT_FILES)
2428 doc/cppinternals.pdf: $(TEXI_CPPINT_FILES)
2429
2430 $(build_htmldir)/cpp/index.html: $(TEXI_CPP_FILES)
2431 $(build_htmldir)/gcc/index.html: $(TEXI_GCC_FILES)
2432 $(build_htmldir)/gccint/index.html: $(TEXI_GCCINT_FILES)
2433 $(build_htmldir)/cppinternals/index.html: $(TEXI_CPPINT_FILES)
2434
2435 dvi:: doc/gcc.dvi doc/gccint.dvi doc/gccinstall.dvi doc/cpp.dvi \
2436       doc/cppinternals.dvi lang.dvi
2437
2438 doc/%.dvi: %.texi
2439         $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
2440
2441 # Duplicate entry to handle renaming of gccinstall.dvi
2442 doc/gccinstall.dvi: $(TEXI_GCCINSTALL_FILES)
2443         $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
2444
2445 PDFFILES = doc/gcc.pdf doc/gccint.pdf doc/gccinstall.pdf doc/cpp.pdf \
2446            doc/cppinternals.pdf
2447
2448 pdf:: $(PDFFILES) lang.pdf
2449
2450 doc/%.pdf: %.texi
2451         $(TEXI2PDF) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
2452
2453 # Duplicate entry to handle renaming of gccinstall.pdf
2454 doc/gccinstall.pdf: $(TEXI_GCCINSTALL_FILES)
2455         $(TEXI2PDF) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
2456
2457 # List the directories or single hmtl files which are installed by
2458 # install-html. The lang.html file triggers language fragments to build
2459 # html documentation. Installing language fragment documentation is not
2460 # yet supported.
2461 HTMLS_INSTALL=$(build_htmldir)/cpp $(build_htmldir)/gcc \
2462        $(build_htmldir)/gccinstall $(build_htmldir)/gccint \
2463        $(build_htmldir)/cppinternals
2464
2465 # List the html file targets.
2466 HTMLS_BUILD=$(build_htmldir)/cpp/index.html $(build_htmldir)/gcc/index.html \
2467        $(build_htmldir)/gccinstall/index.html $(build_htmldir)/gccint/index.html \
2468        $(build_htmldir)/cppinternals/index.html lang.html
2469
2470 html:: $(HTMLS_BUILD)
2471
2472 $(build_htmldir)/%/index.html: %.texi
2473         $(mkinstalldirs) $(@D)
2474         rm -f $(@D)/*
2475         $(TEXI2HTML) -I $(abs_docdir) -I $(abs_docdir)/include -o $(@D) $<
2476
2477 # Duplicate entry to handle renaming of gccinstall
2478 $(build_htmldir)/gccinstall/index.html: $(TEXI_GCCINSTALL_FILES)
2479         $(mkinstalldirs) $(@D)
2480         echo rm -f $(@D)/*
2481         SOURCEDIR=$(abs_docdir) \
2482         DESTDIR=$(@D) \
2483         $(SHELL) $(srcdir)/doc/install.texi2html
2484
2485 MANFILES = doc/gcov.1 doc/cpp.1 doc/gcc.1 doc/gfdl.7 doc/gpl.7 doc/fsf-funding.7
2486
2487 generated-manpages: man
2488
2489 man: $(MANFILES) lang.man @GENINSRC@ srcman lang.srcman
2490
2491 srcman: $(MANFILES)
2492         -cp -p $^ $(srcdir)/doc
2493
2494 doc/%.1: %.pod
2495         $(STAMP) $@
2496         -($(POD2MAN) --section=1 $< > $(@).T$$$$ && \
2497                 mv -f $(@).T$$$$ $@) || \
2498                 (rm -f $(@).T$$$$ && exit 1)
2499
2500 doc/%.7: %.pod
2501         $(STAMP) $@
2502         -($(POD2MAN) --section=7 $< > $(@).T$$$$ && \
2503                 mv -f $(@).T$$$$ $@) || \
2504                 (rm -f $(@).T$$$$ && exit 1)
2505
2506 %.pod: %.texi
2507         $(STAMP) $@
2508         -$(TEXI2POD) -DBUGURL="$(BUGURL_TEXI)" $< > $@
2509
2510 .INTERMEDIATE: cpp.pod gcc.pod gfdl.pod fsf-funding.pod
2511 cpp.pod: cpp.texi cppenv.texi cppopts.texi
2512
2513 # These next rules exist because the output name is not the same as
2514 # the input name, so our implicit %.pod rule will not work.
2515
2516 gcc.pod: invoke.texi cppenv.texi cppopts.texi
2517         $(STAMP) $@
2518         -$(TEXI2POD) $< > $@
2519 gfdl.pod: fdl.texi
2520         $(STAMP) $@
2521         -$(TEXI2POD) $< > $@
2522 fsf-funding.pod: funding.texi
2523         $(STAMP) $@
2524         -$(TEXI2POD) $< > $@
2525
2526 #\f
2527 # Deletion of files made during compilation.
2528 # There are four levels of this:
2529 #   `mostlyclean', `clean', `distclean' and `maintainer-clean'.
2530 # `mostlyclean' is useful while working on a particular type of machine.
2531 # It deletes most, but not all, of the files made by compilation.
2532 # It does not delete libgcc.a or its parts, so it won't have to be recompiled.
2533 # `clean' deletes everything made by running `make all'.
2534 # `distclean' also deletes the files made by config.
2535 # `maintainer-clean' also deletes everything that could be regenerated
2536 # automatically, except for `configure'.
2537 # We remove as much from the language subdirectories as we can
2538 # (less duplicated code).
2539
2540 mostlyclean: lang.mostlyclean
2541         -rm -f $(MOSTLYCLEANFILES)
2542         -rm -f *$(objext)
2543         -rm -f *$(coverageexts)
2544 # Delete build programs
2545         -rm -f build/*
2546         -rm -f mddeps.mk
2547 # Delete other built files.
2548         -rm -f xsys-protos.hT
2549         -rm -f specs.h gencheck.h options.c options.h
2550 # Delete the stamp and temporary files.
2551         -rm -f s-* tmp-* stamp-* stmp-*
2552         -rm -f */stamp-* */tmp-*
2553 # Delete debugging dump files.
2554         -rm -f *.[0-9][0-9].* */*.[0-9][0-9].*
2555 # Delete some files made during installation.
2556         -rm -f specs $(SPECS) SYSCALLS.c.X SYSCALLS.c
2557         -rm -f collect collect2 mips-tfile mips-tdump
2558 # Delete files generated for fixproto
2559         -rm -rf $(build_exeext) xsys-protos.h deduced.h tmp-deduced.h \
2560           gen-protos$(build_exeext) fixproto.list fixtmp.* fixhdr.ready
2561 # Delete unwanted output files from TeX.
2562         -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
2563         -rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg
2564 # Delete sorted indices we don't actually use.
2565         -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
2566 # Delete core dumps.
2567         -rm -f core */core
2568 # Delete file generated for gengtype
2569         -rm -f gtyp-input.list
2570 # Delete files generated by gengtype.c
2571         -rm -f gtype-*
2572         -rm -f gt-*
2573 # Delete genchecksum outputs
2574         -rm -f *-checksum.c
2575
2576 # Delete all files made by compilation
2577 # that don't exist in the distribution.
2578 clean: mostlyclean lang.clean
2579         -rm -f libgcc.a libgcc_eh.a libgcov.a
2580         -rm -f libgcc_s*
2581         -rm -f libunwind*
2582         -rm -f config.h tconfig.h bconfig.h tm_p.h tm.h
2583         -rm -f options.c options.h optionlist
2584         -rm -f cs-*
2585         -rm -f doc/*.dvi
2586         -rm -f doc/*.pdf
2587 # Delete the include directories.
2588         -rm -rf include include-fixed
2589 # Delete files used by the "multilib" facility (including libgcc subdirs).
2590         -rm -f multilib.h tmpmultilib*
2591         -if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \
2592           rm -rf $(MULTILIB_DIRNAMES); \
2593         else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \
2594           rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
2595         fi ; fi
2596
2597 # Delete all files that users would normally create
2598 # while building and installing GCC.
2599 distclean: clean lang.distclean
2600         -rm -f auto-host.h auto-build.h
2601         -rm -f cstamp-h
2602         -rm -f config.status config.run config.cache config.bak
2603         -rm -f Make-lang Make-hooks Make-host Make-target
2604         -rm -f Makefile *.oaux
2605         -rm -f gthr-default.h
2606         -rm -f TAGS */TAGS
2607         -rm -f *.asm
2608         -rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
2609         -rm -f testsuite/*.log testsuite/*.sum
2610         -cd testsuite && rm -f x *.x *.x? *.exe *.rpo *.o *.s *.S *.c
2611         -cd testsuite && rm -f *.out *.gcov *$(coverageexts)
2612         -rm -rf ${QMTEST_DIR} stamp-qmtest
2613         -rm -f cxxmain.c
2614         -rm -f gccbug .gdbinit configargs.h
2615         -rm -f gcov.pod
2616 # Delete po/*.gmo only if we are not building in the source directory.
2617         -if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi
2618         -rm -rf $(DEPDIR) */$(DEPDIR)
2619         -rmdir ada cp f java objc intl po testsuite 2>/dev/null
2620
2621 # Get rid of every file that's generated from some other file, except for `configure'.
2622 # Most of these files ARE PRESENT in the GCC distribution.
2623 maintainer-clean:
2624         @echo 'This command is intended for maintainers to use; it'
2625         @echo 'deletes files that may need special tools to rebuild.'
2626         $(MAKE) lang.maintainer-clean distclean
2627         -rm -f cpp.??s cpp.*aux
2628         -rm -f gcc.??s gcc.*aux
2629         -rm -f $(gcc_docdir)/*.info $(gcc_docdir)/*.1 $(gcc_docdir)/*.7 $(gcc_docdir)/*.dvi $(gcc_docdir)/*.pdf
2630 #\f
2631 # Entry points `install' and `uninstall'.
2632 # Also use `install-collect2' to install collect2 when the config files don't.
2633
2634 # Copy the compiler files into directories where they will be run.
2635 # Install the driver last so that the window when things are
2636 # broken is small.
2637 install: install-common $(INSTALL_HEADERS) \
2638     install-cpp install-man install-info install-@POSUB@ \
2639     install-driver
2640
2641 # Handle cpp installation.
2642 install-cpp: installdirs cpp$(exeext)
2643         -rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext)
2644         -$(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext)
2645         -if [ x$(cpp_install_dir) != x ]; then \
2646           rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
2647           $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
2648         else true; fi
2649
2650 # Create the installation directories.
2651 # $(libdir)/gcc/include isn't currently searched by cpp.
2652 installdirs:
2653         $(mkinstalldirs) $(DESTDIR)$(libsubdir)
2654         $(mkinstalldirs) $(DESTDIR)$(libexecsubdir)
2655         $(mkinstalldirs) $(DESTDIR)$(bindir)
2656         $(mkinstalldirs) $(DESTDIR)$(includedir)
2657         $(mkinstalldirs) $(DESTDIR)$(infodir)
2658         $(mkinstalldirs) $(DESTDIR)$(slibdir)
2659         $(mkinstalldirs) $(DESTDIR)$(man1dir)
2660         $(mkinstalldirs) $(DESTDIR)$(man7dir)
2661
2662 # Install the compiler executables built during cross compilation.
2663 install-common: native lang.install-common installdirs
2664         for file in $(COMPILERS); do \
2665           if [ -f $$file ] ; then \
2666             rm -f $(DESTDIR)$(libexecsubdir)/$$file; \
2667             $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \
2668           else true; \
2669           fi; \
2670         done
2671         for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(COLLECT2) ..; do \
2672           if [ x"$$file" != x.. ]; then \
2673             rm -f $(DESTDIR)$(libexecsubdir)/$$file; \
2674             $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \
2675           else true; fi; \
2676         done
2677 # We no longer install the specs file because its presence makes the
2678 # driver slower, and because people who need it can recreate it by
2679 # using -dumpspecs.  We remove any old version because it would
2680 # otherwise override the specs built into the driver.
2681         rm -f $(DESTDIR)$(libsubdir)/specs
2682 # Install protoize if it was compiled.
2683         -if [ -f protoize$(exeext) ]; then \
2684           rm -f $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
2685           $(INSTALL_PROGRAM) protoize$(exeext) $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
2686           rm -f $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
2687           $(INSTALL_PROGRAM) unprotoize$(exeext) $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
2688           rm -f $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \
2689           $(INSTALL_DATA) SYSCALLS.c.X $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \
2690           chmod a-x $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \
2691         fi
2692 # Install gcov if it was compiled.
2693         -if [ -f gcov$(exeext) ]; \
2694         then \
2695             rm -f $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
2696             $(INSTALL_PROGRAM) gcov$(exeext) $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
2697         fi
2698         $(INSTALL_SCRIPT) gccbug $(DESTDIR)$(bindir)/$(GCCBUG_INSTALL_NAME)
2699
2700 # Install the driver program as $(target_noncanonical)-gcc,
2701 # $(target_noncanonical)-gcc-$(version)
2702 # and also as either gcc (if native) or $(gcc_tooldir)/bin/gcc.
2703 install-driver: installdirs xgcc$(exeext)
2704         -rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
2705         -$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
2706         -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext)
2707         -( cd $(DESTDIR)$(bindir) && \
2708            $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version)$(exeext) )
2709         -if [ -f gcc-cross$(exeext) ] ; then \
2710           if [ -d $(DESTDIR)$(gcc_tooldir)/bin/. ] ; then \
2711             rm -f $(DESTDIR)$(gcc_tooldir)/bin/gcc$(exeext); \
2712             $(INSTALL_PROGRAM) gcc-cross$(exeext) $(DESTDIR)$(gcc_tooldir)/bin/gcc$(exeext); \
2713           else true; fi; \
2714         else \
2715           rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \
2716           ( cd $(DESTDIR)$(bindir) && \
2717             $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-tmp$(exeext) && \
2718             mv -f $(target_noncanonical)-gcc-tmp$(exeext) $(GCC_TARGET_INSTALL_NAME)$(exeext) ); \
2719         fi
2720
2721 # Install the info files.
2722 # $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir
2723 # to do the install.
2724 install-info:: doc installdirs \
2725         $(DESTDIR)$(infodir)/cpp.info \
2726         $(DESTDIR)$(infodir)/gcc.info \
2727         $(DESTDIR)$(infodir)/cppinternals.info \
2728         $(DESTDIR)$(infodir)/gccinstall.info \
2729         $(DESTDIR)$(infodir)/gccint.info \
2730         lang.install-info
2731
2732 $(DESTDIR)$(infodir)/%.info: doc/%.info installdirs
2733         rm -f $@
2734         if [ -f $< ]; then \
2735           for f in $(<)*; do \
2736             realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
2737             $(INSTALL_DATA) $$f $(DESTDIR)$(infodir)/$$realfile; \
2738             chmod a-x $(DESTDIR)$(infodir)/$$realfile; \
2739           done; \
2740         else true; fi
2741         -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
2742           if [ -f $@ ]; then \
2743             install-info --dir-file=$(DESTDIR)$(infodir)/dir $@; \
2744           else true; fi; \
2745         else true; fi;
2746
2747 pdf__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
2748
2749 install-pdf: $(PDFFILES) lang.install-pdf
2750         @$(NORMAL_INSTALL)
2751         test -z "$(pdfdir)/gcc" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc"
2752         @list='$(PDFFILES)'; for p in $$list; do \
2753           if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
2754           f=$(pdf__strip_dir) \
2755           echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/gcc/$$f'"; \
2756           $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \
2757         done
2758
2759 html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
2760
2761 install-html: $(HTMLS_BUILD)
2762         @$(NORMAL_INSTALL)
2763         test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)"
2764         @list='$(HTMLS_INSTALL)'; for p in $$list; do \
2765           if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
2766           f=$(html__strip_dir) \
2767           if test -d "$$d$$p"; then \
2768             echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \
2769             $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
2770             echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
2771             $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
2772           else \
2773             echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
2774             $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
2775           fi; \
2776         done
2777
2778 # Install the man pages.
2779 install-man: lang.install-man \
2780         $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext) \
2781         $(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext) \
2782         $(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext) \
2783         $(DESTDIR)$(man7dir)/fsf-funding$(man7ext) \
2784         $(DESTDIR)$(man7dir)/gfdl$(man7ext) \
2785         $(DESTDIR)$(man7dir)/gpl$(man7ext)
2786
2787 $(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs
2788         -rm -f $@
2789         -$(INSTALL_DATA) $< $@
2790         -chmod a-x $@
2791
2792 $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc.1 installdirs
2793         -rm -f $@
2794         -$(INSTALL_DATA) $< $@
2795         -chmod a-x $@
2796
2797 $(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp.1 installdirs
2798         -rm -f $@
2799         -$(INSTALL_DATA) $< $@
2800         -chmod a-x $@
2801
2802 $(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcov.1 installdirs
2803         -rm -f $@
2804         -$(INSTALL_DATA) $< $@
2805         -chmod a-x $@
2806
2807 # Install all the header files built in the include subdirectory.
2808 install-headers: $(INSTALL_HEADERS_DIR)
2809 # Fix symlinks to absolute paths in the installed include directory to
2810 # point to the installed directory, not the build directory.
2811 # Don't need to use LN_S here since we really do need ln -s and no substitutes.
2812         -files=`cd $(DESTDIR)$(libsubdir)/include-fixed; find . -type l -print 2>/dev/null`; \
2813         if [ $$? -eq 0 ]; then \
2814           dir=`cd include-fixed; ${PWD_COMMAND}`; \
2815           for i in $$files; do \
2816             dest=`ls -ld $(DESTDIR)$(libsubdir)/include-fixed/$$i | sed -n 's/.*-> //p'`; \
2817             if expr "$$dest" : "$$dir.*" > /dev/null; then \
2818               rm -f $(DESTDIR)$(libsubdir)/include-fixed/$$i; \
2819               ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(DESTDIR)$(libsubdir)/include-fixed/$$i; \
2820             fi; \
2821           done; \
2822         fi
2823
2824 # Create or recreate the gcc private include file directory.
2825 install-include-dir: installdirs
2826         $(mkinstalldirs) $(DESTDIR)$(libsubdir)/include
2827         -rm -rf $(DESTDIR)$(libsubdir)/include-fixed
2828         mkdir $(DESTDIR)$(libsubdir)/include-fixed
2829         -chmod a+rx $(DESTDIR)$(libsubdir)/include-fixed
2830
2831 # Create or recreate the install-tools include file directory.
2832 itoolsdir = $(libexecsubdir)/install-tools
2833 itoolsdatadir = $(libsubdir)/install-tools
2834 install-itoolsdirs: installdirs
2835         $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include
2836         $(mkinstalldirs) $(DESTDIR)$(itoolsdir)
2837
2838 # Install the include directory using tar.
2839 install-headers-tar: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
2840 # We use `pwd`/include instead of just include to problems with CDPATH
2841 # Unless a full pathname is provided, some shells would print the new CWD,
2842 # found in CDPATH, corrupting the output.  We could just redirect the
2843 # output of `cd', but some shells lose on redirection within `()'s
2844         (cd `${PWD_COMMAND}`/include ; \
2845          tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - )
2846         (cd `${PWD_COMMAND}`/include-fixed ; \
2847          tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - )
2848 # /bin/sh on some systems returns the status of the first tar,
2849 # and that can lose with GNU tar which always writes a full block.
2850 # So use `exit 0' to ignore its exit status.
2851
2852 # Install the include directory using cpio.
2853 install-headers-cpio: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
2854 # See discussion about the use of `pwd` above
2855         cd `${PWD_COMMAND}`/include ; \
2856         find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include
2857         cd `${PWD_COMMAND}`/include-fixed ; \
2858         find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed
2859
2860 # Install the include directory using cp.
2861 install-headers-cp: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
2862         cp -p -r include $(DESTDIR)$(libsubdir)
2863         cp -p -r include-fixed $(DESTDIR)$(libsubdir)
2864
2865 # Targets without dependencies, for use in prev-gcc during bootstrap.
2866 real-install-headers-tar:
2867         (cd `${PWD_COMMAND}`/include-fixed ; \
2868          tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - )
2869
2870 real-install-headers-cpio:
2871         cd `${PWD_COMMAND}`/include-fixed ; \
2872         find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed
2873
2874 real-install-headers-cp:
2875         cp -p -r include-fixed $(DESTDIR)$(libsubdir)
2876
2877 # Install supporting files for fixincludes to be run later.
2878 install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-itoolsdirs \
2879   macro_list fixinc_list
2880         $(INSTALL_DATA) $(srcdir)/gsyslimits.h \
2881           $(DESTDIR)$(itoolsdatadir)/gsyslimits.h
2882         $(INSTALL_DATA) macro_list $(DESTDIR)$(itoolsdatadir)/macro_list
2883         $(INSTALL_DATA) fixinc_list $(DESTDIR)$(itoolsdatadir)/fixinc_list
2884         set -e; for ml in `cat fixinc_list`; do \
2885           multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
2886           $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}; \
2887           $(INSTALL_DATA) include-fixed$${multidir}/limits.h $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}/limits.h; \
2888         done
2889         $(INSTALL_SCRIPT) $(srcdir)/../mkinstalldirs \
2890                 $(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
2891         if [ x$(STMP_FIXPROTO) != x ] ; then \
2892           $(INSTALL_SCRIPT) $(srcdir)/fixproto $(DESTDIR)$(itoolsdir)/fixproto ; \
2893           $(INSTALL_PROGRAM) build/fix-header$(build_exeext) \
2894                 $(DESTDIR)$(itoolsdir)/fix-header$(build_exeext) ; \
2895         else :; fi
2896         sysroot_headers_suffix='$${sysroot_headers_suffix}'; \
2897                 echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \
2898                 > $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
2899         echo 'OTHER_FIXINCLUDES_DIRS="$(OTHER_FIXINCLUDES_DIRS)"' \
2900                 >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
2901         echo 'FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"' \
2902                 >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
2903         echo 'STMP_FIXPROTO="$(STMP_FIXPROTO)"' \
2904                 >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
2905         echo 'STMP_FIXINC="$(STMP_FIXINC)"' \
2906                 >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
2907
2908 # Use this target to install the program `collect2' under the name `collect2'.
2909 install-collect2: collect2 installdirs
2910         $(INSTALL_PROGRAM) collect2$(exeext) $(DESTDIR)$(libexecsubdir)/collect2$(exeext)
2911 # Install the driver program as $(libsubdir)/gcc for collect2.
2912         $(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(libexecsubdir)/gcc$(exeext)
2913
2914 # Cancel installation by deleting the installed files.
2915 uninstall: lang.uninstall
2916         -rm -rf $(DESTDIR)$(libsubdir)
2917         -rm -rf $(DESTDIR)$(libexecsubdir)
2918         -rm -rf $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
2919         -rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext)
2920         -if [ x$(cpp_install_dir) != x ]; then \
2921           rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
2922         else true; fi
2923         -rm -rf $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext)
2924         -rm -rf $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext)
2925         -rm -rf $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext)
2926         -rm -rf $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext)
2927         -rm -rf $(DESTDIR)$(man1dir)/cpp$(man1ext)
2928         -rm -rf $(DESTDIR)$(man1dir)/protoize$(man1ext)
2929         -rm -rf $(DESTDIR)$(man1dir)/unprotoize$(man1ext)
2930         -rm -f $(DESTDIR)$(infodir)/cpp.info* $(DESTDIR)$(infodir)/gcc.info*
2931         -rm -f $(DESTDIR)$(infodir)/cppinternals.info* $(DESTDIR)$(infodir)/gccint.info*
2932 #\f
2933 # These targets are for the dejagnu testsuites. The file site.exp
2934 # contains global variables that all the testsuites will use.
2935
2936 target_subdir = @target_subdir@
2937
2938 site.exp: ./config.status Makefile
2939         @echo "Making a new config file..."
2940         -@rm -f ./tmp?
2941         @$(STAMP) site.exp
2942         -@mv site.exp site.bak
2943         @echo "## these variables are automatically generated by make ##" > ./tmp0
2944         @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
2945         @echo "# add them to the last section" >> ./tmp0
2946         @echo "set rootme \"`${PWD_COMMAND}`\"" >> ./tmp0
2947         @echo "set srcdir \"`cd ${srcdir}; ${PWD_COMMAND}`\"" >> ./tmp0
2948         @echo "set host_triplet $(host)" >> ./tmp0
2949         @echo "set build_triplet $(build)" >> ./tmp0
2950         @echo "set target_triplet $(target)" >> ./tmp0
2951         @echo "set target_alias $(target_noncanonical)" >> ./tmp0
2952         @echo "set libiconv \"$(LIBICONV)\"" >> ./tmp0
2953 # CFLAGS is set even though it's empty to show we reserve the right to set it.
2954         @echo "set CFLAGS \"\"" >> ./tmp0
2955         @echo "set CXXFLAGS \"\"" >> ./tmp0
2956         @echo "set HOSTCC \"$(CC)\"" >> ./tmp0
2957         @echo "set HOSTCFLAGS \"$(CFLAGS)\"" >> ./tmp0
2958         @echo "set TESTING_IN_BUILD_TREE 1" >> ./tmp0
2959         @echo "set HAVE_LIBSTDCXX_V3 1" >> ./tmp0
2960         @echo "set GCC_EXEC_PREFIX \"$(libdir)/gcc/\"" >> ./tmp0
2961 # If newlib has been configured, we need to pass -B to gcc so it can find
2962 # newlib's crt0.o if it exists.  This will cause a "path prefix not used"
2963 # message if it doesn't, but the testsuite is supposed to ignore the message -
2964 # it's too difficult to tell when to and when not to pass -B (not all targets
2965 # have crt0's).  We could only add the -B if ../newlib/crt0.o exists, but that
2966 # seems like too selective a test.
2967 # ??? Another way to solve this might be to rely on linker scripts.  Then
2968 # theoretically the -B won't be needed.
2969 # We also need to pass -L ../ld so that the linker can find ldscripts.
2970         @if [ -d $(objdir)/../$(target_subdir)/newlib ] \
2971             && [ "${host}" != "${target}" ]; then \
2972           echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)/newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./tmp0; \
2973           echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)/newlib/\"" >> ./tmp0; \
2974           echo "append CFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
2975           echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
2976           echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./tmp0; \
2977         else true; \
2978         fi
2979         @if [ -d $(objdir)/../ld ] ; then \
2980           echo "append LDFLAGS \" -L$(objdir)/../ld\"" >> ./tmp0; \
2981         else true; \
2982         fi
2983         echo "set tmpdir $(objdir)/testsuite" >> ./tmp0
2984         @echo "set srcdir \"\$${srcdir}/testsuite\"" >> ./tmp0
2985         @if [ "X$(ALT_CC_UNDER_TEST)" != "X" ] ; then \
2986           echo "set ALT_CC_UNDER_TEST \"$(ALT_CC_UNDER_TEST)\"" >> ./tmp0; \
2987         else true; \
2988         fi
2989         @if [ "X$(ALT_CXX_UNDER_TEST)" != "X" ] ; then \
2990           echo "set ALT_CXX_UNDER_TEST \"$(ALT_CXX_UNDER_TEST)\"" >> ./tmp0; \
2991         else true; \
2992         fi
2993         @if [ "X$(COMPAT_OPTIONS)" != "X" ] ; then \
2994           echo "set COMPAT_OPTIONS \"$(COMPAT_OPTIONS)\"" >> ./tmp0; \
2995         else true; \
2996         fi
2997         @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
2998         @cat ./tmp0 > site.exp
2999         @cat site.bak | sed \
3000                 -e '1,/^## All variables above are.*##/ d' >> site.exp
3001         -@rm -f ./tmp?
3002
3003 CHECK_TARGETS = check-gcc @check_languages@
3004
3005 check: $(CHECK_TARGETS)
3006
3007 # The idea is to parallelize testing of multilibs, for example:
3008 #   make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
3009 # will run 3 concurrent sessions of check-gcc, eventually testing
3010 # all 10 combinations.  GNU make is required, as is a shell that expands
3011 # alternations within braces.
3012 lang_checks_parallel = $(lang_checks:=//%)
3013 $(lang_checks_parallel): site.exp
3014         target=`echo "$@" | sed 's,//.*,,'`; \
3015         variant=`echo "$@" | sed 's,^[^/]*//,,'`; \
3016         vardots=`echo "$$variant" | sed 's,/,.,g'`; \
3017         $(MAKE) TESTSUITEDIR="testsuite.$$vardots" \
3018           RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \
3019           "$$target"
3020
3021 TESTSUITEDIR = testsuite
3022
3023 $(TESTSUITEDIR)/site.exp: site.exp
3024         -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
3025         -rm -f $@
3026         sed '/set tmpdir/ s|testsuite|$(TESTSUITEDIR)|' < site.exp > $@
3027
3028 $(lang_checks): check-% : site.exp
3029         -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
3030         test -d $(TESTSUITEDIR)/$* || mkdir $(TESTSUITEDIR)/$*
3031         -(rootme=`${PWD_COMMAND}`; export rootme; \
3032         srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
3033         cd $(TESTSUITEDIR)/$*; \
3034         rm -f tmp-site.exp; \
3035         sed '/set tmpdir/ s|testsuite|$(TESTSUITEDIR)/$*|' \
3036                 < ../../site.exp > tmp-site.exp; \
3037         $(SHELL) $${srcdir}/../move-if-change tmp-site.exp site.exp; \
3038         EXPECT=${EXPECT} ; export EXPECT ; \
3039         if [ -f $${rootme}/../expect/expect ] ; then  \
3040            TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
3041             export TCL_LIBRARY ; fi ; \
3042         GCC_EXEC_PREFIX="$(libdir)/gcc/" ; export GCC_EXEC_PREFIX ; \
3043         $(RUNTEST) --tool $* $(RUNTESTFLAGS))
3044
3045 check-consistency: testsuite/site.exp
3046         -rootme=`${PWD_COMMAND}`; export rootme; \
3047         srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
3048         cd testsuite; \
3049         EXPECT=${EXPECT} ; export EXPECT ; \
3050         if [ -f $${rootme}/../expect/expect ] ; then  \
3051            TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
3052            export TCL_LIBRARY ; fi ; \
3053         GCC_EXEC_PREFIX="$(libdir)/gcc/" ; export GCC_EXEC_PREFIX ; \
3054         $(RUNTEST) --tool consistency $(RUNTESTFLAGS)
3055
3056 # QMTest targets
3057
3058 # The path to qmtest.
3059 QMTEST_PATH=qmtest
3060
3061 # The flags to pass to qmtest.
3062 QMTESTFLAGS=
3063
3064 # The flags to pass to "qmtest run".
3065 QMTESTRUNFLAGS=-f none --result-stream dejagnu_stream.DejaGNUStream
3066
3067 # The command to use to invoke qmtest.
3068 QMTEST=${QMTEST_PATH} ${QMTESTFLAGS}
3069
3070 # The tests (or suites) to run.
3071 QMTEST_GPP_TESTS=g++
3072
3073 # The subdirectory of the OBJDIR that will be used to store the QMTest
3074 # test database configuration and that will be used for temporary
3075 # scratch space during QMTest's execution.
3076 QMTEST_DIR=qmtestsuite
3077
3078 # Create the QMTest database configuration.
3079 ${QMTEST_DIR} stamp-qmtest:
3080         ${QMTEST} -D ${QMTEST_DIR} create-tdb \
3081             -c gcc_database.GCCDatabase \
3082             -a srcdir=`cd ${srcdir}/testsuite && ${PWD_COMMAND}` && \
3083             $(STAMP) stamp-qmtest
3084
3085 # Create the QMTest context file.
3086 ${QMTEST_DIR}/context: stamp-qmtest
3087         rm -f $@
3088         echo "CompilerTable.languages=c cplusplus" >> $@
3089         echo "CompilerTable.c_kind=GCC" >> $@
3090         echo "CompilerTable.c_path=${objdir}/xgcc" >> $@
3091         echo "CompilerTable.c_options=-B${objdir}/" >> $@
3092         echo "CompilerTable.cplusplus_kind=GCC" >> $@
3093         echo "CompilerTable.cplusplus_path=${objdir}/g++" >> $@
3094         echo "CompilerTable.cplusplus_options=-B${objdir}/" >> $@
3095         echo "DejaGNUTest.target=${target_noncanonical}" >> $@
3096
3097 # Run the G++ testsuite using QMTest.
3098 qmtest-g++: ${QMTEST_DIR}/context
3099         cd ${QMTEST_DIR} && ${QMTEST} run ${QMTESTRUNFLAGS} -C context \
3100            -o g++.qmr ${QMTEST_GPP_TESTS}
3101
3102 # Use the QMTest GUI.
3103 qmtest-gui: ${QMTEST_DIR}/context
3104         cd ${QMTEST_DIR} && ${QMTEST} gui -C context
3105
3106 .PHONY: qmtest-g++
3107
3108 # Run Paranoia on real.c.
3109
3110 paranoia.o: $(srcdir)/../contrib/paranoia.cc $(CONFIG_H) $(SYSTEM_H) \
3111   $(REAL_H) $(TREE_H)
3112         g++ -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION)
3113
3114 paranoia: paranoia.o real.o $(LIBIBERTY)
3115         g++ -o $@ paranoia.o real.o $(LIBIBERTY)
3116
3117 # These exist for maintenance purposes.
3118
3119 # Update the tags table.
3120 TAGS: lang.tags
3121         (cd $(srcdir);                                  \
3122         incs= ;                                         \
3123         list='$(SUBDIRS)'; for dir in $$list; do        \
3124           if test -f $$dir/TAGS; then                   \
3125             incs="$$incs --include $$dir/TAGS.sub";     \
3126           fi;                                           \
3127         done;                                           \
3128         etags -o TAGS.sub *.y *.h *.c; \
3129         etags --include TAGS.sub $$incs)
3130
3131 # -----------------------------------------------------
3132 # Rules for generating translated message descriptions.
3133 # Disabled by autoconf if the tools are not available.
3134 # -----------------------------------------------------
3135
3136 XGETTEXT = @XGETTEXT@
3137 GMSGFMT = @GMSGFMT@
3138 MSGMERGE = msgmerge
3139 CATALOGS = $(patsubst %,po/%,@CATALOGS@)
3140
3141 .PHONY: build- install- build-po install-po update-po
3142
3143 # Dummy rules to deal with dependencies produced by use of
3144 # "build-@POSUB@" and "install-@POSUB@" above, when NLS is disabled.
3145 build-: ; @true
3146 install-: ; @true
3147
3148 build-po: $(CATALOGS)
3149
3150 # This notation should be acceptable to all Make implementations used
3151 # by people who are interested in updating .po files.
3152 update-po: $(CATALOGS:.gmo=.pox)
3153
3154 # N.B. We do not attempt to copy these into $(srcdir).  The snapshot
3155 # script does that.
3156 .po.gmo:
3157         -test -d po || mkdir po
3158         $(GMSGFMT) --statistics -o $@ $<
3159
3160 # The new .po has to be gone over by hand, so we deposit it into
3161 # build/po with a different extension.
3162 # If build/po/gcc.pot exists, use it (it was just created),
3163 # else use the one in srcdir.
3164 .po.pox:
3165         -test -d po || mkdir po
3166         $(MSGMERGE) $< `if test -f po/gcc.pot; \
3167                         then echo po/gcc.pot; \
3168                         else echo $(srcdir)/po/gcc.pot; fi` -o $@
3169
3170 # This rule has to look for .gmo modules in both srcdir and
3171 # the cwd, and has to check that we actually have a catalog
3172 # for each language, in case they weren't built or included
3173 # with the distribution.
3174 install-po:
3175         $(mkinstalldirs) $(DESTDIR)$(datadir)
3176         cats="$(CATALOGS)"; for cat in $$cats; do \
3177           lang=`basename $$cat | sed 's/\.gmo$$//'`; \
3178           if [ -f $$cat ]; then :; \
3179           elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
3180           else continue; \
3181           fi; \
3182           dir=$(localedir)/$$lang/LC_MESSAGES; \
3183           echo $(mkinstalldirs) $(DESTDIR)$$dir; \
3184           $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \
3185           echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
3186           $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
3187         done
3188
3189 # Rule for regenerating the message template (gcc.pot).
3190 # Instead of forcing everyone to edit POTFILES.in, which proved impractical,
3191 # this rule has no dependencies and always regenerates gcc.pot.  This is
3192 # relatively harmless since the .po files do not directly depend on it.
3193 # Note that exgettext has an awk script embedded in it which requires a
3194 # fairly modern (POSIX-compliant) awk.
3195 # The .pot file is left in the build directory.
3196 gcc.pot: po/gcc.pot
3197 po/gcc.pot: force
3198         -test -d po || mkdir po
3199         $(MAKE) srcextra
3200         AWK=$(AWK) $(SHELL) $(srcdir)/po/exgettext \
3201                 $(XGETTEXT) gcc $(srcdir)
3202
3203 #\f
3204
3205 # Dependency information.
3206
3207 # Add flags needed by some particular compilations.
3208 collect2.o : \
3209         ALL_CPPFLAGS := $(ALL_CPPFLAGS) \
3210                 -DTARGET_MACHINE=\"$(target_noncanonical)\"
3211 c-opts.o : \
3212         ALL_CPPFLAGS := $(ALL_CPPFLAGS) @TARGET_SYSTEM_ROOT_DEFINE@
3213 gcc.o: \
3214         ALL_CPPFLAGS := $(ALL_CPPFLAGS) $(DRIVER_DEFINES)
3215 gccspec.o: \
3216         ALL_CPPFLAGS := $(ALL_CPPFLAGS) $(DRIVER_DEFINES)
3217 gcc-options.o: \
3218         ALL_CPPFLAGS := $(ALL_CPPFLAGS) -DGCC_DRIVER
3219 cppdefault.o : \
3220         ALL_CPPFLAGS := $(ALL_CPPFLAGS) $(PREPROCESSOR_DEFINES)
3221 protoize.o: \
3222         ALL_CPPFLAGS := $(ALL_CPPFLAGS) $(DRIVER_DEFINES)
3223 unprotoize.o: \
3224         ALL_CPPFLAGS := $(ALL_CPPFLAGS) $(DRIVER_DEFINES) -DUNPROTOIZE
3225 # Remake internationalization support.
3226 intl.o : \
3227         ALL_CPPFLAGS := $(ALL_CPPFLAGS) -DLOCALEDIR=\"$(localedir)\"
3228
3229 # We need an explicit dependency here, because these are not directly
3230 # included but their contents are included via command line options.
3231 ifdef REVISION_s
3232 version.o: version.c version.h $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
3233 else
3234 version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE)
3235 endif
3236
3237 version.o : \
3238         ALL_CPPFLAGS := $(ALL_CPPFLAGS) \
3239         -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
3240         -DREVISION=$(REVISION_s) \
3241         -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \
3242         -DBUGURL=$(BUGURL_s)
3243 prefix.o : \
3244         ALL_CPPFLAGS := $(ALL_CPPFLAGS) -DPREFIX=\"$(prefix)\" \
3245         -DBASEVER=$(BASEVER_s)
3246 toplev.o : \
3247         ALL_CPPFLAGS := $(ALL_CPPFLAGS) -DTARGET_NAME=\"$(target_noncanonical)\"
3248
3249 # Special code and dependencies for -combine compilation.
3250 libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
3251   $(DATESTAMP) $(BASEVER) $(DEVPHASE)
3252         $(COMPILE) \
3253           -DTARGET_NAME=\"$(target_noncanonical)\" \
3254           -DLOCALEDIR=\"$(localedir)\" \
3255           $(filter %.c,$^) \
3256           -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
3257           -DREVISION=$(REVISION_s) \
3258           -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \
3259           -DBUGURL=$(BUGURL_s) -combine
3260
3261 # A couple object files don't share a base name with their source files.
3262 $(out_object_file): $(out_file)
3263         $(COMPILE) $<
3264 gcc-options.o: options.c
3265         $(COMPILE) $<
3266
3267 # Make sure generated files are built at the right time.
3268 $(ALL_HOST_OBJS): | $(generated_files)
3269
3270 # Include the auto-generated dependencies for all host objects.
3271 DEPFILES = \
3272   $(foreach obj,$(ALL_HOST_OBJS),\
3273     $(dir $(obj))$(DEPDIR)$(patsubst %.o,%.Po,$(notdir $(obj))))
3274 -include $(DEPFILES)
3275
3276 # Include the auto-generated dependencies for all build objects.
3277 -include $(patsubst %.o,build/$(DEPDIR)/%.Po,$(ALL_BUILD_OBJS))