Makefile.in revision 117404
1# Makefile for GNU C compiler.
2#   Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
3#   1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
4
5#This file is part of GCC.
6
7#GCC is free software; you can redistribute it and/or modify
8#it under the terms of the GNU General Public License as published by
9#the Free Software Foundation; either version 2, or (at your option)
10#any later version.
11
12#GCC is distributed in the hope that it will be useful,
13#but WITHOUT ANY WARRANTY; without even the implied warranty of
14#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15#GNU General Public License for more details.
16
17#You should have received a copy of the GNU General Public License
18#along with GCC; see the file COPYING.  If not, write to
19#the Free Software Foundation, 59 Temple Place - Suite 330,
20#Boston MA 02111-1307, USA.
21
22# The targets for external use include:
23# all, doc, proto, install, install-cross, install-cross-rest,
24# uninstall, TAGS, mostlyclean, clean, distclean, maintainer-clean,
25# stage1, stage2, stage3, stage4.
26
27# This is the default target.
28all:
29
30# Suppress smart makes who think they know how to automake Yacc files
31.y.c:
32
33# Directory where sources are, from where we are.
34srcdir = @srcdir@
35VPATH = @srcdir@
36
37# Pointer to the GCC Project website
38website=http://gcc.gnu.org
39
40# Variables that exist for you to override.
41# See below for how to change them for certain systems.
42
43# List of language subdirectories.
44# This is overridden by configure.
45SUBDIRS =@subdirs@
46
47# Selection of languages to be made.
48# This is overridden by configure.
49CONFIG_LANGUAGES = @all_languages@
50LANGUAGES = c gcov$(exeext) $(CONFIG_LANGUAGES)
51
52# Selection of languages to be made during stage1 build.
53# This is overridden by configure.
54BOOT_LANGUAGES = c @all_boot_languages@
55
56# Various ways of specifying flags for compilations:
57# CFLAGS is for the user to override to, e.g., do a cross build with -O2.
58# For recursive  bootstrap builds CFLAGS is used to pass in STAGE1_CFLAGS
59# or BOOT_CFLAGS
60# STAGE1_CFLAGS is set by configure on some targets or passed from toplevel
61# and sets the CFLAGS passed to stage1 of a bootstrap compilation.
62# BOOT_CFLAGS is the value of CFLAGS to pass to the stage2, stage3 and stage4
63# bootstrap compilations.
64# XCFLAGS is used for most compilations but not when using the GCC just built.
65# TCFLAGS is used for compilations with the GCC just built.
66XCFLAGS =
67TCFLAGS =
68CFLAGS = -g
69STAGE1_CFLAGS = -g @stage1_cflags@
70BOOT_CFLAGS = -g -O2
71
72# Flags to determine code coverage. When coverage is disabled, this will
73# contain the optimization flags, as you normally want code coverage
74# without optimization. The -dumpbase $@ makes sure that the auxilary
75# files end up near the object files.
76COVERAGE_FLAGS = @coverage_flags@
77coverageexts = .{da,bb,bbg}
78
79# The warning flags are separate from BOOT_CFLAGS because people tend to
80# override optimization flags and we'd like them to still have warnings
81# turned on.  These flags are also used to pass other stage dependent
82# flags from configure.  The user is free to explicitly turn these flags
83# off if they wish.
84# LOOSE_WARN are the warning flags to use when compiling something
85# which is only compiled with gcc, such as libgcc and the frontends
86# other than C.
87# STRICT_WARN and STRICT2_WARN are the additional warning flags to
88# apply to the back end and the C front end, which may be compiled
89# with other compilers.  This is partially controlled by configure in
90# stage1, as not all versions of gcc understand -Wno-long-long.
91LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
92STRICT_WARN = -Wtraditional @strict1_warn@
93STRICT2_WARN = -Wtraditional -pedantic -Wno-long-long
94
95# This is set by --enable-checking.  The idea is to catch forgotten
96# "extern" tags in header files.
97NOCOMMON_FLAG = @nocommon_flag@
98
99# These are set by --enable-checking=valgrind.
100RUN_GEN = @valgrind_command@
101VALGRIND_DRIVER_DEFINES = @valgrind_path_defines@
102
103# This is how we control whether or not the additional warnings are applied.
104.-warn = $(STRICT_WARN)
105GCC_WARN_CFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG)
106
107# All warnings have to be shut off in stage1 if the compiler used then
108# isn't gcc; configure determines that.  WARN_CFLAGS will be either
109# $(GCC_WARN_CFLAGS), or nothing.
110WARN_CFLAGS = @warn_cflags@
111
112# These exists to be overridden by the x-* and t-* files, respectively.
113X_CFLAGS =
114T_CFLAGS =
115
116X_CPPFLAGS =
117T_CPPFLAGS =
118
119ADAC = @ADAC@
120AWK = @AWK@
121CC = @CC@
122BISON = @BISON@
123BISONFLAGS =
124FLEX = @FLEX@
125FLEXFLAGS =
126AR = ar
127AR_FLAGS = rc
128DLLTOOL = dlltool
129RANLIB = @RANLIB@
130SHELL = @SHELL@
131# pwd command to use.  Allow user to override default by setting PWDCMD in
132# the environment to account for automounters.  The make variable must not
133# be called PWDCMD, otherwise the value set here is passed to make
134# subprocesses and overrides the setting from the user's environment.
135# Don't use PWD since it is a common shell environment variable and we
136# don't want to corrupt it.
137PWD_COMMAND = $${PWDCMD-pwd}
138# on sysV, define this as cp.
139INSTALL = @INSTALL@
140# Some systems may be missing symbolic links, regular links, or both.
141# Allow configure to check this and use "ln -s", "ln", or "cp" as appropriate.
142LN=@LN@
143LN_S=@LN_S@
144# These permit overriding just for certain files.
145INSTALL_PROGRAM = @INSTALL_PROGRAM@
146INSTALL_DATA = @INSTALL_DATA@
147INSTALL_SCRIPT = @INSTALL@
148MAKEINFO = @MAKEINFO@
149MAKEINFOFLAGS =
150TEXI2DVI = texi2dvi
151TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl
152POD2MAN = pod2man --center="GNU" --release="gcc-$(version)"
153# For GNUmake: let us decide what gets passed to recursive makes.
154MAKEOVERRIDES =
155@SET_MAKE@
156# Some compilers can't handle cc -c blah.c -o foo/blah.o.
157# In stage2 and beyond, we force this to "-o $@" since we know we're using gcc.
158OUTPUT_OPTION = @OUTPUT_OPTION@
159
160# Some versions of `touch' (such as the version on Solaris 2.8)
161# do not correctly set the timestamp due to buggy versions of `utime'
162# in the kernel.  So, we use `echo' instead.
163STAMP = echo timestamp >
164
165# This is where we get zlib from.  zlibdir is -L../zlib and zlibinc is
166# -I../zlib, unless we were configured with --with-system-zlib, in which
167# case both are empty.
168ZLIB = @zlibdir@ -lz
169ZLIBINC = @zlibinc@
170
171# Substitution type for target's getgroups 2nd arg.
172TARGET_GETGROUPS_T = @TARGET_GETGROUPS_T@
173
174# Target to use when installing include directory.  Either
175# install-headers-tar, install-headers-cpio or install-headers-cp.
176INSTALL_HEADERS_DIR = @build_install_headers_dir@
177
178# Header files that are made available under the same name
179# to programs compiled with GCC.
180USER_H = $(srcdir)/ginclude/float.h \
181	 $(srcdir)/ginclude/iso646.h \
182	 $(srcdir)/ginclude/stdarg.h \
183	 $(srcdir)/ginclude/stdbool.h \
184	 $(srcdir)/ginclude/stddef.h \
185	 $(srcdir)/ginclude/varargs.h \
186	 $(srcdir)/unwind.h \
187	 $(EXTRA_HEADERS)
188
189# The GCC to use for compiling libgcc.a and crt*.o.
190# Usually the one we just built.
191# Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
192GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include
193
194# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
195# It omits XCFLAGS, and specifies -B./.
196# It also specifies -isystem ./include to find, e.g., stddef.h.
197GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) -isystem ./include $(TCFLAGS)
198
199# Sed command to transform gcc to installed name.  Overwritten by configure.
200program_transform_name = @program_transform_name@
201program_transform_cross_name = s,^,$(target_alias)-,
202
203build_canonical = @build_canonical@
204host_canonical = @host_canonical@
205
206# Tools to use when building a cross-compiler.
207# These are used because `configure' appends `cross-make'
208# to the makefile when making a cross-compiler.
209
210# Use the tools from the build tree, if they are available.
211
212# objdir is set by configure.
213objdir = @objdir@
214
215AR_FOR_TARGET = ` \
216  if [ -f $(objdir)/../binutils/ar ] ; then \
217    echo $(objdir)/../binutils/ar ; \
218  else \
219    if [ "$(host_canonical)" = "$(target)" ] ; then \
220      echo ar; \
221    else \
222       t='$(program_transform_cross_name)'; echo ar | sed -e $$t ; \
223    fi; \
224  fi`
225AR_FLAGS_FOR_TARGET =
226AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc
227AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x
228RANLIB_FOR_TARGET = ` \
229  if [ -f $(objdir)/../binutils/ranlib ] ; then \
230    echo $(objdir)/../binutils/ranlib ; \
231  else \
232    if [ "$(host_canonical)" = "$(target)" ] ; then \
233      echo ranlib; \
234    else \
235       t='$(program_transform_cross_name)'; echo ranlib | sed -e $$t ; \
236    fi; \
237  fi`
238RANLIB_TEST_FOR_TARGET = \
239  [ -f $(RANLIB_FOR_TARGET) ] \
240  || ( [ "$(host_canonical)" = "$(target)" ] \
241       && [ -f /usr/bin/ranlib -o -f /bin/ranlib ] )
242NM_FOR_TARGET = ` \
243  if [ -f ./nm ] ; then \
244    echo ./nm ; \
245  elif [ -f $(objdir)/../binutils/nm-new ] ; then \
246    echo $(objdir)/../binutils/nm-new ; \
247  else \
248    if [ "$(host_canonical)" = "$(target)" ] ; then \
249      echo nm; \
250    else \
251       t='$(program_transform_cross_name)'; echo nm | sed -e $$t ; \
252    fi; \
253  fi`
254
255# Where to find some libiberty headers.
256HASHTAB_H   = $(srcdir)/../include/hashtab.h
257OBSTACK_H   = $(srcdir)/../include/obstack.h
258SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h
259FIBHEAP_H   = $(srcdir)/../include/fibheap.h
260PARTITION_H = $(srcdir)/../include/partition.h
261
262# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
263NATIVE_SYSTEM_HEADER_DIR = /usr/include
264# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
265CROSS_SYSTEM_HEADER_DIR = $(build_tooldir)/sys-include
266
267# autoconf sets SYSTEM_HEADER_DIR to one of the above.
268SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@
269
270# Control whether to run fixproto and fixincludes.
271STMP_FIXPROTO = @STMP_FIXPROTO@
272STMP_FIXINC = @STMP_FIXINC@
273
274# Test to see whether <limits.h> exists in the system header files.
275LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
276
277target=@target@
278target_alias=@target_alias@
279xmake_file=@dep_host_xmake_file@
280tmake_file=@dep_tmake_file@
281out_file=$(srcdir)/config/@out_file@
282out_object_file=@out_object_file@
283md_file=$(srcdir)/config/@md_file@
284tm_defines=@tm_defines@
285tm_p_file_list=@tm_p_file_list@
286tm_p_file=@tm_p_file@
287build_xm_file_list=@build_xm_file_list@
288build_xm_file=@build_xm_file@
289build_xm_defines=@build_xm_defines@
290host_xm_file_list=@host_xm_file_list@
291host_xm_file=@host_xm_file@
292host_xm_defines=@host_xm_defines@
293xm_file=@xm_file@
294xm_defines=@xm_defines@
295lang_specs_files=@lang_specs_files@
296lang_options_files=@lang_options_files@
297lang_tree_files=@lang_tree_files@
298target_cpu_default=@target_cpu_default@
299GCC_THREAD_FILE=@thread_file@
300OBJC_BOEHM_GC=@objc_boehm_gc@
301GTHREAD_FLAGS=@gthread_flags@
302# Be prepared for gcc2 merges.
303gcc_version=@gcc_version@
304gcc_version_trigger=@gcc_version_trigger@
305version=$(gcc_version)
306mainversion=`grep version_string $(srcdir)/version.c | sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/'`
307
308# Common prefix for installation directories.
309# NOTE: This directory must exist when you start installation.
310prefix = @prefix@
311# Directory in which to put localized header files. On the systems with
312# gcc as the native cc, `local_prefix' may not be `prefix' which is
313# `/usr'.
314# NOTE: local_prefix *should not* default from prefix.
315local_prefix = @local_prefix@
316# Directory in which to put host dependent programs and libraries
317exec_prefix = @exec_prefix@
318# Directory in which to put the executable for the command `gcc'
319bindir = @bindir@
320# Directory in which to put the directories used by the compiler.
321libdir = @libdir@
322# Directory in which the compiler finds executables, libraries, etc.
323libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(version)
324# Used to produce a relative $(gcc_tooldir) in gcc.o
325unlibsubdir = ../../..
326# Directory in which to find other cross-compilation tools and headers.
327dollar = @dollar@
328# Used in install-cross.
329gcc_tooldir = @gcc_tooldir@
330# Used to install the shared libgcc.
331slibdir = @slibdir@
332# Since gcc_tooldir does not exist at build-time, use -B$(build_tooldir)/bin/
333build_tooldir = $(exec_prefix)/$(target_alias)
334# Directory in which the compiler finds target-independent g++ includes.
335gcc_gxx_include_dir = @gcc_gxx_include_dir@
336# Directory to search for site-specific includes.
337local_includedir = $(local_prefix)/include
338includedir = $(prefix)/include
339# where the info files go
340infodir = @infodir@
341# Where cpp should go besides $prefix/bin if necessary
342cpp_install_dir = @cpp_install_dir@
343# where the locale files go
344datadir = @datadir@
345localedir = $(datadir)/locale
346# Extension (if any) to put in installed man-page filename.
347man1ext = .1
348man7ext = .7
349objext = .o
350exeext = @host_exeext@
351build_exeext = @build_exeext@
352
353# Directory in which to put man pages.
354mandir = @mandir@
355man1dir = $(mandir)/man1
356man7dir = $(mandir)/man7
357# Dir for temp files.
358tmpdir = /tmp
359
360# Top build directory, relative to here.
361top_builddir = .
362
363# Whether we were configured with NLS.
364USE_NLS = @USE_NLS@
365
366# Internationalization library.
367INTLLIBS = @INTLLIBS@
368INTLDEPS = @INTLDEPS@
369
370# Character encoding conversion library.
371LIBICONV = @LIBICONV@
372
373# List of internationalization subdirectories.
374INTL_SUBDIRS = intl
375
376# The GC method to be used on this system.
377GGC=@GGC@.o
378
379# If a supplementary library is being used for the GC.
380GGC_LIB=
381
382# libgcc.a may be built directly or via stmp-multilib,
383# and installed likewise.  Overridden by t-fragment.
384LIBGCC = libgcc.a
385INSTALL_LIBGCC = install-libgcc
386
387# Options to use when compiling libgcc2.a.
388#
389LIBGCC2_DEBUG_CFLAGS = -g
390LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED @inhibit_libc@
391
392# Additional options to use when compiling libgcc2.a.
393# Some targets override this to -isystem include
394LIBGCC2_INCLUDES =
395
396# Additional target-dependent options for compiling libgcc2.a.
397TARGET_LIBGCC2_CFLAGS =
398
399# Options to use when compiling crtbegin/end.
400CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
401  -finhibit-size-directive -fno-inline-functions -fno-exceptions \
402  -fno-zero-initialized-in-bss
403
404# Additional sources to handle exceptions; overridden on ia64.
405LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
406  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
407LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
408
409# nm flags to list global symbols in libgcc object files.
410SHLIB_NM_FLAGS = -pg
411
412# List of extra executables that should be compiled for this target machine
413# that are used for compiling from source code to object code.
414# The rules for compiling them should be in the t-* file for the machine.
415EXTRA_PASSES =@extra_passes@
416
417# Like EXTRA_PASSES, but these are used when linking.
418EXTRA_PROGRAMS = @extra_programs@
419
420# List of extra object files that should be compiled for this target machine.
421# The rules for compiling them should be in the t-* file for the machine.
422EXTRA_PARTS = @extra_parts@
423
424# List of extra object files that should be compiled and linked with
425# compiler proper (cc1, cc1obj, cc1plus).
426EXTRA_OBJS = @extra_objs@
427
428# List of extra object files that should be compiled and linked with
429# the gcc driver.
430EXTRA_GCC_OBJS =@host_extra_gcc_objs@
431
432# List of additional header files to install.
433# Often this is edited directly by `configure'.
434EXTRA_HEADERS =@extra_headers_list@
435
436# It is convenient for configure to add the assignment at the beginning,
437# so don't override it here.
438USE_COLLECT2 = collect2$(exeext)
439
440# List of extra C and assembler files to add to static and shared libgcc2.
441# Assembler files should have names ending in `.asm'.
442LIB2FUNCS_EXTRA =
443
444# List of extra C and assembler files to add to static libgcc2.
445# Assembler files should have names ending in `.asm'.
446LIB2FUNCS_STATIC_EXTRA =
447
448# Program to convert libraries.
449LIBCONVERT =
450
451# Control whether header files are installed.
452INSTALL_HEADERS=install-headers install-mkheaders
453
454# Control whether Info documentation is built and installed.
455BUILD_INFO = @BUILD_INFO@
456
457# Control whether manpages generated by texi2pod.pl can be rebuilt.
458GENERATED_MANPAGES = @GENERATED_MANPAGES@
459
460# Additional directories of header files to run fixincludes on.
461# These should be directories searched automatically by default
462# just as /usr/include is.
463# *Do not* use this for directories that happen to contain
464# header files, but are not searched automatically by default.
465# On most systems, this is empty.
466OTHER_FIXINCLUDES_DIRS=
467
468# A list of all the language-specific executables.
469# This is overridden by configure.
470COMPILERS = cc1$(exeext) @all_compilers@
471
472# List of things which should already be built whenever we try to use xgcc
473# to compile anything (without linking).
474GCC_PASSES=xgcc$(exeext) cc1$(exeext) specs $(EXTRA_PASSES)
475
476# List of things which should already be built whenever we try to use xgcc
477# to link anything.
478GCC_PARTS=$(GCC_PASSES) $(LIBGCC) $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
479
480# Directory to link to, when using the target `maketest'.
481DIR = ../gcc
482
483# Flags to use when cross-building GCC.
484# Prefix to apply to names of object files when using them
485# to run on the machine we are compiling on.
486BUILD_PREFIX = @BUILD_PREFIX@
487# Prefix to apply to names of object files when compiling them
488# to run on the machine we are compiling on.
489# The default for this variable is chosen to keep these rules
490# out of the way of the other rules for compiling the same source files.
491BUILD_PREFIX_1 = @BUILD_PREFIX_1@
492# Native compiler for the build machine and its switches.
493HOST_CC = @HOST_CC@
494HOST_CFLAGS= @HOST_CFLAGS@ -DGENERATOR_FILE
495
496# Native linker and preprocessor flags.  For x-fragment overrides.
497HOST_LDFLAGS=$(LDFLAGS)
498HOST_CPPFLAGS=$(ALL_CPPFLAGS)
499
500# Actual name to use when installing a native compiler.
501GCC_INSTALL_NAME = `echo gcc|sed '$(program_transform_name)'`
502GCC_TARGET_INSTALL_NAME = $(target_alias)-`echo gcc|sed '$(program_transform_name)'`
503CPP_INSTALL_NAME = `echo cpp|sed '$(program_transform_name)'`
504PROTOIZE_INSTALL_NAME = `echo protoize|sed '$(program_transform_name)'`
505UNPROTOIZE_INSTALL_NAME = `echo unprotoize|sed '$(program_transform_name)'`
506GCOV_INSTALL_NAME = `echo gcov|sed '$(program_transform_name)'`
507GCCBUG_INSTALL_NAME = `echo gccbug|sed '$(program_transform_name)'`
508
509# Actual name to use when installing a cross-compiler.
510GCC_CROSS_NAME = `echo gcc|sed '$(program_transform_cross_name)'`
511CPP_CROSS_NAME = `echo cpp|sed '$(program_transform_cross_name)'`
512PROTOIZE_CROSS_NAME = `echo protoize|sed '$(program_transform_cross_name)'`
513UNPROTOIZE_CROSS_NAME = `echo unprotoize|sed '$(program_transform_cross_name)'`
514
515# Set by autoconf to "all.internal" for a native build, or
516# "all.cross" to build a cross compiler.
517ALL = @ALL@
518
519# Setup the testing framework, if you have one
520EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
521            echo $${rootme}/../expect/expect ; \
522          else echo expect ; fi`
523
524RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
525	       echo $${srcdir}/../dejagnu/runtest ; \
526	    else echo runtest; fi`
527RUNTESTFLAGS =
528
529# Extra symbols for fixproto to define when parsing headers.
530FIXPROTO_DEFINES =
531
532# Extra flags to use when compiling crt{begin,end}.o.
533CRTSTUFF_T_CFLAGS =
534
535# Extra flags to use when compiling [m]crt0.o.
536CRT0STUFF_T_CFLAGS =
537
538# "t" or nothing, for building multilibbed versions of, say, crtbegin.o.
539T =
540
541# Should T contain a `=', libgcc.mk will make T_TARGET, setting
542# $(T_TARGET) to the name of the actual target filename.
543T_TARGET =
544T_TARGET : $(T_TARGET)
545
546# End of variables for you to override.
547
548# Definition of `all' is here so that new rules inserted by sed
549# do not specify the default target.
550# The real definition is under `all.internal' (for native compilers)
551# or `all.cross' (for cross compilers).
552all: all.indirect
553
554# This tells GNU Make version 3 not to put all variables in the environment.
555.NOEXPORT:
556
557# GCONFIG_H lists the config files that the generator files depend on, while
558# CONFIG_H lists the ones ordinary gcc files depend on, which includes
559# several files generated by those generators.
560GCONFIG_H = config.h $(host_xm_file_list)
561HCONFIG_H = hconfig.h $(build_xm_file_list)
562CONFIG_H = $(GCONFIG_H) insn-constants.h insn-flags.h
563TCONFIG_H = tconfig.h $(xm_file_list)
564TARGET_H = target.h
565HOOKS_H = hooks.h
566LANGHOOKS_DEF_H = langhooks-def.h $(HOOKS_H)
567TARGET_DEF_H = target-def.h $(HOOKS_H)
568TM_P_H = tm_p.h $(tm_p_file_list) tm-preds.h
569
570MACHMODE_H = machmode.h machmode.def @extra_modes_file@
571RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H)
572RTL_H = $(RTL_BASE_H) genrtl.h
573PARAMS_H = params.h params.def
574TREE_H = tree.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def \
575          location.h
576BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h $(PARTITION_H) \
577          hard-reg-set.h
578DEMANGLE_H = $(srcdir)/../include/demangle.h
579RECOG_H = recog.h
580EXPR_H = expr.h
581OPTABS_H = optabs.h insn-codes.h
582REGS_H = regs.h varray.h $(MACHMODE_H)
583INTEGRATE_H = integrate.h varray.h
584LOOP_H = loop.h varray.h bitmap.h
585GCC_H = gcc.h version.h
586GGC_H = ggc.h varray.h gtype-desc.h
587TIMEVAR_H = timevar.h timevar.def
588INSN_ATTR_H = insn-attr.h $(srcdir)/insn-addr.h $(srcdir)/varray.h
589C_COMMON_H = c-common.h $(SPLAY_TREE_H) $(CPPLIB_H)
590C_TREE_H = c-tree.h $(C_COMMON_H)
591SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h
592PREDICT_H = predict.h predict.def
593CPPLIB_H = cpplib.h line-map.h
594
595# sed inserts variable overrides after the following line.
596####target overrides
597@target_overrides@
598
599####host overrides
600@host_overrides@
601#
602# Now figure out from those variables how to compile and link.
603
604all.indirect: $(ALL)
605
606# IN_GCC distinguishes between code compiled into GCC itself and other
607# programs built during a bootstrap.
608# autoconf inserts -DCROSS_COMPILE if we are building a cross compiler.
609INTERNAL_CFLAGS = -DIN_GCC @CROSS@
610
611# This is the variable actually used when we compile.
612# If you change this line, you probably also need to change the definition
613# of HOST_CFLAGS in build-make to match.
614ALL_CFLAGS = $(X_CFLAGS) $(T_CFLAGS) \
615  $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@
616
617# Likewise.
618ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
619
620# Build and host support libraries.  FORBUILD is either
621# .. or ../$(build_alias) depending on whether host != build.
622LIBIBERTY = ../libiberty/libiberty.a
623BUILD_LIBIBERTY = @FORBUILD@/libiberty/libiberty.a
624
625# Dependencies on the intl and portability libraries.
626LIBDEPS= $(INTLDEPS) $(LIBIBERTY)
627
628# Likewise, for use in the tools that must run on this machine
629# even if we are cross-building GCC.
630HOST_LIBDEPS= $(BUILD_LIBIBERTY)
631
632# How to link with both our special library facilities
633# and the system's installed libraries.
634LIBS =	$(INTLLIBS) @LIBS@ $(LIBIBERTY)
635
636# Any system libraries needed just for GNAT.
637SYSLIBS = @GNAT_LIBEXC@
638
639# Libs needed (at present) just for jcf-dump.
640LDEXP_LIB = @LDEXP_LIB@
641
642# Likewise, for use in the tools that must run on this machine
643# even if we are cross-building GCC.
644HOST_LIBS = $(BUILD_LIBIBERTY)
645
646HOST_RTL = $(BUILD_PREFIX)rtl.o read-rtl.o $(BUILD_PREFIX)bitmap.o \
647		$(BUILD_PREFIX)ggc-none.o
648HOST_SUPPORT = gensupport.o insn-conditions.o
649HOST_EARLY_SUPPORT = gensupport.o dummy-conditions.o
650
651HOST_PRINT = print-rtl1.o
652HOST_ERRORS = $(BUILD_PREFIX)errors.o
653HOST_VARRAY = $(BUILD_PREFIX)varray.o
654
655# Specify the directories to be searched for header files.
656# Both . and srcdir are used, in that order,
657# so that *config.h will be found in the compilation
658# subdirectory rather than in the source directory.
659# -I$(@D) and -I$(srcdir)/$(@D) cause the subdirectory of the file
660# currently being compiled, in both source trees, to be examined as well.
661INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
662	   -I$(srcdir)/config -I$(srcdir)/../include
663
664# Always use -I$(srcdir)/config when compiling.
665.c.o:
666	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
667
668# This tells GNU make version 3 not to export all the variables
669# defined in this file into the environment.
670.NOEXPORT:
671#
672# Support for additional languages (other than c and objc).
673# ??? objc can be supported this way too (leave for later).
674
675# These next lines are overridden by configure.
676LANG_MAKEFILES = @all_lang_makefiles@
677LANG_STAGESTUFF = @all_stagestuff@
678
679# Flags to pass to recursive makes.
680# CC is set by configure.  Hosts without symlinks need special handling
681# because we need CC="stage1/xgcc -Bstage1/" to work in the language
682# subdirectories.
683# ??? The choices here will need some experimenting with.
684ORDINARY_FLAGS_TO_PASS = \
685	"AR_FLAGS_FOR_TARGET=$(AR_FLAGS_FOR_TARGET)" \
686	"AR_CREATE_FOR_TARGET=$(AR_CREATE_FOR_TARGET)" \
687	"AR_EXTRACT_FOR_TARGET=$(AR_EXTRACT_FOR_TARGET)" \
688	"AR_FOR_TARGET=$(AR_FOR_TARGET)" \
689	"BISON=$(BISON)" \
690	"BISONFLAGS=$(BISONFLAGS)" \
691	"CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
692	"DESTDIR=$(DESTDIR)" \
693	"GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
694	"LDFLAGS=$(LDFLAGS)" \
695	"FLEX=$(FLEX)" \
696	"FLEXFLAGS=$(FLEXFLAGS)" \
697	"LN=$(LN)" \
698	"LN_S=$(LN_S)" \
699	"MAKEINFO=$(MAKEINFO)" \
700	"MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
701	"MAKEOVERRIDES=" \
702	"RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
703	"RANLIB_TEST_FOR_TARGET=$(RANLIB_TEST_FOR_TARGET)" \
704	"SHELL=$(SHELL)" \
705	"exeext=$(exeext)" \
706	"build_exeext=$(build_exeext)" \
707	"objext=$(objext)" \
708	"exec_prefix=$(exec_prefix)" \
709	"prefix=$(prefix)" \
710	"local_prefix=$(local_prefix)" \
711	"gxx_include_dir=$(gcc_gxx_include_dir)" \
712	"build_tooldir=$(build_tooldir)" \
713	"gcc_tooldir=$(gcc_tooldir)" \
714	"bindir=$(bindir)" \
715	"libsubdir=$(libsubdir)" \
716	"datadir=$(datadir)" \
717	"localedir=$(localedir)"
718FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) "CC=@cc_set_by_configure@" \
719	"STAGE_PREFIX=@stage_prefix_set_by_configure@"
720PREPEND_DOTDOT_TO_RELATIVE_PATHS = sed \
721	-e 's|^ *[^ /][^ /]*/|%&|' \
722	-e 's| -B| -B%|g' \
723	-e 's|% *[^- /]|%&|g' \
724	-e 's|%% *|../|g' \
725	-e 's|%||g'
726SUBDIR_FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) \
727	"CC=`echo @quoted_cc_set_by_configure@ | $(PREPEND_DOTDOT_TO_RELATIVE_PATHS)`" \
728	"STAGE_PREFIX=`echo @quoted_stage_prefix_set_by_configure@ | $(PREPEND_DOTDOT_TO_RELATIVE_PATHS)`"
729#
730# Lists of files for various purposes.
731
732# Target specific, C specific object file
733C_TARGET_OBJS=@c_target_objs@
734
735# Target specific, C++ specific object file
736CXX_TARGET_OBJS=@cxx_target_objs@
737
738# Language-specific object files for C and Objective C.
739C_AND_OBJC_OBJS = attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o \
740  c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o \
741  c-objc-common.o c-dump.o libcpp.a $(C_TARGET_OBJS)
742
743# Language-specific object files for C.
744C_OBJS = c-parse.o c-lang.o c-pretty-print.o $(C_AND_OBJC_OBJS)
745
746# Language-independent object files.
747
748OBJS = alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o	   \
749 cfg.o cfganal.o cfgbuild.o cfgcleanup.o cfglayout.o cfgloop.o		   \
750 cfgrtl.o combine.o conflict.o convert.o cse.o cselib.o dbxout.o	   \
751 debug.o df.o diagnostic.o doloop.o dominance.o		                   \
752 dwarf2asm.o dwarf2out.o dwarfout.o emit-rtl.o except.o explow.o	   \
753 expmed.o expr.o final.o flow.o fold-const.o function.o gcse.o		   \
754 genrtl.o ggc-common.o global.o graph.o gtype-desc.o			   \
755 haifa-sched.o hashtable.o hooks.o ifcvt.o insn-attrtab.o insn-emit.o	   \
756 insn-extract.o insn-opinit.o insn-output.o insn-peep.o insn-recog.o	   \
757 integrate.o intl.o jump.o  langhooks.o lcm.o lists.o local-alloc.o	   \
758 loop.o mbchar.o optabs.o params.o predict.o print-rtl.o print-tree.o	   \
759 profile.o ra.o ra-build.o ra-colorize.o ra-debug.o ra-rewrite.o	   \
760 real.o recog.o reg-stack.o regclass.o regmove.o regrename.o		   \
761 reload.o reload1.o reorg.o resource.o rtl.o rtlanal.o rtl-error.o	   \
762 sbitmap.o sched-deps.o sched-ebb.o sched-rgn.o sched-vis.o sdbout.o	   \
763 sibcall.o simplify-rtx.o ssa.o ssa-ccp.o ssa-dce.o stmt.o		   \
764 stor-layout.o stringpool.o timevar.o toplev.o tracer.o tree.o tree-dump.o \
765 tree-inline.o unroll.o varasm.o varray.o version.o vmsdbgout.o xcoffout.o \
766 et-forest.o $(GGC) $(out_object_file) $(EXTRA_OBJS)
767
768BACKEND = main.o libbackend.a
769
770# Files to be copied away after each stage in building.
771STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
772 insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
773 insn-attr.h insn-attrtab.c insn-opinit.c insn-constants.h tm-preds.h \
774 tree-check.h insn-conditions.c \
775 s-flags s-config s-codes s-mlib s-genrtl s-gtype gtyp-gen.h \
776 s-output s-recog s-emit s-extract s-peep s-check s-conditions \
777 s-attr s-attrtab s-opinit s-preds s-constants s-crt0 \
778 genemit$(build_exeext) genoutput$(build_exeext) genrecog$(build_exeext) \
779 genextract$(build_exeext) genflags$(build_exeext) gencodes$(build_exeext) \
780 genconfig$(build_exeext) genpeep$(build_exeext) genattrtab$(build_exeext) \
781 genattr$(build_exeext) genopinit$(build_exeext) gengenrtl$(build_exeext) \
782 gencheck$(build_exeext) genpreds$(build_exeext) genconstants$(build_exeext) \
783 gengtype$(build_exeext) genconditions$(build_exeext) \
784 genrtl.c genrtl.h gt-*.h gtype-*.h gtype-desc.c \
785 xgcc$(exeext) cpp$(exeext) cc1$(exeext) $(EXTRA_PASSES) \
786 $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) cc1obj$(exeext) \
787 protoize$(exeext) unprotoize$(exeext) \
788 specs collect2$(exeext) $(USE_COLLECT2) \
789 gcov$(exeext) *.[0-9][0-9].* *.[si] libcpp.a libbackend.a libgcc.mk \
790 $(LANG_STAGESTUFF)
791
792# Library members defined in libgcc2.c.
793# Variable length limited to 255 charactes when passed to a shell script.
794LIB2FUNCS_1 = _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 _clz \
795    _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi \
796    _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi
797
798LIB2FUNCS_2 = _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf \
799    _clear_cache _trampoline __main _exit _absvsi2 _absvdi2 _addvsi3 \
800    _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors
801
802# Defined in libgcc2.c, included only in the static library.
803LIB2FUNCS_ST = _eprintf _bb __gcc_bcmp
804
805FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
806    _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
807    _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
808    _sf_to_df _sf_to_tf _thenan_sf _sf_to_usi _usi_to_sf
809
810DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
811    _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \
812    _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \
813    _df_to_sf _df_to_tf _thenan_df _df_to_usi _usi_to_df
814
815TPBIT_FUNCS = _pack_tf _unpack_tf _addsub_tf _mul_tf _div_tf \
816    _fpcmp_parts_tf _compare_tf _eq_tf _ne_tf _gt_tf _ge_tf \
817    _lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \
818    _tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf
819
820# These might cause a divide overflow trap and so are compiled with
821# unwinder info.
822LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
823
824# The only suffixes we want for implicit rules are .c and .o, so clear
825# the list and add them.  This speeds up GNU Make, and allows -r to work.
826# For i18n support, we also need .gmo, .po, .pox.
827# This must come before the language makefile fragments to allow them to
828# add suffixes and rules of their own.
829.SUFFIXES:
830.SUFFIXES: .c .o .po .pox .gmo
831
832#
833# Language makefile fragments.
834
835# The following targets define the interface between us and the languages.
836#
837# all.cross, start.encap, rest.encap,
838# info, dvi,
839# install-normal, install-common, install-info, install-man,
840# uninstall,
841# mostlyclean, clean, distclean, extraclean, maintainer-clean,
842# stage1, stage2, stage3, stage4
843#
844# Each language is linked in with a series of hooks (since we can't use `::'
845# targets).  The name of each hooked is "lang.${target_name}" (eg: lang.info).
846# Configure computes and adds these here.
847
848####language hooks
849@language_hooks@
850
851# sed inserts language fragments after the following line.
852####language fragments
853@language_fragments@
854
855# End of language makefile fragments.
856#
857
858Makefile: $(srcdir)/Makefile.in config.status $(srcdir)/version.c \
859   $(xmake_file) $(tmake_file) $(LANG_MAKEFILES)
860	$(SHELL) $(srcdir)/configure.frag $(srcdir) "$(SUBDIRS)" \
861		"$(xmake_file)" "$(tmake_file)"
862	cp config.status config.run
863	LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.run
864	rm -f config.run
865
866config.h: cs-config.h ; @true
867hconfig.h: cs-hconfig.h ; @true
868tconfig.h: cs-tconfig.h ; @true
869tm_p.h: cs-tm_p.h ; @true
870
871cs-config.h: Makefile
872	TM_DEFINES="$(tm_defines)" \
873	HEADERS="$(host_xm_file)" XM_DEFINES="$(host_xm_defines)" \
874	TARGET_CPU_DEFAULT="$(target_cpu_default)" \
875	$(SHELL) $(srcdir)/mkconfig.sh config.h
876
877cs-hconfig.h: Makefile
878	TM_DEFINES="$(tm_defines)" \
879	HEADERS="$(build_xm_file)" XM_DEFINES="$(build_xm_defines)" \
880	TARGET_CPU_DEFAULT="$(target_cpu_default)" \
881	$(SHELL) $(srcdir)/mkconfig.sh hconfig.h
882
883cs-tconfig.h: Makefile
884	TM_DEFINES="$(tm_defines)" \
885	HEADERS="$(xm_file)" XM_DEFINES="$(xm_defines)" \
886	TARGET_CPU_DEFAULT="" \
887	$(SHELL) $(srcdir)/mkconfig.sh tconfig.h
888
889cs-tm_p.h: Makefile
890	TM_DEFINES="" \
891	HEADERS="$(tm_p_file)" XM_DEFINES="" TARGET_CPU_DEFAULT="" \
892	$(SHELL) $(srcdir)/mkconfig.sh tm_p.h
893
894# Don't automatically run autoconf, since configure.in might be accidentally
895# newer than configure.  Also, this writes into the source directory which
896# might be on a read-only file system.  If configured for maintainer mode
897# then do allow autoconf to be run.
898
899$(srcdir)/configure: @MAINT@ $(srcdir)/configure.in
900	(cd $(srcdir) && autoconf)
901
902gccbug:	$(srcdir)/gccbug.in
903	CONFIG_FILES=gccbug CONFIG_HEADERS= ./config.status
904
905mklibgcc: $(srcdir)/mklibgcc.in
906	CONFIG_FILES=mklibgcc CONFIG_HEADERS= ./config.status
907
908mkheaders: $(srcdir)/mkheaders.in
909	CONFIG_FILES=mkheaders CONFIG_HEADERS= ./config.status
910
911# cstamp-h.in controls rebuilding of config.in.
912# It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't
913# delete it.  A stamp file is needed as autoheader won't update the file if
914# nothing has changed.
915# It remains in the source directory and is part of the distribution.
916# This follows what is done in shellutils, fileutils, etc.
917# "echo timestamp" is used instead of touch to be consistent with other
918# packages that use autoconf (??? perhaps also to avoid problems with patch?).
919# ??? Newer versions have a maintainer mode that may be useful here.
920
921# Don't run autoheader automatically either.
922# Only run it if maintainer mode is enabled.
923@MAINT@ $(srcdir)/config.in: $(srcdir)/cstamp-h.in
924@MAINT@ $(srcdir)/cstamp-h.in: $(srcdir)/configure.in $(srcdir)/acconfig.h
925@MAINT@	(cd $(srcdir) && autoheader)
926@MAINT@	@rm -f $(srcdir)/cstamp-h.in
927@MAINT@	echo timestamp > $(srcdir)/cstamp-h.in
928auto-host.h: cstamp-h ; @true
929cstamp-h: config.in config.status
930	CONFIG_HEADERS=auto-host.h:config.in LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status
931
932# Really, really stupid make features, such as SUN's KEEP_STATE, may force
933# a target to build even if it is up-to-date.  So we must verify that
934# config.status does not exist before failing.
935config.status: $(srcdir)/configure $(srcdir)/config.gcc version.c
936	@if [ ! -f config.status ] ; then \
937	  echo You must configure gcc.  Look at http://gcc.gnu.org/install/ for details.; \
938	  false; \
939	else \
940	  LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status --recheck; \
941	fi
942
943all.internal: start.encap rest.encap doc
944# This is what to compile if making a cross-compiler.
945all.cross: native gcc-cross cpp$(exeext) specs \
946	$(LIBGCC) $(EXTRA_PARTS) lang.all.cross doc
947# This is what must be made before installing GCC and converting libraries.
948start.encap: native xgcc$(exeext) cpp$(exeext) specs \
949	xlimits.h lang.start.encap
950# These can't be made until after GCC can run.
951rest.encap: $(STMP_FIXPROTO) $(LIBGCC) $(EXTRA_PARTS) lang.rest.encap
952# This is what is made with the host's compiler
953# whether making a cross compiler or not.
954native: config.status auto-host.h intl.all build-@POSUB@ $(LANGUAGES) \
955	$(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
956
957# Define the names for selecting languages in LANGUAGES.
958C c: cc1$(exeext)
959PROTO: proto
960
961# Tell GNU make these are phony targets.
962.PHONY: C c PROTO proto
963
964# On the target machine, finish building a cross compiler.
965# This does the things that can't be done on the host machine.
966rest.cross: $(LIBGCC) specs
967
968# Recompile all the language-independent object files.
969# This is used only if the user explicitly asks for it.
970compilations: $(BACKEND)
971
972# Like libcpp.a, this archive is strictly for the host.
973libbackend.a: $(OBJS)
974	-rm -rf libbackend.a
975	$(AR) $(AR_FLAGS) libbackend.a $(OBJS)
976	-$(RANLIB) libbackend.a
977
978# We call this executable `xgcc' rather than `gcc'
979# to avoid confusion if the current directory is in the path
980# and CC is `gcc'.  It is renamed to `gcc' when it is installed.
981xgcc$(exeext): gcc.o gccspec.o version.o intl.o prefix.o \
982   version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
983	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o gccspec.o intl.o \
984	  prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
985
986# cpp is to cpp0 as gcc is to cc1.
987# The only difference from xgcc is that it's linked with cppspec.o
988# instead of gccspec.o.
989cpp$(exeext): gcc.o cppspec.o version.o intl.o prefix.o \
990   version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
991	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o cppspec.o intl.o \
992	  prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
993
994# Dump a specs file to make -B./ read these specs over installed ones.
995specs: xgcc$(exeext)
996	$(GCC_FOR_TARGET) -dumpspecs > tmp-specs
997	mv tmp-specs specs
998
999# We do want to create an executable named `xgcc', so we can use it to
1000# compile libgcc2.a.
1001# Also create gcc-cross, so that install-common will install properly.
1002gcc-cross: xgcc$(exeext)
1003	cp xgcc$(exeext) gcc-cross$(exeext)
1004
1005cc1$(exeext): $(C_OBJS) $(BACKEND) $(LIBDEPS)
1006	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1$(exeext) \
1007		$(C_OBJS) $(BACKEND) $(LIBS)
1008
1009# Build the version of limits.h that we will install.
1010xlimits.h: glimits.h limitx.h limity.h
1011	if $(LIMITS_H_TEST) ; then \
1012	  cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-xlimits.h; \
1013	else \
1014	  cat $(srcdir)/glimits.h > tmp-xlimits.h; \
1015	fi
1016	mv tmp-xlimits.h xlimits.h
1017#
1018# Build libgcc.a.
1019
1020LIB2ADD = $(LIB2FUNCS_EXTRA)
1021LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA)
1022
1023libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) xgcc$(exeext) specs
1024	objext='$(objext)' \
1025	LIB1ASMFUNCS='$(LIB1ASMFUNCS)' \
1026	LIB2FUNCS_1='$(LIB2FUNCS_1)' \
1027	LIB2FUNCS_2='$(LIB2FUNCS_2)' \
1028	LIB2FUNCS_ST='$(LIB2FUNCS_ST)' \
1029	LIB2ADD='$(LIB2ADD)' \
1030	LIB2ADD_ST='$(LIB2ADD_ST)' \
1031	LIB2ADDEH='$(LIB2ADDEH)' \
1032	LIB2ADDEHDEP='$(LIB2ADDEHDEP)' \
1033	FPBIT='$(FPBIT)' \
1034	FPBIT_FUNCS='$(FPBIT_FUNCS)' \
1035	LIB2_DIVMOD_FUNCS='$(LIB2_DIVMOD_FUNCS)' \
1036	DPBIT='$(DPBIT)' \
1037	DPBIT_FUNCS='$(DPBIT_FUNCS)' \
1038	TPBIT='$(TPBIT)' \
1039	TPBIT_FUNCS='$(TPBIT_FUNCS)' \
1040	MULTILIBS=`$(GCC_FOR_TARGET) --print-multi-lib` \
1041	EXTRA_MULTILIB_PARTS='$(EXTRA_MULTILIB_PARTS)' \
1042	SHLIB_LINK='$(SHLIB_LINK)' \
1043	SHLIB_INSTALL='$(SHLIB_INSTALL)' \
1044	SHLIB_EXT='$(SHLIB_EXT)' \
1045	SHLIB_MULTILIB='$(SHLIB_MULTILIB)' \
1046	SHLIB_MKMAP='$(SHLIB_MKMAP)' \
1047	SHLIB_MKMAP_OPTS='$(SHLIB_MKMAP_OPTS)' \
1048	SHLIB_MAPFILES='$(SHLIB_MAPFILES)' \
1049	SHLIB_NM_FLAGS='$(SHLIB_NM_FLAGS)' \
1050	MULTILIB_OSDIRNAMES='$(MULTILIB_OSDIRNAMES)' \
1051	mkinstalldirs='$(SHELL) $(srcdir)/mkinstalldirs' \
1052	  $(SHELL) mklibgcc > tmp-libgcc.mk
1053	mv tmp-libgcc.mk libgcc.mk
1054
1055# All the things that might cause us to want to recompile bits of libgcc.
1056LIBGCC_DEPS = $(GCC_PASSES) $(LANGUAGES) stmp-int-hdrs $(STMP_FIXPROTO) \
1057	libgcc.mk $(srcdir)/libgcc2.c $(TCONFIG_H) \
1058	$(MACHMODE_H) longlong.h gbl-ctors.h config.status stmp-int-hdrs \
1059	tsystem.h $(FPBIT) $(DPBIT) $(TPBIT) $(LIB2ADD) \
1060	$(LIB2ADD_ST) $(LIB2ADDEH) $(LIB2ADDEHDEP) $(EXTRA_PARTS) \
1061	$(srcdir)/config/$(LIB1ASMSRC)
1062
1063libgcc.a: $(LIBGCC_DEPS)
1064	$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
1065	  BUILD_PREFIX="$(BUILD_PREFIX)" BUILD_PREFIX_1="$(BUILD_PREFIX_1)" \
1066	  AR_FOR_TARGET="$(AR_FOR_TARGET)" \
1067	  AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
1068	  AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
1069	  CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
1070	  RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \
1071	  RANLIB_TEST_FOR_TARGET="$(RANLIB_TEST_FOR_TARGET)" \
1072	  NM_FOR_TARGET="$(NM_FOR_TARGET)" AWK="$(AWK)" \
1073	  LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
1074	  INCLUDES="$(INCLUDES)" \
1075	  CONFIG_H="$(TCONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
1076	  LIB1ASMSRC='$(LIB1ASMSRC)' \
1077	  MAKEOVERRIDES= \
1078	  -f libgcc.mk all
1079
1080# Use the genmultilib shell script to generate the information the gcc
1081# driver program needs to select the library directory based on the
1082# switches.
1083multilib.h: s-mlib; @true
1084s-mlib: $(srcdir)/genmultilib Makefile
1085	if test @enable_multilib@ = yes \
1086	   || test -n "$(MULTILIB_OSDIRNAMES)"; then \
1087	  $(SHELL) $(srcdir)/genmultilib \
1088	    "$(MULTILIB_OPTIONS)" \
1089	    "$(MULTILIB_DIRNAMES)" \
1090	    "$(MULTILIB_MATCHES)" \
1091	    "$(MULTILIB_EXCEPTIONS)" \
1092	    "$(MULTILIB_EXTRA_OPTS)" \
1093	    "$(MULTILIB_EXCLUSIONS)" \
1094	    "$(MULTILIB_OSDIRNAMES)" \
1095	    "@enable_multilib@" \
1096	    > tmp-mlib.h; \
1097	else \
1098	  $(SHELL) $(srcdir)/genmultilib '' '' '' '' '' '' '' no \
1099	    > tmp-mlib.h; \
1100	fi
1101	$(SHELL) $(srcdir)/move-if-change tmp-mlib.h multilib.h
1102	$(STAMP) s-mlib
1103
1104# Build multiple copies of libgcc.a, one for each target switch.
1105stmp-multilib: $(LIBGCC_DEPS)
1106	$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
1107	  BUILD_PREFIX="$(BUILD_PREFIX)" BUILD_PREFIX_1="$(BUILD_PREFIX_1)" \
1108	  AR_FOR_TARGET="$(AR_FOR_TARGET)" \
1109	  AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
1110	  AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
1111	  CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
1112	  RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \
1113	  RANLIB_TEST_FOR_TARGET="$(RANLIB_TEST_FOR_TARGET)" \
1114	  NM_FOR_TARGET="$(NM_FOR_TARGET)" AWK="$(AWK)" \
1115	  LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
1116	  INCLUDES="$(INCLUDES)" \
1117	  CONFIG_H="$(CONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
1118	  LIB1ASMSRC='$(LIB1ASMSRC)' \
1119	  MAKEOVERRIDES= \
1120	  -f libgcc.mk all
1121	$(STAMP) stmp-multilib
1122
1123# Compile two additional files that are linked with every program
1124# linked using GCC on systems using COFF or ELF, for the sake of C++
1125# constructors.
1126$(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
1127  gbl-ctors.h stmp-int-hdrs tsystem.h
1128	$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
1129	  @inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_BEGIN \
1130	  -o $(T)crtbegin$(objext)
1131
1132$(T)crtend.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
1133  gbl-ctors.h stmp-int-hdrs tsystem.h
1134	$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
1135	  @inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_END \
1136	  -o $(T)crtend$(objext)
1137
1138# These are versions of crtbegin and crtend for shared libraries.
1139$(T)crtbeginS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
1140  gbl-ctors.h stmp-int-hdrs tsystem.h
1141	$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
1142	  @inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O \
1143	  -o $(T)crtbeginS$(objext)
1144
1145$(T)crtendS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
1146  gbl-ctors.h stmp-int-hdrs tsystem.h
1147	$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
1148	  @inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O \
1149	  -o $(T)crtendS$(objext)
1150
1151# This is a version of crtbegin for -static links.
1152$(T)crtbeginT.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
1153  gbl-ctors.h stmp-int-hdrs tsystem.h
1154	$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
1155	  @inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O \
1156	  -o $(T)crtbeginT$(objext)
1157
1158# Compile the start modules crt0.o and mcrt0.o that are linked with
1159# every program
1160crt0.o: s-crt0 ; @true
1161mcrt0.o: s-crt0; @true
1162
1163s-crt0:	$(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
1164	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
1165	  -o crt0.o -c $(CRT0_S)
1166	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
1167	  -o mcrt0.o -c $(MCRT0_S)
1168	$(STAMP) s-crt0
1169#
1170# Compiling object files from source files.
1171
1172# Note that dependencies on obstack.h are not written
1173# because that file is not part of GCC.
1174
1175# C language specific files.
1176
1177c-errors.o: c-errors.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) flags.h \
1178    diagnostic.h $(TM_P_H)
1179c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) $(GGC_H) intl.h \
1180    $(C_TREE_H) input.h flags.h $(SYSTEM_H) toplev.h output.h $(CPPLIB_H) \
1181    gt-c-parse.h
1182	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1183	       -c $(srcdir)/c-parse.c $(OUTPUT_OPTION)
1184
1185$(srcdir)/c-parse.c: $(srcdir)/c-parse.y
1186	cd $(srcdir) && \
1187	if $(BISON) $(BISONFLAGS) -o c-p$$$$.c c-parse.y; then \
1188	  test -f c-p$$$$.output && mv -f c-p$$$$.output c-parse.output ; \
1189	  mv -f c-p$$$$.c c-parse.c ; \
1190	else \
1191	  rm -f c-p$$$$.* ; \
1192	  false ; \
1193	fi
1194
1195$(srcdir)/c-parse.y: c-parse.in
1196	echo '/*WARNING: This file is automatically generated!*/' >tmp-c-parse.y
1197	sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
1198	  -e "/^ifc$$/d" -e "/^end ifc$$/d" \
1199	  $(srcdir)/c-parse.in >>tmp-c-parse.y
1200	$(SHELL) $(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y
1201
1202c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) $(C_TREE_H) \
1203    $(GGC_H) $(TARGET_H) flags.h function.h output.h $(EXPR_H) \
1204    debug.h toplev.h intl.h $(TM_P_H) tree-inline.h $(TIMEVAR_H) c-pragma.h \
1205    gt-c-decl.h libfuncs.h except.h
1206c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
1207    $(TARGET_H) flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h $(TM_P_H)
1208c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
1209    $(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) c-common.h gtype-c.h
1210c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) \
1211    debug.h $(C_TREE_H) c-common.h real.h \
1212    c-pragma.h input.h intl.h flags.h toplev.h output.h \
1213    mbchar.h $(CPPLIB_H) $(EXPR_H) $(TM_P_H)
1214c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
1215    $(C_TREE_H) $(RTL_H) insn-config.h integrate.h $(EXPR_H) $(C_TREE_H) \
1216    flags.h toplev.h tree-inline.h diagnostic.h integrate.h $(VARRAY_H) \
1217    langhooks.h $(GGC_H) gt-c-objc-common.h $(TARGET_H)
1218c-aux-info.o : c-aux-info.c  $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
1219    flags.h toplev.h
1220c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h toplev.h \
1221    $(C_COMMON_H)
1222c-pragma.o: c-pragma.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) function.h \
1223    c-pragma.h toplev.h output.h $(GGC_H) $(TM_P_H) $(C_COMMON_H) gt-c-pragma.h
1224mbchar.o: mbchar.c $(CONFIG_H) $(SYSTEM_H) mbchar.h
1225graph.o: graph.c $(CONFIG_H) $(SYSTEM_H) toplev.h flags.h output.h $(RTL_H) \
1226    function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h
1227sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h hard-reg-set.h \
1228    $(BASIC_BLOCK_H)
1229
1230COLLECT2_OBJS = collect2.o tlink.o intl.o version.o
1231COLLECT2_LIBS = @COLLECT2_LIBS@
1232collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS)
1233# Don't try modifying collect2 (aka ld) in place--it might be linking this.
1234	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o T$@ \
1235		$(COLLECT2_OBJS) $(LIBS) $(COLLECT2_LIBS)
1236	mv -f T$@ $@
1237
1238collect2.o : collect2.c $(CONFIG_H) $(SYSTEM_H) gstab.h intl.h \
1239	$(OBSTACK_H) $(DEMANGLE_H) collect2.h version.h
1240	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES)  \
1241	-DTARGET_MACHINE=\"$(target_alias)\" \
1242	-c $(srcdir)/collect2.c $(OUTPUT_OPTION)
1243
1244tlink.o: tlink.c $(DEMANGLE_H) $(HASHTAB_H) $(CONFIG_H) $(SYSTEM_H) \
1245    $(OBSTACK_H) collect2.h intl.h
1246
1247# A file used by all variants of C.
1248
1249c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \
1250	$(C_COMMON_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
1251	$(EXPR_H) $(TM_P_H) builtin-types.def builtin-attrs.def $(TARGET_H) \
1252	diagnostic.h except.h gt-c-common.h real.h langhooks.h c-tree.h
1253c-pretty-print.o : c-pretty-print.c c-pretty-print.h pretty-print.h \
1254	$(C_COMMON_H) $(CONFIG_H) $(SYSTEM_H) real.h
1255
1256c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_COMMON_H) \
1257        c-pragma.h flags.h toplev.h langhooks.h tree-inline.h diagnostic.h \
1258	intl.h
1259
1260# A file used by all variants of C and some other languages.
1261
1262attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h \
1263	toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) $(EXPR_H) $(TM_P_H) \
1264	builtin-types.def $(TARGET_H) langhooks.h
1265
1266c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) langhooks.h \
1267	$(C_COMMON_H) flags.h toplev.h intl.h diagnostic.h
1268
1269c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
1270	flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
1271	$(EXPR_H) $(PREDICT_H)
1272
1273c-dump.o : c-dump.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) tree-dump.h
1274
1275# Language-independent files.
1276
1277DRIVER_DEFINES = \
1278  -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
1279  -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
1280  -DDEFAULT_TARGET_VERSION=\"$(version)\" \
1281  -DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \
1282  -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
1283  -DTOOLDIR_BASE_PREFIX=\"$(unlibsubdir)/../\" \
1284  $(VALGRIND_DRIVER_DEFINES) \
1285  `test "X$${SHLIB_LINK}" = "X" || test "@enable_shared@" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` \
1286  `test "X$${SHLIB_MULTILIB}" = "X" || echo "-DNO_SHARED_LIBGCC_MULTILIB"`
1287
1288gcc.o: gcc.c $(CONFIG_H) $(SYSTEM_H) intl.h multilib.h \
1289    Makefile $(lang_specs_files) specs.h prefix.h $(GCC_H)
1290	(SHLIB_LINK='$(SHLIB_LINK)' \
1291	SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
1292	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1293  $(DRIVER_DEFINES) \
1294  -c $(srcdir)/gcc.c $(OUTPUT_OPTION))
1295
1296gccspec.o: gccspec.c $(CONFIG_H) $(SYSTEM_H) $(GCC_H)
1297	(SHLIB_LINK='$(SHLIB_LINK)' \
1298	SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
1299	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1300  $(DRIVER_DEFINES) \
1301  -c $(srcdir)/gccspec.c $(OUTPUT_OPTION))
1302
1303cppspec.o: cppspec.c $(CONFIG_H) $(SYSTEM_H) $(GCC_H)
1304
1305tree-check.h: s-check ; @true
1306s-check : gencheck$(build_exeext) $(srcdir)/move-if-change
1307	$(RUN_GEN) ./gencheck$(build_exeext) > tmp-check.h
1308	$(SHELL) $(srcdir)/move-if-change tmp-check.h tree-check.h
1309	$(STAMP) s-check
1310
1311gencheck$(build_exeext) : gencheck.o $(HOST_LIBDEPS)
1312	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1313	 gencheck.o $(HOST_LIBS)
1314
1315gencheck.o : gencheck.c gencheck.h tree.def $(HCONFIG_H) $(SYSTEM_H) \
1316             $(lang_tree_files)
1317	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1318	  $(srcdir)/gencheck.c $(OUTPUT_OPTION)
1319
1320gencheck.h : s-gencheck ; @true
1321s-gencheck : Makefile
1322	ltf="$(lang_tree_files)"; for f in $$ltf; do \
1323	    echo "#include \"$$f\""; \
1324	done | sed 's|$(srcdir)/||' > tmp-gencheck.h
1325	$(SHELL) $(srcdir)/move-if-change tmp-gencheck.h gencheck.h
1326	$(STAMP) s-gencheck
1327
1328options.h : s-options ; @true
1329s-options : Makefile
1330	lof="$(lang_options_files)"; for f in $$lof; do \
1331	    echo "#include \"$$f\""; \
1332	done | sed 's|$(srcdir)/||' > tmp-options.h
1333	$(SHELL) $(srcdir)/move-if-change tmp-options.h options.h
1334	$(STAMP) s-options
1335
1336specs.h : s-specs ; @true
1337s-specs : Makefile
1338	lsf="$(lang_specs_files)"; for f in $$lsf; do \
1339	    echo "#include \"$$f\""; \
1340	done | sed 's|$(srcdir)/||' > tmp-specs.h
1341	$(SHELL) $(srcdir)/move-if-change tmp-specs.h specs.h
1342	$(STAMP) s-specs
1343
1344dumpvers: dumpvers.c
1345
1346version.o: version.c version.h
1347
1348gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) varray.h $(HASHTAB_H) \
1349	$(TREE_H) $(RTL_H) function.h insn-config.h $(EXPR_H) $(OPTABS_H) \
1350	libfuncs.h debug.h $(GGC_H) bitmap.h $(BASIC_BLOCK_H) hard-reg-set.h \
1351	ssa.h cselib.h insn-addr.h
1352
1353ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) \
1354	flags.h $(GGC_H) varray.h $(HASHTAB_H) $(TM_P_H) langhooks.h \
1355	$(PARAMS_H)
1356
1357ggc-simple.o: ggc-simple.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
1358	$(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H)
1359
1360ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
1361	toplev.h $(GGC_H) $(TIMEVAR_H) $(TM_P_H)
1362
1363stringpool.o: stringpool.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \
1364	flags.h toplev.h $(GGC_H)
1365
1366hashtable.o: hashtable.c hashtable.h $(CONFIG_H) $(SYSTEM_H) $(OBSTACK_H)
1367
1368line-map.o: line-map.c line-map.h intl.h $(CONFIG_H) $(SYSTEM_H)
1369
1370ggc-none.o: ggc-none.c $(GCONFIG_H) $(SYSTEM_H) $(GGC_H)
1371	$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
1372
1373prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) Makefile prefix.h
1374	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1375	-DPREFIX=\"$(prefix)\" \
1376	  -c $(srcdir)/prefix.c $(OUTPUT_OPTION)
1377
1378convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h convert.h \
1379   toplev.h langhooks.h
1380
1381langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) toplev.h \
1382   tree-inline.h $(RTL_H) insn-config.h integrate.h langhooks.h \
1383   $(LANGHOOKS_DEF_H) flags.h
1384tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h function.h toplev.h \
1385   $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \
1386   real.h gt-tree.h
1387tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
1388   flags.h langhooks.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
1389   $(EXPR_H) $(SPLAY_TREE_H) tree-dump.h
1390tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) \
1391   expr.h flags.h params.h input.h insn-config.h $(INTEGRATE_H) \
1392   $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) toplev.h langhooks.h \
1393   $(C_COMMON_H) tree-inline.h
1394print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(GGC_H) \
1395   langhooks.h real.h
1396stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h \
1397   function.h $(EXPR_H) $(RTL_H) toplev.h $(GGC_H) $(TM_P_H) $(TARGET_H) \
1398   langhooks.h
1399fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h real.h \
1400   toplev.h $(HASHTAB_H) $(EXPR_H) $(RTL_H) $(GGC_H) $(TM_P_H) langhooks.h
1401diagnostic.o : diagnostic.c diagnostic.h real.h diagnostic.def \
1402   $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TM_P_H) flags.h $(GGC_H) \
1403   input.h toplev.h intl.h langhooks.h $(LANGHOOKS_DEF_H)
1404toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) function.h \
1405   flags.h xcoffout.h input.h $(INSN_ATTR_H) output.h diagnostic.h \
1406   debug.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h \
1407   dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \
1408   graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) $(lang_options_files) \
1409   ssa.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
1410   langhooks.h insn-flags.h options.h cfglayout.h real.h
1411	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1412	  -DTARGET_NAME=\"$(target_alias)\" \
1413	  -c $(srcdir)/toplev.c $(OUTPUT_OPTION)
1414main.o : main.c $(CONFIG_H) $(SYSTEM_H) toplev.h
1415
1416rtl-error.o: rtl-error.c system.h $(RTL_H) $(INSN_ATTR_H) insn-config.h \
1417   input.h toplev.h intl.h diagnostic.h $(CONFIG_H)
1418
1419rtl.o : rtl.c $(GCONFIG_H) $(SYSTEM_H) $(RTL_H) real.h $(GGC_H) errors.h
1420	$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
1421
1422print-rtl.o : print-rtl.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) \
1423    hard-reg-set.h $(BASIC_BLOCK_H) real.h
1424rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) toplev.h $(RTL_H) \
1425   hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) real.h flags.h
1426
1427errors.o : errors.c $(GCONFIG_H) $(SYSTEM_H) errors.h
1428	$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
1429
1430varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
1431   function.h $(EXPR_H) hard-reg-set.h $(REGS_H) \
1432   output.h c-pragma.h toplev.h xcoffout.h debug.h $(GGC_H) $(TM_P_H) \
1433   $(HASHTAB_H) $(TARGET_H) langhooks.h gt-varasm.h real.h
1434function.o : function.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
1435   function.h $(EXPR_H) libfuncs.h $(REGS_H) hard-reg-set.h \
1436   insn-config.h $(RECOG_H) output.h toplev.h except.h $(HASHTAB_H) $(GGC_H) \
1437   $(TM_P_H) langhooks.h gt-function.h
1438stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h function.h  \
1439   insn-config.h hard-reg-set.h $(EXPR_H) libfuncs.h except.h \
1440   $(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H) \
1441   langhooks.h $(PREDICT_H) gt-stmt.h
1442except.o : except.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
1443   except.h function.h $(EXPR_H) libfuncs.h integrate.h langhooks.h \
1444   insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \
1445   dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H) \
1446   gt-except.h
1447expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h function.h \
1448   $(REGS_H) $(EXPR_H) $(OPTABS_H) libfuncs.h insn-attr.h insn-config.h \
1449   $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
1450   except.h reload.h $(GGC_H) langhooks.h intl.h $(TM_P_H) real.h
1451builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
1452   $(TARGET_H) function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) insn-config.h \
1453   $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
1454   except.h $(TM_P_H) $(PREDICT_H) libfuncs.h real.h langhooks.h
1455calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
1456   $(EXPR_H) langhooks.h $(TARGET_H) \
1457   libfuncs.h $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H) $(TM_P_H) \
1458   except.h
1459expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h  \
1460   insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) real.h \
1461   toplev.h $(TM_P_H) langhooks.h
1462explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
1463   hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \
1464   toplev.h function.h ggc.h $(TM_P_H) gt-explow.h
1465optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h  \
1466   insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(RECOG_H) reload.h \
1467   toplev.h $(GGC_H) real.h $(TM_P_H) except.h gt-optabs.h $(BASIC_BLOCK_H)
1468dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
1469    $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) function.h langhooks.h \
1470   insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h toplev.h
1471debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H)
1472sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
1473   function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) real.h \
1474   insn-config.h xcoffout.h c-pragma.h ggc.h \
1475   sdbout.h toplev.h $(TM_P_H) except.h debug.h langhooks.h gt-sdbout.h
1476dwarfout.o : dwarfout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) dwarf.h \
1477   flags.h insn-config.h reload.h output.h toplev.h $(TM_P_H) \
1478   debug.h langhooks.h
1479dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) dwarf2.h \
1480   debug.h flags.h insn-config.h reload.h output.h diagnostic.h real.h \
1481   hard-reg-set.h $(REGS_H) $(EXPR_H) libfuncs.h toplev.h dwarf2out.h varray.h \
1482   $(GGC_H) except.h dwarf2asm.h $(TM_P_H) langhooks.h $(HASHTAB_H) gt-dwarf2out.h
1483dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) flags.h $(RTL_H) $(TREE_H) \
1484   output.h dwarf2asm.h $(TM_P_H) $(GGC_H)
1485vmsdbgout.o : vmsdbgout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
1486   output.h vmsdbg.h debug.h langhooks.h function.h
1487xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) xcoffout.h \
1488   flags.h toplev.h output.h dbxout.h $(GGC_H) $(TARGET_H)
1489emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
1490   function.h $(REGS_H) insn-config.h $(RECOG_H) real.h $(GGC_H) \
1491   $(EXPR_H) $(srcdir)/../include/obstack.h hard-reg-set.h bitmap.h toplev.h \
1492   $(HASHTAB_H) $(TM_P_H) debug.h langhooks.h
1493real.o : real.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) toplev.h $(TM_P_H)
1494integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
1495   debug.h $(INTEGRATE_H) insn-config.h $(EXPR_H) real.h $(REGS_H) \
1496   intl.h function.h output.h $(RECOG_H) except.h toplev.h $(LOOP_H) \
1497   $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h gt-integrate.h
1498jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \
1499   insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
1500   toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H)
1501
1502simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) \
1503   hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
1504   output.h function.h $(GGC_H) $(OBSTACK_H) $(TM_P_H) $(TREE_H)
1505cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) \
1506   hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
1507   output.h function.h cselib.h $(GGC_H) $(TM_P_H) gt-cselib.h
1508cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
1509   real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h output.h function.h \
1510   $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H)
1511gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) hard-reg-set.h \
1512   flags.h real.h insn-config.h ggc.h $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) \
1513   function.h output.h toplev.h $(TM_P_H) $(PARAMS_H) except.h gt-gcse.h
1514sibcall.o : sibcall.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) function.h \
1515   hard-reg-set.h flags.h insn-config.h $(RECOG_H) $(BASIC_BLOCK_H)
1516resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) \
1517   $(BASIC_BLOCK_H) $(REGS_H) flags.h output.h resource.h function.h toplev.h \
1518   $(INSN_ATTR_H) except.h $(PARAMS_H) $(TM_P_H)
1519lcm.o : lcm.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
1520   real.h insn-config.h $(INSN_ATTR_H) $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) \
1521   $(TM_P_H) df.h
1522ssa.o : ssa.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) varray.h $(EXPR_H) \
1523   hard-reg-set.h flags.h function.h real.h insn-config.h $(RECOG_H)	\
1524   $(BASIC_BLOCK_H) output.h ssa.h
1525ssa-dce.o : ssa-dce.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) hard-reg-set.h \
1526   $(BASIC_BLOCK_H) ssa.h insn-config.h $(RECOG_H) output.h
1527ssa-ccp.o : ssa-ccp.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h \
1528    $(BASIC_BLOCK_H) ssa.h insn-config.h $(RECOG_H) output.h \
1529    errors.h $(GGC_H) df.h function.h
1530df.o : df.c $(CONFIG_H) system.h $(RTL_H) insn-config.h $(RECOG_H) \
1531   function.h $(REGS_H) $(OBSTACK_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h \
1532   $(FIBHEAP_H)
1533conflict.o : conflict.c $(CONFIG_H) $(SYSTEM_H) $(OBSTACK_H) $(HASHTAB_H) \
1534   $(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H)
1535profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
1536   insn-config.h output.h $(REGS_H) $(EXPR_H) function.h \
1537   gcov-io.h toplev.h $(GGC_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TARGET_H) \
1538   langhooks.h profile.h libfuncs.h gt-profile.h
1539loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h $(LOOP_H) \
1540   insn-config.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) \
1541   real.h $(PREDICT_H) $(BASIC_BLOCK_H) function.h \
1542   toplev.h varray.h except.h cselib.h $(OPTABS_H) $(TM_P_H)
1543doloop.o : doloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h $(LOOP_H) \
1544   $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) toplev.h
1545unroll.o : unroll.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) insn-config.h function.h \
1546   $(INTEGRATE_H) $(REGS_H) $(RECOG_H) flags.h $(EXPR_H) $(LOOP_H) toplev.h \
1547   hard-reg-set.h varray.h $(BASIC_BLOCK_H) $(TM_P_H) $(PREDICT_H) $(PARAMS_H)
1548flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h insn-config.h \
1549   $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
1550   function.h except.h $(EXPR_H) ssa.h $(GGC_H) $(TM_P_H)
1551cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
1552   $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
1553   function.h except.h $(GGC_H) $(TM_P_H)
1554cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
1555   $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
1556   function.h except.h $(GGC_H) $(TM_P_H) insn-config.h
1557cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(BASIC_BLOCK_H) \
1558   hard-reg-set.h insn-config.h $(RECOG_H) $(GGC_H) $(TM_P_H)
1559cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
1560   $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
1561   function.h except.h $(GGC_H)
1562cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TIMEVAR_H)\
1563   $(BASIC_BLOCK_H) hard-reg-set.h output.h flags.h $(RECOG_H) toplev.h \
1564   $(GGC_H) insn-config.h cselib.h $(TARGET_H) $(TM_P_H) $(PARAMS_H)
1565cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
1566   $(BASIC_BLOCK_H) hard-reg-set.h
1567dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) hard-reg-set.h \
1568   $(BASIC_BLOCK_H) et-forest.h
1569et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) et-forest.h
1570combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h function.h \
1571   insn-config.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \
1572   $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h $(TM_P_H)
1573regclass.o : regclass.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) hard-reg-set.h flags.h \
1574   $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h real.h \
1575   toplev.h function.h output.h $(GGC_H) $(TM_P_H) $(EXPR_H)
1576local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h \
1577   $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
1578   output.h function.h $(INSN_ATTR_H) toplev.h  except.h $(TM_P_H)
1579bitmap.o : bitmap.c $(GCONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h \
1580   $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H)
1581	$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
1582global.o : global.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h reload.h function.h \
1583   $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h toplev.h \
1584   $(TM_P_H)
1585varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) varray.h $(GGC_H) errors.h
1586ra.o : ra.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H)  $(TM_P_H) insn-config.h \
1587   $(RECOG_H) integrate.h function.h $(REGS_H) $(OBSTACK_H) hard-reg-set.h \
1588   $(BASIC_BLOCK_H) df.h expr.h output.h toplev.h flags.h reload.h ra.h
1589ra-build.o : ra-build.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_P_H) \
1590   insn-config.h $(RECOG_H) function.h $(REGS_H) hard-reg-set.h \
1591   $(BASIC_BLOCK_H) df.h output.h ggc.h ra.h gt-ra-build.h reload.h
1592ra-colorize.o : ra-colorize.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_P_H) \
1593    function.h $(REGS_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h output.h ra.h
1594ra-debug.o : ra-debug.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H)  insn-config.h \
1595   $(RECOG_H) function.h hard-reg-set.h $(BASIC_BLOCK_H) df.h output.h ra.h \
1596   $(TM_P_H)
1597ra-rewrite.o : ra-rewrite.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_P_H) \
1598   function.h $(REGS_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h expr.h \
1599   output.h except.h ra.h reload.h insn-config.h
1600reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h output.h \
1601   $(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) hard-reg-set.h insn-config.h \
1602   $(REGS_H) function.h real.h toplev.h $(TM_P_H)
1603reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) real.h flags.h \
1604   $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
1605   $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.h $(TM_P_H) \
1606   except.h $(TREE_H)
1607caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h \
1608   $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \
1609   $(RECOG_H) reload.h $(EXPR_H) toplev.h $(TM_P_H)
1610reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) conditions.h hard-reg-set.h \
1611   $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(INSN_ATTR_H) except.h \
1612   $(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h $(PARAMS_H) $(TM_P_H)
1613alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h hard-reg-set.h \
1614   $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(EXPR_H) \
1615   $(GGC_H) function.h cselib.h $(TREE_H) $(TM_P_H) langhooks.h $(TARGET_H) \
1616   gt-alias.h
1617regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) insn-config.h \
1618   $(RECOG_H) output.h $(REGS_H) hard-reg-set.h flags.h function.h \
1619   $(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h reload.h
1620haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \
1621   $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
1622   $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H)
1623sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \
1624   $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
1625   $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h cselib.h $(PARAMS_H) $(TM_P_H)
1626sched-rgn.o : sched-rgn.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \
1627   $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
1628   $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H)
1629sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \
1630   $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
1631   $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H)
1632sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \
1633   hard-reg-set.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(REGS_H) $(TM_P_H) \
1634   $(TARGET_H) real.h
1635final.o : final.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h intl.h \
1636   $(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) function.h \
1637   real.h output.h hard-reg-set.h except.h debug.h xcoffout.h profile.h \
1638   toplev.h reload.h dwarf2out.h $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) $(EXPR_H)
1639recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) function.h $(BASIC_BLOCK_H) \
1640   $(REGS_H) $(RECOG_H) $(EXPR_H) hard-reg-set.h flags.h insn-config.h \
1641   $(INSN_ATTR_H) real.h toplev.h output.h reload.h $(TM_P_H)
1642reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) $(RECOG_H) \
1643   $(REGS_H) hard-reg-set.h flags.h insn-config.h toplev.h reload.h \
1644   varray.h function.h $(TM_P_H) $(GGC_H) gt-reg-stack.h
1645predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
1646   insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
1647   $(RECOG_H) function.h except.h $(EXPR_H) $(TM_P_H) $(PREDICT_H) real.h \
1648   $(PARAMS_H) $(TARGET_H)
1649lists.o: lists.c $(CONFIG_H) $(SYSTEM_H) toplev.h $(RTL_H) $(GGC_H)
1650bb-reorder.o : bb-reorder.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) \
1651   flags.h $(BASIC_BLOCK_H) hard-reg-set.h output.h cfglayout.h $(TARGET_H)
1652tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) \
1653   $(BASIC_BLOCK_H) hard-reg-set.h output.h cfglayout.h flags.h \
1654   $(PARAMS_H) profile.h
1655cfglayout.o : cfglayout.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) \
1656   insn-config.h $(BASIC_BLOCK_H) hard-reg-set.h output.h function.h \
1657   cfglayout.h
1658timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) $(TIMEVAR_H) flags.h intl.h
1659regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) insn-config.h \
1660   $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(RECOG_H) function.h \
1661   resource.h $(OBSTACK_H) flags.h $(TM_P_H)
1662ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) toplev.h \
1663   flags.h insn-config.h function.h $(RECOG_H) $(BASIC_BLOCK_H) $(EXPR_H) \
1664   output.h except.h $(TM_P_H) real.h
1665params.o : params.c $(CONFIG_H) $(SYSTEM_H) $(PARAMS_H) toplev.h
1666hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) $(HOOKS_H)
1667
1668$(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) $(GGC_H) \
1669   $(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \
1670   output.h $(INSN_ATTR_H) $(SYSTEM_H) toplev.h $(TARGET_H) libfuncs.h \
1671   $(TARGET_DEF_H) function.h sched-int.h $(TM_P_H) $(EXPR_H) $(OPTABS_H) \
1672   langhooks.h
1673	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1674		$(out_file) $(OUTPUT_OPTION)
1675
1676# Build auxiliary files that support ecoff format.
1677mips-tfile: mips-tfile.o version.o $(LIBDEPS)
1678	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
1679
1680mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) version.h
1681
1682mips-tdump: mips-tdump.o version.o $(LIBDEPS)
1683	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS)
1684
1685mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H)
1686
1687#
1688# Generate header and source files from the machine description,
1689# and compile them.
1690
1691.PRECIOUS: insn-config.h insn-flags.h insn-codes.h insn-constants.h \
1692  insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
1693  insn-attr.h insn-attrtab.c
1694
1695# The following pair of rules has this effect:
1696# genconfig is run only if the md has changed since genconfig was last run;
1697# but the file insn-config.h is touched only when its contents actually change.
1698
1699# Each of the other insn-* files is handled by a similar pair of rules.
1700
1701# This causes an anomaly in the results of make -n
1702# because insn-* is older than s-*
1703# and thus make -n thinks that insn-* will be updated
1704# and force recompilation of things that depend on it.
1705# We use move-if-change precisely to avoid such recompilation.
1706# But there is no way to teach make -n that it will be avoided.
1707
1708# Each of the insn-*.[ch] rules has a semicolon at the end,
1709# for otherwise the system Make on SunOS 4.1 never tries
1710# to recompile insn-*.o.  To avoid problems and extra noise from
1711# versions of make which don't like empty commands (nothing after the
1712# trailing `;'), we call true for each.
1713
1714insn-config.h: s-config ; @true
1715s-config : $(md_file) genconfig$(build_exeext) $(srcdir)/move-if-change
1716	$(RUN_GEN) ./genconfig$(build_exeext) $(md_file) > tmp-config.h
1717	$(SHELL) $(srcdir)/move-if-change tmp-config.h insn-config.h
1718	$(STAMP) s-config
1719
1720insn-conditions.c: s-conditions ; @true
1721s-conditions : $(md_file) genconditions$(build_exeext) $(srcdir)/move-if-change
1722	$(RUN_GEN) ./genconditions$(build_exeext) $(md_file) > tmp-conditions.c
1723	$(SHELL) $(srcdir)/move-if-change tmp-conditions.c insn-conditions.c
1724	$(STAMP) s-conditions
1725
1726insn-conditions.o : insn-conditions.c $(GCONFIG_H) $(SYSTEM_H) $(RTL_H) \
1727  $(TM_P_H) $(REGS_H) function.h $(RECOG_H) real.h output.h flags.h \
1728  hard-reg-set.h resource.h toplev.h reload.h gensupport.h insn-constants.h
1729	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) insn-conditions.c
1730
1731dummy-conditions.o : dummy-conditions.c $(HCONFIG_H) $(SYSTEM_H) gensupport.h
1732	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1733	    $(srcdir)/dummy-conditions.c $(OUTPUT_OPTION)
1734
1735insn-flags.h: s-flags ; @true
1736s-flags : $(md_file) genflags$(build_exeext) $(srcdir)/move-if-change
1737	$(RUN_GEN) ./genflags$(build_exeext) $(md_file) > tmp-flags.h
1738	$(SHELL) $(srcdir)/move-if-change tmp-flags.h insn-flags.h
1739	$(STAMP) s-flags
1740
1741insn-codes.h: s-codes ; @true
1742s-codes : $(md_file) gencodes$(build_exeext) $(srcdir)/move-if-change
1743	$(RUN_GEN) ./gencodes$(build_exeext) $(md_file) > tmp-codes.h
1744	$(SHELL) $(srcdir)/move-if-change tmp-codes.h insn-codes.h
1745	$(STAMP) s-codes
1746
1747insn-constants.h: s-constants ; @true
1748s-constants : $(md_file) genconstants$(build_exeext) $(srcdir)/move-if-change
1749	$(RUN_GEN) ./genconstants$(build_exeext) $(md_file) > tmp-constants.h
1750	$(SHELL) $(srcdir)/move-if-change tmp-constants.h insn-constants.h
1751	$(STAMP) s-constants
1752
1753insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) $(EXPR_H) real.h output.h \
1754  insn-config.h $(OPTABS_H) $(SYSTEM_H) reload.h $(RECOG_H) toplev.h \
1755  function.h flags.h hard-reg-set.h resource.h $(TM_P_H)
1756	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c \
1757	  $(OUTPUT_OPTION)
1758
1759insn-emit.c: s-emit ; @true
1760s-emit : $(md_file) genemit$(build_exeext) $(srcdir)/move-if-change
1761	$(RUN_GEN) ./genemit$(build_exeext) $(md_file) > tmp-emit.c
1762	$(SHELL) $(srcdir)/move-if-change tmp-emit.c insn-emit.c
1763	$(STAMP) s-emit
1764
1765insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h $(RECOG_H) \
1766  real.h output.h flags.h $(SYSTEM_H) function.h hard-reg-set.h resource.h \
1767  $(TM_P_H) toplev.h reload.h
1768	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c \
1769	  $(OUTPUT_OPTION)
1770
1771insn-recog.c: s-recog ; @true
1772s-recog : $(md_file) genrecog$(build_exeext) $(srcdir)/move-if-change
1773	$(RUN_GEN) ./genrecog$(build_exeext) $(md_file) > tmp-recog.c
1774	$(SHELL) $(srcdir)/move-if-change tmp-recog.c insn-recog.c
1775	$(STAMP) s-recog
1776
1777insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) \
1778  insn-config.h flags.h $(RECOG_H) $(EXPR_H) $(OPTABS_H) reload.h $(SYSTEM_H)
1779	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c \
1780	  $(OUTPUT_OPTION)
1781
1782insn-opinit.c: s-opinit ; @true
1783s-opinit : $(md_file) genopinit$(build_exeext) $(srcdir)/move-if-change
1784	$(RUN_GEN) ./genopinit$(build_exeext) $(md_file) > tmp-opinit.c
1785	$(SHELL) $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c
1786	$(STAMP) s-opinit
1787
1788insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) toplev.h \
1789  insn-config.h $(RECOG_H)
1790	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c \
1791	  $(OUTPUT_OPTION)
1792
1793insn-extract.c: s-extract ; @true
1794s-extract : $(md_file) genextract$(build_exeext) $(srcdir)/move-if-change
1795	$(RUN_GEN) ./genextract$(build_exeext) $(md_file) > tmp-extract.c
1796	$(SHELL) $(srcdir)/move-if-change tmp-extract.c insn-extract.c
1797	$(STAMP) s-extract
1798
1799insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) $(REGS_H) output.h real.h \
1800	$(SYSTEM_H) insn-config.h $(RECOG_H) except.h function.h $(TM_P_H)
1801	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c \
1802	  $(OUTPUT_OPTION)
1803
1804insn-peep.c: s-peep ; @true
1805s-peep : $(md_file) genpeep$(build_exeext) $(srcdir)/move-if-change
1806	$(RUN_GEN) ./genpeep$(build_exeext) $(md_file) > tmp-peep.c
1807	$(SHELL) $(srcdir)/move-if-change tmp-peep.c insn-peep.c
1808	$(STAMP) s-peep
1809
1810insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) $(REGS_H) real.h \
1811    output.h $(INSN_ATTR_H) insn-config.h $(SYSTEM_H) toplev.h $(RECOG_H) \
1812	$(TM_P_H) flags.h
1813	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c \
1814	  $(OUTPUT_OPTION)
1815
1816insn-attr.h: s-attr ; @true
1817s-attr : $(md_file) genattr$(build_exeext) $(srcdir)/move-if-change
1818	$(RUN_GEN) ./genattr$(build_exeext) $(md_file) > tmp-attr.h
1819	$(SHELL) $(srcdir)/move-if-change tmp-attr.h insn-attr.h
1820	$(STAMP) s-attr
1821
1822insn-attrtab.c: s-attrtab ; @true
1823s-attrtab : $(md_file) genattrtab$(build_exeext) $(srcdir)/move-if-change
1824	$(RUN_GEN) ./genattrtab$(build_exeext) $(md_file) > tmp-attrtab.c
1825	$(SHELL) $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
1826	$(STAMP) s-attrtab
1827
1828insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) $(GGC_H) $(REGS_H) real.h \
1829    conditions.h hard-reg-set.h insn-config.h $(INSN_ATTR_H) $(EXPR_H) \
1830    output.h $(RECOG_H) function.h $(SYSTEM_H) toplev.h flags.h \
1831    insn-codes.h $(TM_P_H)
1832	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c \
1833	  $(OUTPUT_OPTION)
1834
1835insn-output.c: s-output ; @true
1836s-output : $(md_file) genoutput$(build_exeext) $(srcdir)/move-if-change
1837	$(RUN_GEN) ./genoutput$(build_exeext) $(md_file) > tmp-output.c
1838	$(SHELL) $(srcdir)/move-if-change tmp-output.c insn-output.c
1839	$(STAMP) s-output
1840
1841genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) $(GGC_H)
1842genrtl.c genrtl.h : s-genrtl
1843	@true	# force gnu make to recheck modification times.
1844
1845s-genrtl: gengenrtl$(build_exeext) $(srcdir)/move-if-change $(RTL_BASE_H)
1846	$(RUN_GEN) ./gengenrtl$(build_exeext) -h > tmp-genrtl.h
1847	$(SHELL) $(srcdir)/move-if-change tmp-genrtl.h genrtl.h
1848	$(RUN_GEN) ./gengenrtl$(build_exeext) > tmp-genrtl.c
1849	$(SHELL) $(srcdir)/move-if-change tmp-genrtl.c genrtl.c
1850	$(STAMP) s-genrtl
1851
1852tm-preds.h: s-preds; @true
1853
1854s-preds: genpreds$(build_exeext) $(srcdir)/move-if-change
1855	$(RUN_GEN) ./genpreds$(build_exeext) > tmp-preds.h
1856	$(SHELL) $(srcdir)/move-if-change tmp-preds.h tm-preds.h
1857	$(STAMP) s-preds
1858
1859GTFILES = $(GCONFIG_H) $(srcdir)/location.h \
1860  $(HASHTAB_H) \
1861  $(srcdir)/bitmap.h $(srcdir)/function.h  $(srcdir)/rtl.h $(srcdir)/optabs.h \
1862  $(srcdir)/tree.h $(srcdir)/libfuncs.h $(srcdir)/hashtable.h $(srcdir)/real.h \
1863  $(srcdir)/varray.h $(srcdir)/ssa.h $(srcdir)/insn-addr.h $(srcdir)/cselib.h \
1864  $(srcdir)/c-common.h $(srcdir)/c-tree.h \
1865  $(srcdir)/basic-block.h \
1866  $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c \
1867  $(srcdir)/dwarf2out.c $(srcdir)/emit-rtl.c \
1868  $(srcdir)/except.c $(srcdir)/explow.c $(srcdir)/expr.c \
1869  $(srcdir)/fold-const.c $(srcdir)/function.c \
1870  $(srcdir)/gcse.c $(srcdir)/integrate.c $(srcdir)/lists.c $(srcdir)/optabs.c \
1871  $(srcdir)/profile.c $(srcdir)/ra-build.c $(srcdir)/regclass.c \
1872  $(srcdir)/reg-stack.c \
1873  $(srcdir)/sdbout.c $(srcdir)/stmt.c $(srcdir)/stor-layout.c \
1874  $(srcdir)/tree.c $(srcdir)/varasm.c \
1875  $(out_file) \
1876  @all_gtfiles@
1877
1878GTFILES_FILES_LANGS = @all_gtfiles_files_langs@
1879GTFILES_FILES_FILES = @all_gtfiles_files_files@
1880GTFILES_LANG_DIR_NAMES = @subdirs@
1881GTFILES_SRCDIR = @srcdir@
1882
1883gtype-desc.h gtype-desc.c gt-except.h gt-function.h : s-gtype; @true
1884gt-integrate.h gt-stmt.h gt-tree.h gt-varasm.h gt-emit-rtl.h : s-gtype; @true
1885gt-explow.h gt-stor-layout.h gt-regclass.h gt-lists.h : s-gtype; @true
1886gt-alias.h gt-cselib.h gt-fold-const.h gt-gcse.h gt-profile.h : s-gtype; @true
1887gt-expr.h gt-sdbout.h gt-optabs.h gt-bitmap.h gt-dwarf2out.h : s-gtype ; @true
1888gt-ra-build.h gt-reg-stack.h : s-gtype ; @true
1889gt-c-common.h gt-c-decl.h gt-c-parse.h gt-c-pragma.h : s-gtype; @true
1890gt-c-objc-common.h gtype-c.h gt-location.h : s-gtype ; @true
1891
1892gtyp-gen.h: Makefile
1893	echo "/* This file is machine generated.  Do not edit.  */" > tmp-gtyp.h
1894	echo "static const char *srcdir = "  >> tmp-gtyp.h
1895	echo "\"$(GTFILES_SRCDIR)\"" >> tmp-gtyp.h
1896	echo ";" >> tmp-gtyp.h
1897	echo "static const char *lang_files[] = {" >> tmp-gtyp.h
1898	ll="$(GTFILES_FILES_FILES)"; \
1899	for f in $$ll; do \
1900	echo "\"$$f\", "; done >> tmp-gtyp.h
1901	echo "NULL};" >> tmp-gtyp.h
1902	echo "static const char *langs_for_lang_files[] = {" >> tmp-gtyp.h
1903	ff="$(GTFILES_FILES_LANGS)"; \
1904	for f in $$ff; do \
1905	echo "\"$$f\", " ; done  >> tmp-gtyp.h
1906	echo "NULL};" >> tmp-gtyp.h
1907	echo "static const char *all_files[] = {" >> tmp-gtyp.h
1908	gf="$(GTFILES)"; \
1909	for f in $$gf; do \
1910	echo "\"$$f\", "; done >> tmp-gtyp.h
1911	echo " NULL};" >> tmp-gtyp.h
1912	echo "static const char *lang_dir_names[] = { \"c\", " >> tmp-gtyp.h
1913	gf="$(GTFILES_LANG_DIR_NAMES)"; \
1914	for l in $$gf; do \
1915	echo "\"$$l\", "; done >> tmp-gtyp.h
1916	echo "NULL};" >> tmp-gtyp.h
1917	$(SHELL) $(srcdir)/move-if-change tmp-gtyp.h gtyp-gen.h 
1918
1919s-gtype: gengtype$(build_exeext) $(GTFILES)
1920	$(RUN_GEN) ./gengtype
1921	$(STAMP) s-gtype
1922
1923#
1924# Compile the programs that generate insn-* from the machine description.
1925# They are compiled with $(HOST_CC), and associated libraries,
1926# since they need to run on this machine
1927# even if GCC is being compiled to run on some other machine.
1928
1929# $(CONFIG_H) is omitted from the deps of the gen*.o
1930# because these programs don't really depend on anything
1931# about the target machine.  They do depend on config.h itself,
1932# since that describes the host machine.
1933
1934read-rtl.o: read-rtl.c $(HCONFIG_H) $(SYSTEM_H) $(RTL_H) \
1935  $(OBSTACK_H) $(HASHTAB_H)
1936	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/read-rtl.c $(OUTPUT_OPTION)
1937
1938gensupport.o: gensupport.c $(RTL_H) $(OBSTACK_H) $(SYSTEM_H) errors.h gensupport.h
1939	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gensupport.c $(OUTPUT_OPTION)
1940
1941genconfig$(build_exeext) : genconfig.o $(HOST_RTL) $(HOST_SUPPORT) \
1942  $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1943	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1944	  genconfig.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
1945	    $(HOST_ERRORS) $(HOST_LIBS)
1946
1947genconfig.o : genconfig.c $(RTL_H) $(HCONFIG_H) \
1948  $(SYSTEM_H) errors.h gensupport.h
1949	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c $(OUTPUT_OPTION)
1950
1951genflags$(build_exeext) : genflags.o $(HOST_RTL) $(HOST_SUPPORT) \
1952  $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1953	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1954	 genflags.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
1955	    $(HOST_ERRORS) $(HOST_LIBS)
1956
1957genflags.o : genflags.c $(RTL_H) $(OBSTACK_H) $(HCONFIG_H) \
1958  $(SYSTEM_H) errors.h gensupport.h
1959	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c $(OUTPUT_OPTION)
1960
1961gencodes$(build_exeext) : gencodes.o $(HOST_RTL) $(HOST_SUPPORT) \
1962  $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1963	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1964	 gencodes.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
1965	    $(HOST_ERRORS) $(HOST_LIBS)
1966
1967gencodes.o : gencodes.c $(RTL_H) $(HCONFIG_H) \
1968  $(SYSTEM_H) errors.h gensupport.h
1969	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c $(OUTPUT_OPTION)
1970
1971genconstants$(build_exeext) : genconstants.o $(HOST_RTL) $(HOST_EARLY_SUPPORT) \
1972  $(HOST_ERRORS) $(HOST_LIBDEPS)
1973	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1974	 genconstants.o $(HOST_EARLY_SUPPORT) $(HOST_RTL) \
1975	    $(HOST_ERRORS) $(HOST_LIBS)
1976
1977genconstants.o : genconstants.c $(RTL_H) $(HCONFIG_H) $(SYSTEM_H) errors.h
1978	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconstants.c $(OUTPUT_OPTION)
1979
1980genemit$(build_exeext) : genemit.o $(HOST_RTL) $(HOST_SUPPORT) \
1981  $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1982	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1983	 genemit.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
1984	    $(HOST_ERRORS) $(HOST_LIBS)
1985
1986genemit.o : genemit.c $(RTL_H) $(HCONFIG_H) $(SYSTEM_H) errors.h gensupport.h
1987	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c $(OUTPUT_OPTION)
1988
1989genopinit$(build_exeext) : genopinit.o $(HOST_RTL) $(HOST_SUPPORT) \
1990  $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1991	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1992	 genopinit.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
1993	    $(HOST_ERRORS) $(HOST_LIBS)
1994
1995genopinit.o : genopinit.c $(RTL_H) $(HCONFIG_H) \
1996  $(SYSTEM_H) errors.h gensupport.h
1997	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c $(OUTPUT_OPTION)
1998
1999genrecog$(build_exeext) : genrecog.o $(HOST_RTL) $(HOST_SUPPORT) \
2000    $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
2001	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
2002	 genrecog.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
2003	    $(HOST_ERRORS) $(HOST_LIBS)
2004
2005genrecog.o : genrecog.c $(RTL_H) $(HCONFIG_H) \
2006  $(SYSTEM_H) errors.h gensupport.h
2007	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c $(OUTPUT_OPTION)
2008
2009genextract$(build_exeext) : genextract.o $(HOST_RTL) $(HOST_SUPPORT) \
2010  $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
2011	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
2012	 genextract.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
2013	    $(HOST_ERRORS) $(HOST_LIBS)
2014
2015genextract.o : genextract.c $(RTL_H) $(HCONFIG_H) \
2016  $(SYSTEM_H) insn-config.h errors.h gensupport.h
2017	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c $(OUTPUT_OPTION)
2018
2019genpeep$(build_exeext) : genpeep.o $(HOST_RTL) $(HOST_SUPPORT) \
2020  $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
2021	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
2022	 genpeep.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
2023	    $(HOST_ERRORS) $(HOST_LIBS)
2024
2025genpeep.o : genpeep.c $(RTL_H) $(HCONFIG_H) $(SYSTEM_H) errors.h gensupport.h
2026	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c $(OUTPUT_OPTION)
2027
2028genattr$(build_exeext) : genattr.o $(HOST_RTL) $(HOST_SUPPORT) \
2029  $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
2030	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
2031	 genattr.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
2032	    $(HOST_ERRORS) $(HOST_LIBS)
2033
2034genattr.o : genattr.c $(RTL_H) $(HCONFIG_H) $(SYSTEM_H) errors.h gensupport.h
2035	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c $(OUTPUT_OPTION)
2036
2037genattrtab$(build_exeext) : genattrtab.o genautomata.o \
2038  $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_VARRAY) \
2039  $(HOST_LIBDEPS)
2040	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
2041	 genattrtab.o genautomata.o \
2042	 $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) $(HOST_ERRORS) \
2043	 $(HOST_VARRAY) $(HOST_LIBS) -lm
2044
2045genattrtab.o : genattrtab.c $(RTL_H) $(OBSTACK_H) $(HCONFIG_H) \
2046  $(SYSTEM_H) errors.h $(GGC_H) gensupport.h genattrtab.h
2047	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c $(OUTPUT_OPTION)
2048
2049genautomata.o : genautomata.c $(RTL_H) $(OBSTACK_H) $(HCONFIG_H) \
2050  $(SYSTEM_H) errors.h varray.h genattrtab.h $(HASHTAB_H)
2051	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genautomata.c $(OUTPUT_OPTION)
2052
2053genoutput$(build_exeext) : genoutput.o $(HOST_RTL) $(HOST_SUPPORT) \
2054  $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
2055	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
2056	 genoutput.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
2057	    $(HOST_ERRORS) $(HOST_LIBS)
2058
2059genoutput.o : genoutput.c $(RTL_H) $(HCONFIG_H) \
2060  $(SYSTEM_H) errors.h gensupport.h
2061	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c $(OUTPUT_OPTION)
2062
2063gengenrtl$(build_exeext) : gengenrtl.o $(HOST_LIBDEPS)
2064	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
2065	 gengenrtl.o $(HOST_LIBS)
2066
2067gengenrtl.o : gengenrtl.c $(RTL_BASE_H) $(HCONFIG_H) $(SYSTEM_H) real.h
2068	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gengenrtl.c $(OUTPUT_OPTION)
2069
2070genpreds$(build_exeext) : genpreds.o $(HOST_LIBDEPS)
2071	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
2072	 genpreds.o $(HOST_LIBS)
2073
2074genpreds.o : genpreds.c $(RTL_BASE_H) $(HCONFIG_H) $(SYSTEM_H)
2075	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpreds.c $(OUTPUT_OPTION)
2076
2077gengtype$(build_exeext) : gengtype.o gengtype-lex.o gengtype-yacc.o \
2078  $(HOST_LIBDEPS)
2079	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
2080	 gengtype.o gengtype-lex.o gengtype-yacc.o $(HOST_LIBS)
2081
2082gengtype.o : gengtype.c gengtype.h $(HCONFIG_H) $(SYSTEM_H) real.h rtl.def \
2083  gtyp-gen.h
2084	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
2085	  $(srcdir)/gengtype.c $(OUTPUT_OPTION)
2086
2087gengtype-lex.o : $(srcdir)/gengtype-lex.c gengtype.h $(srcdir)/gengtype-yacc.c \
2088  $(HCONFIG_H) $(SYSTEM_H)
2089	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
2090	  $(srcdir)/gengtype-lex.c $(OUTPUT_OPTION)
2091
2092gengtype-yacc.o : $(srcdir)/gengtype-yacc.c gengtype.h $(HCONFIG_H) $(SYSTEM_H)
2093	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
2094	  $(srcdir)/gengtype-yacc.c $(OUTPUT_OPTION)
2095
2096# The sed command works around a bug in flex-2.5.4.
2097$(srcdir)/gengtype-lex.c : $(srcdir)/gengtype-lex.l
2098	cd $(srcdir) && \
2099	$(FLEX) $(FLEXFLAGS) -t -o$@ gengtype-lex.l | \
2100	  sed 's/^\(char msg\[\];\)/yyconst \1/' > g-$$$$ ; \
2101	if test $$? -eq 0 ; then \
2102	  mv -f g-$$$$ gengtype-lex.c ; \
2103	else \
2104	  rm -f g-$$$$.* ; \
2105	  false ; \
2106	fi
2107
2108$(srcdir)/gengtype-yacc.c: $(srcdir)/gengtype-yacc.y
2109	(cd $(srcdir) && \
2110	 $(BISON) $(BISONFLAGS) -d -o gengtype-yacc.c gengtype-yacc.y || \
2111	 ( rm -f $@ && false ) )
2112
2113genconditions$(build_exeext) : genconditions.o $(HOST_EARLY_SUPPORT) \
2114  $(HOST_RTL) $(HOST_ERRORS) $(HOST_LIBDEPS)
2115	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
2116	 genconditions.o $(HOST_EARLY_SUPPORT) $(HOST_RTL) \
2117	    $(HOST_ERRORS) $(HOST_LIBS)
2118
2119genconditions.o : genconditions.c $(RTL_H) $(HCONFIG_H) $(SYSTEM_H) errors.h
2120	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
2121		$(srcdir)/genconditions.c $(OUTPUT_OPTION)
2122
2123#
2124# Compile the libraries to be used by gen*.
2125# If we are not cross-building, gen* use the same .o's that cc1 will use,
2126# and BUILD_PREFIX_1 is `loser-', just to ensure these rules don't conflict
2127# with the rules for rtl.o, etc.
2128$(BUILD_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(HCONFIG_H) $(SYSTEM_H) $(RTL_H) \
2129  real.h $(GGC_H) errors.h
2130	rm -f $(BUILD_PREFIX)rtl.c
2131	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(BUILD_PREFIX)rtl.c
2132	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)rtl.c $(OUTPUT_OPTION)
2133
2134print-rtl1.o: $(srcdir)/print-rtl.c $(HCONFIG_H) \
2135  $(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H)
2136	rm -f print-rtl1.c
2137	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > print-rtl1.c
2138	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) print-rtl1.c $(OUTPUT_OPTION)
2139
2140$(BUILD_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(HCONFIG_H) $(SYSTEM_H) \
2141  $(RTL_H) flags.h $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H)
2142	rm -f $(BUILD_PREFIX)bitmap.c
2143	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/bitmap.c > $(BUILD_PREFIX)bitmap.c
2144	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)bitmap.c $(OUTPUT_OPTION)
2145
2146$(BUILD_PREFIX_1)errors.o: errors.c $(HCONFIG_H) $(SYSTEM_H) errors.h
2147	rm -f $(BUILD_PREFIX)errors.c
2148	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/errors.c > $(BUILD_PREFIX)errors.c
2149	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)errors.c $(OUTPUT_OPTION)
2150
2151$(BUILD_PREFIX_1)varray.o: varray.c $(HCONFIG_H) $(SYSTEM_H) varray.h \
2152  $(RTL_H) $(GGC_H) $(TREE_H) bitmap.h errors.h
2153	rm -f $(BUILD_PREFIX)varray.c
2154	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/varray.c > \
2155		$(BUILD_PREFIX)varray.c
2156	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
2157		$(BUILD_PREFIX)varray.c $(OUTPUT_OPTION)
2158
2159$(BUILD_PREFIX_1)ggc-none.o: ggc-none.c $(HCONFIG_H) $(SYSTEM_H) $(GGC_H)
2160	rm -f $(BUILD_PREFIX)ggc-none.c
2161	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/ggc-none.c > $(BUILD_PREFIX)ggc-none.c
2162	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)ggc-none.c $(OUTPUT_OPTION)
2163
2164#
2165# Remake internationalization support.
2166intl.o: intl.c $(CONFIG_H) system.h intl.h Makefile
2167	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2168	  -DLOCALEDIR=\"$(localedir)\" \
2169	  -c $(srcdir)/intl.c $(OUTPUT_OPTION)
2170
2171$(top_builddir)/intl/libintl.a: intl.all
2172
2173intl.all intl.install intl.uninstall \
2174  intl.mostlyclean intl.clean intl.distclean intl.maintainer-clean:
2175	@for d in $(INTL_SUBDIRS); do \
2176	  target=`expr $@ : 'intl.\(.*\)'` && \
2177	  echo "(cd $$d && $(MAKE) $$target)" && \
2178	  (cd $$d && AWK='$(AWK)' $(MAKE) $(SUBDIR_FLAGS_TO_PASS) $$target); \
2179	  if [ $$? -eq 0 ] ; then true ; else exit 1 ; fi ; \
2180	done
2181
2182# intl.all and intl.install need config.h to exist, and the files it includes.
2183# (FIXME: intl/*.c shouldn't need to see insn-foo.h!)
2184intl.all intl.install: config.h insn-flags.h insn-constants.h
2185
2186# Make-lang.in should add dependencies of po-generated on any generated
2187# files which need to be scanned by gettext (usually Yacc-generated parsers).
2188po-generated: c-parse.c
2189
2190#
2191# Remake cpp and protoize.
2192
2193PREPROCESSOR_DEFINES = \
2194  -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
2195  -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
2196  -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_alias)\" \
2197  -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
2198  -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
2199  -DCROSS_INCLUDE_DIR=\"$(gcc_tooldir)/sys-include\" \
2200  -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\"
2201
2202LIBCPP_OBJS =	cpplib.o cpplex.o cppmacro.o cppexp.o cppfiles.o cpptrad.o \
2203		cpphash.o cpperror.o cppinit.o cppdefault.o cppmain.o \
2204		hashtable.o line-map.o mkdeps.o prefix.o mbchar.o
2205
2206LIBCPP_DEPS =	$(CPPLIB_H) cpphash.h line-map.h hashtable.h intl.h \
2207		$(OBSTACK_H) $(SYSTEM_H)
2208
2209# Most of the other archives built/used by this makefile are for
2210# targets.  This one is strictly for the host.
2211libcpp.a: $(LIBCPP_OBJS)
2212	-rm -rf libcpp.a
2213	$(AR) $(AR_FLAGS) libcpp.a $(LIBCPP_OBJS)
2214	-$(RANLIB) libcpp.a
2215
2216cppmain.o:  cppmain.c  $(CONFIG_H) $(LIBCPP_DEPS)
2217
2218cpperror.o: cpperror.c $(CONFIG_H) $(LIBCPP_DEPS)
2219cppexp.o:   cppexp.c   $(CONFIG_H) $(LIBCPP_DEPS)
2220cpplex.o:   cpplex.c   $(CONFIG_H) $(LIBCPP_DEPS) mbchar.h
2221cppmacro.o: cppmacro.c $(CONFIG_H) $(LIBCPP_DEPS)
2222cpplib.o:   cpplib.c   $(CONFIG_H) $(LIBCPP_DEPS)
2223cpphash.o:  cpphash.c  $(CONFIG_H) $(LIBCPP_DEPS)
2224cpptrad.o:  cpptrad.c  $(CONFIG_H) $(LIBCPP_DEPS)
2225cppfiles.o: cppfiles.c $(CONFIG_H) $(LIBCPP_DEPS) $(SPLAY_TREE_H) mkdeps.h
2226cppinit.o:  cppinit.c  $(CONFIG_H) $(LIBCPP_DEPS) cppdefault.h \
2227		mkdeps.h prefix.h
2228
2229cppdefault.o: cppdefault.c $(CONFIG_H) $(SYSTEM_H) cppdefault.h Makefile
2230	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2231	  $(PREPROCESSOR_DEFINES) \
2232	  -c $(srcdir)/cppdefault.c $(OUTPUT_OPTION)
2233
2234mkdeps.o: mkdeps.c $(CONFIG_H) $(SYSTEM_H) mkdeps.h
2235
2236# Note for the stamp targets, we run the program `true' instead of
2237# having an empty command (nothing following the semicolon).
2238
2239proto: config.status protoize$(exeext) unprotoize$(exeext) SYSCALLS.c.X
2240
2241PROTO_OBJS = intl.o version.o cppdefault.o
2242
2243protoize$(exeext): protoize.o $(PROTO_OBJS) $(LIBDEPS)
2244	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ protoize.o $(PROTO_OBJS) $(LIBS)
2245
2246unprotoize$(exeext): unprotoize.o $(PROTO_OBJS) $(LIBDEPS)
2247	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ unprotoize.o $(PROTO_OBJS) $(LIBS)
2248
2249protoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) $(SYSTEM_H) \
2250   Makefile version.h
2251	(SHLIB_LINK='$(SHLIB_LINK)' \
2252	SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
2253	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2254	  $(DRIVER_DEFINES) \
2255	  $(srcdir)/protoize.c $(OUTPUT_OPTION))
2256
2257unprotoize.o: protoize.c $(srcdir)/../include/getopt.h \
2258   $(CONFIG_H) $(SYSTEM_H) Makefile version.h
2259	(SHLIB_LINK='$(SHLIB_LINK)' \
2260	SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
2261	$(CC) -c -DUNPROTOIZE $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2262	  $(DRIVER_DEFINES) \
2263	  $(srcdir)/protoize.c $(OUTPUT_OPTION))
2264
2265# This info describes the target machine, so compile with GCC just built.
2266SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) \
2267   stmp-int-hdrs
2268	-rm -f SYSCALLS.c tmp-SYSCALLS.s
2269	sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \
2270	  $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c
2271	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2272	  -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c
2273	-rm -f SYSCALLS.c tmp-SYSCALLS.s
2274
2275
2276test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
2277	-rm -f tmp-proto.[cso]
2278	cp $(srcdir)/protoize.c tmp-proto.c
2279	chmod u+w tmp-proto.c
2280	./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \
2281	  $(GCC_CFLAGS) $(INCLUDES) \
2282	  -DGCC_INCLUDE_DIR=0 \
2283	  -DGPLUSPLUS_INCLUDE_DIR=0 \
2284	  -DCROSS_INCLUDE_DIR=0 \
2285	  -DTOOL_INCLUDE_DIR=0 \
2286	  -DSTANDARD_EXEC_PREFIX=0 \
2287	  -DDEFAULT_TARGET_MACHINE=0 \
2288	  -DDEFAULT_TARGET_VERSION=0" tmp-proto.c
2289	@echo '**********' Expect 400 lines of differences.
2290	-diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff
2291	-wc -l tmp-proto.diff
2292	./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \
2293	  $(GCC_CFLAGS) $(INCLUDES) \
2294	  -DGCC_INCLUDE_DIR=0 \
2295	  -DGPLUSPLUS_INCLUDE_DIR=0 \
2296	  -DCROSS_INCLUDE_DIR=0 \
2297	  -DTOOL_INCLUDE_DIR=0 \
2298	  -DSTANDARD_EXEC_PREFIX=0 \
2299	  -DDEFAULT_TARGET_MACHINE=0 \
2300	  -DDEFAULT_TARGET_VERSION=0" tmp-proto.c
2301	@echo Expect zero differences.
2302	diff $(srcdir)/protoize.c tmp-proto.c | cat
2303	-rm -f tmp-proto.[cs] tmp-proto$(objext)
2304
2305gcov.o: gcov.c gcov-io.h intl.h $(SYSTEM_H) $(CONFIG_H)
2306
2307# Only one of 'gcov' or 'gcov.exe' is actually built, depending
2308# upon whether $(exeext) is empty or not.
2309GCOV_OBJS = gcov.o intl.o version.o
2310gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
2311	$(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
2312#
2313# Build the include directory.  The stamp files are stmp-* rather than
2314# s-* so that mostlyclean does not force the include directory to
2315# be rebuilt.
2316
2317# Build the include directory
2318stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h
2319# Copy in the headers provided with gcc.
2320# The sed command gets just the last file name component;
2321# this is necessary because VPATH could add a dirname.
2322# Using basename would be simpler, but some systems don't have it.
2323# The touch command is here to workaround an AIX/Linux NFS bug.
2324	-if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
2325	for file in .. $(USER_H); do \
2326	  if [ X$$file != X.. ]; then \
2327	    realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
2328	    $(STAMP) include/$$realfile; \
2329	    rm -f include/$$realfile; \
2330	    cp $$file include; \
2331	    chmod a+r include/$$realfile; \
2332	  fi; \
2333	done
2334	rm -f include/limits.h
2335	cp xlimits.h include/limits.h
2336	chmod a+r include/limits.h
2337# Install the README
2338	rm -f include/README
2339	cp $(srcdir)/README-fixinc include/README
2340	chmod a+r include/README
2341	$(STAMP) $@
2342
2343# fixinc.sh depends on this, not on specs directly.
2344# The idea is to make sure specs gets built, but not rerun fixinc.sh
2345# after each stage just because specs' mtime has changed.
2346specs.ready: specs
2347	-if [ -f specs.ready ] ; then \
2348		true; \
2349	else \
2350		$(STAMP) specs.ready; \
2351	fi
2352
2353FIXINCSRCDIR=$(srcdir)/fixinc
2354fixinc.sh: $(FIXINCSRCDIR)/mkfixinc.sh $(FIXINCSRCDIR)/fixincl.c \
2355	$(FIXINCSRCDIR)/procopen.c $(FIXINCSRCDIR)/gnu-regex.c \
2356	$(FIXINCSRCDIR)/server.c $(FIXINCSRCDIR)/gnu-regex.h \
2357	$(FIXINCSRCDIR)/server.h $(FIXINCSRCDIR)/inclhack.def specs.ready
2358	(MAKE="$(MAKE)"; srcdir=`cd $(srcdir)/fixinc && ${PWD_COMMAND}` ; \
2359	CC="$(HOST_CC)"; CFLAGS="$(HOST_CFLAGS)"; LDFLAGS="$(HOST_LDFLAGS)"; \
2360	WARN_CFLAGS="$(WARN_CFLAGS)"; \
2361	export MAKE srcdir CC CFLAGS LDFLAGS WARN_CFLAGS; cd ./fixinc && \
2362	$(SHELL) $${srcdir}/mkfixinc.sh $(build_canonical) $(target))
2363
2364# Build fixed copies of system files.
2365stmp-fixinc: fixinc.sh gsyslimits.h
2366	rm -rf include; mkdir include
2367	-chmod a+rx include
2368	(TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \
2369	SHELL='$(SHELL)' ;\
2370	export TARGET_MACHINE srcdir SHELL ; \
2371	$(SHELL) ./fixinc.sh `${PWD_COMMAND}`/include $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); \
2372	rm -f include/syslimits.h; \
2373	if [ -f include/limits.h ]; then \
2374	  mv include/limits.h include/syslimits.h; \
2375	else \
2376	  cp $(srcdir)/gsyslimits.h include/syslimits.h; \
2377	fi; \
2378	chmod a+r include/syslimits.h)
2379# If $(SYSTEM_HEADER_DIR) is $(build_tooldir)/sys-include, and
2380# that directory exists, then make sure that $(libsubdir) exists.
2381# This is because cpp is compiled to find $(gcc_tooldir)/include via
2382# $(libsubdir)/$(unlibsubdir), which will only work if $(libsubdir)
2383# exists.
2384# ??? Better would be to use -isystem $(build_tooldir)/sys-include,
2385# but fixincludes does not take such arguments.
2386	if [ "$(SYSTEM_HEADER_DIR)" = "$(build_tooldir)/sys-include" ] \
2387	   && [ -d $(build_tooldir)/sys-include ]; then \
2388	  if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi; \
2389	  if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib; fi; \
2390	  if [ -d $(libdir)/gcc-lib/$(target_alias) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias) ; fi; \
2391	  if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version) ; fi; \
2392	else true; fi
2393	$(STAMP) stmp-fixinc
2394
2395# Files related to the fixproto script.
2396# gen-protos and fix-header are compiled with HOST_CC, but they are only
2397# used in native and host-x-target builds, so it's safe to link them with
2398# libiberty.a.
2399
2400deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs
2401	if [ -d $(SYSTEM_HEADER_DIR) ]; \
2402	then \
2403	  CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -I. -I$(srcdir) -isystem include -isystem ${SYSTEM_HEADER_DIR}"; \
2404	  export CC; \
2405	  $(SHELL) $(srcdir)/scan-types.sh "$(srcdir)" >tmp-deduced.h; \
2406	  mv tmp-deduced.h deduced.h; \
2407	else \
2408	  $(STAMP) deduced.h; \
2409	fi
2410
2411GEN_PROTOS_OBJS = gen-protos.o scan.o
2412gen-protos$(build_exeext): $(GEN_PROTOS_OBJS)
2413	${HOST_CC} $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
2414	  $(GEN_PROTOS_OBJS) $(HOST_LIBS)
2415
2416gen-protos.o: gen-protos.c scan.h $(HCONFIG_H) $(SYSTEM_H)
2417	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gen-protos.c $(OUTPUT_OPTION)
2418
2419scan.o: scan.c scan.h $(HCONFIG_H) $(SYSTEM_H)
2420	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c $(OUTPUT_OPTION)
2421
2422xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos$(build_exeext) Makefile
2423	sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \
2424	  deduced.h $(srcdir)/sys-protos.h > tmp-fixtmp.c
2425	mv tmp-fixtmp.c fixtmp.c
2426	$(GCC_FOR_TARGET) fixtmp.c -w -U__SIZE_TYPE__ -U__PTRDIFF_TYPE__ -U__WCHAR_TYPE__ -E \
2427	  | sed -e 's/	/ /g' -e 's/ *(/ (/g' -e 's/ [ ]*/ /g' -e 's/( )/()/' \
2428	  | $(RUN_GEN) ./gen-protos >xsys-protos.hT
2429	mv xsys-protos.hT xsys-protos.h
2430	rm -rf fixtmp.c
2431
2432# This is nominally a 'build' program, but it's run only when host==build,
2433# so we can (indeed, must) use $(LIBDEPS) and $(LIBS).
2434fix-header$(build_exeext): fix-header.o scan-decls.o scan.o xsys-protos.h \
2435           $(LIBDEPS) libcpp.a
2436	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ fix-header.o \
2437	   scan-decls.o scan.o libcpp.a $(LIBS)
2438
2439fix-header.o: fix-header.c $(OBSTACK_H) scan.h \
2440	xsys-protos.h $(HCONFIG_H) $(SYSTEM_H) $(CPPLIB_H)
2441	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/fix-header.c $(OUTPUT_OPTION)
2442
2443scan-decls.o: scan-decls.c scan.h $(CPPLIB_H) $(HCONFIG_H) $(SYSTEM_H)
2444	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan-decls.c $(OUTPUT_OPTION)
2445
2446# stmp-fixproto depends on this, not on fix-header directly.
2447# The idea is to make sure fix-header gets built,
2448# but not rerun fixproto after each stage
2449# just because fix-header's mtime has changed.
2450fixhdr.ready: fix-header$(build_exeext)
2451	-if [ -f fixhdr.ready ] ; then \
2452		true; \
2453	else \
2454		$(STAMP) fixhdr.ready; \
2455	fi
2456
2457# stmp-int-headers is to make sure fixincludes has already finished.
2458# The if statement is so that we don't run fixproto a second time
2459# if it has already been run on the files in `include'.
2460stmp-fixproto: fixhdr.ready fixproto stmp-int-hdrs
2461	if [ -f include/fixed ] ; then true; \
2462	else \
2463	  : This line works around a 'make' bug in BSDI 1.1.; \
2464	  FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"; export FIXPROTO_DEFINES; \
2465	  mkinstalldirs="$(SHELL) $(srcdir)/mkinstalldirs"; \
2466	    export mkinstalldirs; \
2467	  if [ -d $(SYSTEM_HEADER_DIR) ] ; then \
2468	    $(SHELL) ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \
2469	    if [ $$? -eq 0 ] ; then true ; else exit 1 ; fi ; \
2470	  else true; fi; \
2471	  $(STAMP) include/fixed; \
2472	fi
2473	$(STAMP) stmp-fixproto
2474#
2475# Remake the info files.
2476
2477docdir = $(srcdir)/doc
2478
2479doc: $(BUILD_INFO) $(GENERATED_MANPAGES) gccbug
2480info: $(docdir)/cpp.info $(docdir)/gcc.info $(docdir)/gccint.info $(docdir)/gccinstall.info lang.info $(docdir)/cppinternals.info
2481
2482TEXI_CPP_FILES = $(docdir)/cpp.texi $(docdir)/include/fdl.texi \
2483  $(docdir)/cppenv.texi $(docdir)/cppopts.texi
2484
2485TEXI_GCC_FILES = $(docdir)/gcc.texi $(docdir)/include/gcc-common.texi \
2486	 $(docdir)/frontends.texi $(docdir)/standards.texi \
2487	 $(docdir)/invoke.texi $(docdir)/extend.texi $(docdir)/md.texi \
2488	 $(docdir)/objc.texi $(docdir)/gcov.texi $(docdir)/trouble.texi \
2489	 $(docdir)/bugreport.texi $(docdir)/service.texi \
2490	 $(docdir)/contribute.texi $(docdir)/compat.texi \
2491	 $(docdir)/include/funding.texi $(docdir)/gnu.texi \
2492	 $(docdir)/include/gpl.texi $(docdir)/include/fdl.texi \
2493	 $(docdir)/contrib.texi $(docdir)/cppenv.texi $(docdir)/cppopts.texi
2494
2495TEXI_GCCINT_FILES = $(docdir)/gccint.texi \
2496	 $(docdir)/include/gcc-common.texi $(docdir)/contribute.texi \
2497	 $(docdir)/makefile.texi $(docdir)/configterms.texi \
2498	 $(docdir)/portability.texi $(docdir)/interface.texi \
2499	 $(docdir)/passes.texi $(docdir)/c-tree.texi \
2500	 $(docdir)/rtl.texi $(docdir)/md.texi $(docdir)/tm.texi \
2501	 $(docdir)/hostconfig.texi $(docdir)/fragments.texi \
2502	 $(docdir)/configfiles.texi $(docdir)/collect2.texi \
2503	 $(docdir)/headerdirs.texi $(docdir)/include/funding.texi \
2504	 $(docdir)/gnu.texi $(docdir)/include/gpl.texi \
2505	 $(docdir)/include/fdl.texi $(docdir)/contrib.texi \
2506	 $(docdir)/languages.texi $(docdir)/sourcebuild.texi \
2507	 $(docdir)/gty.texi
2508
2509TEXI_GCCINSTALL_FILES = $(docdir)/install.texi $(docdir)/install-old.texi \
2510	 $(docdir)/include/fdl.texi
2511
2512TEXI_CPPINT_FILES = $(docdir)/cppinternals.texi
2513
2514$(docdir)/cpp.info: $(TEXI_CPP_FILES)
2515	cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -I doc -I doc/include -o doc/cpp.info doc/cpp.texi
2516
2517$(docdir)/gcc.info: $(TEXI_GCC_FILES)
2518	cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -I doc -I doc/include -o doc/gcc.info doc/gcc.texi
2519
2520$(docdir)/gccint.info: $(TEXI_GCCINT_FILES)
2521	cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -I doc -I doc/include -o doc/gccint.info doc/gccint.texi
2522
2523$(docdir)/gccinstall.info: $(TEXI_GCCINSTALL_FILES)
2524	cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -I doc -I doc/include -o doc/gccinstall.info doc/install.texi
2525
2526$(docdir)/cppinternals.info: $(TEXI_CPPINT_FILES)
2527	cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -I doc -I doc/include -o doc/cppinternals.info \
2528		doc/cppinternals.texi
2529
2530dvi: gcc.dvi gccint.dvi gccinstall.dvi cpp.dvi lang.dvi cppinternals.dvi
2531
2532# This works with GNU Make's default rule.
2533cpp.dvi: $(TEXI_CPP_FILES)
2534	$(TEXI2DVI) -I $(docdir) -I $(docdir)/include $(docdir)/cpp.texi
2535
2536gcc.dvi: $(TEXI_GCC_FILES)
2537	$(TEXI2DVI) -I $(docdir) -I $(docdir)/include $(docdir)/gcc.texi
2538
2539gccint.dvi: $(TEXI_GCCINT_FILES)
2540	$(TEXI2DVI) -I $(docdir) -I $(docdir)/include $(docdir)/gccint.texi
2541
2542gccinstall.dvi: $(TEXI_GCCINSTALL_FILES)
2543	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
2544	$(TEXI2DVI) -I $$s/doc -I $$s/doc/include -o $@ $$s/doc/install.texi
2545
2546cppinternals.dvi: $(TEXI_CPPINT_FILES)
2547	$(TEXI2DVI) -I $(docdir) -I $(docdir)/include $(docdir)/cppinternals.texi
2548
2549generated-manpages: $(docdir)/gcov.1 $(docdir)/cpp.1 $(docdir)/gcc.1 \
2550	 $(docdir)/gfdl.7 $(docdir)/gpl.7 $(docdir)/fsf-funding.7 \
2551	 lang.generated-manpages
2552
2553$(docdir)/gcov.1: $(docdir)/gcov.texi
2554	$(STAMP) $(docdir)/gcov.1
2555	-$(TEXI2POD) $(docdir)/gcov.texi > gcov.pod
2556	-($(POD2MAN) --section=1 gcov.pod > $(docdir)/gcov.1.T$$$$ && \
2557		mv -f $(docdir)/gcov.1.T$$$$ $(docdir)/gcov.1) || \
2558		(rm -f $(docdir)/gcov.1.T$$$$ && exit 1)
2559	-rm -f gcov.pod
2560
2561$(docdir)/cpp.1: $(docdir)/cpp.texi $(docdir)/cppenv.texi \
2562  $(docdir)/cppopts.texi
2563	$(STAMP) $(docdir)/cpp.1
2564	-$(TEXI2POD) $(docdir)/cpp.texi > cpp.pod
2565	-($(POD2MAN) --section=1 cpp.pod > $(docdir)/cpp.1.T$$$$ && \
2566		mv -f $(docdir)/cpp.1.T$$$$ $(docdir)/cpp.1) || \
2567		(rm -f $(docdir)/cpp.1.T$$$$ && exit 1)
2568	-rm -f cpp.pod
2569
2570$(docdir)/gcc.1: $(docdir)/invoke.texi $(docdir)/cppenv.texi \
2571  $(docdir)/cppopts.texi
2572	$(STAMP) $(docdir)/gcc.1
2573	-$(TEXI2POD) $(docdir)/invoke.texi > gcc.pod
2574	-($(POD2MAN) --section=1 gcc.pod > $(docdir)/gcc.1.T$$$$ && \
2575		mv -f $(docdir)/gcc.1.T$$$$ $(docdir)/gcc.1) || \
2576		(rm -f $(docdir)/gcc.1.T$$$$ && exit 1)
2577	-rm -f gcc.pod
2578
2579$(docdir)/gfdl.7: $(docdir)/include/fdl.texi
2580	$(STAMP) $(docdir)/gfdl.7
2581	-$(TEXI2POD) $(docdir)/include/fdl.texi > gfdl.pod
2582	-($(POD2MAN) --section=7 gfdl.pod > $(docdir)/gfdl.7.T$$$$ && \
2583		mv -f $(docdir)/gfdl.7.T$$$$ $(docdir)/gfdl.7) || \
2584		(rm -f $(docdir)/gfdl.7.T$$$$ && exit 1)
2585	-rm -f gfdl.pod
2586
2587$(docdir)/gpl.7: $(docdir)/include/gpl.texi
2588	$(STAMP) $(docdir)/gpl.7
2589	-$(TEXI2POD) $(docdir)/include/gpl.texi > gpl.pod
2590	-($(POD2MAN) --section=7 gpl.pod > $(docdir)/gpl.7.T$$$$ && \
2591		mv -f $(docdir)/gpl.7.T$$$$ $(docdir)/gpl.7) || \
2592		(rm -f $(docdir)/gpl.7.T$$$$ && exit 1)
2593	-rm -f gpl.pod
2594
2595$(docdir)/fsf-funding.7: $(docdir)/include/funding.texi
2596	$(STAMP) $(docdir)/fsf-funding.7
2597	-$(TEXI2POD) $(docdir)/include/funding.texi > fsf-funding.pod
2598	-($(POD2MAN) --section=7 fsf-funding.pod \
2599		> $(docdir)/fsf-funding.7.T$$$$ && \
2600	    mv -f $(docdir)/fsf-funding.7.T$$$$ $(docdir)/fsf-funding.7) || \
2601	    (rm -f $(docdir)/fsf-funding.7.T$$$$ && exit 1)
2602	-rm -f fsf-funding.pod
2603
2604#
2605# Deletion of files made during compilation.
2606# There are four levels of this:
2607#   `mostlyclean', `clean', `distclean' and `maintainer-clean'.
2608# `mostlyclean' is useful while working on a particular type of machine.
2609# It deletes most, but not all, of the files made by compilation.
2610# It does not delete libgcc.a or its parts, so it won't have to be recompiled.
2611# `clean' deletes everything made by running `make all'.
2612# `distclean' also deletes the files made by config.
2613# `maintainer-clean' also deletes everything that could be regenerated
2614# automatically, except for `configure'.
2615# We remove as much from the language subdirectories as we can
2616# (less duplicated code).
2617
2618INTL_MOSTLYCLEAN = intl.mostlyclean
2619mostlyclean: $(INTL_MOSTLYCLEAN) lang.mostlyclean
2620	-rm -f $(STAGESTUFF)
2621	-rm -f *$(coverageexts)
2622	-rm -rf libgcc
2623# Delete the temporary source copies for cross compilation.
2624	-rm -f $(BUILD_PREFIX_1)rtl.c $(BUILD_PREFIX_1)print-rtl.c
2625	-rm -f $(BUILD_PREFIX_1)bitmap.c $(BUILD_PREFIX_1)errors.c
2626	-rm -f $(BUILD_PREFIX_1)ggc-none.c
2627# Delete the temp files made in the course of building libgcc.a.
2628	-rm -f xlimits.h
2629# Delete other built files.
2630	-rm -f xsys-protos.hT
2631	-rm -f specs.h options.h gencheck.h
2632# Delete the stamp and temporary files.
2633	-rm -f s-* tmp-* stamp-* stmp-*
2634	-rm -f */stamp-* */tmp-*
2635# Delete debugging dump files.
2636	-rm -f *.[0-9][0-9].* */*.[0-9][0-9].*
2637# Delete some files made during installation.
2638	-rm -f specs SYSCALLS.c.X SYSCALLS.c
2639	-rm -f collect collect2 mips-tfile mips-tdump
2640# Delete files generated for fixproto
2641	-rm -rf fix-header$(build_exeext) xsys-protos.h deduced.h tmp-deduced.h \
2642	  gen-protos$(build_exeext) fixproto.list fixtmp.* fixhdr.ready
2643# Delete files generated for fixincl
2644	-rm -rf fixincl fixinc.sh specs.ready
2645	(cd fixinc && $(MAKE) clean)
2646# Delete unwanted output files from TeX.
2647	-rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
2648	-rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg
2649# Delete sorted indices we don't actually use.
2650	-rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
2651# Delete core dumps.
2652	-rm -f core */core
2653# Delete file generated for gengtype.c
2654	-rm -f gtyp-gen.h
2655# Delete files generated by gengtype.c
2656	-rm -f gtype-*
2657	-rm -f gt-*
2658
2659# Delete all files made by compilation
2660# that don't exist in the distribution.
2661INTL_CLEAN = intl.clean
2662clean: mostlyclean $(INTL_CLEAN) lang.clean
2663	-rm -f libgcc.a libgcc_eh.a libgcc_s$(SHLIB_EXT) libgcc_s$(SHLIB_EXT).1
2664	-rm -f config.h tconfig.h hconfig.h tm_p.h
2665	-rm -f cs-*
2666	-rm -rf libgcc
2667	-rm -f *.dvi
2668	-rm -f */*.dvi
2669# Delete the include directory.
2670	-rm -rf include
2671# Delete files used by the "multilib" facility (including libgcc subdirs).
2672	-rm -f multilib.h tmpmultilib*
2673	-if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \
2674	  rm -rf $(MULTILIB_DIRNAMES); \
2675	else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \
2676	  rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
2677	fi ; fi
2678	-rm -fr stage1 stage2 stage3 stage4
2679# Delete stamps of bootstrap stages
2680	-rm -f stage?_*
2681	-rm -f clean?_*
2682	-rm -f stage_last
2683
2684# Delete all files that users would normally create
2685# while building and installing GCC.
2686INTL_DISTCLEAN = intl.distclean
2687distclean: clean $(INTL_DISTCLEAN) lang.distclean
2688	-rm -f auto-host.h auto-build.h
2689	-rm -f cstamp-h
2690	-rm -f config.status config.run config.cache config.bak
2691	-rm -f Make-lang Make-hooks Make-host Make-target
2692	-rm -f Makefile *.oaux
2693	-rm -f gthr-default.h
2694	-rm -f */stage1 */stage2 */stage3 */stage4 */include
2695	-rm -f c-parse.output
2696	-rm -f *.asm
2697	-rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
2698	-rm -f testsuite/*.log testsuite/*.sum
2699	-cd testsuite && rm -f x *.x *.x? *.exe *.rpo *.o *.s *.S *.c
2700	-cd testsuite && rm -f *.out *.gcov *.bb *.bbg
2701	-rm -rf ${QMTEST_DIR} stamp-qmtest
2702	-rm -f intl/libintl.h libintl.h
2703	-rm -f cxxmain.c
2704	-rm -f mklibgcc mkheaders gccbug .gdbinit configargs.h
2705	-rm -f gcov.pod
2706	-rm -f fixinc/Makefile
2707# Delete po/*.gmo only if we are not building in the source directory.
2708	-if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi
2709	-rmdir ada cp f java objc fixinc intl po testsuite 2>/dev/null
2710
2711# Delete anything likely to be found in the source directory
2712# that shouldn't be in the distribution.
2713extraclean: distclean lang.extraclean
2714	-rm -rf =* ./"#"* *~* config/=* config/"#"* config/*~*
2715	-rm -f patch* *.orig *.rej config/patch* config/*.orig config/*.rej
2716	-rm -f config/*/=* config/*/"#"* config/*/*~*
2717	-rm -f config/*/*.orig config/*/*.rej
2718	-rm -f *.dvi *.ps *.oaux *.d *.[zZ] *.gz
2719	-rm -f *.tar *.xtar *diff *.diff.* *.tar.* *.xtar.* *diffs
2720	-rm -f *lose config/*lose config/*/*lose
2721	-rm -f *.s *.s[0-9] *.i config/ChangeLog
2722	-rm -f y.tab.c yacc.*
2723	-rm -f */=* */"#"* */*~*
2724	-rm -f */patch* */*.orig */*.rej
2725	-rm -f */*.dvi */*.oaux */*.d */*.[zZ] */*.gz
2726	-rm -f */*.tar */*.xtar */*diff */*.diff.* */*.tar.* */*.xtar.* */*diffs
2727	-rm -f */*lose */*.s */*.s[0-9] */*.i
2728
2729# Get rid of every file that's generated from some other file, except for `configure'.
2730# Most of these files ARE PRESENT in the GCC distribution.
2731# We define INTL_DISTCLEAN, INTL_CLEAN & INTL_MOSTLYCLEAN to be empty in the
2732# submake, so that we don't descend into intl after its makefile has been
2733# removed.
2734maintainer-clean:
2735	@echo 'This command is intended for maintainers to use; it'
2736	@echo 'deletes files that may need special tools to rebuild.'
2737	$(MAKE) INTL_DISTCLEAN= INTL_CLEAN= INTL_MOSTLYCLEAN= \
2738		intl.maintainer-clean lang.maintainer-clean distclean
2739	-rm -f c-parse.y c-parse.c c-parse.output TAGS
2740	-rm -f cpp.??s cpp.*aux
2741	-rm -f gcc.??s gcc.*aux
2742	-rm -f $(docdir)/cpp.info* $(docdir)/gcc.info* $(docdir)/gccint.info*
2743	-rm -f $(docdir)/cppinternals.info*
2744	-rm -f $(docdir)/gcov.1 $(docdir)/cpp.1 $(docdir)/gcc.1
2745	-rm -f $(docdir)/fsf-funding.7 $(docdir)/gfdl.7 $(docdir)/gpl.7
2746#
2747# Entry points `install' and `uninstall'.
2748# Also use `install-collect2' to install collect2 when the config files don't.
2749
2750# Copy the compiler files into directories where they will be run.
2751# Install the driver last so that the window when things are
2752# broken is small.
2753install: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \
2754    install-cpp install-man install-info intl.install install-@POSUB@ \
2755    lang.install-normal install-driver
2756
2757# Handle cpp installation.
2758install-cpp: cpp$(exeext)
2759	-if [ -f gcc-cross$(exeext) ] ; then \
2760	  rm -f $(DESTDIR)$(bindir)/$(CPP_CROSS_NAME)$(exeext); \
2761	  $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_CROSS_NAME)$(exeext); \
2762	  if [ x$(cpp_install_dir) != x ]; then \
2763	    rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
2764	    $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
2765	  else true; fi; \
2766	else \
2767	  rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext); \
2768	  $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext); \
2769	  if [ x$(cpp_install_dir) != x ]; then \
2770	    rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
2771	    $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
2772	  else true; fi; \
2773	fi
2774
2775# Create the installation directories.
2776# $(libdir)/gcc-lib/include isn't currently searched by cpp.
2777installdirs:
2778	$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(libsubdir)
2779	$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(bindir)
2780	$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(includedir)
2781	$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(infodir)
2782	$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(slibdir)
2783	$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(man1dir)
2784	$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(man7dir)
2785
2786# Install the compiler executables built during cross compilation.
2787install-common: native $(EXTRA_PARTS) lang.install-common
2788	for file in $(COMPILERS); do \
2789	  if [ -f $$file ] ; then \
2790	    rm -f $(DESTDIR)$(libsubdir)/$$file; \
2791	    $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libsubdir)/$$file; \
2792	  else true; \
2793	  fi; \
2794	done
2795	for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \
2796	  if [ x"$$file" != x.. ]; then \
2797	    rm -f $(DESTDIR)$(libsubdir)/$$file; \
2798	    $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libsubdir)/$$file; \
2799	  else true; fi; \
2800	done
2801	for file in $(EXTRA_PARTS) ..; do \
2802	  if [ x"$$file" != x.. ]; then \
2803	    rm -f $(DESTDIR)$(libsubdir)/$$file; \
2804	    $(INSTALL_DATA) $$file $(DESTDIR)$(libsubdir)/$$file; \
2805	    chmod a-x $(DESTDIR)$(libsubdir)/$$file; \
2806	  else true; fi; \
2807	done
2808# Don't mess with specs if it doesn't exist yet.
2809	-if [ -f specs ] ; then \
2810	  rm -f $(DESTDIR)$(libsubdir)/specs; \
2811	  $(INSTALL_DATA) specs $(DESTDIR)$(libsubdir)/specs; \
2812	  chmod a-x $(DESTDIR)$(libsubdir)/specs; \
2813	fi
2814# Install protoize if it was compiled.
2815	-if [ -f protoize$(exeext) ]; \
2816	then \
2817	    if [ -f gcc-cross$(exeext) ] ; then \
2818		rm -f $(DESTDIR)$(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \
2819		$(INSTALL_PROGRAM) protoize$(exeext) $(DESTDIR)$(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \
2820		rm -f $(DESTDIR)$(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \
2821		$(INSTALL_PROGRAM) unprotoize$(exeext) $(DESTDIR)$(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \
2822	    else \
2823		rm -f $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
2824		$(INSTALL_PROGRAM) protoize$(exeext) $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
2825		rm -f $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
2826		$(INSTALL_PROGRAM) unprotoize$(exeext) $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
2827	    fi ; \
2828	    rm -f $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \
2829	    $(INSTALL_DATA) SYSCALLS.c.X $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \
2830	    chmod a-x $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \
2831	fi
2832# Install gcov if it was compiled.
2833	-if [ -f gcov$(exeext) ]; \
2834	then \
2835	    rm -f $(DESTDIR)$(bindir)/gcov$(exeext); \
2836	    $(INSTALL_PROGRAM) gcov$(exeext) $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
2837	fi
2838	$(INSTALL_SCRIPT) gccbug $(DESTDIR)$(bindir)/$(GCCBUG_INSTALL_NAME)
2839
2840# Install the driver program as $(target_alias)-gcc, 
2841# $(target-alias)-gcc-$(version)
2842# and also as either gcc (if native) or $(gcc_tooldir)/bin/gcc.
2843install-driver: installdirs xgcc$(exeext)
2844	-if [ -f gcc-cross$(exeext) ] ; then \
2845	  rm -f $(DESTDIR)$(bindir)/$(GCC_CROSS_NAME)$(exeext); \
2846	  $(INSTALL_PROGRAM) gcc-cross$(exeext) $(DESTDIR)$(bindir)/$(GCC_CROSS_NAME)$(exeext); \
2847	  rm -f $(DESTDIR)$(bindir)/$(target_alias)-gcc-$(version); \
2848	  ( cd $(DESTDIR)$(bindir) && \
2849	    $(LN) $(GCC_CROSS_NAME)$(exeext) $(target_alias)-gcc-$(version) ); \
2850	  if [ -d $(DESTDIR)$(gcc_tooldir)/bin/. ] ; then \
2851	    rm -f $(DESTDIR)$(gcc_tooldir)/bin/gcc$(exeext); \
2852	    $(INSTALL_PROGRAM) gcc-cross$(exeext) $(DESTDIR)$(gcc_tooldir)/bin/gcc$(exeext); \
2853	  else true; fi; \
2854	else \
2855	  rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
2856	  $(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
2857	  rm -f $(DESTDIR)$(bindir)/$(target_alias)-gcc-$(version); \
2858	  ( cd $(DESTDIR)$(bindir) && \
2859	    $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_alias)-gcc-$(version) ); \
2860	  rm -f $(DESTDIR)$(bindir)/$(target_alias)-gcc-tmp$(exeext); \
2861	  ( cd $(DESTDIR)$(bindir) && \
2862	    $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_alias)-gcc-tmp$(exeext) && \
2863	    mv -f $(target_alias)-gcc-tmp$(exeext) $(GCC_TARGET_INSTALL_NAME)$(exeext) ); \
2864	fi
2865
2866# Install the info files.
2867# $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir
2868# to do the install.
2869install-info: doc installdirs lang.install-info
2870	-rm -f $(DESTDIR)$(infodir)/cpp.info* $(DESTDIR)$(infodir)/gcc.info*
2871	-rm -f $(DESTDIR)$(infodir)/cppinternals.info* $(DESTDIR)$(infodir)/gccint.info*
2872	if [ -f $(docdir)/gcc.info ]; then \
2873	  for f in $(docdir)/cpp.info* $(docdir)/gcc.info* \
2874		$(docdir)/cppinternals.info* $(docdir)/gccint.info*; do \
2875	    realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
2876	    $(INSTALL_DATA) $$f $(DESTDIR)$(infodir)/$$realfile; \
2877	  done; \
2878	else true; fi
2879	-if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
2880	  if [ -f $(DESTDIR)$(infodir)/dir ] ; then \
2881	    for f in cpp.info gcc.info gccint.info cppinternals.info; do \
2882		if [ -f $(DESTDIR)$(infodir)/$$f ]; then \
2883		  install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/$$f; \
2884		else true; fi; \
2885	    done; \
2886	  else true; fi; \
2887	else true; fi;
2888	-chmod a-x $(DESTDIR)$(infodir)/cpp.info* $(DESTDIR)$(infodir)/gcc.info*
2889	-chmod a-x $(DESTDIR)$(infodir)/cppinternals.info* $(DESTDIR)$(infodir)/gccint.info*
2890
2891# Install the man pages.
2892install-man: installdirs $(GENERATED_MANPAGES) lang.install-man
2893	-if [ -f gcc-cross$(exeext) ] ; then \
2894	  rm -f $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext); \
2895	  $(INSTALL_DATA) $(docdir)/gcc.1 $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext); \
2896	  chmod a-x $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext); \
2897	else \
2898	  rm -f $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext); \
2899	  $(INSTALL_DATA) $(docdir)/gcc.1 $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext); \
2900	  chmod a-x $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext); \
2901	fi
2902	-rm -f $(DESTDIR)$(man1dir)/cpp$(man1ext)
2903	-$(INSTALL_DATA) $(docdir)/cpp.1 $(DESTDIR)$(man1dir)/cpp$(man1ext)
2904	-chmod a-x $(DESTDIR)$(man1dir)/cpp$(man1ext)
2905	-rm -f $(DESTDIR)$(man1dir)/gcov$(man1ext)
2906	-$(INSTALL_DATA) $(docdir)/gcov.1 $(DESTDIR)$(man1dir)/gcov$(man1ext)
2907	-chmod a-x $(DESTDIR)$(man1dir)/gcov$(man1ext)
2908	-rm -f $(DESTDIR)$(man7dir)/fsf-funding$(man7ext)
2909	-$(INSTALL_DATA) $(docdir)/fsf-funding.7 $(DESTDIR)$(man7dir)/fsf-funding$(man7ext)
2910	-chmod a-x $(DESTDIR)$(man7dir)/fsf-funding$(man7ext)
2911	-rm -f $(DESTDIR)$(man7dir)/gfdl$(man7ext)
2912	-$(INSTALL_DATA) $(docdir)/gfdl.7 $(DESTDIR)$(man7dir)/gfdl$(man7ext)
2913	-chmod a-x $(DESTDIR)$(man7dir)/gfdl$(man7ext)
2914	-rm -f $(DESTDIR)$(man7dir)/gpl$(man7ext)
2915	-$(INSTALL_DATA) $(docdir)/gpl.7 $(DESTDIR)$(man7dir)/gpl$(man7ext)
2916	-chmod a-x $(DESTDIR)$(man7dir)/gpl$(man7ext)
2917
2918# Install the library.
2919install-libgcc: libgcc.mk libgcc.a installdirs
2920	if $(RANLIB_TEST_FOR_TARGET); then \
2921	  r_f_t=$(RANLIB_FOR_TARGET); \
2922	else \
2923	  r_f_t=: ; \
2924	fi; \
2925	$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
2926	  BUILD_PREFIX="$(BUILD_PREFIX)" BUILD_PREFIX_1="$(BUILD_PREFIX_1)" \
2927	  AR_FOR_TARGET="$(AR_FOR_TARGET)" \
2928	  AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
2929	  AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
2930	  CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
2931	  RANLIB_TEST_FOR_TARGET="$(RANLIB_TEST_FOR_TARGET)" \
2932	  NM_FOR_TARGET="$(NM_FOR_TARGET)" AWK="$(AWK)" \
2933	  LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
2934	  INCLUDES="$(INCLUDES)" \
2935	  CONFIG_H="$(TCONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
2936	  LIB1ASMSRC='$(LIB1ASMSRC)' \
2937	  MAKEOVERRIDES= \
2938	  INSTALL_DATA="$(INSTALL_DATA)" \
2939	  RANLIB_FOR_TARGET="$$r_f_t" \
2940	  DESTDIR="$(DESTDIR)" \
2941	  libsubdir="$(libsubdir)" \
2942	  slibdir="$(slibdir)" \
2943	  -f libgcc.mk install
2944
2945# Install multiple versions of libgcc.a.
2946install-multilib: stmp-multilib installdirs
2947	if $(RANLIB_TEST_FOR_TARGET); then \
2948	  r_f_t=$(RANLIB_FOR_TARGET); \
2949	else \
2950	  r_f_t=: ; \
2951	fi; \
2952	$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
2953	  BUILD_PREFIX="$(BUILD_PREFIX)" BUILD_PREFIX_1="$(BUILD_PREFIX_1)" \
2954	  AR_FOR_TARGET="$(AR_FOR_TARGET)" \
2955	  AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
2956	  AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
2957	  CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
2958	  RANLIB_TEST_FOR_TARGET="$(RANLIB_TEST_FOR_TARGET)" \
2959	  NM_FOR_TARGET="$(NM_FOR_TARGET)" AWK="$(AWK)" \
2960	  LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
2961	  INCLUDES="$(INCLUDES)" \
2962	  CONFIG_H="$(CONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
2963	  LIB1ASMSRC='$(LIB1ASMSRC)' \
2964	  MAKEOVERRIDES= \
2965	  INSTALL_DATA="$(INSTALL_DATA)" \
2966	  RANLIB_FOR_TARGET="$$r_f_t" \
2967	  DESTDIR="$(DESTDIR)" \
2968	  libsubdir="$(libsubdir)" \
2969	  slibdir="$(slibdir)" \
2970	  -f libgcc.mk install
2971
2972# Install all the header files built in the include subdirectory.
2973install-headers: $(INSTALL_HEADERS_DIR)
2974# Fix symlinks to absolute paths in the installed include directory to
2975# point to the installed directory, not the build directory.
2976# Don't need to use LN_S here since we really do need ln -s and no substitutes.
2977	-files=`cd $(DESTDIR)$(libsubdir)/include; find . -type l -print 2>/dev/null`; \
2978	if [ $$? -eq 0 ]; then \
2979	  dir=`cd include; ${PWD_COMMAND}`; \
2980	  for i in $$files; do \
2981	    dest=`ls -ld $(DESTDIR)$(libsubdir)/include/$$i | sed -n 's/.*-> //p'`; \
2982	    if expr "$$dest" : "$$dir.*" > /dev/null; then \
2983	      rm -f $(DESTDIR)$(libsubdir)/include/$$i; \
2984	      ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(DESTDIR)$(libsubdir)/include/$$i; \
2985	    fi; \
2986	  done; \
2987	fi
2988
2989# Create or recreate the gcc private include file directory.
2990install-include-dir: installdirs
2991	-rm -rf $(DESTDIR)$(libsubdir)/include
2992	mkdir $(DESTDIR)$(libsubdir)/include
2993	-chmod a+rx $(DESTDIR)$(libsubdir)/include
2994
2995# Install the include directory using tar.
2996install-headers-tar: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
2997# We use `pwd`/include instead of just include to problems with CDPATH
2998# Unless a full pathname is provided, some shells would print the new CWD,
2999# found in CDPATH, corrupting the output.  We could just redirect the
3000# output of `cd', but some shells lose on redirection within `()'s
3001	(cd `${PWD_COMMAND}`/include ; \
3002	 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - )
3003# /bin/sh on some systems returns the status of the first tar,
3004# and that can lose with GNU tar which always writes a full block.
3005# So use `exit 0' to ignore its exit status.
3006
3007# Install the include directory using cpio.
3008install-headers-cpio: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
3009# See discussion about the use of `pwd` above
3010	cd `${PWD_COMMAND}`/include ; \
3011	find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include
3012
3013# Install the include directory using cp.
3014install-headers-cp: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
3015	cp -p -r include $(DESTDIR)$(libsubdir)
3016
3017itoolsdir = $(libsubdir)/install-tools
3018# Don't install the headers.  Instead, install appropriate scripts
3019# and supporting files for fixincludes to be run later.
3020install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir \
3021    mkheaders xlimits.h
3022	-rm -rf $(DESTDIR)$(itoolsdir)
3023	$(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(itoolsdir)/include
3024	for file in $(USER_H); do \
3025	  realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
3026	  $(INSTALL_DATA) $$file \
3027	    $(DESTDIR)$(itoolsdir)/include/$$realfile ; \
3028	done
3029	$(INSTALL_DATA) xlimits.h $(DESTDIR)$(itoolsdir)/include/limits.h
3030	if [ x$(STMP_FIXINC) != x ] ; then \
3031	  $(INSTALL_DATA) $(srcdir)/README-fixinc \
3032	    $(DESTDIR)$(itoolsdir)/include/README ; \
3033	  $(INSTALL_PROGRAM) fixinc.sh $(DESTDIR)$(itoolsdir)/fixinc.sh ; \
3034	  $(INSTALL_PROGRAM) fixinc/fixincl $(DESTDIR)$(itoolsdir)/fixincl ; \
3035	  $(INSTALL_DATA) $(srcdir)/gsyslimits.h $(DESTDIR)$(itoolsdir)/gsyslimits.h ; \
3036	else :; fi
3037	if [ x$(STMP_FIXPROTO) != x ] ; then \
3038	  $(INSTALL_PROGRAM) $(srcdir)/mkinstalldirs \
3039		$(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
3040	  $(INSTALL_PROGRAM) $(srcdir)/fixproto $(DESTDIR)$(itoolsdir)/fixproto ; \
3041	  $(INSTALL_PROGRAM) fix-header$(build_exeext) \
3042		$(DESTDIR)$(itoolsdir)/fix-header$(build_exeext) ; \
3043	else :; fi
3044	$(INSTALL_PROGRAM) mkheaders $(DESTDIR)$(itoolsdir)/mkheaders
3045	echo 'SYSTEM_HEADER_DIR="$(SYSTEM_HEADER_DIR)"' \
3046		> $(DESTDIR)$(itoolsdir)/mkheaders.conf
3047	echo 'OTHER_FIXINCLUDES_DIRS="$(OTHER_FIXINCLUDES_DIRS)"' \
3048		>> $(DESTDIR)$(itoolsdir)/mkheaders.conf
3049	echo 'FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"' \
3050		>> $(DESTDIR)$(itoolsdir)/mkheaders.conf
3051	echo 'STMP_FIXPROTO="$(STMP_FIXPROTO)"' >> $(DESTDIR)$(itoolsdir)/mkheaders.conf
3052	echo 'STMP_FIXINC="$(STMP_FIXINC)"' >> $(DESTDIR)$(itoolsdir)/mkheaders.conf
3053
3054# Use this target to install the program `collect2' under the name `collect2'.
3055install-collect2: collect2 installdirs
3056	$(INSTALL_PROGRAM) collect2$(exeext) $(DESTDIR)$(libsubdir)/collect2$(exeext)
3057# Install the driver program as $(libsubdir)/gcc for collect2.
3058	$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(libsubdir)/gcc$(exeext)
3059
3060# Cancel installation by deleting the installed files.
3061uninstall: intl.uninstall lang.uninstall
3062	-rm -rf $(DESTDIR)$(libsubdir)
3063	-rm -rf $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
3064	-rm -rf $(DESTDIR)$(bindir)/$(GCC_CROSS_NAME)$(exeext)
3065	-rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext)
3066	-rm -f $(DESTDIR)$(bindir)/$(CPP_CROSS_NAME)$(exeext)
3067	-if [ x$(cpp_install_dir) != x ]; then \
3068	  rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
3069	  rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
3070	else true; fi
3071	-rm -rf $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext)
3072	-rm -rf $(DESTDIR)$(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext)
3073	-rm -rf $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext)
3074	-rm -rf $(DESTDIR)$(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext)
3075	-rm -rf $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext)
3076	-rm -rf $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext)
3077	-rm -rf $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext)
3078	-rm -rf $(DESTDIR)$(man1dir)/cpp$(man1ext)
3079	-rm -rf $(DESTDIR)$(man1dir)/protoize$(man1ext)
3080	-rm -rf $(DESTDIR)$(man1dir)/unprotoize$(man1ext)
3081	-rm -f $(DESTDIR)$(infodir)/cpp.info* $(DESTDIR)$(infodir)/gcc.info*
3082	-rm -f $(DESTDIR)$(infodir)/cppinternals.info* $(DESTDIR)$(infodir)/gccint.info*
3083#
3084# These targets are for the dejagnu testsuites. The file site.exp
3085# contains global variables that all the testsuites will use.
3086
3087# Set to $(target_alias)/ for cross.
3088target_subdir = @target_subdir@
3089
3090site.exp: ./config.status Makefile
3091	@echo "Making a new config file..."
3092	-@rm -f ./tmp?
3093	@$(STAMP) site.exp
3094	-@mv site.exp site.bak
3095	@echo "## these variables are automatically generated by make ##" > ./tmp0
3096	@echo "# Do not edit here. If you wish to override these values" >> ./tmp0
3097	@echo "# add them to the last section" >> ./tmp0
3098	@echo "set rootme \"`${PWD_COMMAND}`\"" >> ./tmp0
3099	@echo "set srcdir \"`cd ${srcdir}; ${PWD_COMMAND}`\"" >> ./tmp0
3100	@echo "set host_triplet $(host_canonical)" >> ./tmp0
3101	@echo "set build_triplet $(build_canonical)" >> ./tmp0
3102	@echo "set target_triplet $(target)" >> ./tmp0
3103	@echo "set target_alias $(target_alias)" >> ./tmp0
3104# CFLAGS is set even though it's empty to show we reserve the right to set it.
3105	@echo "set CFLAGS \"\"" >> ./tmp0
3106	@echo "set CXXFLAGS \"-I$(objdir)/../$(target_subdir)libio -I\$$srcdir/../libg++/src -I\$$srcdir/../libio -I\$$srcdir/../libstdc++ -I\$$srcdir/../libstdc++/stl -L$(objdir)/../$(target_subdir)libg++ -L$(objdir)/../$(target_subdir)libstdc++\"" >> ./tmp0
3107	@echo "set TESTING_IN_BUILD_TREE 1" >> ./tmp0
3108	@echo "set HAVE_LIBSTDCXX_V3 1" >> ./tmp0
3109# If newlib has been configured, we need to pass -B to gcc so it can find
3110# newlib's crt0.o if it exists.  This will cause a "path prefix not used"
3111# message if it doesn't, but the testsuite is supposed to ignore the message -
3112# it's too difficult to tell when to and when not to pass -B (not all targets
3113# have crt0's).  We could only add the -B if ../newlib/crt0.o exists, but that
3114# seems like too selective a test.
3115# ??? Another way to solve this might be to rely on linker scripts.  Then
3116# theoretically the -B won't be needed.
3117# We also need to pass -L ../ld so that the linker can find ldscripts.
3118	@if [ -d $(objdir)/../$(target_subdir)newlib ] ; then \
3119	  echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./tmp0; \
3120	  echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)newlib/\"" >> ./tmp0; \
3121	  echo "append CFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
3122	  echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
3123	  echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./tmp0; \
3124	else true; \
3125	fi
3126	@if [ -d $(objdir)/../ld ] ; then \
3127	  echo "append LDFLAGS \" -L$(objdir)/../ld\"" >> ./tmp0; \
3128	else true; \
3129	fi
3130	echo "set tmpdir $(objdir)/testsuite" >> ./tmp0
3131	@echo "set srcdir \"\$${srcdir}/testsuite\"" >> ./tmp0
3132	@if [ "X$(ALT_CXX_UNDER_TEST)" != "X" ] ; then \
3133	  echo "set ALT_CXX_UNDER_TEST $(ALT_CXX_UNDER_TEST)" >> ./tmp0; \
3134	else true; \
3135	fi
3136	@if [ "X$(COMPAT_OPTIONS)" != "X" ] ; then \
3137	  echo "set COMPAT_OPTIONS $(COMPAT_OPTIONS)" >> ./tmp0; \
3138	else true; \
3139	fi
3140	@echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
3141	@cat ./tmp0 > site.exp
3142	@cat site.bak | sed \
3143		-e '1,/^## All variables above are.*##/ d' >> site.exp
3144	-@rm -f ./tmp?
3145
3146CHECK_TARGETS = check-gcc @check_languages@
3147
3148check-c++ : check-g++
3149check-f77 : check-g77
3150check-java :
3151
3152check: $(CHECK_TARGETS)
3153
3154# The idea is to parallelize testing of multilibs, for example:
3155#   make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
3156# will run 3 concurrent sessions of check-gcc, eventually testing
3157# all 10 combinations.  GNU make is required, as is a shell that expands
3158# alternations within braces.
3159check-gcc//% check-g++//% check-g77//% check-objc//%: site.exp
3160	target=`echo "$@" | sed 's,//.*,,'`; \
3161	variant=`echo "$@" | sed 's,^[^/]*//,,'`; \
3162	vardots=`echo "$$variant" | sed 's,/,.,g'`; \
3163	$(MAKE) TESTSUITEDIR="testsuite.$$vardots" \
3164	  RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \
3165	  "$$target"
3166
3167TESTSUITEDIR = testsuite
3168
3169$(TESTSUITEDIR)/site.exp: site.exp
3170	test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
3171	-rm -f $@
3172	sed '/set tmpdir/ s|testsuite|$(TESTSUITEDIR)|' < site.exp > $@
3173
3174check-g++: $(TESTSUITEDIR)/site.exp
3175	-(rootme=`${PWD_COMMAND}`; export rootme; \
3176	srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
3177	cd $(TESTSUITEDIR); \
3178	EXPECT=${EXPECT} ; export EXPECT ; \
3179	if [ -f $${rootme}/../expect/expect ] ; then  \
3180	   TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
3181	    export TCL_LIBRARY ; fi ; \
3182	$(RUNTEST) --tool g++ $(RUNTESTFLAGS))
3183
3184check-gcc: $(TESTSUITEDIR)/site.exp
3185	-(rootme=`${PWD_COMMAND}`; export rootme; \
3186	srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
3187	cd $(TESTSUITEDIR); \
3188	EXPECT=${EXPECT} ; export EXPECT ; \
3189	if [ -f $${rootme}/../expect/expect ] ; then  \
3190	   TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
3191	   export TCL_LIBRARY ; fi ; \
3192	$(RUNTEST) --tool gcc $(RUNTESTFLAGS))
3193
3194check-g77: $(TESTSUITEDIR)/site.exp
3195	-(rootme=`${PWD_COMMAND}`; export rootme; \
3196	srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
3197	cd $(TESTSUITEDIR); \
3198	EXPECT=${EXPECT} ; export EXPECT ; \
3199	if [ -f $${rootme}/../expect/expect ] ; then  \
3200	   TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
3201	   export TCL_LIBRARY ; fi ; \
3202	$(RUNTEST) --tool g77 $(RUNTESTFLAGS))
3203
3204check-objc: $(TESTSUITEDIR)/site.exp
3205	-(rootme=`${PWD_COMMAND}`; export rootme; \
3206	srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
3207	cd $(TESTSUITEDIR); \
3208	EXPECT=${EXPECT} ; export EXPECT ; \
3209	if [ -f $${rootme}/../expect/expect ] ; then  \
3210	   TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
3211	    export TCL_LIBRARY ; fi ; \
3212	$(RUNTEST) --tool objc $(RUNTESTFLAGS))
3213
3214check-consistency: testsuite/site.exp
3215	-rootme=`${PWD_COMMAND}`; export rootme; \
3216	srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
3217	cd testsuite; \
3218	EXPECT=${EXPECT} ; export EXPECT ; \
3219	if [ -f $${rootme}/../expect/expect ] ; then  \
3220	   TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
3221	   export TCL_LIBRARY ; fi ; \
3222	$(RUNTEST) --tool consistency $(RUNTESTFLAGS)
3223
3224# QMTest targets
3225
3226# The path to qmtest.
3227QMTEST_PATH=qmtest
3228
3229# The flags to pass to qmtest.
3230QMTESTFLAGS=
3231
3232# The flags to pass to "qmtest run".
3233QMTESTRUNFLAGS=
3234
3235# The command to use to invoke qmtest.
3236QMTEST=${QMTEST_PATH} ${QMTESTFLAGS}
3237
3238# The tests (or suites) to run.
3239QMTEST_GPP_TESTS=gpp
3240
3241# The subdirectory of the OBJDIR that will be used to store the QMTest
3242# test database configuration and that will be used for temporary
3243# scratch space during QMTest's execution.
3244QMTEST_DIR=qmtestsuite
3245
3246# Create the QMTest database configuration.
3247${QMTEST_DIR} stamp-qmtest:
3248	debug_options=""; \
3249	    ${STAMP} empty.C; \
3250	    for option in \
3251	        -gdwarf-2 -gstabs -gstabs+ -gxcoff -gxcoff+ -gcoff; do \
3252		(./cc1plus -q $${option} empty.C 2>&1 | \
3253		     grep "unknown or unsupported -g option" > /dev/null) || \
3254		debug_options="$${debug_options}$${option} "; done; \
3255	    ${QMTEST} -D ${QMTEST_DIR} create-tdb \
3256	        -c gcc_database.GCCDatabase \
3257	        -a GCCDatabase.testsuite_root=`cd ${srcdir}/testsuite && pwd` \
3258	        -a GCCDatabase.debug_options="$${debug_options}"
3259	rm -f empty.C empty.s
3260	$(STAMP) stamp-qmtest
3261
3262# Create the QMTest context file.
3263${QMTEST_DIR}/context: stamp-qmtest
3264	echo "GCCTest.flags=-B${objdir}" >> $@
3265	echo "GCCTest.objdir=${objdir}/.." >> $@
3266	echo "GCCTest.host=${host_canonical}" >> $@
3267	echo "GCCTest.target=${target}" >> $@
3268	echo "GCCTest.gcov=${objdir}/gcov" >> $@
3269	echo "GPPTest.gpp=${objdir}/g++" >> $@
3270	echo "DGTest.demangler=${objdir}/c++filt" >> $@
3271
3272# Run the G++ testsuite using QMTest.
3273qmtest-g++: ${QMTEST_DIR}/context ${QMTEST_DIR}/gpp-expected.qmr
3274	cd ${QMTEST_DIR} && ${QMTEST} run ${QMTESTRUNFLAGS} -C context \
3275	   -o gpp.qmr -O gpp-expected.qmr \
3276	   ${QMTEST_GPP_TESTS}
3277
3278# Use the QMTest GUI.
3279qmtest-gui: ${QMTEST_DIR}/context
3280	cd ${QMTEST_DIR} && ${QMTEST} gui -C context
3281
3282# Build the set of expected G++ failures.
3283${QMTEST_DIR}/gpp-expected.qmr: ${QMTEST_DIR}/context
3284	echo "Determining expected results..."
3285	cd ${QMTEST_DIR} && ${QMTEST} run ${QMTESTRUNFLAGS} -C context \
3286           -c "GCCTest.generate_xfails=1" -o gpp-expected.qmr \
3287	   ${QMTEST_GPP_TESTS} \
3288	   > /dev/null
3289
3290.PHONY: qmtest-g++
3291
3292# Run Paranoia on real.c.
3293
3294paranoia.o: $(srcdir)/../contrib/paranoia.cc $(CONFIG_H) $(SYSTEM_H) \
3295  real.h $(TREE_H)
3296	g++ -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
3297
3298paranoia: paranoia.o real.o $(LIBIBERTY)
3299	g++ -o $@ paranoia.o real.o $(LIBIBERTY)
3300
3301# These exist for maintenance purposes.
3302
3303# Update the tags table.
3304TAGS: force
3305	(cd $(srcdir);							\
3306	mkdir tmp-tags;							\
3307	mv -f c-parse.[ch] =*.[chy] tmp-tags;				\
3308	etags *.y *.h *.c;						\
3309	mv tmp-tags/* .;						\
3310	rmdir tmp-tags)
3311
3312# A list of files to be destroyed during "lean" builds.
3313VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_OBJS) $(LIBCPP_OBJS) *.c *.h gen*`
3314
3315# Flags to pass to stage2 and later recursive makes.  Note that the
3316# WARN_CFLAGS setting can't be to the expansion of GCC_WARN_CFLAGS in
3317# the context of the stage_x rule.
3318STAGE2_FLAGS_TO_PASS = \
3319	ADAC="\$$(CC)" \
3320	CFLAGS="$(BOOT_CFLAGS)" \
3321	LDFLAGS="$(BOOT_LDFLAGS)" \
3322	WARN_CFLAGS="\$$(GCC_WARN_CFLAGS)" \
3323	STRICT_WARN="$(STRICT2_WARN)" \
3324	libdir=$(libdir) \
3325	LANGUAGES="$(LANGUAGES)" \
3326	MAKEOVERRIDES= \
3327	OUTPUT_OPTION="-o \$$@"
3328
3329# Only build the C compiler for stage1, because that is the only one that
3330# we can guarantee will build with the native compiler, and also it is the
3331# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS),
3332# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
3333# overrideable (for a bootstrap build stage1 also builds gcc.info).
3334stage1_build:
3335	$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" \
3336		CFLAGS="$(STAGE1_CFLAGS)" MAKEINFO="$(MAKEINFO)" \
3337		MAKEINFOFLAGS="$(MAKEINFOFLAGS)" COVERAGE_FLAGS=
3338	$(STAMP) stage1_build
3339	echo stage1_build > stage_last
3340
3341stage1_copy: stage1_build
3342	$(MAKE) stage1
3343	$(STAMP) stage1_copy
3344	echo stage2_build > stage_last
3345
3346stage2_build: stage1_copy
3347	$(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
3348		 STAGE_PREFIX=stage1/ \
3349		 $(STAGE2_FLAGS_TO_PASS)
3350	$(STAMP) stage2_build
3351	echo stage2_build > stage_last
3352
3353stage2_copy: stage2_build
3354	$(MAKE) stage2
3355	$(STAMP) stage2_copy
3356	echo stage3_build > stage_last
3357
3358stage3_build: stage2_copy
3359	$(MAKE) CC="$(STAGE_CC_WRAPPER) stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" \
3360		 STAGE_PREFIX=stage2/ \
3361		 $(STAGE2_FLAGS_TO_PASS)
3362	$(STAMP) stage3_build
3363	echo stage3_build > stage_last
3364
3365# For bootstrap4:
3366stage3_copy: stage3_build
3367	$(MAKE) stage3
3368	$(STAMP) stage3_copy
3369	echo stage4_build > stage_last
3370
3371stage4_build: stage3_copy
3372	$(MAKE) CC="$(STAGE_CC_WRAPPER) stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" \
3373		 STAGE_PREFIX=stage3/ \
3374		 $(STAGE2_FLAGS_TO_PASS)
3375	$(STAMP) stage4_build
3376	echo stage4_build > stage_last
3377
3378# Additional steps for *-lean targets:
3379clean_s1: stage1_copy
3380	-(cd stage1 && rm -f $(VOL_FILES))
3381	$(STAMP) clean_s1
3382
3383clean_s2: stage2_copy
3384	-rm -rf stage1
3385	$(STAMP) clean_s2
3386
3387# The various entry points for bootstrapping.
3388
3389bootstrap: stage3_build
3390	@echo
3391	@echo Bootstrap complete - make \"quickstrap\" to redo last build,
3392	@echo \"restage1\" through \"restage3\" to rebuild specific stages,
3393	@echo \"restrap\" to redo the bootstrap from stage1, or
3394	@echo \"cleanstrap\" to redo the bootstrap from scratch.
3395
3396bootstrap-lean : clean_s1 clean_s2 stage3_build
3397	@echo
3398	@echo Bootstrap complete - make \"quickstrap\" to redo last build,
3399	@echo or \"cleanstrap\" to redo the bootstrap from scratch.
3400
3401bootstrap2: bootstrap
3402
3403bootstrap2-lean : bootstrap-lean
3404
3405bootstrap3 bootstrap3-lean: bootstrap
3406
3407bootstrap4 bootstrap4-lean: stage4_build
3408
3409unstage1 unstage2 unstage3 unstage4:
3410	-set -vx; stage=`echo $@ | sed -e 's/un//'`; \
3411	rm -f $$stage/as$(exeext); \
3412	rm -f $$stage/ld$(exeext); \
3413	rm -f $$stage/collect-ld$(exeext); \
3414	if test -d $$stage; then \
3415	  mv $$stage/* . 2>/dev/null; \
3416	  for i in `cd $$stage; echo *` ; do \
3417	    if test -d $$stage/$$i; then \
3418	      mv $$stage/$$i/* $$i/. 2>/dev/null; \
3419	    else \
3420	      mv $$stage/$$i .; \
3421	    fi; \
3422	  done \
3423	fi ; \
3424	rm -f $${stage}_build $${stage}_copy ;\
3425	echo $${stage}_build > stage_last
3426
3427restage1: unstage1
3428	$(MAKE) stage1_build
3429
3430restage2: unstage2
3431	$(MAKE) LANGUAGES="$(LANGUAGES)" stage2_build
3432
3433restage3: unstage3
3434	$(MAKE) LANGUAGES="$(LANGUAGES)" stage3_build
3435
3436restage4: unstage4
3437	$(MAKE) LANGUAGES="$(LANGUAGES)" stage4_build
3438
3439bubblestrap:
3440	if test -f stage3_build; then true; else \
3441	  echo; echo You must \"make bootstrap\" first.; \
3442	  exit 1; \
3443	fi
3444	for i in stage3 \
3445		unstage1 stage1_build stage1_copy \
3446		unstage2 stage2_build stage2_copy \
3447		unstage3 stage3_build ; \
3448	do \
3449	  $(MAKE) LANGUAGES="$(LANGUAGES)" $$i || exit 1 ; \
3450	done
3451
3452quickstrap:
3453	if test -f stage_last ; then \
3454	  LAST=`cat stage_last`; rm $$LAST; $(MAKE) LANGUAGES="$(LANGUAGES)" $$LAST; \
3455	else \
3456	  $(MAKE) stage1_build; \
3457	fi
3458
3459cleanstrap:
3460	-$(MAKE) clean
3461	$(MAKE) LANGUAGES="$(LANGUAGES)" bootstrap
3462
3463unstrap:
3464	-rm -rf stage[234]*
3465	$(MAKE) unstage1
3466
3467# Differs from cleanstrap in that it starts from the earlier stage1 build,
3468# not from scratch.
3469restrap:
3470	$(MAKE) unstrap
3471	$(MAKE) LANGUAGES="$(LANGUAGES)" bootstrap
3472
3473# Compare the object files in the current directory with those in the
3474# stage2 directory.
3475
3476# ./ avoids bug in some versions of tail.
3477compare compare3 compare4 compare-lean compare3-lean compare4-lean: force
3478	-rm -f .bad_compare
3479	case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
3480	for file in *$(objext); do \
3481	  tail +16c ./$$file > tmp-foo1; \
3482	  tail +16c stage$$stage/$$file > tmp-foo2 \
3483	    && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
3484	done
3485	case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
3486	for dir in tmp-foo intl $(SUBDIRS); do \
3487	  if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
3488	    for file in $$dir/*$(objext); do \
3489	      tail +16c ./$$file > tmp-foo1; \
3490	      tail +16c stage$$stage/$$file > tmp-foo2 \
3491	        && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
3492	    done; \
3493	  else true; fi; \
3494	done
3495	-rm -f tmp-foo*
3496	case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
3497	if [ -f .bad_compare ]; then \
3498	  echo "Bootstrap comparison failure!"; \
3499	  cat .bad_compare; \
3500	  exit 1; \
3501	else \
3502	  case "$@" in \
3503	    *-lean ) rm -rf stage$$stage ;; \
3504	    *) ;; \
3505	  esac; true; \
3506	fi
3507
3508# Compare the object files in the current directory with those in the
3509# stage2 directory.  Use gnu cmp (diffutils v2.4 or later) to avoid
3510# running tail and the overhead of twice copying each object file.
3511# An exit status of 1 is precisely the result we're looking for (other
3512# values mean other problems).
3513gnucompare gnucompare3 gnucompare4 gnucompare-lean gnucompare3-lean gnucompare4-lean: force
3514	-rm -f .bad_compare
3515	case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \
3516	for file in *$(objext); do \
3517	  cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1; \
3518	  test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
3519	done
3520	case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \
3521	for dir in tmp-foo intl $(SUBDIRS); do \
3522	  if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
3523	    for file in $$dir/*$(objext); do \
3524	      cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1; \
3525	      test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
3526	    done; \
3527	  else true; fi; \
3528	done
3529	case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \
3530	if [ -f .bad_compare ]; then \
3531	  echo "Bootstrap comparison failure!"; \
3532	  cat .bad_compare; \
3533	  exit 1; \
3534	else \
3535	  case "$@" in \
3536	    *-lean ) rm -rf stage$$stage ;; \
3537	  esac; true; \
3538	fi
3539
3540# Copy the object files from a particular stage into a subdirectory.
3541stage1-start:
3542	-if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
3543	$(MAKE) -f libgcc.mk libgcc-stage-start stage=stage1
3544	-for dir in intl $(SUBDIRS) ; \
3545	 do \
3546	   if [ -d stage1/$$dir ] ; then true ; else mkdir stage1/$$dir ; fi ; \
3547	 done
3548	-mv $(STAGESTUFF) stage1
3549	-mv intl/*$(objext) stage1/intl
3550# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
3551# dir will work properly.
3552	-if [ -f as$(exeext) ] ; then (cd stage1 && $(LN_S) ../as$(exeext) .) ; else true ; fi
3553	-if [ -f ld$(exeext) ] ; then (cd stage1 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
3554	-if [ -f collect-ld$(exeext) ] ; then (cd stage1 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
3555	-rm -f stage1/libgcc.a stage1/libgcc_eh.a
3556	-cp libgcc.a stage1
3557	-if $(RANLIB_TEST_FOR_TARGET) ; then \
3558	  $(RANLIB_FOR_TARGET) stage1/libgcc.a; \
3559	else true; fi
3560	-if [ -f libgcc_eh.a ] ; then cp libgcc_eh.a stage1; \
3561	  if $(RANLIB_TEST_FOR_TARGET) ; then \
3562	   $(RANLIB_FOR_TARGET) stage1/libgcc_eh.a; \
3563	  else true; fi; fi
3564	-for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
3565	  cp stage1/$${f} . ; \
3566	else true; \
3567	fi; done
3568stage1: force stage1-start lang.stage1
3569
3570stage2-start:
3571	-if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
3572	$(MAKE) -f libgcc.mk libgcc-stage-start stage=stage2
3573	-for dir in intl $(SUBDIRS) ; \
3574	 do \
3575	   if [ -d stage2/$$dir ] ; then true ; else mkdir stage2/$$dir ; fi ; \
3576	 done
3577	-mv $(STAGESTUFF) stage2
3578	-mv intl/*$(objext) stage2/intl
3579# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
3580# dir will work properly.
3581	-if [ -f as$(exeext) ] ; then (cd stage2 && $(LN_S) ../as$(exeext) .) ; else true ; fi
3582	-if [ -f ld$(exeext) ] ; then (cd stage2 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
3583	-if [ -f collect-ld$(exeext) ] ; then (cd stage2 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
3584	-rm -f stage2/libgcc.a stage2/libgcc_eh.a
3585	-cp libgcc.a stage2
3586	-if $(RANLIB_TEST_FOR_TARGET) ; then \
3587	  $(RANLIB_FOR_TARGET) stage2/libgcc.a; \
3588	else true; fi
3589	-if [ -f libgcc_eh.a ] ; then cp libgcc_eh.a stage2; \
3590	  if $(RANLIB_TEST_FOR_TARGET) ; then \
3591	   $(RANLIB_FOR_TARGET) stage2/libgcc_eh.a; \
3592	  else true; fi; fi
3593	-for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
3594	  cp stage2/$${f} . ; \
3595	else true; \
3596	fi; done
3597stage2: force stage2-start lang.stage2
3598
3599stage3-start:
3600	-if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
3601	$(MAKE) -f libgcc.mk libgcc-stage-start stage=stage3
3602	-for dir in intl $(SUBDIRS) ; \
3603	 do \
3604	   if [ -d stage3/$$dir ] ; then true ; else mkdir stage3/$$dir ; fi ; \
3605	 done
3606	-mv $(STAGESTUFF) stage3
3607	-mv intl/*$(objext) stage3/intl
3608# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
3609# dir will work properly.
3610	-if [ -f as$(exeext) ] ; then (cd stage3 && $(LN_S) ../as$(exeext) .) ; else true ; fi
3611	-if [ -f ld$(exeext) ] ; then (cd stage3 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
3612	-if [ -f collect-ld$(exeext) ] ; then (cd stage3 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
3613	-rm -f stage3/libgcc.a stage3/libgcc_eh.a
3614	-cp libgcc.a stage3
3615	-if $(RANLIB_TEST_FOR_TARGET) ; then \
3616	  $(RANLIB_FOR_TARGET) stage3/libgcc.a; \
3617	else true; fi
3618	-if [ -f libgcc_eh.a ] ; then cp libgcc_eh.a stage3; \
3619	  if $(RANLIB_TEST_FOR_TARGET) ; then \
3620	   $(RANLIB_FOR_TARGET) stage3/libgcc_eh.a; \
3621	  else true; fi; fi
3622	-for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
3623	  cp stage3/$${f} . ; \
3624	else true; \
3625	fi; done
3626stage3: force stage3-start lang.stage3
3627
3628stage4-start:
3629	-if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
3630	$(MAKE) -f libgcc.mk libgcc-stage-start stage=stage4
3631	-for dir in intl $(SUBDIRS) ; \
3632	 do \
3633	   if [ -d stage4/$$dir ] ; then true ; else mkdir stage4/$$dir ; fi ; \
3634	 done
3635	-mv $(STAGESTUFF) stage4
3636	-mv intl/*$(objext) stage4/intl
3637# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
3638# dir will work properly.
3639	-if [ -f as$(exeext) ] ; then (cd stage4 && $(LN_S) ../as$(exeext) .) ; else true ; fi
3640	-if [ -f ld$(exeext) ] ; then (cd stage4 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
3641	-if [ -f collect-ld$(exeext) ] ; then (cd stage4 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
3642	-rm -f stage4/libgcc.a stage4/libgcc_eh.a
3643	-cp libgcc.a stage4
3644	-if $(RANLIB_TEST_FOR_TARGET) ; then \
3645	  $(RANLIB_FOR_TARGET) stage4/libgcc.a; \
3646	else true; fi
3647	-if [ -f libgcc_eh.a ] ; then cp libgcc_eh.a stage4; \
3648	  if $(RANLIB_TEST_FOR_TARGET) ; then \
3649	   $(RANLIB_FOR_TARGET) stage4/libgcc_eh.a; \
3650	  else true; fi; fi
3651	-for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
3652	  cp stage4/$${f} . ; \
3653	else true; \
3654	fi; done
3655stage4: force stage4-start lang.stage4
3656
3657# Copy just the executable files from a particular stage into a subdirectory,
3658# and delete the object files.  Use this if you're just verifying a version
3659# that is pretty sure to work, and you are short of disk space.
3660risky-stage1: stage1
3661	-$(MAKE) clean
3662
3663risky-stage2: stage2
3664	-$(MAKE) clean
3665
3666risky-stage3: stage3
3667	-$(MAKE) clean
3668
3669risky-stage4: stage4
3670	-$(MAKE) clean
3671
3672#In GNU Make, ignore whether `stage*' exists.
3673.PHONY: stage1 stage2 stage3 stage4 clean maintainer-clean TAGS bootstrap
3674.PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
3675
3676force:
3677
3678# Rules for generating translated message descriptions.
3679# Disabled by autoconf if the tools are not available.
3680
3681XGETTEXT = @XGETTEXT@
3682GMSGFMT = @GMSGFMT@
3683MSGMERGE = msgmerge
3684
3685PACKAGE = @PACKAGE@
3686CATALOGS = @CATALOGS@
3687
3688.PHONY: build- install- build-po install-po update-po
3689
3690# Dummy rules to deal with dependencies produced by use of
3691# "build-@POSUB@" and "install-@POSUB@" above, when NLS is disabled.
3692build-: ; @true
3693install-: ; @true
3694
3695build-po: $(CATALOGS)
3696
3697# This notation should be acceptable to all Make implementations used
3698# by people who are interested in updating .po files.
3699update-po: $(CATALOGS:.gmo=.pox)
3700
3701# N.B. We do not attempt to copy these into $(srcdir).  The snapshot
3702# script does that.
3703.po.gmo:
3704	-test -d po || mkdir po
3705	$(GMSGFMT) --statistics -o $@ $<
3706
3707# The new .po has to be gone over by hand, so we deposit it into
3708# build/po with a different extension.
3709# If build/po/$(PACKAGE).pot exists, use it (it was just created),
3710# else use the one in srcdir.
3711.po.pox:
3712	-test -d po || mkdir po
3713	$(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \
3714			then echo po/$(PACKAGE).pot; \
3715			else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@
3716
3717# This rule has to look for .gmo modules in both srcdir and
3718# the cwd, and has to check that we actually have a catalog
3719# for each language, in case they weren't built or included
3720# with the distribution.
3721install-po:
3722	$(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(datadir)
3723	for cat in $(CATALOGS); do \
3724	  lang=`basename $$cat | sed 's/\.gmo$$//'`; \
3725	  if [ -f $$cat ]; then :; \
3726	  elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
3727	  else continue; \
3728	  fi; \
3729	  dir=$(localedir)/$$lang/LC_MESSAGES; \
3730	  echo $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$$dir; \
3731	  $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$$dir || exit 1; \
3732	  echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
3733	  $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
3734	done
3735
3736# Rule for regenerating the message template (gcc.pot).
3737# Instead of forcing everyone to edit POTFILES.in, which proved impractical,
3738# this rule has no dependencies and always regenerates gcc.pot.  This is
3739# relatively harmless since the .po files do not directly depend on it.
3740# Note that exgettext has an awk script embedded in it which requires a
3741# fairly modern (POSIX-compliant) awk.
3742# The .pot file is left in the build directory.
3743$(PACKAGE).pot: po/$(PACKAGE).pot
3744po/$(PACKAGE).pot: force
3745	-test -d po || mkdir po
3746	$(MAKE) po-generated
3747	AWK=$(AWK) $(SHELL) $(srcdir)/po/exgettext \
3748		$(XGETTEXT) $(PACKAGE) $(srcdir)
3749