OSDN Git Service

* Makefile.in (STAGESTUFF): Wildcard all debugging dumps at once.
[pf3gnuchains/gcc-fork.git] / gcc / Makefile.in
1 # Makefile for GNU C compiler.
2 #   Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995
3 #   1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
4
5 #This file is part of GNU CC.
6
7 #GNU CC 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 #GNU CC 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 GNU CC; 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 # Suppress smart makes who think they know how to automake Yacc files
28 .y.c:
29
30 # Directory where sources are, from where we are.
31 srcdir = @srcdir@
32 VPATH = @srcdir@
33
34 # Pointer to the GCC Project website
35 website=http://gcc.gnu.org
36
37 # Variables that exist for you to override.
38 # See below for how to change them for certain systems.
39
40 # List of language subdirectories.
41 # This is overridden by configure.
42 SUBDIRS =@subdirs@
43
44 # Selection of languages to be made.
45 # This is overridden by configure.
46 CONFIG_LANGUAGES = @all_languages@
47 LANGUAGES = c gcov$(exeext) $(CONFIG_LANGUAGES)
48
49 # Languages should create dependencies of $(INTL_TARGETS) on generated
50 # sources in Make-lang.in.  Example:
51 # $(INTL_TARGETS): $(srcdir)/cp/parse.c
52 INTL_TARGETS = intl.all intl.install intl.distdir
53
54 # Selection of languages to be made during stage1 build.
55 # This is overridden by configure.
56 BOOT_LANGUAGES = c @all_boot_languages@
57
58 ALLOCA =
59 ALLOCA_FLAGS =
60 ALLOCA_FINISH = true
61
62 # Various ways of specifying flags for compilations:
63 # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
64 # BOOT_CFLAGS is the value of CFLAGS to pass
65 # to the stage2 and stage3 compilations
66 # WARN_CFLAGS are the warning flags to pass to stage2 and stage3.
67 # (And for stage 1 if the native compiler is GCC.)  It is
68 # separate from BOOT_CFLAGS because people tend to override optimization
69 # flags and we'd like them to still have warnings turned on.  They are free
70 # to explicitly turn warnings off if they wish.
71 # XCFLAGS is used for most compilations but not when using the GCC just built.
72 # TCFLAGS is used for compilations with the GCC just built.
73 XCFLAGS =
74 TCFLAGS =
75 CFLAGS = -g @stage1_warn_cflags@
76 BOOT_CFLAGS = -O2 $(CFLAGS)
77 WARN_CFLAGS = -W -Wall -Wtraditional
78 # These exists to be overridden by the x-* and t-* files, respectively.
79 X_CFLAGS =
80 T_CFLAGS =
81
82 X_CPPFLAGS =
83 T_CPPFLAGS =
84
85 AWK = @AWK@
86 CC = @CC@
87 # srcdir might be a relative pathname which won't be valid in a subdirectory,
88 # so we must use objdir/srcdir instead to make it safe.  objdir is always
89 # a full pathname.
90 BISON = `if [ -f $(objdir)/../bison/bison ] ; then case $(srcdir) in \
91         /*) echo $(objdir)/../bison/bison -L $(srcdir)/../bison/ ;; \
92         *) echo $(objdir)/../bison/bison -L $(objdir)/$(srcdir)/../bison/ ;; \
93         esac; else echo bison ; fi`
94 BISONFLAGS =
95 LEX = `if [ -f $(objdir)/../flex/flex ] ; then echo $(objdir)/../flex/flex ; else echo flex ; fi`
96 LEXFLAGS =
97 AR = ar
98 AR_FLAGS = rc
99 LN = @symbolic_link@
100 DLLTOOL = dlltool
101 SHELL = /bin/sh
102 # on sysV, define this as cp.
103 INSTALL = @INSTALL@
104 # Some systems may be missing symbolic links, regular links, or both.
105 # Allow configure to check this and use "ln -s", "ln", or "cp" as appropriate.
106 LN=@LN@
107 LN_S=@LN_S@
108 # These permit overriding just for certain files.
109 INSTALL_PROGRAM = @INSTALL_PROGRAM@
110 INSTALL_DATA = @INSTALL_DATA@
111 MAKEINFO = `if [ -f $(objdir)/../texinfo/makeinfo/Makefile ] ; \
112         then echo $(objdir)/../texinfo/makeinfo/makeinfo ; \
113         else echo makeinfo ; fi`
114 MAKEINFOFLAGS =
115 TEXI2DVI = texi2dvi
116 # For GNUmake: let us decide what gets passed to recursive makes.
117 MAKEOVERRIDES =
118 @SET_MAKE@
119
120 # Define this as & to perform parallel make on a Sequent.
121 # Note that this has some bugs, and it seems currently necessary
122 # to compile all the gen* files first by hand to avoid erroneous results.
123 P =
124
125 # How to invoke ranlib.
126 RANLIB = ranlib
127 # Test to use to see whether ranlib exists on the system.
128 RANLIB_TEST = \
129   [ -f $(RANLIB) ] \
130   || [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
131
132 # Compiler to use for compiling libgcc1.a.
133 # OLDCC should not be the GNU C compiler,
134 # since that would compile typical libgcc1.a functions such as mulsi3
135 # into infinite recursions.
136 OLDCC = cc
137
138 # CFLAGS for use with OLDCC, for compiling libgcc1.a.
139 # NOTE: -O does not work on some Unix systems!
140 CCLIBFLAGS = -O
141
142 # Version of ar to use when compiling libgcc1.a.
143 OLDAR = ar
144 OLDAR_FLAGS = qc
145
146 # Target to use when installing include directory.  Either
147 # install-headers-tar or install-headers-cpio.
148 INSTALL_HEADERS_DIR = @build_install_headers_dir@
149
150 # Header files that are made available under the same name
151 # to programs compiled with GCC.
152 USER_H = $(srcdir)/ginclude/stdarg.h $(srcdir)/ginclude/stddef.h \
153     $(srcdir)/ginclude/varargs.h $(srcdir)/ginclude/proto.h \
154     $(srcdir)/ginclude/stdbool.h $(srcdir)/ginclude/iso646.h \
155     $(EXTRA_HEADERS) $(LANG_EXTRA_HEADERS)
156
157 # Target to use whe installing assert.h.  Some systems may
158 # want to set this empty.
159 INSTALL_ASSERT_H = install-assert-h
160
161 # The GCC to use for compiling libgcc2.a, enquire, and libgcc1-test.
162 # Usually the one we just built.
163 # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
164 GCC_FOR_TARGET = ./xgcc -B$(build_tooldir)/bin/ -B./ -I$(build_tooldir)/include
165
166 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
167 # It omits XCFLAGS, and specifies -B./.
168 # It also specifies -I./include to find, e.g., stddef.h.
169 GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) -I./include $(TCFLAGS)
170
171 # Specify the abi to use when building the c++ runtime
172 GXX_ABI_FLAG=@GXX_ABI_FLAG@
173
174 # Sed command to transform gcc to installed name.  Overwritten by configure.
175 program_transform_name = @program_transform_name@
176 program_transform_cross_name = s,^,$(target_alias)-,
177
178 build_canonical = @build_canonical@
179 host_canonical = @host_canonical@
180
181 # Tools to use when building a cross-compiler.
182 # These are used because `configure' appends `cross-make'
183 # to the makefile when making a cross-compiler.
184
185 # Use the tools from the build tree, if they are available.
186
187 # objdir is set by configure.
188 objdir = @objdir@
189
190 AR_FOR_TARGET = ` \
191   if [ -f $(objdir)/../binutils/ar ] ; then \
192     echo $(objdir)/../binutils/ar ; \
193   else \
194     if [ "$(host_canonical)" = "$(target)" ] ; then \
195       echo ar; \
196     else \
197        t='$(program_transform_cross_name)'; echo ar | sed -e $$t ; \
198     fi; \
199   fi`
200 AR_FLAGS_FOR_TARGET = 
201 AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc
202 AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x
203 RANLIB_FOR_TARGET = ` \
204   if [ -f $(objdir)/../binutils/ranlib ] ; then \
205     echo $(objdir)/../binutils/ranlib ; \
206   else \
207     if [ "$(host_canonical)" = "$(target)" ] ; then \
208       echo ranlib; \
209     else \
210        t='$(program_transform_cross_name)'; echo ranlib | sed -e $$t ; \
211     fi; \
212   fi`
213 RANLIB_TEST_FOR_TARGET = \
214   [ -f $(RANLIB_FOR_TARGET) ] \
215   || ( [ "$(host_canonical)" = "$(target)" ] \
216        && [ -f /usr/bin/ranlib -o -f /bin/ranlib ] )
217
218 # Dir to search for system headers.  Overridden by cross-make.
219 SYSTEM_HEADER_DIR = /usr/include
220
221 # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
222 CROSS_SYSTEM_HEADER_DIR = $(tooldir)/sys-include
223
224 # Control whether to run fixproto and fixincludes.
225 STMP_FIXPROTO = stmp-fixproto
226 STMP_FIXINC = stmp-fixinc
227
228 # Test to see whether <limits.h> exists in the system header files.
229 LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
230
231 target=@target@
232 target_alias=@target_alias@
233 xmake_file=@dep_host_xmake_file@
234 tmake_file=@dep_tmake_file@
235 out_file=$(srcdir)/config/@out_file@
236 out_object_file=@out_object_file@
237 md_file=$(srcdir)/config/@md_file@
238 tm_file=@tm_file_list@
239 build_xm_file=@build_xm_file_list@
240 host_xm_file=@host_xm_file_list@
241 lang_specs_files=@lang_specs_files@
242 lang_options_files=@lang_options_files@
243 lang_tree_files=@lang_tree_files@
244 GCC_THREAD_FILE=@thread_file@
245 OBJC_BOEHM_GC=@objc_boehm_gc@
246 GTHREAD_FLAGS=@gthread_flags@
247 # Be prepared for gcc2 merges.
248 gcc_version=@gcc_version@
249 gcc_version_trigger=@gcc_version_trigger@
250 version=$(gcc_version)
251 mainversion=`grep version_string $(srcdir)/version.c | sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/'`
252
253 # Common prefix for installation directories.
254 # NOTE: This directory must exist when you start installation.
255 prefix = @prefix@
256 # Directory in which to put localized header files. On the systems with
257 # gcc as the native cc, `local_prefix' may not be `prefix' which is
258 # `/usr'.
259 # NOTE: local_prefix *should not* default from prefix.
260 local_prefix = @local_prefix@
261 # Directory in which to put host dependent programs and libraries
262 exec_prefix = @exec_prefix@
263 # Directory in which to put the executable for the command `gcc'
264 bindir = @bindir@
265 # Directory in which to put the directories used by the compiler.
266 libdir = @libdir@
267 # Directory in which the compiler finds executables, libraries, etc.
268 libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(version)
269 # Used to produce a relative $(gcc_tooldir) in gcc.o
270 unlibsubdir = ../../..
271 # Directory in which to find other cross-compilation tools and headers.
272 dollar = @dollar@
273 # Used in install-cross.
274 gcc_tooldir = @gcc_tooldir@
275 # Since tooldir does not exist at build-time, use -B$(build_tooldir)/bin/
276 build_tooldir = $(exec_prefix)/$(target_alias)
277 # Directory in which the compiler finds g++ includes.
278 gcc_gxx_include_dir= @gcc_gxx_include_dir@
279 # Directory to search for site-specific includes.
280 includedir = $(local_prefix)/include
281 # assertdir is overridden in cross-make.
282 # (But this currently agrees with what is in cross-make.)
283 assertdir = $(gcc_tooldir)/include
284 # where the info files go
285 infodir = @infodir@
286 # Where cpp should go besides $prefix/bin if necessary
287 cpp_install_dir = @cpp_install_dir@
288 # where the locale files go
289 datadir = $(prefix)/@DATADIRNAME@
290 localedir = $(datadir)/locale
291 # Extension (if any) to put in installed man-page filename.
292 manext = .1
293 objext = .o
294 exeext = @host_exeext@
295 build_exeext = @build_exeext@
296
297 # Directory in which to put man pages.
298 mandir = @mandir@
299 man1dir = $(mandir)/man1
300 # Dir for temp files.
301 tmpdir = /tmp
302
303 # Top build directory, relative to here.
304 top_builddir = .
305
306 # Whether we were configured with NLS.
307 USE_NLS = @USE_NLS@
308
309 # Internationalization library.
310 INTLLIBS = @INTLLIBS@
311
312 # List of internationalization subdirectories.
313 POSUB = @POSUB@
314 INTL_SUBDIRS = intl $(POSUB)
315
316 # Additional system libraries to link with.
317 CLIB=
318
319 # Change this to a null string if obstacks are installed in the
320 # system library.
321 OBSTACK=obstack.o
322
323 # The GC method to be used on this system.
324 GGC=@GGC@.o
325
326 # If a supplementary library is being used for the GC.
327 GGC_LIB=
328
329 # Configure will set these if you need vfprintf and possibly _doprnt support.
330 VFPRINTF=@vfprintf@
331 DOPRINT=@doprint@
332
333 # Specify the rule for actually making libgcc.a,
334 LIBGCC = libgcc.a
335 # and the rule for installing it.
336 INSTALL_LIBGCC = install-libgcc
337
338 # Specify the rule for actually making libgcc1.a.
339 # The value may be empty; that means to do absolutely nothing
340 # with or for libgcc1.a.
341 LIBGCC1 = libgcc1.a
342
343 # Specify the rule for making libgcc1.a for a cross-compiler.
344 # The default rule assumes that libgcc1.a is supplied by the user.
345 CROSS_LIBGCC1 = libgcc1.cross
346
347 # Specify the rule for actually making libgcc2.a.
348 LIBGCC2 = libgcc2.a
349
350 # Options to use when compiling libgcc2.a.
351 # -g1 causes output of debug info only for file-scope entities.
352 # we use this here because that should be enough, and also
353 # so that -g1 will be tested.
354 #
355 LIBGCC2_DEBUG_CFLAGS = -g1
356 LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED @inhibit_libc@
357
358 # Additional options to use when compiling libgcc2.a.
359 # Some targets override this to -Iinclude
360 LIBGCC2_INCLUDES =
361
362 # Additional target-dependent options for compiling libgcc2.a.
363 TARGET_LIBGCC2_CFLAGS =
364
365 # libgcc1-test target (must also be overridable for a target)
366 LIBGCC1_TEST = libgcc1-test
367
368 # List of extra executables that should be compiled for this target machine
369 # that are used for compiling from source code to object code.
370 # The rules for compiling them should be in the t-* file for the machine.
371 EXTRA_PASSES =@extra_passes@
372
373 # Like EXTRA_PASSES, but these are used when linking.
374 EXTRA_PROGRAMS = @extra_programs@
375
376 # List of extra object files that should be compiled for this target machine.
377 # The rules for compiling them should be in the t-* file for the machine.
378 EXTRA_PARTS = @extra_parts@
379
380 # List of extra object files that should be compiled and linked with
381 # compiler proper (cc1, cc1obj, cc1plus).
382 EXTRA_OBJS = @extra_objs@
383
384 # List of extra object files that should be compiled and linked with
385 # the gcc driver.
386 EXTRA_GCC_OBJS =@host_extra_gcc_objs@
387
388 # List of additional header files to install.
389 # Often this is edited directly by `configure'.
390 EXTRA_HEADERS =@extra_headers_list@
391
392 # Set this to `collect2' to enable use of collect2.
393 USE_COLLECT2 = @will_use_collect2@
394 # If we might be using collect2, then this variable will be set to
395 # -DUSE_COLLECT2.  toplev.c, collect2.c and libgcc2.c all need to
396 # if we may be using collect2.
397 MAYBE_USE_COLLECT2 = @maybe_use_collect2@
398 # It is convenient for configure to add the assignment at the beginning,
399 # so don't override it here.
400 USE_COLLECT2 = collect2$(exeext)
401
402 # List of extra C and assembler files to add to libgcc1.a.
403 # Assembler files should have names ending in `.asm'.
404 LIB1FUNCS_EXTRA =
405
406 # List of extra C and assembler files to add to libgcc2.a.
407 # Assembler files should have names ending in `.asm'.
408 LIB2FUNCS_EXTRA =
409
410 # Handle cpp installation.
411 INSTALL_CPP=
412 UNINSTALL_CPP=
413
414 # We do not try to build float.h anymore.  Let configure select the
415 # appropriate pre-built float.h file for the target.
416 FLOAT_H=@float_h_file@
417
418 # Program to convert libraries.
419 LIBCONVERT =
420
421 # Control whether header files are installed.
422 INSTALL_HEADERS=install-headers
423
424 # Additional directories of header files to run fixincludes on.
425 # These should be directories searched automatically by default
426 # just as /usr/include is.
427 # *Do not* use this for directories that happen to contain
428 # header files, but are not searched automatically by default.
429 # On most systems, this is empty.
430 OTHER_FIXINCLUDES_DIRS=
431
432 # A list of all the language-specific executables.
433 # This is overridden by configure.
434 COMPILERS = cc1$(exeext) @all_compilers@
435
436 # List of things which should already be built whenever we try to use xgcc
437 # to compile anything (without linking).
438 GCC_PASSES=xgcc$(exeext) cc1$(exeext) cpp$(exeext) $(EXTRA_PASSES)
439
440 # List of things which should already be built whenever we try to use xgcc
441 # to link anything.
442 GCC_PARTS=$(GCC_PASSES) $(LIBGCC) $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
443
444 # Directory to link to, when using the target `maketest'.
445 DIR = ../gcc
446
447 # Guaranteed to not exist when not passing md through cpp.
448 # This value is overridden directly by configure.
449 MD_FILE = md-cpp-not-used
450
451 # Flags to use when cross-building GCC.
452 # Prefix to apply to names of object files when using them
453 # to run on the machine we are compiling on.
454 HOST_PREFIX=
455 # Prefix to apply to names of object files when compiling them
456 # to run on the machine we are compiling on.
457 # The default for this variable is chosen to keep these rules
458 # out of the way of the other rules for compiling the same source files.
459 HOST_PREFIX_1=loser-
460 HOST_CC=$(CC)
461 HOST_CFLAGS=$(ALL_CFLAGS)
462 HOST_CLIB=$(CLIB)
463 HOST_INTLLIBS=$(INTLLIBS)
464 HOST_LDFLAGS=$(LDFLAGS)
465 HOST_CPPFLAGS=$(ALL_CPPFLAGS)
466 HOST_ALLOCA=$(ALLOCA)
467 HOST_MALLOC=$(MALLOC)
468 HOST_OBSTACK=$(OBSTACK)
469 HOST_VFPRINTF=$(VFPRINTF)
470 HOST_DOPRINT=$(DOPRINT)
471
472 # Actual name to use when installing a native compiler.
473 GCC_INSTALL_NAME = `t='$(program_transform_name)'; echo gcc | sed -e $$t`
474 CPP_INSTALL_NAME = `t='$(program_transform_name)'; echo cpp | sed -e $$t`
475 PROTOIZE_INSTALL_NAME = `t='$(program_transform_name)'; echo protoize | sed -e $$t`
476 UNPROTOIZE_INSTALL_NAME = `t='$(program_transform_name)'; echo unprotoize | sed -e $$t`
477 GCOV_INSTALL_NAME = `t='$(program_transform_name)'; echo gcov | sed -e $$t`
478 GCCBUG_INSTALL_NAME = `t='$(program_transform_name)'; echo gccbug | sed -e $$t`
479
480 # Actual name to use when installing a cross-compiler.
481 GCC_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcc | sed -e $$t`
482 CPP_CROSS_NAME = `t='$(program_transform_cross_name)'; echo cpp | sed -e $$t`
483 PROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo protoize | sed -e $$t`
484 UNPROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo unprotoize | sed -e $$t`
485
486 # Choose the real default target.
487 ALL=all.internal
488
489 # Choose the real install target.
490 INSTALL_TARGET=install-normal
491
492 # Setup the testing framework, if you have one
493 EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
494             echo $${rootme}/../expect/expect ; \
495           else echo expect ; fi`
496
497 RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
498                echo $${srcdir}/../dejagnu/runtest ; \
499             else echo runtest; fi`
500 RUNTESTFLAGS =
501
502 # Extra symbols for fixproto to define when parsing headers.
503 FIXPROTO_DEFINES =
504
505 # Extra flags to use when compiling crt{begin,end}.o.
506 CRTSTUFF_T_CFLAGS =
507
508 # Extra flags to use when compiling [m]crt0.o.
509 CRT0STUFF_T_CFLAGS =
510
511 # "t" or nothing, for building multilibbed versions of, say, crtbegin.o.
512 T =
513
514 # End of variables for you to override.
515
516 # Definition of `all' is here so that new rules inserted by sed
517 # do not specify the default target.
518 # The real definition is under `all.internal' (for native compilers)
519 # or `all.cross' (for cross compilers).
520 all: all.indirect
521
522 # This tells GNU Make version 3 not to put all variables in the environment.
523 .NOEXPORT:
524
525 # sed inserts variable overrides after the following line.
526 ####target overrides
527 @target_overrides@
528
529 ####host overrides
530 @host_overrides@
531
532 ####cross overrides
533 @cross_defines@
534 @cross_overrides@
535
536 ####build overrides
537 @build_overrides@
538 #\f
539 # Now figure out from those variables how to compile and link.
540
541 all.indirect: $(ALL)
542
543 # IN_GCC tells various files that system.h, toplev.c, etc are available.
544 INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
545
546 # This is the variable actually used when we compile.
547 # If you change this line, you probably also need to change the definition
548 # of HOST_CFLAGS in build-make to match.
549 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) \
550         @DEFS@
551
552 # Likewise.
553 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
554
555 # Even if ALLOCA is set, don't use it if compiling with GCC.
556 USE_ALLOCA= ${ALLOCA}
557 USE_HOST_ALLOCA= ` case "${HOST_ALLOCA}" in ?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac `
558 USE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo ${HOST_PREFIX}${HOST_MALLOC} ;; esac `
559 USE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo ${HOST_PREFIX}${HOST_OBSTACK} ;; esac `
560 USE_HOST_VFPRINTF= ` case "${HOST_VFPRINTF}" in ?*) echo ${HOST_PREFIX}${HOST_VFPRINTF} ;; esac `
561 USE_HOST_DOPRINT= ` case "${HOST_DOPRINT}" in ?*) echo ${HOST_PREFIX}${HOST_DOPRINT} ;; esac `
562
563 # Dependency on obstack, alloca, malloc or whatever library facilities
564 # are not installed in the system libraries.
565 # We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
566 LIBDEPS= $(INTLLIBS) $(OBSTACK) $(ALLOCA) $(MALLOC) $(VFPRINTF) $(DOPRINT)
567
568 # Likewise, for use in the tools that must run on this machine
569 # even if we are cross-building GCC.
570 # We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
571 HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_INTLLIBS) $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC) $(HOST_PREFIX)$(HOST_VFPRINTF) $(HOST_PREFIX)$(HOST_DOPRINT)
572
573 # How to link with both our special library facilities
574 # and the system's installed libraries.
575 LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(INTLLIBS) @LIBS@ $(VFPRINTF) $(DOPRINT) $(CLIB) ../libiberty/libiberty.a
576
577 # Likewise, for use in the tools that must run on this machine
578 # even if we are cross-building GCC.
579 HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC)  \
580             $(HOST_INTLLIBS) $(USE_HOST_VFPRINTF) $(USE_HOST_DOPRINT) \
581             $(HOST_CLIB)
582
583 HOST_RTL = $(HOST_PREFIX)rtl.o $(HOST_PREFIX)bitmap.o $(HOST_PREFIX)ggc-none.o
584 HOST_PRINT = $(HOST_PREFIX)print-rtl.o
585 HOST_ERRORS = $(HOST_PREFIX)errors.o
586
587 # Specify the directories to be searched for header files.
588 # Both . and srcdir are used, in that order,
589 # so that tm.h and config.h will be found in the compilation
590 # subdirectory rather than in the source directory.
591 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config -I$(srcdir)/../include
592
593 # Always use -I$(srcdir)/config when compiling.
594 .c.o:
595         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
596
597 # This tells GNU make version 3 not to export all the variables
598 # defined in this file into the environment.
599 .NOEXPORT:
600 #\f
601 # Support for additional languages (other than c and objc).
602 # ??? objc can be supported this way too (leave for later).
603
604 # These next lines are overridden by configure.
605 LANG_MAKEFILES = @all_lang_makefiles@
606 LANG_STAGESTUFF = @all_stagestuff@
607 LANG_DIFF_EXCLUDES = @all_diff_excludes@
608 LANG_LIB2FUNCS = @all_lib2funcs@
609 LANG_EXTRA_HEADERS = @all_headers@
610
611 # Flags to pass to recursive makes.
612 # CC is set by configure.  Hosts without symlinks need special handling
613 # because we need CC="stage1/xgcc -Bstage1/" to work in the language
614 # subdirectories.
615 # ??? The choices here will need some experimenting with.
616 ORDINARY_FLAGS_TO_PASS = \
617         "AR_FLAGS_FOR_TARGET=$(AR_FLAGS_FOR_TARGET)" \
618         "AR_CREATE_FOR_TARGET=$(AR_CREATE_FOR_TARGET)" \
619         "AR_EXTRACT_FOR_TARGET=$(AR_EXTRACT_FOR_TARGET)" \
620         "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
621         "BISON=$(BISON)" \
622         "BISONFLAGS=$(BISONFLAGS)" \
623         "CFLAGS=$(CFLAGS)" \
624         "CLIB=$(CLIB)" \
625         "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
626         "LDFLAGS=$(LDFLAGS)" \
627         "LEX=$(LEX)" \
628         "LEXFLAGS=$(LEXFLAGS)" \
629         "LN=$(LN)" \
630         "LN_S=$(LN_S)" \
631         "MAKEINFO=$(MAKEINFO)" \
632         "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
633         "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
634         "RANLIB_TEST_FOR_TARGET=$(RANLIB_TEST_FOR_TARGET)" \
635         "SHELL=$(SHELL)" \
636         "STAGE_PREFIX=@stage_prefix_set_by_configure@" \
637         "exeext=$(exeext)" \
638         "build_exeext=$(build_exeext)" \
639         "objext=$(objext)" \
640         "exec_prefix=$(exec_prefix)" \
641         "prefix=$(prefix)" \
642         "local_prefix=$(local_prefix)" \
643         "gxx_include_dir=$(gcc_gxx_include_dir)" \
644         "tooldir=$(tooldir)" \
645         "gcc_tooldir=$(gcc_tooldir)" \
646         "bindir=$(bindir)" \
647         "libsubdir=$(libsubdir)" \
648         "datadir=$(datadir)" \
649         "distdir=../tmp/\$$(subdir)" \
650         "localedir=$(localedir)"
651 FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) "CC=@cc_set_by_configure@"
652 PREPEND_DOTDOT_TO_RELATIVE_PATHS = sed \
653         -e 's|^ *[^ /][^ /]*/|%&|' \
654         -e 's| -B| -B%|g' \
655         -e 's|% *[^- /]|%&|g' \
656         -e 's|%% *|../|g' \
657         -e 's|%||g'
658 SUBDIR_FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) \
659   "CC=`echo @quoted_cc_set_by_configure@ | $(PREPEND_DOTDOT_TO_RELATIVE_PATHS)`"
660 #\f
661 # Lists of files for various purposes.
662
663 # Language-specific object files for C and Objective C.
664 C_AND_OBJC_OBJS = c-lex.o c-pragma.o c-decl.o c-typeck.o c-convert.o \
665   c-aux-info.o c-common.o c-iterate.o @extra_c_objs@
666
667 # Language-specific object files for C.
668 C_OBJS = c-parse.o c-lang.o $(C_AND_OBJC_OBJS)
669
670 # Language-independent object files.
671 OBJS = diagnostic.o \
672  toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
673  function.o stmt.o except.o expr.o calls.o expmed.o explow.o optabs.o real.o \
674  builtins.o intl.o varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o genrtl.o \
675  dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o bitmap.o alias.o gcse.o \
676  integrate.o jump.o cse.o loop.o unroll.o flow.o combine.o varray.o \
677  regclass.o regmove.o local-alloc.o global.o reload.o reload1.o caller-save.o \
678  insn-peep.o reorg.o haifa-sched.o final.o recog.o reg-stack.o \
679  insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o lcm.o \
680  profile.o insn-attrtab.o $(out_object_file) $(EXTRA_OBJS) convert.o \
681  mbchar.o dyn-string.o splay-tree.o graph.o sbitmap.o resource.o hash.o \
682  predict.o lists.o ggc-common.o $(GGC) simplify-rtx.o ssa.o bb-reorder.o \
683  sibcall.o
684
685 # GEN files are listed separately, so they can be built before doing parallel
686 #  makes for cc1 or cc1plus.  Otherwise sequent parallel make attempts to load
687 #  them before rtl.o is compiled.
688 GEN= genemit genoutput genrecog genextract genflags gencodes genconfig \
689  genpeep gengenrtl gencheck
690
691 CCCP=@cpp_main@
692
693 # Files to be copied away after each stage in building.
694 STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
695  insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
696  insn-attr.h insn-attrtab.c insn-opinit.c tree-check.h \
697  s-flags s-config s-codes s-mlib s-unders s-genrtl \
698  s-output s-recog s-emit s-extract s-peep s-check \
699  s-attr s-attrtab s-opinit s-crt s-$(T)crtS s-crt0 \
700  genemit$(build_exeext) genoutput$(build_exeext) genrecog$(build_exeext) \
701  genextract$(build_exeext) genflags$(build_exeext) gencodes$(build_exeext) \
702  genconfig$(build_exeext) genpeep$(build_exeext) genattrtab$(build_exeext) \
703  genattr$(build_exeext) genopinit$(build_exeext) gengenrtl$(build_exeext) \
704  gencheck$(build_exeext) \
705  xgcc$(exeext) xcpp$(exeext) cc1$(exeext) cpp$(exeext) $(EXTRA_PASSES) \
706  $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
707  $(CCCP)$(exeext) cc1obj$(exeext) enquire$(exeext) \
708  protoize$(exeext) unprotoize$(exeext) \
709  specs collect2$(exeext) $(USE_COLLECT2) underscore.c \
710  gcov$(exeext) *.[0-9][0-9].* *.[si] libcpp.a \
711  $(LANG_STAGESTUFF)
712
713 # Members of libgcc1.a.
714 LIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
715    _lshrsi3 _ashrsi3 _ashlsi3 \
716    _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \
717    _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \
718    _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \
719    _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
720    _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
721
722 # Library members defined in libgcc2.c.
723 LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
724      _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 \
725     _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
726     _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
727     _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \
728     _fixtfdi _fixunstfdi _floatditf \
729     __gcc_bcmp _varargs __dummy _eprintf \
730     _bb _shtab _clear_cache _trampoline __main _exit \
731     _ctors _pure
732
733 LIB2FUNCS_EH = _eh
734
735 FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
736     _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
737     _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
738     _sf_to_df _thenan_sf _sf_to_usi _df_to_usi
739
740 DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
741     _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \
742     _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \
743     _df_to_sf _thenan_df _sf_to_usi _df_to_usi
744
745 # The files that "belong" in CONFIG_H are deliberately omitted
746 # because having them there would not be useful in actual practice.
747 # All they would do is cause complete recompilation every time
748 # one of the machine description files is edited.
749 # That may or may not be what one wants to do.
750 # If it is, rm *.o is an easy way to do it.
751 # CONFIG_H = $(host_xm_file) $(tm_file)
752 CONFIG_H =
753 MACHMODE_H = machmode.h machmode.def
754 RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H)
755 RTL_H = $(RTL_BASE_H) genrtl.h
756 TREE_H = tree.h real.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def
757 BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h
758 DEMANGLE_H = $(srcdir)/../include/demangle.h
759 RECOG_H = recog.h
760 EXPR_H = expr.h insn-codes.h
761 REGS_H = regs.h varray.h $(MACHMODE_H)
762 INTEGRATE_H = integrate.h varray.h
763 LOOP_H = loop.h varray.h basic-block.h
764 GCC_H = gcc.h version.h
765 #\f
766 # Language makefile fragments.
767
768 # The following targets define the interface between us and the languages.
769 #
770 # all.build, all.cross, start.encap, rest.encap,
771 # info, dvi,
772 # install-normal, install-common, install-info, install-man,
773 # uninstall, distdir,
774 # mostlyclean, clean, distclean, extraclean, maintainer-clean,
775 # stage1, stage2, stage3, stage4
776 #
777 # Each language is linked in with a series of hooks (since we can't use `::'
778 # targets).  The name of each hooked is "lang.${target_name}" (eg: lang.info).
779 # Configure computes and adds these here.
780
781 ####language hooks
782 @language_hooks@
783
784 # sed inserts language fragments after the following line.
785 ####language fragments
786 @language_fragments@
787
788 # End of language makefile fragments.
789 #\f
790 # The only suffixes we want for implicit rules are .c and .o, so clear
791 # the list and add them.  This speeds up GNU Make, and allows -r to work.
792 .SUFFIXES:
793 .SUFFIXES: .c .o
794
795 Makefile: $(srcdir)/Makefile.in config.status $(srcdir)/version.c \
796    $(xmake_file) $(tmake_file) $(LANG_MAKEFILES)
797         $(SHELL) $(srcdir)/configure.frag $(srcdir) "$(SUBDIRS)" \
798                 "$(xmake_file)" "$(tmake_file)"
799         cp config.status config.run
800         LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.run
801         rm -f config.run
802
803 $(srcdir)/configure: $(srcdir)/configure.in
804         cd $(srcdir); autoconf
805
806 # cstamp-h.in controls rebuilding of config.in.
807 # It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't
808 # delete it.  A stamp file is needed as autoheader won't update the file if
809 # nothing has changed.
810 # It remains in the source directory and is part of the distribution.
811 # This follows what is done in shellutils, fileutils, etc.
812 # "echo timestamp" is used instead of touch to be consistent with other
813 # packages that use autoconf (??? perhaps also to avoid problems with patch?).
814 # ??? Newer versions have a maintainer mode that may be useful here.
815 $(srcdir)/config.in: $(srcdir)/cstamp-h.in
816 $(srcdir)/cstamp-h.in: $(srcdir)/configure.in $(srcdir)/acconfig.h
817         cd $(srcdir) && autoheader
818         @rm -f $(srcdir)/cstamp-h.in
819         echo timestamp > $(srcdir)/cstamp-h.in
820 auto-host.h: cstamp-h ; @true
821 cstamp-h: config.in config.status
822         CONFIG_HEADERS=auto-host.h:config.in LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status
823
824 # Really, really stupid make features, such as SUN's KEEP_STATE, may force
825 # a target to build even if it is up-to-date.  So we must verify that
826 # config.status does not exist before failing.
827 config.status: $(srcdir)/configure version.c
828         @if [ ! -f config.status ] ; then \
829           echo You must configure gcc.  Look at the INSTALL file for details.; \
830           false; \
831         else \
832           LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status --recheck; \
833         fi
834
835 all.internal: start.encap rest.encap doc
836 # This is what to compile if making a cross-compiler.
837 # Note that we can compile enquire using the cross-compiler just built,
838 # although we can't run it on this machine.
839 all.cross: native gcc-cross xcpp$(exeext) specs \
840         $(LIBGCC) $(LIBGCC1_TEST) $(EXTRA_PARTS) lang.all.cross doc
841 # This is what to compile if making gcc with a cross-compiler.
842 all.build: native xgcc$(exeext) xcpp$(exeext) $(EXTRA_PARTS) lang.all.build
843 # This is what must be made before installing GCC and converting libraries.
844 start.encap: native xgcc$(exeext) xcpp$(exeext) specs $(LIBGCC1) \
845         xlimits.h lang.start.encap
846 # These can't be made until after GCC can run.
847 rest.encap: $(STMP_FIXPROTO) $(LIBGCC) $(EXTRA_PARTS) lang.rest.encap
848 # This is what is made with the host's compiler
849 # whether making a cross compiler or not.
850 native: config.status auto-host.h cpp$(exeext) intl.all $(LANGUAGES) \
851         $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
852
853 # Define the names for selecting languages in LANGUAGES.
854 C c: cc1$(exeext)
855 PROTO: proto
856
857 # Tell GNU make these are phony targets.
858 .PHONY: C c PROTO proto
859
860 # On the target machine, finish building a cross compiler.
861 # This does the things that can't be done on the host machine.
862 rest.cross: $(LIBGCC) specs
863
864 # Verify that it works to compile and link libgcc1-test.
865 # If it does, then there are sufficient replacements for libgcc1.a.
866 libgcc1-test: libgcc1-test.o native $(GCC_PARTS)
867         @echo "Testing libgcc1.  Ignore linker warning messages."
868         $(GCC_FOR_TARGET) $(GCC_CFLAGS) libgcc1-test.o -o libgcc1-test \
869           -nostartfiles -nostdlib `$(GCC_FOR_TARGET) --print-libgcc-file-name`
870 libgcc1-test.o: libgcc1-test.c native xgcc$(exeext)
871         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -c $(srcdir)/libgcc1-test.c
872
873 # Recompile all the language-independent object files.
874 # This is used only if the user explicitly asks for it.
875 compilations: ${OBJS}
876
877 # Create a list of the language-independent object files so the language
878 # subdirectories needn't mention their names explicitly.
879 stamp-objlist: $(OBJS)
880         echo " $(OBJS)" | sed -e 's, \([a-z0-9]\), ../\1,g' -e 's/\.o/$(objext)/g' >stamp-objlist
881
882 # We call this executable `xgcc' rather than `gcc'
883 # to avoid confusion if the current directory is in the path
884 # and CC is `gcc'.  It is renamed to `gcc' when it is installed.
885 xgcc$(exeext): gcc.o gccspec.o version.o intl.o prefix.o \
886    version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
887         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o gccspec.o intl.o \
888           prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
889
890 # We call this executable `xcpp' rather than `cpp'
891 # since the real preprocessor is named `cpp'.  It too is renamed
892 # when it is installed.
893 # The only difference from xgcc is that it's linked with cppspec.o
894 # instead of gccspec.o.
895 xcpp$(exeext): gcc.o cppspec.o version.o intl.o prefix.o \
896    version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
897         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o cppspec.o intl.o \
898           prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
899
900 # Dump a specs file to make -B./ read these specs over installed ones.
901 specs: xgcc$(exeext)
902         $(GCC_FOR_TARGET) -dumpspecs > tmp-specs
903         mv tmp-specs specs
904
905 # We do want to create an executable named `xgcc', so we can use it to
906 # compile libgcc2.a.
907 # Also create gcc-cross, so that install-common will install properly.
908 gcc-cross: xgcc$(exeext)
909         cp xgcc$(exeext) gcc-cross$(exeext)
910
911 cc1$(exeext): $(P) $(OBJS) $(C_OBJS) $(LIBDEPS)
912         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(C_OBJS) $(LIBS)
913
914 # Build the version of limits.h that we will install.
915 xlimits.h: glimits.h limitx.h limity.h
916         if $(LIMITS_H_TEST) ; then \
917           cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-xlimits.h; \
918         else \
919           cat $(srcdir)/glimits.h > tmp-xlimits.h; \
920         fi
921         mv tmp-xlimits.h xlimits.h
922 #\f
923 # Build libgcc.a.
924 # This is done in two parts because some functions, in libgcc1.c,
925 # must be compiled with something other than GCC,
926 # while the rest, in libgcc2.c, must be compiled with xgcc.
927 # That means we can't do libgcc2.c until after xgcc, cc1, etc.
928
929 # Use this as value of LIBGCC1 to cause conversion to GNU library format.
930 # LIBCONVERT should put its output in libgcc1.conv.
931 libgcc1.conv: libgcc1.a
932         $(LIBCONVERT) libgcc1.a libgcc1.conv
933
934 # Use this as value of LIBGCC1 to inhibit use of libgcc1.c entirely.
935 # Make an empty file instead.
936 libgcc1.null: $(GCC_PASSES)
937         echo "void __foo () {}" > dummy.c
938         $(GCC_FOR_TARGET) $(GCC_CFLAGS) -c dummy.c
939         $(AR_CREATE_FOR_TARGET) libgcc1.null dummy$(objext)
940         rm -f dummy$(objext) dummy.c
941
942 # This is $(LIBGCC1) for a cross-compiler.
943 # We have no automatic way of building libgcc1.a,
944 # so it's up to the installer to find a way to do that.
945 # This rule deliberately does not depend on libgcc1.a
946 # so that it will fail if the installer hasn't provided it.
947 libgcc1.cross:
948         mv libgcc1.a libgcc1.cross || (echo You must find a way to make libgcc1.a; false)
949
950 # Compile the library of arithmetic subroutines with the native compiler.
951 # Don't compile it with GCC!
952 # (That would cause most arithmetic functions to call themselves.)
953 #
954 # NOTE: If you modify these rules substantially, please be sure to
955 # check at least config/i386/t-sco5 and possibly other makefile
956 # fragments.
957 libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status
958         -rm -f tmplibgcc1.a
959 # Actually build it in tmplibgcc1.a, then rename at end,
960 # so that libgcc1.a itself remains nonexistent if compilation is aborted.
961 # -e causes any failing command to make this rule fail.
962 # -e doesn't work in certain shells, so we test $$? as well.
963 # lynx has a broken ar, it always complains when the initial library is
964 # empty, thus this command works only if we don't do -e
965 # There is a trailing backslash (\) deleted from the following line.
966 #       set -e;
967         for name in $(LIB1FUNCS); \
968         do \
969           echo $${name}; \
970           rm -f $${name}$(objext); \
971           $(OLDCC) -DIN_LIBGCC1 $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $(srcdir)/libgcc1.c; \
972           if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
973           mv libgcc1$(objext) $${name}$(objext); \
974           $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}$(objext); \
975           rm -f $${name}$(objext); \
976         done
977 # Some shells crash when a loop has no items.
978 # So make sure there is always at least one--`..'.
979 # Then ignore it.
980 # We don't use -e here because there are if statements
981 # that should not make the command give up when the if condition is false.
982 # Instead, we test for failure after each command where it matters.
983         for file in .. $(LIB1FUNCS_EXTRA); \
984         do \
985           if [ x$${file} != x.. ]; then \
986             name=`echo $${file} | sed -e 's/[.][cS]$$//' -e 's/[.]asm$$//'`; \
987             echo $${name}; \
988             if [ $${name}.asm = $${file} ]; then \
989               cp $${file} $${name}.s || exit 1; file=$${name}.s; \
990             else true; fi; \
991             $(OLDCC) -DIN_LIBGCC1 $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \
992             if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
993             $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}$(objext); \
994             if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
995             rm -f $${name}.s $${name}$(objext); \
996           else true; \
997           fi; \
998         done
999         -if $(RANLIB_TEST_FOR_TARGET) ; then \
1000           $(RANLIB_FOR_TARGET) tmplibgcc1.a; \
1001         else true; fi
1002         mv tmplibgcc1.a libgcc1.a
1003
1004 # Build libgcc1.a from assembler source.  LIB1ASMFUNCS is the list of
1005 # functions.  LIB1ASMSRC is the name of the source file in the config
1006 # subdirectory.
1007 libgcc1-asm.a: libgcc2.ready config.status $(srcdir)/config/$(LIB1ASMSRC)
1008         -rm -f tmplibgcc1.a libgcc1.S
1009         cp $(srcdir)/config/$(LIB1ASMSRC) libgcc1.S
1010 # Actually build it in tmplibgcc1.a, then rename at end,
1011 # so that libgcc1-asm.a itself remains nonexistent if compilation is aborted.
1012 # -e causes any failing command to make this rule fail.
1013 # -e doesn't work in certain shells, so we test $$? as well.
1014 # lynx has a broken ar, it always complains when the initial library is
1015 # empty, thus this command works only if we don't do -e
1016 # There is a trailing backslash (\) deleted from the following line.
1017 #       set -e;
1018         for name in $(LIB1ASMFUNCS); \
1019         do \
1020           echo $${name}; \
1021           $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} libgcc1.S; \
1022           if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1023           mv libgcc1$(objext) $${name}$(objext); \
1024           $(AR_CREATE_FOR_TARGET) tmplibgcc1.a $${name}$(objext); \
1025           rm -f $${name}$(objext); \
1026         done
1027         -rm -f libgcc1.S
1028         mv tmplibgcc1.a libgcc1-asm.a
1029
1030 # Generate assembly versions of the functions required for libgcc1.
1031 # You'll still need to massage the code by hand (possibly hacking
1032 # underscores and local labels) but this will get you started.
1033 libgcc1.S: libgcc1.c $(CONFIG_H) config.status
1034         -rm -f libgcc1.S
1035         touch libgcc1.S
1036         for name in $(LIB1FUNCS); \
1037         do \
1038           echo $${name}; \
1039           $(OLDCC) -DIN_LIBGCC1 $(CCLIBFLAGS) $(INCLUDES) -S -DL$${name} $(srcdir)/libgcc1.c; \
1040           if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1041           echo '#ifdef ' L$${name} >> libgcc1.S; \
1042           cat  libgcc1.s >> libgcc1.S; \
1043           echo '#endif /*' L$${name} '*/' >> libgcc1.S; \
1044           echo "" >> libgcc1.S; \
1045         done
1046
1047 # Compiling libgcc2.a requires making sure that cc1, etc. have been compiled.
1048 # But recompiling cc1 should not force recompilation of libgcc2.a.
1049 # If you want to force recompilation, delete libgcc2.a.
1050 libgcc2.ready: $(GCC_PASSES) stmp-int-hdrs $(STMP_FIXPROTO)
1051         -if [ -f libgcc2.ready ] ; then \
1052                 true; \
1053         else \
1054                 touch libgcc2.ready; \
1055         fi
1056
1057 LIB2ADD = $(srcdir)/frame.c $(LIB2FUNCS_EXTRA) $(LANG_LIB2FUNCS)
1058 libgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(FPBIT) $(DPBIT) $(LIB2ADD) \
1059    $(MACHMODE_H) longlong.h frame.h gbl-ctors.h config.status stmp-int-hdrs \
1060    tsystem.h
1061 # Actually build it in tmplibgcc2.a, then rename at end,
1062 # so that libgcc2.a itself remains nonexistent if compilation is aborted.
1063         -rm -f tmplibgcc2.a
1064 # -e causes any failing command to make this rule fail.
1065 # -e doesn't work in certain shells, so we test $$? as well.
1066 # lynx has a broken ar, it always complains when the initial library is
1067 # empty, thus this command works only if we don't do -e
1068 # There is a trailing backslash (\) deleted from the following line.
1069 #       set -e;
1070         for name in $(LIB2FUNCS); \
1071         do \
1072           echo $${name}; \
1073           $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
1074               $(MAYBE_USE_COLLECT2) $(srcdir)/libgcc2.c -o $${name}$(objext); \
1075           if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1076           $(AR_CREATE_FOR_TARGET) tmplibgcc2.a $${name}$(objext); \
1077           rm -f $${name}$(objext); \
1078         done
1079         for name in $(LIB2FUNCS_EH); \
1080         do \
1081           echo $${name}; \
1082           $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -fexceptions $(INCLUDES) -c \
1083               -DL$${name} $(srcdir)/libgcc2.c -o $${name}$(objext); \
1084           if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1085           $(AR_CREATE_FOR_TARGET) tmplibgcc2.a $${name}$(objext); \
1086           rm -f $${name}$(objext); \
1087         done
1088         if [ x$(FPBIT) != x ]; then \
1089           for name in $(FPBIT_FUNCS); \
1090           do \
1091             echo $${name}; \
1092             $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
1093                 -DFINE_GRAINED_LIBRARIES $(FPBIT) -o $${name}$(objext); \
1094             if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1095             $(AR_CREATE_FOR_TARGET) tmplibgcc2.a $${name}$(objext); \
1096             rm -f $${name}$(objext); \
1097           done; \
1098         else true; fi;
1099         if [ x$(DPBIT) != x ]; then \
1100           for name in $(DPBIT_FUNCS); \
1101           do \
1102             echo $${name}; \
1103             $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
1104                 -DFINE_GRAINED_LIBRARIES $(DPBIT) -o _dp$${name}$(objext); \
1105             if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1106             $(AR_CREATE_FOR_TARGET) tmplibgcc2.a _dp$${name}$(objext); \
1107             rm -f _dp$${name}$(objext); \
1108           done; \
1109         else true; fi;
1110 # Some shells crash when a loop has no items.
1111 # So make sure there is always at least one--`..'.
1112 # Then ignore it.
1113 # We don't use -e here because there are if statements
1114 # that should not make the command give up when the if condition is false.
1115 # Instead, we test for failure after each command where it matters.
1116         for file in $(LIB2ADD); do \
1117           name=`echo $${file} | sed -e 's/[.][cSo]$$//' -e 's/[.]asm$$//' -e 's/[.]txt$$//'`; \
1118           oname=` echo $${name} | sed -e 's,.*/,,'`; \
1119           if [ $${name}.txt = $${file} ]; then \
1120             for f in .. `cat $${file}`; do if [ x$${f} != x.. ]; then \
1121               $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
1122                 AR_FOR_TARGET="$(AR_FOR_TARGET)" \
1123                 AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
1124                 AR_EXTRACT_FOR_TARGET="$(AR_EXTRACT_FOR_TARGET)" \
1125                 AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" CC="$(CC)" \
1126                 CFLAGS="$(CFLAGS)" HOST_PREFIX="$(HOST_PREFIX)" \
1127                 HOST_PREFIX_1="$(HOST_PREFIX_1)" \
1128                 LANGUAGES="$(LANGUAGES)" \
1129                 LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" $${f}; \
1130               if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1131               $(AR_CREATE_FOR_TARGET) tmplibgcc2.a $${f}; \
1132               rm -f $${f}; \
1133             else true; \
1134             fi; done; \
1135           else \
1136             echo $${name}; \
1137             if [ $${name}.asm = $${file} ]; then \
1138               cp $${file} $${name}.s || exit 1; file=$${name}.s; \
1139             else true; fi; \
1140             $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
1141             if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1142             $(AR_CREATE_FOR_TARGET) tmplibgcc2.a $${oname}$(objext); \
1143             rm -f $${name}.s $${oname}$(objext); \
1144           fi; \
1145         done
1146         mv tmplibgcc2.a libgcc2.a
1147 # These lines were deleted from above the mv command
1148 # because ranlibing libgcc.a itself should suffice.
1149 #       -if [ x${HPUX_GAS} = x ] ; then \
1150 #         if $(RANLIB_TEST_FOR_TARGET) ; then \
1151 #           $(RANLIB_FOR_TARGET) tmplibgcc2.a;
1152 #         else true; fi; \
1153 #       else true; fi
1154
1155 # Combine the various libraries into a single library, libgcc.a.
1156 # $(LIBGCC1) is added after $(LIBGCC2) so that routines written in
1157 # assembler will be used in preference to the C versions.
1158 libgcc.a: $(LIBGCC1) $(LIBGCC2)
1159         -rm -rf tmplibgcc.a libgcc.a tmpcopy
1160         mkdir tmpcopy
1161         (cd tmpcopy; $(AR_EXTRACT_FOR_TARGET) ../$(LIBGCC2))
1162 # Some versions of ar (specifically the one in RISC/os 5.x), create an
1163 # unwritable table of contents file, and then print an error message when
1164 # the second ar command tries to overwrite this file.  To avoid the error
1165 # message from ar, we make sure all files are writable.
1166         -(cd tmpcopy; chmod +w * > /dev/null 2>&1)
1167         -if [ x$(LIBGCC1) != x ];                       \
1168         then (cd tmpcopy; $(AR_EXTRACT_FOR_TARGET) ../$(LIBGCC1));      \
1169         else true;                                      \
1170         fi
1171         (cd tmpcopy; $(AR_CREATE_FOR_TARGET) ../tmplibgcc.a *$(objext))
1172         rm -rf tmpcopy
1173         -if $(RANLIB_TEST_FOR_TARGET) ; then \
1174           $(RANLIB_FOR_TARGET) tmplibgcc.a; \
1175         else true; fi
1176 # Actually build it in tmplibgcc.a, then rename at end,
1177 # so that libgcc.a itself remains nonexistent if compilation is aborted.
1178         mv tmplibgcc.a libgcc.a
1179
1180 # Use the genmultilib shell script to generate the information the gcc
1181 # driver program needs to select the library directory based on the
1182 # switches.
1183 multilib.h: s-mlib; @true
1184 s-mlib: $(srcdir)/genmultilib Makefile
1185         $(SHELL) $(srcdir)/genmultilib \
1186           "$(MULTILIB_OPTIONS)" \
1187           "$(MULTILIB_DIRNAMES)" \
1188           "$(MULTILIB_MATCHES)" \
1189           "$(MULTILIB_EXCEPTIONS)" \
1190           "$(MULTILIB_EXTRA_OPTS)" \
1191           "$(MULTILIB_EXCLUSIONS)" > tmp-mlib.h
1192         $(SHELL) $(srcdir)/move-if-change tmp-mlib.h multilib.h
1193         touch s-mlib
1194
1195 # Build multiple copies of libgcc.a, one for each target switch.
1196 stmp-multilib: $(LIBGCC1) libgcc2.c libgcc2.ready $(CONFIG_H) \
1197    frame.h tsystem.h \
1198    $(LIB2ADD) $(MACHMODE_H) longlong.h gbl-ctors.h config.status
1199         for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
1200           dir=`echo $$i | sed -e 's/;.*$$//'`; \
1201           flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
1202           $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
1203             AR_FOR_TARGET="$(AR_FOR_TARGET)" \
1204             AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
1205             AR_EXTRACT_FOR_TARGET="$(AR_EXTRACT_FOR_TARGET)" \
1206             AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
1207             CC="$(CC)" CFLAGS="$(CFLAGS)" \
1208             RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \
1209             RANLIB_TEST_FOR_TARGET="$(RANLIB_TEST_FOR_TARGET)" \
1210             LANGUAGES="$(LANGUAGES)" \
1211             HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
1212             LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS) $${flags}" \
1213             MULTILIB_CFLAGS="$${flags}" \
1214             LIBGCC1="$(LIBGCC1)" LIBGCC2="$(LIBGCC2)" \
1215             dir="$${dir}" stmp-multilib-sub; \
1216           if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1217         done
1218         touch stmp-multilib
1219
1220 # Subroutine of stmp-multilib so make -n works.
1221 stmp-multilib-sub:
1222         rm -f $(LIBGCC2)
1223         if [ -d $(dir) ]; then \
1224           cd $(dir); \
1225           rm -f libgcc.a $(EXTRA_MULTILIB_PARTS); \
1226         else true; \
1227         fi
1228         $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
1229           AR_FOR_TARGET="$(AR_FOR_TARGET)" \
1230           AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
1231           AR_EXTRACT_FOR_TARGET="$(AR_EXTRACT_FOR_TARGET)" \
1232           AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
1233           CC="$(CC)" CFLAGS="$(CFLAGS)" \
1234           HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
1235           LANGUAGES="$(LANGUAGES)" \
1236           LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" $(LIBGCC2)
1237         if [ x$(LIBGCC1) != xlibgcc1-asm.a ]; \
1238         then true; \
1239         else rm -f $(LIBGCC1); \
1240         fi
1241         if [ x$(LIBGCC1) != xlibgcc1-asm.a ]; \
1242         then true; \
1243         else \
1244           $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
1245             AR_FOR_TARGET="$(AR_FOR_TARGET)" \
1246             AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
1247             AR_EXTRACT_FOR_TARGET="$(AR_EXTRACT_FOR_TARGET)" \
1248             AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
1249             CC="$(CC)" CFLAGS="$(CFLAGS)" \
1250             HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
1251             LANGUAGES="$(LANGUAGES)" \
1252             LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" $(LIBGCC1); \
1253         fi
1254         rm -rf tmplibgcc.a tmpcopy
1255         mkdir tmpcopy
1256         (cd tmpcopy; $(AR_EXTRACT_FOR_TARGET) ../$(LIBGCC2))
1257 # Some versions of ar (specifically the one in RISC/os 5.x), create an
1258 # unwritable table of contents file, and then print an error message when
1259 # the second ar command tries to overwrite this file.  To avoid the error
1260 # message from ar, we make sure all files are writable.
1261         -(cd tmpcopy; chmod +w * > /dev/null 2>&1)
1262         if [ x$(LIBGCC1) != x ]; \
1263         then (cd tmpcopy; $(AR_EXTRACT_FOR_TARGET) ../$(LIBGCC1)); \
1264         else true; \
1265         fi
1266         (cd tmpcopy; $(AR_CREATE_FOR_TARGET) ../tmplibgcc.a *$(objext))
1267         rm -rf libgcc2.a tmpcopy
1268         if $(RANLIB_TEST_FOR_TARGET) ; then \
1269           $(RANLIB_FOR_TARGET) tmplibgcc.a; \
1270         else true; fi
1271         if [ -d $(dir) ]; then true; else mkdir $(dir); fi
1272         mv tmplibgcc.a $(dir)/libgcc.a
1273         for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
1274           $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
1275             AR_FOR_TARGET="$(AR_FOR_TARGET)" \
1276             AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
1277             AR_EXTRACT_FOR_TARGET="$(AR_EXTRACT_FOR_TARGET)" \
1278             AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
1279             CC="$(CC)" CFLAGS="$(CFLAGS)" \
1280             HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
1281             LANGUAGES="$(LANGUAGES)" \
1282             MULTILIB_CFLAGS="$(MULTILIB_CFLAGS)" T="t" t$${f}; \
1283           mv t$${f} $(dir)/$${f}; \
1284         else true; \
1285         fi; done
1286
1287 # Compile two additional files that are linked with every program
1288 # linked using GCC on systems using COFF or ELF, for the sake of C++
1289 # constructors.
1290 $(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
1291   defaults.h frame.h gbl-ctors.h stmp-int-hdrs tsystem.h
1292         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
1293           -finhibit-size-directive -fno-inline-functions \
1294           -fno-exceptions $(CRTSTUFF_T_CFLAGS) @inhibit_libc@ \
1295           -c $(srcdir)/crtstuff.c -DCRT_BEGIN -o $(T)crtbegin$(objext)
1296
1297 $(T)crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
1298   defaults.h frame.h gbl-ctors.h stmp-int-hdrs tsystem.h
1299         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
1300           -finhibit-size-directive -fno-inline-functions \
1301           -fno-exceptions $(CRTSTUFF_T_CFLAGS) @inhibit_libc@ \
1302           -c $(srcdir)/crtstuff.c -DCRT_END -o $(T)crtend$(objext)
1303
1304 # On some systems we also want to install versions of these files
1305 # compiled using PIC for use in shared libraries.
1306 $(T)crtbeginS.o $(T)crtendS.o: s-$(T)crtS ; @true
1307
1308 s-$(T)crtS: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
1309   defaults.h frame.h gbl-ctors.h stmp-int-hdrs tsystem.h
1310         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
1311           -DCRT_BEGIN -DCRTSTUFFS_O -finhibit-size-directive \
1312           -fno-inline-functions -fno-exceptions @inhibit_libc@ -g0 \
1313           -c $(srcdir)/crtstuff.c -o $(T)crtbeginS$(objext)
1314         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
1315           -DCRT_END -DCRTSTUFFS_O -finhibit-size-directive \
1316           -fno-inline-functions -fno-exceptions @inhibit_libc@ -g0 \
1317           -c $(srcdir)/crtstuff.c -o $(T)crtendS$(objext)
1318         touch s-$(T)crtS
1319
1320 # Compile the start modules crt0.o and mcrt0.o that are linked with every program
1321 crt0.o: s-crt0 ; @true
1322 mcrt0.o: s-crt0; @true
1323
1324 s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
1325         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
1326           -o crt0.o -c $(CRT0_S)
1327         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
1328           -o mcrt0.o -c $(MCRT0_S)
1329         touch s-crt0
1330 #\f
1331 # Compiling object files from source files.
1332
1333 # Note that dependencies on obstack.h are not written
1334 # because that file is not part of GCC.
1335
1336 # C language specific files.
1337
1338 c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h ggc.h \
1339     $(srcdir)/c-parse.h c-tree.h c-common.h input.h flags.h system.h toplev.h
1340         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
1341 $(srcdir)/c-parse.h: $(srcdir)/c-parse.c
1342 $(srcdir)/c-parse.c: $(srcdir)/c-parse.y
1343         cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o c-parse.c c-parse.y
1344 $(srcdir)/c-parse.y: c-parse.in
1345         echo '/*WARNING: This file is automatically generated!*/' >tmp-c-parse.y
1346         sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
1347           -e "/^ifc$$/d" -e "/^end ifc$$/d" \
1348           $(srcdir)/c-parse.in >>tmp-c-parse.y
1349         $(SHELL) $(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y
1350
1351 $(srcdir)/c-gperf.h: c-parse.gperf
1352         gperf -L C -F ', 0, 0' -p -j1 -i 1 -g -o -t -G -N is_reserved_word \
1353            -k1,3,$$ $(srcdir)/c-parse.gperf >tmp-gperf.h || ( \
1354         echo "See " $(website)/cvs.html#generated_files >&2 ; \
1355         exit 1 )
1356          $(SHELL) $(srcdir)/move-if-change tmp-gperf.h $(srcdir)/c-gperf.h
1357
1358 c-decl.o : c-decl.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-common.h ggc.h \
1359     c-lex.h flags.h function.h output.h toplev.h defaults.h
1360 c-typeck.o : c-typeck.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-common.h \
1361     flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h
1362 c-lang.o : c-lang.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-common.h ggc.h \
1363     c-lex.h toplev.h output.h function.h
1364 c-lex.o : c-lex.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-lex.h c-tree.h \
1365     c-common.h $(srcdir)/c-parse.h $(srcdir)/c-gperf.h c-pragma.h input.h \
1366     intl.h flags.h toplev.h output.h mbchar.h ggc.h
1367 c-aux-info.o : c-aux-info.c  $(CONFIG_H) system.h $(TREE_H) c-tree.h \
1368     c-common.h flags.h toplev.h
1369 c-convert.o : c-convert.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h
1370 c-pragma.o: c-pragma.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) function.h \
1371     defaults.h c-pragma.h toplev.h ggc.h
1372 c-iterate.o: c-iterate.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-tree.h \
1373     c-common.h flags.h toplev.h $(EXPR_H)
1374 mbchar.o: mbchar.c $(CONFIG_H) system.h mbchar.h
1375 graph.o: graph.c $(CONFIG_H) system.h toplev.h flags.h output.h $(RTL_H) \
1376     function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h
1377 sbitmap.o: sbitmap.c $(CONFIG_H) system.h $(RTL_H) flags.h $(BASIC_BLOCK_H)
1378
1379 COLLECT2_OBJS = collect2.o tlink.o hash.o intl.o underscore.o version.o
1380 collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS)
1381 # Don't try modifying collect2 (aka ld) in place--it might be linking this.
1382         -rm -f collect2$(exeext)
1383         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(COLLECT2_OBJS) $(LIBS)
1384
1385 collect2.o : collect2.c $(CONFIG_H) system.h gstab.h intl.h \
1386         $(srcdir)/../include/obstack.h $(DEMANGLE_H) collect2.h version.h
1387         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES)  \
1388         -DTARGET_MACHINE=\"$(target_alias)\" $(MAYBE_USE_COLLECT2) \
1389         -c `echo $(srcdir)/collect2.c | sed 's,^\./,,'`
1390
1391 tlink.o: tlink.c $(DEMANGLE_H) hash.h $(CONFIG_H) system.h collect2.h
1392 hash.o: hash.c hash.h system.h toplev.h
1393
1394 vfprintf.o: $(srcdir)/../libiberty/vfprintf.c $(CONFIG_H) system.h
1395         rm -f vfprintf.c
1396         $(LN_S) $(srcdir)/../libiberty/vfprintf.c vfprintf.c
1397         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) vfprintf.c
1398
1399 splay-tree.o: $(srcdir)/../libiberty/splay-tree.c \
1400   $(srcdir)/../include/splay-tree.h $(srcdir)/../include/libiberty.h
1401         rm -f splay-tree.c
1402         $(LN_S) $(srcdir)/../libiberty/splay-tree.c splay-tree.c
1403         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) splay-tree.c
1404
1405 underscore.c: s-under ; @true
1406
1407 s-under: $(GCC_PASSES)
1408         echo "int xxy_us_dummy;" >tmp-dum.c
1409         $(GCC_FOR_TARGET) -S tmp-dum.c
1410         echo '/*WARNING: This file is automatically generated!*/' >tmp-under.c
1411         if grep _xxy_us_dummy tmp-dum.s > /dev/null ; then \
1412           echo "int prepends_underscore = 1;" >>tmp-under.c; \
1413         else \
1414           echo "int prepends_underscore = 0;" >>tmp-under.c; \
1415         fi
1416         $(SHELL) $(srcdir)/move-if-change tmp-under.c underscore.c
1417         -rm -f tmp-dum.c tmp-dum.s
1418         touch s-under
1419
1420 # A file used by all variants of C.
1421
1422 c-common.o : c-common.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h \
1423         c-common.h flags.h toplev.h output.h c-pragma.h $(RTL_H) ggc.h \
1424         $(EXPR_H)
1425
1426 # Language-independent files.
1427
1428 DRIVER_DEFINES = \
1429   -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
1430   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
1431   -DDEFAULT_TARGET_VERSION=\"$(version)\" \
1432   -DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \
1433   -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
1434   -DTOOLDIR_BASE_PREFIX=\"$(unlibsubdir)/../\"
1435 gcc.o: gcc.c $(CONFIG_H) system.h intl.h multilib.h \
1436     Makefile $(lang_specs_files) prefix.h $(GCC_H)
1437         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1438   $(DRIVER_DEFINES) \
1439   -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
1440
1441 gccspec.o: gccspec.c $(CONFIG_H) system.h $(GCC_H)
1442 cppspec.o: cppspec.c $(CONFIG_H) system.h $(GCC_H)
1443
1444 tree-check.h: s-check ; @true
1445 s-check : gencheck $(srcdir)/move-if-change
1446         ./gencheck > tmp-check.h
1447         $(SHELL) $(srcdir)/move-if-change tmp-check.h tree-check.h
1448         touch s-check
1449
1450 gencheck : gencheck.o $(HOST_LIBDEPS)
1451         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1452          gencheck.o $(HOST_LIBS)
1453
1454 gencheck.o : gencheck.c gencheck.h tree.def $(CONFIG_H) hconfig.h system.h \
1455              $(lang_tree_files) 
1456         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1457           $(srcdir)/gencheck.c
1458
1459 dumpvers: dumpvers.c
1460
1461 version.o: version.c version.h
1462
1463 ggc-common.o: ggc-common.c $(CONFIG_H) $(RTL_H) $(TREE_H) \
1464         flags.h ggc.h varray.h hash.h
1465
1466 ggc-simple.o: ggc-simple.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
1467         ggc.h varray.h
1468
1469 ggc-page.o: ggc-page.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
1470         ggc.h varray.h
1471
1472 ggc-none.o: ggc-none.c $(CONFIG_H) $(RTL_H) ggc.h
1473
1474 ggc-callbacks.o: ggc-callbacks.c $(CONFIG_H) $(RTL_H) $(TREE_H) ggc.h
1475
1476 obstack.o: $(srcdir)/../libiberty/obstack.c $(CONFIG_H)
1477         rm -f obstack.c
1478         $(LN_S) $(srcdir)/../libiberty/obstack.c obstack.c
1479         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) obstack.c
1480
1481 prefix.o: prefix.c $(CONFIG_H) system.h Makefile prefix.h
1482         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1483         -DPREFIX=\"$(prefix)\" \
1484           -c `echo $(srcdir)/prefix.c | sed 's,^\./,,'`
1485
1486 convert.o: convert.c $(CONFIG_H) system.h $(TREE_H) flags.h convert.h toplev.h
1487
1488 tree.o : tree.c $(CONFIG_H) system.h $(TREE_H) flags.h function.h toplev.h \
1489    ggc.h $(HASHTAB_H)
1490 print-tree.o : print-tree.c $(CONFIG_H) system.h $(TREE_H) ggc.h
1491 stor-layout.o : stor-layout.c $(CONFIG_H) system.h $(TREE_H) flags.h \
1492    function.h $(EXPR_H) $(RTL_H) toplev.h ggc.h
1493 fold-const.o : fold-const.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h \
1494    $(RTL_H) ggc.h
1495 diagnostic.o : $(CONFIG_H) system.h $(TREE_H) $(RTL_H) tm_p.h flags.h \
1496    input.h insn-attr.h insn-codes.h insn-config.h toplev.h intl.h 
1497 toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) function.h \
1498    flags.h input.h insn-attr.h xcoffout.h defaults.h output.h \
1499    insn-codes.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h dwarfout.h \
1500    dwarf2out.h sdbout.h dbxout.h $(EXPR_H) $(BASIC_BLOCK_H) graph.h loop.h \
1501    except.h regs.h $(lang_options_files)
1502         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(MAYBE_USE_COLLECT2) \
1503           -DTARGET_NAME=\"$(target_alias)\" \
1504           -c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
1505
1506 rtl.o : rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h ggc.h toplev.h
1507
1508 print-rtl.o : print-rtl.c $(CONFIG_H) system.h $(RTL_H) $(BASIC_BLOCK_H)
1509 rtlanal.o : rtlanal.c $(CONFIG_H) system.h $(RTL_H)
1510 errors.o : errors.c $(CONFIG_H) system.h errors.h
1511
1512 varasm.o : varasm.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h \
1513    function.h defaults.h $(EXPR_H) hard-reg-set.h $(REGS_H) \
1514    xcoffout.h output.h c-pragma.h toplev.h dbxout.h sdbout.h ggc.h
1515 function.o : function.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1516    function.h insn-flags.h insn-codes.h $(EXPR_H) $(REGS_H) hard-reg-set.h \
1517    insn-config.h $(RECOG_H) output.h toplev.h except.h hash.h ggc.h
1518 stmt.o : stmt.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h  \
1519    insn-flags.h insn-config.h insn-codes.h hard-reg-set.h $(EXPR_H) except.h \
1520    $(LOOP_H) $(RECOG_H) toplev.h output.h varray.h ggc.h
1521 except.o : except.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1522    function.h insn-flags.h $(EXPR_H) $(REGS_H) hard-reg-set.h \
1523    insn-config.h $(RECOG_H) output.h except.h toplev.h intl.h ggc.h
1524 expr.o : expr.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h \
1525    $(REGS_H) insn-flags.h insn-codes.h $(EXPR_H) insn-config.h $(RECOG_H) \
1526    output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h except.h \
1527    ggc.h intl.h
1528 builtins.o : builtins.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1529    function.h $(REGS_H) insn-flags.h insn-codes.h $(EXPR_H) insn-config.h \
1530    $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
1531    except.h
1532 calls.o : calls.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h $(EXPR_H) \
1533    insn-flags.h $(REGS_H) toplev.h output.h function.h
1534 expmed.o : expmed.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h  \
1535    insn-flags.h insn-config.h insn-codes.h $(EXPR_H) $(RECOG_H) real.h toplev.h
1536 explow.o : explow.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1537    hard-reg-set.h insn-config.h $(EXPR_H) $(RECOG_H) insn-flags.h \
1538    insn-codes.h toplev.h function.h
1539 optabs.o : optabs.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h  \
1540    insn-flags.h insn-config.h insn-codes.h $(EXPR_H) $(RECOG_H) reload.h \
1541    toplev.h ggc.h real.h
1542 dbxout.o : dbxout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h $(REGS_H) \
1543    insn-config.h reload.h gstab.h xcoffout.h defaults.h output.h dbxout.h \
1544    toplev.h
1545 sdbout.o : sdbout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h except.h \
1546    function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) defaults.h real.h \
1547    insn-config.h $(srcdir)/../include/obstack.h xcoffout.h c-pragma.h \
1548    sdbout.h toplev.h
1549 dwarfout.o : dwarfout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf.h \
1550    flags.h insn-config.h reload.h output.h defaults.h toplev.h dwarfout.h
1551 dwarf2out.o : dwarf2out.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf2.h \
1552    flags.h insn-config.h reload.h output.h defaults.h \
1553    hard-reg-set.h $(REGS_H) $(EXPR_H) toplev.h dwarf2out.h varray.h \
1554    ggc.h except.h
1555 xcoffout.o : xcoffout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) xcoffout.h \
1556    flags.h toplev.h output.h dbxout.h ggc.h
1557 emit-rtl.o : emit-rtl.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1558    function.h $(REGS_H) insn-config.h $(RECOG_H) real.h ggc.h \
1559    $(EXPR_H) $(srcdir)/../include/obstack.h hard-reg-set.h bitmap.h toplev.h \
1560    $(HASHTAB_H)
1561 real.o : real.c $(CONFIG_H) system.h $(TREE_H) toplev.h
1562 integrate.o : integrate.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1563    $(INTEGRATE_H) insn-flags.h insn-config.h $(EXPR_H) real.h $(REGS_H) \
1564    intl.h function.h output.h $(RECOG_H) except.h toplev.h $(LOOP_H)
1565 jump.o : jump.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \
1566    insn-config.h insn-flags.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
1567    toplev.h insn-attr.h
1568
1569 simplify-rtx.o : simplify-rtx.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) \
1570    hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
1571    output.h function.h cselib.h ggc.h $(srcdir)/../include/obstack.h
1572 cse.o : cse.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
1573    real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h output.h function.h ggc.h
1574 gcse.o : gcse.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h \
1575    flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) \
1576    function.h output.h toplev.h
1577 sibcall.o : sibcall.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) function.h \
1578    hard-reg-set.h flags.h insn-config.h $(RECOG_H) $(BASIC_BLOCK_H)
1579 resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h system.h \
1580    $(BASIC_BLOCK_H) $(REGS_H) flags.h output.h resource.h function.h toplev.h \
1581    insn-attr.h
1582 lcm.o : lcm.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
1583    real.h insn-config.h insn-attr.h $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H)
1584 ssa.o : ssa.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) $(BASIC_BLOCK_H) \
1585    output.h insn-config.h
1586 profile.o : profile.c $(CONFIG_H) system.h $(RTL_H) flags.h insn-flags.h \
1587    gcov-io.h $(TREE_H) output.h $(REGS_H) toplev.h function.h insn-config.h \
1588    ggc.h
1589 loop.o : loop.c $(CONFIG_H) system.h $(RTL_H) flags.h $(LOOP_H) insn-config.h \
1590    insn-flags.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) real.h \
1591    $(BASIC_BLOCK_H) function.h toplev.h varray.h except.h cselib.h
1592 unroll.o : unroll.c $(CONFIG_H) system.h $(RTL_H) insn-config.h function.h \
1593    $(INTEGRATE_H) $(REGS_H) $(RECOG_H) flags.h $(EXPR_H) $(LOOP_H) toplev.h \
1594    varray.h 
1595 flow.o : flow.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h insn-config.h \
1596    $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
1597    insn-flags.h function.h except.h $(EXPR_H)
1598 combine.o : combine.c $(CONFIG_H) system.h $(RTL_H) flags.h function.h \
1599    insn-config.h insn-flags.h insn-codes.h insn-attr.h $(REGS_H) $(EXPR_H) \
1600    $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h
1601 regclass.o : regclass.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h flags.h \
1602    $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h real.h \
1603    toplev.h function.h output.h ggc.h
1604 local-alloc.o : local-alloc.c $(CONFIG_H) system.h $(RTL_H) flags.h \
1605    $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
1606    output.h function.h insn-attr.h toplev.h
1607 bitmap.o : bitmap.c $(CONFIG_H) system.h $(RTL_H) flags.h $(BASIC_BLOCK_H) \
1608    $(REGS_H)
1609 global.o : global.c $(CONFIG_H) system.h $(RTL_H) flags.h reload.h function.h \
1610    $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h toplev.h
1611 varray.o : varray.c $(CONFIG_H) system.h varray.h $(RTL_H) $(TREE_H) bitmap.h
1612 reload.o : reload.c $(CONFIG_H) system.h $(RTL_H) flags.h output.h $(EXPR_H) \
1613    reload.h $(RECOG_H) hard-reg-set.h insn-config.h insn-codes.h $(REGS_H) \
1614    function.h real.h toplev.h
1615 reload1.o : reload1.c $(CONFIG_H) system.h $(RTL_H) real.h flags.h $(EXPR_H) \
1616    reload.h $(REGS_H) hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \
1617    $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.h
1618 caller-save.o : caller-save.c $(CONFIG_H) system.h $(RTL_H) flags.h \
1619    $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \
1620    $(RECOG_H) reload.h $(EXPR_H) toplev.h
1621 reorg.o : reorg.c $(CONFIG_H) system.h $(RTL_H) conditions.h hard-reg-set.h \
1622    $(BASIC_BLOCK_H) $(REGS_H) insn-config.h insn-attr.h insn-flags.h \
1623    $(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h
1624 alias.o : alias.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h \
1625    $(REGS_H) toplev.h output.h $(EXPR_H) insn-flags.h ggc.h function.h \
1626    cselib.h
1627 regmove.o : regmove.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
1628    $(RECOG_H) output.h reload.h $(REGS_H) hard-reg-set.h flags.h function.h \
1629    $(EXPR_H) insn-flags.h $(BASIC_BLOCK_H) toplev.h
1630 haifa-sched.o : haifa-sched.c $(CONFIG_H) system.h $(RTL_H) \
1631    $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
1632    insn-attr.h toplev.h $(RECOG_H) except.h
1633 final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h intl.h \
1634    $(REGS_H) $(RECOG_H) conditions.h insn-config.h insn-attr.h function.h \
1635    real.h output.h hard-reg-set.h insn-flags.h insn-codes.h gstab.h except.h \
1636    xcoffout.h defaults.h toplev.h reload.h dwarfout.h dwarf2out.h sdbout.h \
1637    dbxout.h
1638 recog.o : recog.c $(CONFIG_H) system.h $(RTL_H) function.h $(BASIC_BLOCK_H) \
1639    $(REGS_H) $(RECOG_H) hard-reg-set.h flags.h insn-config.h insn-attr.h \
1640    insn-flags.h insn-codes.h real.h toplev.h output.h resource.h 
1641 reg-stack.o : reg-stack.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) $(RECOG_H) \
1642    $(REGS_H) hard-reg-set.h flags.h insn-config.h insn-flags.h toplev.h \
1643    varray.h function.h
1644 dyn-string.o: dyn-string.c dyn-string.h $(CONFIG_H) system.h
1645 predict.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) insn-flags.h function.h except.h $(EXPR_H)
1648 lists.o: lists.c $(CONFIG_H) system.h toplev.h $(RTL_H) ggc.h
1649 bb-reorder.o : bb-reorder.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1650    insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
1651    $(RECOG_H) insn-flags.h function.h except.h $(EXPR_H)
1652
1653 $(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) ggc.h \
1654    $(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \
1655    insn-flags.h output.h insn-attr.h insn-codes.h system.h toplev.h function.h
1656         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(out_file)
1657
1658 # Build auxiliary files that support ecoff format.
1659 mips-tfile: mips-tfile.o version.o $(LIBDEPS)
1660         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
1661
1662 mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) system.h version.h
1663
1664 mips-tdump: mips-tdump.o version.o $(LIBDEPS)
1665         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS)
1666
1667 mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) system.h
1668
1669 # Build file to support OSF/rose half-pic format.
1670 halfpic.o: halfpic.c $(CONFIG_H) $(RTL_H) $(TREE_H) system.h
1671
1672 # Normally this target is not used; but it is used if you
1673 # define ALLOCA=alloca.o.  In that case, you must get a suitable alloca.c
1674 # from the GNU Emacs distribution.
1675 alloca.o:       $(srcdir)/../libiberty/alloca.c
1676         rm -f alloca.c
1677         $(LN_S) $(srcdir)/../libiberty/alloca.c alloca.c
1678         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ALLOCA_FLAGS) \
1679           -c `echo alloca.c | sed 's,^\./,,'`
1680         $(ALLOCA_FINISH)
1681 #\f
1682 # Generate header and source files from the machine description,
1683 # and compile them.
1684
1685 .PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
1686   insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
1687   insn-attr.h insn-attrtab.c
1688
1689 # The following pair of rules has this effect:
1690 # genconfig is run only if the md has changed since genconfig was last run;
1691 # but the file insn-config.h is touched only when its contents actually change.
1692
1693 # Each of the other insn-* files is handled by a similar pair of rules.
1694
1695 # This causes an anomaly in the results of make -n
1696 # because insn-* is older than s-*
1697 # and thus make -n thinks that insn-* will be updated
1698 # and force recompilation of things that depend on it.
1699 # We use move-if-change precisely to avoid such recompilation.
1700 # But there is no way to teach make -n that it will be avoided.
1701
1702 # Each of the insn-*.[ch] rules has a semicolon at the end,
1703 # for otherwise the system Make on SunOS 4.1 never tries
1704 # to recompile insn-*.o.  To avoid problems and extra noise from
1705 # versions of make which don't like empty commands (nothing after the
1706 # trailing `;'), we call true for each.
1707
1708 insn-config.h: s-config ; @true
1709 s-config : $(md_file) genconfig $(srcdir)/move-if-change
1710         ./genconfig $(md_file) > tmp-config.h
1711         $(SHELL) $(srcdir)/move-if-change tmp-config.h insn-config.h
1712         touch s-config
1713
1714 insn-flags.h: s-flags ; @true
1715 s-flags : $(md_file) genflags $(srcdir)/move-if-change
1716         ./genflags $(md_file) > tmp-flags.h
1717         $(SHELL) $(srcdir)/move-if-change tmp-flags.h insn-flags.h
1718         touch s-flags
1719
1720 insn-codes.h: s-codes ; @true
1721 s-codes : $(md_file) gencodes $(srcdir)/move-if-change
1722         ./gencodes $(md_file) > tmp-codes.h
1723         $(SHELL) $(srcdir)/move-if-change tmp-codes.h insn-codes.h
1724         touch s-codes
1725
1726 insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) $(EXPR_H) real.h output.h \
1727   insn-config.h insn-flags.h insn-codes.h system.h reload.h $(RECOG_H) \
1728   function.h flags.h hard-reg-set.h resource.h
1729         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
1730
1731 insn-emit.c: s-emit ; @true
1732 s-emit : $(md_file) genemit $(srcdir)/move-if-change
1733         ./genemit $(md_file) > tmp-emit.c
1734         $(SHELL) $(srcdir)/move-if-change tmp-emit.c insn-emit.c
1735         touch s-emit
1736
1737 insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h $(RECOG_H) \
1738   real.h output.h flags.h system.h function.h hard-reg-set.h resource.h
1739         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c
1740
1741 insn-recog.c: s-recog ; @true
1742 s-recog : $(md_file) genrecog $(srcdir)/move-if-change
1743         ./genrecog $(md_file) > tmp-recog.c
1744         $(SHELL) $(srcdir)/move-if-change tmp-recog.c insn-recog.c
1745         touch s-recog
1746
1747 insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) insn-codes.h insn-flags.h \
1748   insn-config.h flags.h $(RECOG_H) $(EXPR_H) reload.h system.h
1749         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c
1750
1751 insn-opinit.c: s-opinit ; @true
1752 s-opinit : $(md_file) genopinit $(srcdir)/move-if-change
1753         ./genopinit $(md_file) > tmp-opinit.c
1754         $(SHELL) $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c
1755         touch s-opinit
1756
1757 insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H) system.h toplev.h \
1758   insn-config.h $(RECOG_H)
1759         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c
1760
1761 insn-extract.c: s-extract ; @true
1762 s-extract : $(md_file) genextract $(srcdir)/move-if-change
1763         ./genextract $(md_file) > tmp-extract.c
1764         $(SHELL) $(srcdir)/move-if-change tmp-extract.c insn-extract.c
1765         touch s-extract
1766
1767 insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) $(REGS_H) output.h real.h \
1768         system.h insn-config.h $(RECOG_H) except.h function.h
1769         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c
1770
1771 insn-peep.c: s-peep ; @true
1772 s-peep : $(md_file) genpeep $(srcdir)/move-if-change
1773         ./genpeep $(md_file) > tmp-peep.c
1774         $(SHELL) $(srcdir)/move-if-change tmp-peep.c insn-peep.c
1775         touch s-peep
1776
1777 insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) $(REGS_H) real.h \
1778     output.h insn-attr.h insn-config.h system.h toplev.h $(RECOG_H)
1779         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c
1780
1781 insn-attr.h: s-attr ; @true
1782 s-attr : $(md_file) genattr $(srcdir)/move-if-change
1783         ./genattr $(md_file) > tmp-attr.h
1784         $(SHELL) $(srcdir)/move-if-change tmp-attr.h insn-attr.h
1785         touch s-attr
1786
1787 insn-attrtab.c: s-attrtab ; @true
1788 s-attrtab : $(md_file) genattrtab $(srcdir)/move-if-change
1789         ./genattrtab $(md_file) > tmp-attrtab.c
1790         $(SHELL) $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
1791         touch s-attrtab
1792
1793 insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) ggc.h $(REGS_H) real.h \
1794     conditions.h hard-reg-set.h insn-config.h insn-flags.h insn-attr.h \
1795     output.h $(RECOG_H) function.h insn-codes.h system.h toplev.h flags.h
1796         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
1797
1798 insn-output.c: s-output ; @true
1799 s-output : $(md_file) genoutput $(srcdir)/move-if-change
1800         ./genoutput $(md_file) > tmp-output.c
1801         $(SHELL) $(srcdir)/move-if-change tmp-output.c insn-output.c
1802         touch s-output
1803
1804 genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H) system.h ggc.h
1805 genrtl.c genrtl.h : s-genrtl
1806         @true   # force gnu make to recheck modification times.
1807
1808 s-genrtl: gengenrtl $(srcdir)/move-if-change $(RTL_BASE_H)
1809         ./gengenrtl -h >tmp-genrtl.h
1810         $(SHELL) $(srcdir)/move-if-change tmp-genrtl.h genrtl.h
1811         ./gengenrtl >tmp-genrtl.c
1812         $(SHELL) $(srcdir)/move-if-change tmp-genrtl.c genrtl.c
1813         touch s-genrtl
1814 #\f
1815 # Compile the programs that generate insn-* from the machine description.
1816 # They are compiled with $(HOST_CC), and associated libraries,
1817 # since they need to run on this machine
1818 # even if GCC is being compiled to run on some other machine.
1819
1820 # $(CONFIG_H) is omitted from the deps of the gen*.o
1821 # because these programs don't really depend on anything
1822 # about the target machine.  They do depend on config.h itself,
1823 # since that describes the host machine.
1824
1825 # Pass the md file through cpp if the target requests it.
1826 $(MD_FILE): $(MD_DEPS)
1827         rm -f $@
1828         $(MD_CPP) $(MD_CPPFLAGS) $(md_file) | sed 's/^# /; /g' > tmp-$@
1829         mv tmp-$@ $@
1830
1831 genconfig : genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1832         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1833           genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
1834
1835 genconfig.o : genconfig.c $(RTL_H) $(build_xm_file) system.h errors.h
1836         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
1837
1838 genflags : genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1839         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1840          genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
1841
1842 genflags.o : genflags.c $(RTL_H) $(build_xm_file) system.h errors.h
1843         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
1844
1845 gencodes : gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1846         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1847          gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
1848
1849 gencodes.o : gencodes.c $(RTL_H) $(build_xm_file) system.h errors.h
1850         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
1851
1852 genemit : genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1853         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1854          genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
1855
1856 genemit.o : genemit.c $(RTL_H) $(build_xm_file) system.h errors.h
1857         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
1858
1859 genopinit : genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1860         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1861          genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
1862
1863 genopinit.o : genopinit.c $(RTL_H) $(build_xm_file) system.h errors.h
1864         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c
1865
1866 genrecog : genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1867         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1868          genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
1869
1870 genrecog.o : genrecog.c $(RTL_H) $(build_xm_file) system.h errors.h
1871         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
1872
1873 genextract : genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1874         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1875          genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
1876
1877 genextract.o : genextract.c $(RTL_H) $(build_xm_file) system.h insn-config.h errors.h
1878         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
1879
1880 genpeep : genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1881         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1882          genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
1883
1884 genpeep.o : genpeep.c $(RTL_H) $(build_xm_file) system.h errors.h
1885         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
1886
1887 genattr : genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1888         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1889          genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
1890
1891 genattr.o : genattr.c $(RTL_H) $(build_xm_file) system.h errors.h
1892         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
1893
1894 genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1895         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1896          genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
1897
1898 genattrtab.o : genattrtab.c $(RTL_H)  $(build_xm_file) system.h errors.h ggc.h
1899         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
1900
1901 genoutput : genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
1902         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1903          genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
1904
1905 genoutput.o : genoutput.c $(RTL_H) $(build_xm_file) system.h errors.h
1906         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
1907
1908 gengenrtl : gengenrtl.o $(HOST_LIBDEPS)
1909         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1910          gengenrtl.o $(HOST_LIBS)
1911
1912 gengenrtl.o : gengenrtl.c $(RTL_BASE_H) system.h real.h
1913         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gengenrtl.c
1914 #\f
1915 # Compile the libraries to be used by gen*.
1916 # If we are not cross-building, gen* use the same .o's that cc1 will use,
1917 # and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
1918 # with the rules for rtl.o, alloca.o, etc.
1919 $(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) system.h $(RTL_H) \
1920   bitmap.h ggc.h toplev.h
1921         rm -f $(HOST_PREFIX)rtl.c
1922         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c
1923         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c
1924
1925 $(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) \
1926   $(RTL_H) $(BASIC_BLOCK_H) system.h
1927         rm -f $(HOST_PREFIX)print-rtl.c
1928         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c
1929         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c
1930
1931 $(HOST_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(CONFIG_H) system.h $(RTL_H) \
1932   flags.h $(BASIC_BLOCK_H) $(REGS_H)
1933         rm -f $(HOST_PREFIX)bitmap.c
1934         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/bitmap.c > $(HOST_PREFIX)bitmap.c
1935         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)bitmap.c
1936
1937 $(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) system.h $(RTL_H)
1938         rm -f $(HOST_PREFIX)rtlanal.c
1939         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtlanal.c > $(HOST_PREFIX)rtlanal.c
1940         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c
1941
1942 $(HOST_PREFIX_1)alloca.o: $(srcdir)/../libiberty/alloca.c
1943         rm -f $(HOST_PREFIX)alloca.c
1944         $(LN_S) $(srcdir)/../libiberty/alloca.c $(HOST_PREFIX)alloca.c
1945         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c
1946
1947 $(HOST_PREFIX_1)obstack.o: $(srcdir)/../libiberty/obstack.c $(CONFIG_H)
1948         rm -f $(HOST_PREFIX)obstack.c
1949         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/obstack.c > $(HOST_PREFIX)obstack.c
1950         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c
1951
1952 $(HOST_PREFIX_1)vfprintf.o: $(srcdir)/../libiberty/vfprintf.c
1953         rm -f $(HOST_PREFIX)vfprintf.c
1954         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/vfprintf.c > $(HOST_PREFIX)vfprintf.c
1955         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)vfprintf.c
1956
1957 $(HOST_PREFIX_1)doprint.o: doprint.c
1958         rm -f $(HOST_PREFIX)doprint.c
1959         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/doprint.c > $(HOST_PREFIX)doprint.c
1960         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)doprint.c
1961
1962 $(HOST_PREFIX_1)malloc.o: malloc.c
1963         rm -f $(HOST_PREFIX)malloc.c
1964         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/malloc.c > $(HOST_PREFIX)malloc.c
1965         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c
1966
1967 $(HOST_PREFIX_1)errors.o: errors.c
1968         rm -f $(HOST_PREFIX)errors.c
1969         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/errors.c > $(HOST_PREFIX)errors.c
1970         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)errors.c
1971
1972
1973 # This satisfies the dependency that we get if you cross-compile a compiler
1974 # that does not need to compile alloca, malloc or whatever.
1975 $(HOST_PREFIX_1):
1976         touch $(HOST_PREFIX_1)
1977
1978 $(HOST_PREFIX_1)ggc-none.o: ggc-none.c
1979         rm -f $(HOST_PREFIX)ggc-none.c
1980         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/ggc-none.c > $(HOST_PREFIX)ggc-none.c
1981         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)ggc-none.c
1982
1983
1984 #\f
1985 # Remake internationalization support.
1986
1987 intl.o: intl.c intl.h gansidecl.h Makefile
1988         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1989           -DLOCALEDIR=\"$(localedir)\" \
1990           -c `echo $(srcdir)/intl.c | sed 's,^\./,,'`
1991
1992 # This is needed to when doing a partial build after a `make clean'.
1993 # libintl.a does not depend on intl.all,
1994 # as that would force a lot of recompiling.
1995 $(top_builddir)/intl/libintl.a:
1996         @echo "$(MAKE) intl.all"
1997         @$(MAKE) $(FLAGS_TO_PASS) intl.all
1998
1999 # Make sure all the headers are there for xgettext to scan.
2000 $(INTL_TARGETS): $(srcdir)/c-gperf.h \
2001     $(srcdir)/c-parse.c $(srcdir)/c-parse.h $(srcdir)/cexp.c
2002
2003 intl.all intl.install intl.uninstall intl.distdir \
2004   intl.mostlyclean intl.clean intl.distclean intl.maintainer-clean:
2005         @for d in $(INTL_SUBDIRS); do \
2006           target=`expr $@ : 'intl.\(.*\)'` && \
2007           echo "(cd $$d && $(MAKE) $$target)" && \
2008           (cd $$d && AWK='$(AWK)' $(MAKE) $(SUBDIR_FLAGS_TO_PASS) $$target); \
2009         done
2010
2011 # intl.distdir doesn't copy the intl makefiles (since they aren't distributed),
2012 # but we need them for the `make extraclean' in distdir-finish.
2013 intl.distdir-fixup:
2014         for d in $(INTL_SUBDIRS); do \
2015           ln $$d/Makefile tmp/$$d || cp $$d/Makefile tmp/$$d || exit; \
2016         done
2017 #\f
2018 # Remake cpp and protoize.
2019
2020 # Making the preprocessor
2021 cpp$(exeext): $(CCCP)$(exeext)
2022         -rm -f cpp$(exeext)
2023         $(LN) $(CCCP)$(exeext) cpp$(exeext)
2024 CCCP_OBJS = cccp.o cexp.o intl.o prefix.o version.o @extra_cpp_objs@ mbchar.o
2025 cccp$(exeext): $(CCCP_OBJS) $(LIBDEPS)
2026         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(CCCP_OBJS) $(LIBS)
2027 cexp.o: $(srcdir)/cexp.c $(CONFIG_H) system.h mbchar.h
2028         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
2029 $(srcdir)/cexp.c: $(srcdir)/cexp.y
2030         cd $(srcdir); $(BISON) -o cexp.c cexp.y
2031
2032 PREPROCESSOR_DEFINES = \
2033   -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
2034   -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
2035   -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
2036   -DCROSS_INCLUDE_DIR=\"$(gcc_tooldir)/sys-include\" \
2037   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\"
2038 # We use $(libsubdir)/$(unlibsubdir) to match the
2039 # -iprefix argument which gcc will pass if GCC_EXEC_PREFIX is used.
2040 cccp.o: cccp.c $(CONFIG_H) intl.h pcp.h version.c config.status system.h \
2041            mbchar.h prefix.h Makefile.in version.h
2042         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2043           $(PREPROCESSOR_DEFINES) \
2044           -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
2045
2046 LIBCPP_OBJS =   cpplib.o cpphash.o cpperror.o cppexp.o cppfiles.o \
2047                 cppinit.o cppulp.o cpplex.o mkdeps.o \
2048                 prefix.o version.o mbchar.o @extra_cpp_objs@
2049
2050 LIBCPP_DEPS = cpplib.h cpphash.h intl.h system.h
2051 HASHTAB_H   = $(srcdir)/../include/hashtab.h
2052
2053 # All the other archives built/used by this makefile are for targets.  This
2054 # one is strictly for the host.
2055 #
2056 libcpp.a: $(LIBCPP_OBJS)
2057         -rm -rf libcpp.a
2058         $(AR) $(AR_FLAGS) libcpp.a $(LIBCPP_OBJS)
2059         if $(RANLIB_TEST) ; then $(RANLIB) libcpp.a ; else true ; fi
2060
2061 cppmain$(exeext): cppmain.o intl.o libcpp.a $(LIBDEPS)
2062         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cppmain$(exeext) cppmain.o \
2063         intl.o libcpp.a $(LIBS)
2064
2065 cppmain.o:  cppmain.c  $(CONFIG_H) cpplib.h intl.h system.h
2066
2067 cppulp.o:   cppulp.c   $(CONFIG_H) system.h output.h
2068 cpperror.o: cpperror.c $(CONFIG_H) $(LIBCPP_DEPS)
2069 cppexp.o:   cppexp.c   $(CONFIG_H) $(LIBCPP_DEPS)
2070 cpplex.o:   cpplex.c   $(CONFIG_H) $(LIBCPP_DEPS)
2071 cpplib.o:   cpplib.c   $(CONFIG_H) $(LIBCPP_DEPS) $(HASHTAB_H)
2072 cpphash.o:  cpphash.c  $(CONFIG_H) $(LIBCPP_DEPS) $(HASHTAB_H)
2073 cppfiles.o: cppfiles.c $(CONFIG_H) $(LIBCPP_DEPS) $(HASHTAB_H) mkdeps.h
2074
2075 cppinit.o:  cppinit.c  $(CONFIG_H) $(LIBCPP_DEPS) $(HASHTAB_H) mkdeps.h \
2076                 prefix.h output.h Makefile version.h
2077         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2078           $(PREPROCESSOR_DEFINES) \
2079           -c `echo $(srcdir)/cppinit.c | sed 's,^\./,,'`
2080
2081 mkdeps.o: mkdeps.c $(CONFIG_H) system.h mkdeps.h
2082
2083 # Note for the stamp targets, we run the program `true' instead of
2084 # having an empty command (nothing following the semicolon).
2085
2086 proto: config.status protoize$(exeext) unprotoize$(exeext) SYSCALLS.c.X
2087
2088 PROTO_OBJS = intl.o version.o
2089
2090 protoize$(exeext): protoize.o $(PROTO_OBJS) $(LIBDEPS)
2091         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ protoize.o $(PROTO_OBJS) $(LIBS)
2092
2093 unprotoize$(exeext): unprotoize.o $(PROTO_OBJS) $(LIBDEPS)
2094         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ unprotoize.o $(PROTO_OBJS) $(LIBS)
2095
2096 protoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) system.h \
2097    Makefile version.h
2098         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2099           $(DRIVER_DEFINES) $(PREPROCESSOR_DEFINES) \
2100           $(srcdir)/protoize.c
2101
2102 unprotoize.o: unprotoize.c protoize.c $(srcdir)/../include/getopt.h \
2103    $(CONFIG_H) system.h Makefile version.h
2104         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2105           $(DRIVER_DEFINES) $(PREPROCESSOR_DEFINES) \
2106           $(srcdir)/unprotoize.c
2107
2108 # This info describes the target machine, so compile with GCC just built.
2109 SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) \
2110    stmp-int-hdrs
2111         -rm -f SYSCALLS.c tmp-SYSCALLS.s
2112         cat $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c
2113         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2114           -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c
2115         -rm -f SYSCALLS.c tmp-SYSCALLS.s
2116
2117
2118 test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
2119         -rm -f tmp-proto.[cso]
2120         cp $(srcdir)/protoize.c tmp-proto.c
2121         chmod u+w tmp-proto.c
2122         ./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \
2123           $(GCC_CFLAGS) $(INCLUDES) \
2124           -DGCC_INCLUDE_DIR=0 \
2125           -DGPLUSPLUS_INCLUDE_DIR=0 \
2126           -DCROSS_INCLUDE_DIR=0 \
2127           -DTOOL_INCLUDE_DIR=0 \
2128           -DSTANDARD_EXEC_PREFIX=0 \
2129           -DDEFAULT_TARGET_MACHINE=0 \
2130           -DDEFAULT_TARGET_VERSION=0" tmp-proto.c
2131         @echo '**********' Expect 400 lines of differences.
2132         -diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff
2133         -wc -l tmp-proto.diff
2134         ./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \
2135           $(GCC_CFLAGS) $(INCLUDES) \
2136           -DGCC_INCLUDE_DIR=0 \
2137           -DGPLUSPLUS_INCLUDE_DIR=0 \
2138           -DCROSS_INCLUDE_DIR=0 \
2139           -DTOOL_INCLUDE_DIR=0 \
2140           -DSTANDARD_EXEC_PREFIX=0 \
2141           -DDEFAULT_TARGET_MACHINE=0 \
2142           -DDEFAULT_TARGET_VERSION=0" tmp-proto.c
2143         @echo Expect zero differences.
2144         diff $(srcdir)/protoize.c tmp-proto.c | cat
2145         -rm -f tmp-proto.[cs] tmp-proto$(objext)
2146
2147 gcov.o: gcov.c gcov-io.h intl.h system.h
2148
2149 # Only one of 'gcov' or 'gcov.exe' is actually built, depending
2150 # upon whether $(exeext) is empty or not.
2151 GCOV_OBJS = gcov.o intl.o
2152 gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
2153         $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
2154 #\f
2155 # Build the include directory.  The stamp files are stmp-* rather than
2156 # s-* so that mostlyclean does not force the include directory to
2157 # be rebuilt.
2158
2159 # Build the include directory including float.h (which no longer depends upon
2160 # enquire).
2161 stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h
2162 # Copy in the headers provided with gcc.
2163 # The sed command gets just the last file name component;
2164 # this is necessary because VPATH could add a dirname.
2165 # Using basename would be simpler, but some systems don't have it.
2166 # The touch command is here to workaround an AIX/Linux NFS bug.
2167         for file in .. $(USER_H); do \
2168           if [ X$$file != X.. ]; then \
2169             realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
2170             touch include/$$realfile; \
2171             rm -f include/$$realfile; \
2172             cp $$file include; \
2173             chmod a+r include/$$realfile; \
2174           fi; \
2175         done
2176         rm -f include/limits.h
2177         cp xlimits.h include/limits.h
2178         chmod a+r include/limits.h
2179         rm -f include/float.h
2180         if [ x$(FLOAT_H) != xMakefile.in ]; then \
2181           cp $(srcdir)/config/$(FLOAT_H) include/float.h && \
2182           chmod a+r include/float.h; \
2183         else :; fi
2184 # Install the README
2185         rm -f include/README
2186         cp $(srcdir)/README-fixinc include/README
2187         chmod a+r include/README
2188         touch $@
2189
2190 # fixinc.sh depends on this, not on specs directly.
2191 # The idea is to make sure specs gets built, but not rerun fixinc.sh
2192 # after each stage just because specs' mtime has changed.
2193 specs.ready: specs
2194         -if [ -f specs.ready ] ; then \
2195                 true; \
2196         else \
2197                 touch specs.ready; \
2198         fi
2199
2200 FIXINCSRCDIR=$(srcdir)/fixinc
2201 fixinc.sh: $(FIXINCSRCDIR)/mkfixinc.sh $(FIXINCSRCDIR)/fixincl.c \
2202         $(FIXINCSRCDIR)/procopen.c $(FIXINCSRCDIR)/gnu-regex.c \
2203         $(FIXINCSRCDIR)/server.c $(FIXINCSRCDIR)/gnu-regex.h \
2204         $(FIXINCSRCDIR)/server.h $(FIXINCSRCDIR)/inclhack.def specs.ready
2205         MAKE="$(MAKE)"; srcdir=`cd $(srcdir)/fixinc; pwd` ; \
2206         export MAKE srcdir ; \
2207         cd ./fixinc; $(SHELL) $${srcdir}/mkfixinc.sh $(target)
2208
2209 # Build fixed copies of system files.
2210 stmp-fixinc: fixinc.sh gsyslimits.h
2211         rm -rf include; mkdir include
2212         -chmod a+rx include
2213         TARGET_MACHINE=$(target); srcdir=`cd $(srcdir); pwd`; \
2214         INSTALL_ASSERT_H=$(INSTALL_ASSERT_H); SHELL=$(SHELL) ;\
2215         export TARGET_MACHINE srcdir INSTALL_ASSERT_H SHELL ; \
2216         $(SHELL) ./fixinc.sh `pwd`/include $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS)
2217         rm -f include/syslimits.h
2218         if [ -f include/limits.h ]; then \
2219           mv include/limits.h include/syslimits.h; \
2220         else \
2221           cp $(srcdir)/gsyslimits.h include/syslimits.h; \
2222         fi
2223         chmod a+r include/syslimits.h
2224 # If $(SYSTEM_HEADER_DIR) is $(tooldir)/sys-include, and
2225 # that directory exists, then make sure that $(libsubdir) exists.
2226 # This is because cpp is compiled to find $(tooldir)/include via
2227 # $(libsubdir)/$(unlibsubdir), which will only work if $(libsubdir)
2228 # exists.
2229 # We deliberately use tooldir instead of gcc_tooldir here.  gcc_tooldir
2230 # won't work because libsubdir doesn't exist yet.
2231         if [ "$(SYSTEM_HEADER_DIR)" = "$(tooldir)/sys-include" ] \
2232            && [ -d $(tooldir)/sys-include ]; then \
2233           if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi; \
2234           if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib; fi; \
2235           if [ -d $(libdir)/gcc-lib/$(target_alias) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias) ; fi; \
2236           if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version) ; fi; \
2237         else true; fi
2238         touch stmp-fixinc
2239
2240 # Files related to the fixproto script.
2241 # gen-protos and fix-header are compiled with HOST_CC, but they are only
2242 # used in native and host-x-target builds, so it's safe to link them with
2243 # libiberty.a.
2244
2245 deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs
2246         if [ -d $(SYSTEM_HEADER_DIR) ]; \
2247         then \
2248           CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -I. -I$(srcdir) -Iinclude -I${SYSTEM_HEADER_DIR}"; \
2249           export CC; \
2250           $(SHELL) $(srcdir)/scan-types.sh "$(srcdir)" >tmp-deduced.h; \
2251           mv tmp-deduced.h deduced.h; \
2252         else \
2253           touch deduced.h; \
2254         fi
2255
2256 GEN_PROTOS_OBJS = gen-protos.o scan.o
2257 gen-protos: $(GEN_PROTOS_OBJS)
2258         ${HOST_CC} $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gen-protos \
2259           $(GEN_PROTOS_OBJS) ../libiberty/libiberty.a
2260
2261 gen-protos.o: gen-protos.c scan.h $(build_xm_file) system.h
2262         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gen-protos.c
2263
2264 scan.o: scan.c scan.h $(build_xm_file) system.h
2265         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c
2266
2267 xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos Makefile
2268         cat deduced.h $(srcdir)/sys-protos.h > tmp-fixtmp.c
2269         mv tmp-fixtmp.c fixtmp.c
2270         $(GCC_FOR_TARGET) fixtmp.c -w -U__SIZE_TYPE__ -U__PTRDIFF_TYPE__ -U__WCHAR_TYPE__ -E \
2271           | sed -e 's/  / /g' -e 's/ *(/ (/g' -e 's/ [ ]*/ /g' -e 's/( )/()/' \
2272           | ./gen-protos >xsys-protos.hT
2273         mv xsys-protos.hT xsys-protos.h
2274         rm -rf fixtmp.c
2275
2276 fix-header: fix-header.o scan-decls.o scan.o xsys-protos.h $(HOST_LIBDEPS) \
2277             libcpp.a
2278         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ fix-header.o \
2279            scan-decls.o scan.o libcpp.a $(HOST_LIBS) ../libiberty/libiberty.a
2280
2281 fix-header.o: fix-header.c $(srcdir)/../include/obstack.h scan.h \
2282         xsys-protos.h $(build_xm_file) system.h cpplib.h
2283         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/fix-header.c
2284
2285 scan-decls.o: scan-decls.c scan.h cpplib.h $(build_xm_file) system.h
2286         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan-decls.c
2287
2288 # stmp-fixproto depends on this, not on fix-header directly.
2289 # The idea is to make sure fix-header gets built,
2290 # but not rerun fixproto after each stage
2291 # just because fix-header's mtime has changed.
2292 fixhdr.ready: fix-header
2293         -if [ -f fixhdr.ready ] ; then \
2294                 true; \
2295         else \
2296                 touch fixhdr.ready; \
2297         fi
2298
2299 # stmp-int-headers is to make sure fixincludes has already finished.
2300 # The if statement is so that we don't run fixproto a second time
2301 # if it has already been run on the files in `include'.
2302 stmp-fixproto: fixhdr.ready fixproto stmp-int-hdrs
2303         @echo "Various warnings and error messages from fixproto are normal"
2304         -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
2305         -if [ -f include/fixed ] ; then true; \
2306         else \
2307           : This line works around a 'make' bug in BSDI 1.1.; \
2308           FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"; export FIXPROTO_DEFINES; \
2309           mkinstalldirs="$(SHELL) $(srcdir)/mkinstalldirs"; \
2310             export mkinstalldirs; \
2311           if [ -d $(SYSTEM_HEADER_DIR) ] ; then \
2312             $(SHELL) ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \
2313           else true; fi; \
2314           touch include/fixed; \
2315         fi
2316         touch stmp-fixproto
2317 #\f
2318 # Remake the info files.
2319
2320 doc: info
2321 info: cpp.info gcc.info lang.info
2322
2323 cpp.info: $(srcdir)/cpp.texi
2324         $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o cpp.info $(srcdir)/cpp.texi
2325
2326 gcc.info: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \
2327           $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \
2328           $(srcdir)/tm.texi $(srcdir)/gcov.texi
2329         $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o gcc.info $(srcdir)/gcc.texi
2330
2331 dvi: gcc.dvi cpp.dvi lang.dvi
2332
2333 # This works with GNU Make's default rule.
2334 gcc.dvi: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \
2335          $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \
2336          $(srcdir)/tm.texi $(srcdir)/gcov.texi
2337         TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex gcc.texi
2338         texindex gcc.??
2339         TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex gcc.texi
2340
2341 cpp.dvi: $(srcdir)/cpp.texi
2342         TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex cpp.texi
2343         texindex cpp.??
2344         TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex cpp.texi
2345
2346
2347 INSTALL: $(srcdir)/install1.texi $(srcdir)/install.texi
2348         cd $(srcdir); $(MAKEINFO) -D INSTALLONLY \
2349                 --no-split -o INSTALL install1.texi
2350 #\f
2351 # Deletion of files made during compilation.
2352 # There are four levels of this:
2353 #   `mostlyclean', `clean', `distclean' and `maintainer-clean'.
2354 # `mostlyclean' is useful while working on a particular type of machine.
2355 # It deletes most, but not all, of the files made by compilation.
2356 # It does not delete libgcc.a or its parts, so it won't have to be recompiled.
2357 # `clean' deletes everything made by running `make all'.
2358 # `distclean' also deletes the files made by config.
2359 # `maintainer-clean' also deletes everything that could be regenerated
2360 # automatically, except for `configure'.
2361 # We remove as much from the language subdirectories as we can
2362 # (less duplicated code).
2363
2364 INTL_MOSTLYCLEAN = intl.mostlyclean
2365 mostlyclean: $(INTL_MOSTLYCLEAN) lang.mostlyclean
2366         -rm -f $(STAGESTUFF)
2367 # Delete the temporary source copies for cross compilation.
2368         -rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c
2369         -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
2370         -rm -f $(HOST_PREFIX_1)obstack.c
2371 # Delete the temp files made in the course of building libgcc.a.
2372         -rm -f tmplibgcc* tmpcopy xlimits.h libgcc1-test
2373         for name in $(LIB1FUNCS); do rm -f $${name}.c; done
2374 # Delete other built files.
2375         -rm -f t-float.h-cross xsys-protos.hT fp-bit.c dp-bit.c
2376 # Delete the stamp and temporary files.
2377         -rm -f s-* tmp-* stamp-* stmp-*
2378         -rm -f */stamp-* */tmp-*
2379 # Delete debugging dump files.
2380         -rm -f *.[0-9][0-9].* */*.[0-9][0-9].*
2381 # Delete some files made during installation.
2382         -rm -f specs float.h-* enquire SYSCALLS.c.X SYSCALLS.c
2383         -rm -f collect collect2 mips-tfile mips-tdump alloca.s
2384 # Delete files generated for fixproto
2385         -rm -rf fix-header xsys-protos.h deduced.h tmp-deduced.h \
2386           gen-protos fixproto.list fixtmp.* fixhdr.ready
2387 # Delete unwanted output files from TeX.
2388         -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
2389         -rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg
2390 # Delete sorted indices we don't actually use.
2391         -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
2392 # Delete core dumps.
2393         -rm -f core */core
2394
2395 # Delete all files made by compilation
2396 # that don't exist in the distribution.
2397 INTL_CLEAN = intl.clean
2398 clean: mostlyclean $(INTL_CLEAN) lang.clean
2399         -rm -f libgcc.a libgcc1.a libgcc1-asm.a libgcc2.a libgcc2.ready
2400         -rm -f libgcc1.null
2401         -rm -f *.dvi
2402         -rm -f */*.dvi
2403         -if [ -f md.pre-cpp ]; then \
2404           rm -f md ; \
2405         fi
2406 # Delete the include directory.
2407         -rm -rf include
2408 # Delete files used by the "multilib" facility (including libgcc subdirs).
2409         -rm -f multilib.h tmpmultilib*
2410         -if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \
2411           rm -rf $(MULTILIB_DIRNAMES); \
2412         else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \
2413           rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
2414         fi ; fi
2415         -rm -fr stage1 stage2 stage3 stage4
2416
2417 # Delete all files that users would normally create
2418 # while building and installing GCC.
2419 INTL_DISTCLEAN = intl.distclean
2420 distclean: clean $(INTL_DISTCLEAN) lang.distclean
2421         -rm -f tm.h tm_p.h config.h auto-host.h auto-build.h tconfig.h hconfig.h
2422         -rm -f md cstamp-h
2423         -rm -f config.status config.run config.cache config.bak
2424         -rm -f Make-lang Make-hooks Make-host Make-target
2425         -rm -f Makefile specs.h options.h gencheck.h *.oaux
2426         -rm -f gthr-default.h
2427         -rm -f */stage1 */stage2 */stage3 */stage4 */include
2428         -rm -f c-parse.output
2429         -rm -f *.asm
2430         -rm -f float.h
2431         -rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
2432         -rm -f testsuite/{gcc,g++}.{log,sum}
2433         -rm -f intl/libintl.h libintl.h
2434
2435 # Delete anything likely to be found in the source directory
2436 # that shouldn't be in the distribution.
2437 extraclean: distclean lang.extraclean
2438         -rm -rf =* ./"#"* *~* config/=* config/"#"* config/*~*
2439         -rm -f patch* *.orig *.rej config/patch* config/*.orig config/*.rej
2440         -rm -f config/*/=* config/*/"#"* config/*/*~*
2441         -rm -f config/*/*.orig config/*/*.rej
2442         -rm -f *.dvi *.ps *.oaux *.d *.[zZ] *.gz
2443         -rm -f *.tar *.xtar *diff *.diff.* *.tar.* *.xtar.* *diffs
2444         -rm -f *lose config/*lose config/*/*lose
2445         -rm -f *.s *.s[0-9] *.i config/ChangeLog
2446         -rm -f y.tab.c yacc.*
2447         -rm -f */=* */"#"* */*~*
2448         -rm -f */patch* */*.orig */*.rej
2449         -rm -f */*.dvi */*.oaux */*.d */*.[zZ] */*.gz
2450         -rm -f */*.tar */*.xtar */*diff */*.diff.* */*.tar.* */*.xtar.* */*diffs
2451         -rm -f */*lose */*.s */*.s[0-9] */*.i
2452
2453 # Get rid of every file that's generated from some other file, except for `configure'.
2454 # Most of these files ARE PRESENT in the GCC distribution.
2455 # We define INTL_DISTCLEAN, INTL_CLEAN & INTL_MOSTLYCLEAN to be empty in the
2456 # submake, so that we don't descend into intl after its makefile has been
2457 # removed.
2458 maintainer-clean:
2459         @echo 'This command is intended for maintainers to use; it'
2460         @echo 'deletes files that may need special tools to rebuild.'
2461         $(MAKE) INTL_DISTCLEAN= INTL_CLEAN= INTL_MOSTLYCLEAN= \
2462                 intl.maintainer-clean lang.maintainer-clean distclean
2463         -rm -f c-parse.y c-gperf.h
2464         -rm -f c-parse.c c-parse.h c-parse.output
2465         -rm -f cexp.c cexp.output TAGS
2466         -rm -f cpp.info* cpp.??s cpp.*aux
2467         -rm -f gcc.info* gcc.??s gcc.*aux
2468 #\f
2469 # Entry points `install' and `uninstall'.
2470 # Also use `install-collect2' to install collect2 when the config files don't.
2471
2472 # The semicolon is to prevent the install.sh -> install default rule
2473 # from doing anything.  Having it run true helps avoid problems and
2474 # noise from versions of make which don't like to have null commands.
2475 install: $(INSTALL_TARGET) ; @true
2476
2477 # Copy the compiler files into directories where they will be run.
2478 # Install the driver last so that the window when things are
2479 # broken is small.
2480 install-normal: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \
2481     $(INSTALL_CPP) install-man install-info intl.install lang.install-normal \
2482     install-driver
2483
2484 # Do nothing while making gcc with a cross-compiler. The person who
2485 # makes gcc for the target machine has to know how to put a complete
2486 # gcc together by hand.
2487 install-build: force
2488         @echo You have to install gcc on your target machine by hand.
2489
2490 # Run this on the target machine
2491 # to finish installation of cross compiler.
2492 # This is not used anymore now that float.h does not depend on enquire.
2493 install-cross-rest: install-float-h-cross
2494
2495 # Handle cpp installation.
2496 install-cpp: xcpp$(exeext)
2497         -if [ -f gcc-cross$(exeext) ] ; then \
2498           rm -f $(bindir)/$(CPP_CROSS_NAME)$(exeext); \
2499           $(INSTALL_PROGRAM) -m 755 xcpp$(exeext) $(bindir)/$(CPP_CROSS_NAME)$(exeext); \
2500           if [ x$(cpp_install_dir) != x ]; then \
2501             rm -f $(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
2502             $(INSTALL_PROGRAM) -m 755 xcpp$(exeext) $(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
2503           else true; fi; \
2504         else \
2505           rm -f $(bindir)/$(CPP_INSTALL_NAME)$(exeext); \
2506           $(INSTALL_PROGRAM) -m 755 xcpp$(exeext) $(bindir)/$(CPP_INSTALL_NAME)$(exeext); \
2507           if [ x$(cpp_install_dir) != x ]; then \
2508             rm -f $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
2509             $(INSTALL_PROGRAM) -m 755 xcpp$(exeext) $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
2510           else true; fi; \
2511         fi
2512
2513 uninstall-cpp:
2514         -rm -f $(bindir)/$(CPP_INSTALL_NAME)$(exeext)
2515         -rm -f $(bindir)/$(CPP_CROSS_NAME)$(exeext)
2516         -if [ x$(cpp_install_dir) != x ]; then \
2517           rm -f $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
2518           rm -f $(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
2519         else true; fi
2520
2521 # Install float.h for cross compiler.
2522 # Run this on the target machine!
2523 # This is not used anymore now that float.h does not depend on enquire.
2524 install-float-h-cross: installdirs
2525 #       if [ -f enquire ] ; then true; else false; fi
2526 # Note: don't use -.  We should fail right away if enquire was not made.
2527         ./enquire -f > $(tmpdir)/float.h
2528         -rm -f $(libsubdir)/include/float.h
2529         $(INSTALL_DATA) $(tmpdir)/float.h $(libsubdir)/include/float.h
2530         -rm -f $(tmpdir)/float.h
2531         chmod a-x $(libsubdir)/include/float.h
2532
2533 # Create the installation directories.
2534 installdirs:
2535         -if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; chmod a+rx $(prefix) ; fi
2536         -if [ -d $(exec_prefix) ] ; then true ; else mkdir $(exec_prefix) ; chmod a+rx $(exec_prefix) ; fi
2537         -if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; chmod a+rx $(libdir) ; fi
2538         -if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; chmod a+rx $(libdir)/gcc-lib ; fi
2539 # This dir isn't currently searched by cpp.
2540 #       -if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; chmod a+rx $(libdir)/gcc-lib/include ; fi
2541         -fdir= ; for dir in `echo $(libsubdir) | tr '/' ' '`; do \
2542           fdir=$${fdir}/$${dir}; \
2543           if [ -d $${fdir} ] ; then true ; else mkdir $${fdir}; chmod a+rx $${fdir}; fi ; \
2544         done
2545         -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; chmod a+rx $(bindir) ; fi
2546         -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; chmod a+rx $(includedir) ; fi
2547         -if [ -d $(gcc_tooldir) ] ; then true ; else mkdir $(gcc_tooldir) ; chmod a+rx $(gcc_tooldir) ; fi
2548         -if [ -d $(assertdir) ] ; then true ; else mkdir $(assertdir) ; chmod a+rx $(assertdir) ; fi
2549         -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; chmod a+rx $(infodir) ; fi
2550 # We don't use mkdir -p to create the parents of man1dir,
2551 # because some systems don't support it.
2552 # Instead, we use this technique to create the immediate parent of man1dir.
2553         -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
2554         if [ -d $$parent ] ; then true ; else mkdir $$parent ; chmod a+rx $$parent ; fi
2555         -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; chmod a+rx $(man1dir) ; fi
2556
2557 # Install the compiler executables built during cross compilation.
2558 install-common: native installdirs $(EXTRA_PARTS) lang.install-common
2559         for file in $(COMPILERS); do \
2560           if [ -f $$file ] ; then \
2561             rm -f $(libsubdir)/$$file; \
2562             $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
2563           else true; \
2564           fi; \
2565         done
2566         for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \
2567           if [ x"$$file" != x.. ]; then \
2568             rm -f $(libsubdir)/$$file; \
2569             $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
2570           else true; fi; \
2571         done
2572         for file in $(EXTRA_PARTS) ..; do \
2573           if [ x"$$file" != x.. ]; then \
2574             rm -f $(libsubdir)/$$file; \
2575             $(INSTALL_DATA) $$file $(libsubdir)/$$file; \
2576             chmod a-x $(libsubdir)/$$file; \
2577           else true; fi; \
2578         done
2579 # Don't mess with specs if it doesn't exist yet.
2580         -if [ -f specs ] ; then \
2581           rm -f $(libsubdir)/specs; \
2582           $(INSTALL_DATA) specs $(libsubdir)/specs; \
2583           chmod a-x $(libsubdir)/specs; \
2584         fi
2585 # Install protoize if it was compiled.
2586         -if [ -f protoize$(exeext) ]; \
2587         then \
2588             if [ -f gcc-cross$(exeext) ] ; then \
2589                 rm -f $(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \
2590                 $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \
2591                 rm -f $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \
2592                 $(INSTALL_PROGRAM) unprotoize$(exeext) $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \
2593             else \
2594                 rm -f $(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
2595                 $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
2596                 rm -f $(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
2597                 $(INSTALL_PROGRAM) unprotoize$(exeext) $(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
2598             fi ; \
2599             rm -f $(libsubdir)/SYSCALLS.c.X; \
2600             $(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X; \
2601             chmod a-x $(libsubdir)/SYSCALLS.c.X; \
2602         fi
2603         -rm -f $(libsubdir)/cpp$(exeext)
2604         $(INSTALL_PROGRAM) cpp$(exeext) $(libsubdir)/cpp$(exeext)
2605 # Install gcov if it was compiled.
2606         -if [ -f gcov$(exeext) ]; \
2607         then \
2608             rm -f $(bindir)/gcov$(exeext); \
2609             $(INSTALL_PROGRAM) gcov$(exeext) $(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
2610         fi
2611         $(INSTALL_PROGRAM) gccbug $(bindir)/$(GCCBUG_INSTALL_NAME)
2612
2613 # Install the driver program as $(target_alias)-gcc
2614 # and also as either gcc (if native) or $(gcc_tooldir)/bin/gcc.
2615 install-driver: xgcc$(exeext)
2616         -if [ -f gcc-cross$(exeext) ] ; then \
2617           rm -f $(bindir)/$(GCC_CROSS_NAME)$(exeext); \
2618           $(INSTALL_PROGRAM) gcc-cross$(exeext) $(bindir)/$(GCC_CROSS_NAME)$(exeext); \
2619           if [ -d $(gcc_tooldir)/bin/. ] ; then \
2620             rm -f $(gcc_tooldir)/bin/gcc$(exeext); \
2621             $(INSTALL_PROGRAM) gcc-cross$(exeext) $(gcc_tooldir)/bin/gcc$(exeext); \
2622           else true; fi; \
2623         else \
2624           rm -f $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
2625           $(INSTALL_PROGRAM) xgcc$(exeext) $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
2626           rm -f $(bindir)/$(target_alias)-gcc-1$(exeext); \
2627           $(LN) $(bindir)/$(GCC_INSTALL_NAME)$(exeext) $(bindir)/$(target_alias)-gcc-1$(exeext); \
2628           mv $(bindir)/$(target_alias)-gcc-1$(exeext) $(bindir)/$(target_alias)-gcc$(exeext); \
2629         fi
2630
2631 # Install the info files.
2632 # $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir
2633 # to do the install.
2634 install-info: doc installdirs lang.install-info
2635         -rm -f $(infodir)/cpp.info* $(infodir)/gcc.info*
2636         for f in cpp.info* gcc.info*; do \
2637             $(INSTALL_DATA) $$f $(infodir)/$$f; \
2638         done
2639         -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
2640           if [ -f $(infodir)/dir ] ; then \
2641             for f in cpp.info gcc.info; do \
2642                 install-info --dir-file=$(infodir)/dir $(infodir)/$$f; \
2643             done; \
2644           else true; fi; \
2645         else true; fi;
2646         -chmod a-x $(infodir)/cpp.info* $(infodir)/gcc.info*
2647
2648 # Install the man pages.
2649 install-man: installdirs $(srcdir)/gcc.1 $(srcdir)/cccp.1 lang.install-man
2650         -if [ -f gcc-cross$(exeext) ] ; then \
2651           rm -f $(man1dir)/$(GCC_CROSS_NAME)$(manext); \
2652           $(INSTALL_DATA) $(srcdir)/gcc.1 $(man1dir)/$(GCC_CROSS_NAME)$(manext); \
2653           chmod a-x $(man1dir)/$(GCC_CROSS_NAME)$(manext); \
2654         else \
2655           rm -f $(man1dir)/$(GCC_INSTALL_NAME)$(manext); \
2656           $(INSTALL_DATA) $(srcdir)/gcc.1 $(man1dir)/$(GCC_INSTALL_NAME)$(manext); \
2657           chmod a-x $(man1dir)/$(GCC_INSTALL_NAME)$(manext); \
2658         fi
2659         -rm -f $(man1dir)/cccp$(manext)
2660         -$(INSTALL_DATA) $(srcdir)/cccp.1 $(man1dir)/cccp$(manext)
2661         -chmod a-x $(man1dir)/cccp$(manext)
2662
2663 # Install the library.
2664 install-libgcc: libgcc.a installdirs
2665         -if [ -f libgcc.a ] ; then \
2666           rm -f $(libsubdir)/libgcc.a; \
2667           $(INSTALL_DATA) libgcc.a $(libsubdir)/libgcc.a; \
2668           if $(RANLIB_TEST_FOR_TARGET) ; then \
2669             (cd $(libsubdir); $(RANLIB_FOR_TARGET) libgcc.a); else true; fi; \
2670           chmod a-x $(libsubdir)/libgcc.a; \
2671         else true; fi
2672
2673 # Install multiple versions of libgcc.a.
2674 install-multilib: stmp-multilib installdirs
2675         for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
2676           dir=`echo $$i | sed -e 's/;.*$$//'`; \
2677           if [ -d $(libsubdir)/$${dir} ]; then true; else mkdir $(libsubdir)/$${dir}; chmod a+rx $(libsubdir)/$${dir}; fi; \
2678           for f in libgcc.a $(EXTRA_MULTILIB_PARTS); do \
2679             rm -f $(libsubdir)/$${dir}/$${f}; \
2680             $(INSTALL_DATA) $${dir}/$${f} $(libsubdir)/$${dir}/$${f}; \
2681           done; \
2682           if $(RANLIB_TEST_FOR_TARGET); then \
2683             (cd $(libsubdir)/$${dir}; $(RANLIB_FOR_TARGET) libgcc.a); \
2684           else true; fi; \
2685           chmod a-x $(libsubdir)/$${dir}/libgcc.a; \
2686         done
2687
2688 # Install all the header files built in the include subdirectory.
2689 install-headers: install-include-dir $(INSTALL_HEADERS_DIR) $(INSTALL_ASSERT_H)
2690 # Fix symlinks to absolute paths in the installed include directory to
2691 # point to the installed directory, not the build directory.
2692 # Don't need to use LN_S here since we really do need ln -s and no substitutes.
2693         -files=`cd $(libsubdir)/include; find . -type l -print 2>/dev/null`; \
2694         if [ $$? -eq 0 ]; then \
2695           dir=`cd include; pwd`; \
2696           for i in $$files; do \
2697             dest=`ls -ld $(libsubdir)/include/$$i | sed -n 's/.*-> //p'`; \
2698             if expr "$$dest" : "$$dir.*" > /dev/null; then \
2699               rm -f $(libsubdir)/include/$$i; \
2700               ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(libsubdir)/include/$$i; \
2701             fi; \
2702           done; \
2703         fi
2704
2705 # Create or recreate the gcc private include file directory.
2706 install-include-dir: installdirs
2707         -rm -rf $(libsubdir)/include
2708         mkdir $(libsubdir)/include
2709         -chmod a+rx $(libsubdir)/include
2710
2711 # Install the include directory using tar.
2712 install-headers-tar: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
2713 # We use `pwd`/include instead of just include to problems with CDPATH
2714 # Unless a full pathname is provided, some shells would print the new CWD,
2715 # found in CDPATH, corrupting the output.  We could just redirect the
2716 # output of `cd', but some shells lose on redirection within `()'s
2717         (cd `pwd`/include ; \
2718          tar -cf - .; exit 0) | (cd $(libsubdir)/include; tar xpf - )
2719 # /bin/sh on some systems returns the status of the first tar,
2720 # and that can lose with GNU tar which always writes a full block.
2721 # So use `exit 0' to ignore its exit status.
2722
2723 # Install the include directory using cpio.
2724 install-headers-cpio: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
2725 # See discussion about the use of `pwd` above
2726         cd `pwd`/include ; \
2727         find . -print | cpio -pdum $(libsubdir)/include
2728
2729 # Put assert.h where it won't override GNU libc's assert.h.
2730 # It goes in a dir that is searched after GNU libc's headers;
2731 # thus, the following conditionals are no longer needed.
2732 # But it's not worth deleting them now.
2733 ## Don't replace the assert.h already there if it is not from GCC.
2734 ## This code would be simpler if it tested for -f ... && ! grep ...
2735 ## but supposedly the ! operator is missing in sh on some systems.
2736 install-assert-h: assert.h installdirs
2737         if [ -f $(assertdir)/assert.h ]; \
2738         then \
2739           if grep "__eprintf" $(assertdir)/assert.h >/dev/null; \
2740             then \
2741             rm -f $(assertdir)/assert.h; \
2742             $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
2743             chmod a-x $(assertdir)/assert.h; \
2744           else true; \
2745           fi; \
2746         else \
2747           rm -f $(assertdir)/assert.h; \
2748           $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
2749           chmod a-x $(assertdir)/assert.h; \
2750         fi
2751
2752 # Use this target to install the program `collect2' under the name `collect2'.
2753 install-collect2: collect2 installdirs
2754         $(INSTALL_PROGRAM) collect2$(exeext) $(libsubdir)/collect2$(exeext)
2755 # Install the driver program as $(libsubdir)/gcc for collect2.
2756         $(INSTALL_PROGRAM) xgcc$(exeext) $(libsubdir)/gcc$(exeext)
2757
2758 # Cancel installation by deleting the installed files.
2759 uninstall: intl.uninstall lang.uninstall $(UNINSTALL_CPP)
2760         -rm -rf $(libsubdir)
2761         -rm -rf $(bindir)/$(GCC_INSTALL_NAME)$(exeext)
2762         -rm -rf $(bindir)/$(GCC_CROSS_NAME)$(exeext)
2763         -rm -rf $(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext)
2764         -rm -rf $(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext)
2765         -rm -rf $(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext)
2766         -rm -rf $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext)
2767         -rm -rf $(bindir)/$(GCOV_INSTALL_NAME)$(exeext)
2768         -rm -rf $(man1dir)/$(GCC_INSTALL_NAME)$(manext)
2769         -rm -rf $(man1dir)/$(GCC_CROSS_NAME)$(manext)
2770         -rm -rf $(man1dir)/cccp$(manext)
2771         -rm -rf $(man1dir)/protoize$(manext)
2772         -rm -rf $(man1dir)/unprotoize$(manext)
2773         -rm -f $(infodir)/cpp.info* $(infodir)/gcc.info*
2774 #\f
2775 # These targets are for the dejagnu testsuites. The file site.exp
2776 # contains global variables that all the testsuites will use.
2777
2778 # Set to $(target_alias)/ for cross.
2779 target_subdir = @target_subdir@
2780
2781 site.exp: ./config.status Makefile
2782         @echo "Making a new config file..."
2783         -@rm -f ./tmp?
2784         @touch site.exp
2785         -@mv site.exp site.bak
2786         @echo "## these variables are automatically generated by make ##" > ./tmp0
2787         @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
2788         @echo "# add them to the last section" >> ./tmp0
2789         @echo "set rootme \"`pwd`\"" >> ./tmp0
2790         @echo "set srcdir \"`cd ${srcdir}; pwd`\"" >> ./tmp0
2791         @echo "set host_triplet $(host_canonical)" >> ./tmp0
2792         @echo "set build_triplet $(build_canonical)" >> ./tmp0
2793         @echo "set target_triplet $(target)" >> ./tmp0
2794         @echo "set target_alias $(target_alias)" >> ./tmp0
2795 # CFLAGS is set even though it's empty to show we reserve the right to set it.
2796         @echo "set CFLAGS \"\"" >> ./tmp0
2797         @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
2798 # If newlib has been configured, we need to pass -B to gcc so it can find
2799 # newlib's crt0.o if it exists.  This will cause a "path prefix not used"
2800 # message if it doesn't, but the testsuite is supposed to ignore the message -
2801 # it's too difficult to tell when to and when not to pass -B (not all targets
2802 # have crt0's).  We could only add the -B if ../newlib/crt0.o exists, but that
2803 # seems like too selective a test.
2804 # ??? Another way to solve this might be to rely on linker scripts.  Then
2805 # theoretically the -B won't be needed.
2806 # We also need to pass -L ../ld so that the linker can find ldscripts.
2807         @if [ -d $(objdir)/../$(target_subdir)newlib ] ; then \
2808           echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./tmp0; \
2809           echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)newlib/\"" >> ./tmp0; \
2810           echo "append CFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
2811           echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
2812           echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./tmp0; \
2813         else true; \
2814         fi
2815         @if [ -d $(objdir)/../ld ] ; then \
2816           echo "append LDFLAGS \" -L$(objdir)/../ld\"" >> ./tmp0; \
2817         else true; \
2818         fi
2819         echo "set tmpdir $(objdir)/testsuite" >> ./tmp0
2820         @echo "set srcdir \"\$${srcdir}/testsuite\"" >> ./tmp0
2821         @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
2822         @cat ./tmp0 > site.exp
2823         @cat site.bak | sed \
2824                 -e '1,/^## All variables above are.*##/ d' >> site.exp
2825         -@rm -f ./tmp?
2826
2827 CHECK_TARGETS = check-gcc check-g++ check-g77 check-objc
2828
2829 check: $(CHECK_TARGETS)
2830
2831 testsuite/site.exp: site.exp
2832         if [ -d testsuite ]; then \
2833           true; \
2834         else \
2835           mkdir testsuite; \
2836         fi
2837         rm -rf testsuite/site.exp
2838         cp site.exp testsuite/site.exp
2839
2840 check-g++: testsuite/site.exp
2841         -rootme=`pwd`; export rootme; \
2842         srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
2843         cd testsuite; \
2844         EXPECT=${EXPECT} ; export EXPECT ; \
2845         if [ -f $${rootme}/../expect/expect ] ; then  \
2846            TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; pwd` ; \
2847             export TCL_LIBRARY ; fi ; \
2848         $(RUNTEST) --tool g++ $(RUNTESTFLAGS)
2849
2850 check-gcc: testsuite/site.exp
2851         -rootme=`pwd`; export rootme; \
2852         srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
2853         cd testsuite; \
2854         EXPECT=${EXPECT} ; export EXPECT ; \
2855         if [ -f $${rootme}/../expect/expect ] ; then  \
2856            TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; pwd` ; \
2857            export TCL_LIBRARY ; fi ; \
2858         $(RUNTEST) --tool gcc $(RUNTESTFLAGS)
2859
2860 check-g77: testsuite/site.exp
2861         -rootme=`pwd`; export rootme; \
2862         srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
2863         cd testsuite; \
2864         EXPECT=${EXPECT} ; export EXPECT ; \
2865         if [ -f $${rootme}/../expect/expect ] ; then  \
2866            TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; pwd` ; \
2867            export TCL_LIBRARY ; fi ; \
2868         $(RUNTEST) --tool g77 $(RUNTESTFLAGS)
2869
2870 check-objc: testsuite/site.exp
2871         -rootme=`pwd`; export rootme; \
2872         srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
2873         cd testsuite; \
2874         EXPECT=${EXPECT} ; export EXPECT ; \
2875         if [ -f $${rootme}/../expect/expect ] ; then  \
2876            TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; pwd` ; \
2877             export TCL_LIBRARY ; fi ; \
2878         $(RUNTEST) --tool objc $(RUNTESTFLAGS)
2879
2880 # These exist for maintenance purposes.
2881
2882 # Update the tags table.
2883 TAGS: force
2884         cd $(srcdir);                                                   \
2885         mkdir tmp-tags;                                                 \
2886         mv -f c-parse.[ch] cexp.c =*.[chy] tmp-tags;                    \
2887         etags *.y *.h *.c;                                              \
2888         mv tmp-tags/* .;                                                \
2889         rmdir tmp-tags
2890
2891 # Create the distribution tar.gz file.
2892 dist: tmp-gcc.xtar
2893         gzip --best < tmp-gcc.xtar > tmp-gcc.xtar.gz
2894         mv tmp-gcc.xtar.gz gcc-$(version).tar.gz
2895
2896 tmp-gcc.xtar: distdir
2897 # Make the distribution.
2898         tar -chf tmp-gcc.xtar gcc-$(version)
2899
2900 distdir-cvs: force
2901         if [ -d $(srcdir)/CVS ]; then cd $(srcdir) && cvs -r update; fi
2902
2903 # This target exists to do the initial work before the language specific
2904 # stuff gets done.
2905 distdir-start: doc $(srcdir)/INSTALL $(srcdir)/c-parse.y $(srcdir)/c-gperf.h \
2906   $(srcdir)/c-parse.c $(srcdir)/cexp.c $(srcdir)/config.in \
2907   $(srcdir)/version.c TAGS
2908         @case '$(USE_NLS)' in \
2909         yes) ;; \
2910         *) echo "configure with --enable-nls before making a distribution"; \
2911            exit 1;; \
2912         esac
2913         @if grep -s "for version ${mainversion}" gcc.texi > /dev/null; \
2914         then true; \
2915         else echo "You must update the version number in \`gcc.texi'"; sleep 10;\
2916         fi
2917 # Update the version number in README
2918         $(AWK) '$$1 " " $$2 " " $$3 == "This directory contains" \
2919                 { $$6 = version; print $$0 } \
2920              $$1 " " $$2 " " $$3 != "This directory contains"' \
2921           version=$(version) $(srcdir)/README > tmp.README
2922         mv tmp.README README
2923         -rm -rf gcc-$(version) tmp
2924 # Put all the files in a temporary subdirectory
2925 # which has the name that we want to have in the tar file.
2926         mkdir tmp
2927         mkdir tmp/config
2928         mkdir tmp/ginclude
2929         mkdir tmp/objc
2930         mkdir tmp/intl
2931         mkdir tmp/po
2932         for file in `(cd $(srcdir) && echo *[0-9a-zA-Z+])`; do \
2933           test -f $(srcdir)/$$file && $(LN_S) $(srcdir)/$$file tmp; \
2934         done
2935         if test "$(srcdir)" != "." ; then \
2936           for file in c-parse.c cexp.c ; do \
2937             test -f ./$$file && $(LN_S) ../$$file tmp; \
2938           done; \
2939         fi
2940         for file in `(cd $(srcdir)/config && echo *[0-9a-zA-Z+])`; do \
2941           if test -d $(srcdir)/config/$$file \
2942               && test "$$file" != RCS && test "$$file" != CVS; then \
2943             mkdir tmp/config/$$file; \
2944             for subfile in `(cd $(srcdir)/config/$$file && echo *[0-9a-zA-Z+])`; do \
2945               $(LN_S) $(srcdir)/config/$$file/$$subfile tmp/config/$$file; \
2946             done; \
2947           else \
2948             $(LN_S) $(srcdir)/config/$$file tmp/config; \
2949           fi; \
2950         done
2951         for file in `(cd $(srcdir)/ginclude && echo *[0-9a-zA-Z+])`; do \
2952           $(LN_S) $(srcdir)/ginclude/$$file tmp/ginclude; \
2953         done
2954         for file in `(cd $(srcdir)/objc && echo *[0-9a-zA-Z+])`; do \
2955           $(LN_S) $(srcdir)/objc/$$file tmp/objc; \
2956         done
2957         $(LN_S) .gdbinit tmp
2958
2959 # Finish making `distdir', after the languages have done their thing.
2960 distdir-finish:
2961         mv tmp gcc-$(version)
2962 # Get rid of everything we don't want in the distribution.  We'd want
2963 # this to use Makefile.in, but it doesn't have the `lang.foo' targets
2964 # expanded.
2965         cd gcc-$(version); make extraclean distdir-check VERSION_DEP=
2966
2967 distdir-check:
2968         ($(AWK) '/^[^#]/{print} /^#[A-Za-z]/{print substr($$1, 2)}' | sort) \
2969           < po/POTFILES.in > tmp.POTFILES
2970         ls [A-Za-z]*.[ch] [a-z]*/[A-Za-z]*.[ch] \
2971           [a-z]*/[a-z]*/[A-Za-z]*.[ch] | sort > tmp.src
2972         diff tmp.POTFILES tmp.src || { \
2973           echo "po/POTFILES.in and sources do not match -- please fix"; \
2974           exit 1; \
2975         }
2976         rm -f tmp.*
2977
2978 distdir: distdir-cvs distdir-start intl.distdir intl.distdir-fixup \
2979   lang.distdir distdir-finish
2980
2981 # make diff oldversion=M.N
2982 # creates a diff file between an older distribution and this one.
2983 # The -P option assumes this is GNU diff.
2984 diff:
2985         diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h \
2986           -x cexp.c -x -x TAGS -x INSTALL \
2987           -x configure -x config.in \
2988           -x "gcc.??" -x "gcc.??s" -x gcc.aux -x "gcc.info*" \
2989           -x "cpp.??" -x "cpp.??s" -x cpp.aux -x "cpp.info*" \
2990           $(LANG_DIFF_EXCLUDES) \
2991           gcc-$(oldversion) gcc-$(version) > gcc-$(oldversion)-$(version).diff
2992
2993 # A list of files to be destroyed during "lean" builds.
2994 VOL_FILES=`echo $(OBJS) $(C_OBJS) $(LIBCPP_OBJS) *.c *.h gen*`
2995
2996 bootstrap bootstrap-lean: force
2997 # Only build the C compiler for stage1, because that is the only one that
2998 # we can guarantee will build with the native compiler, and also it is the
2999 # only thing useful for building stage2.
3000         $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)"
3001         $(MAKE) stage1
3002         -if test $@ = bootstrap-lean; then cd stage1 ; rm -f $(VOL_FILES); else true; fi
3003 # This used to define ALLOCA as empty, but that would lead to bad results
3004 # for a subsequent `make install' since that would not have ALLOCA empty.
3005 # To prevent `make install' from compiling alloca.o and then relinking cc1
3006 # because alloca.o is newer, we permit these recursive makes to compile
3007 # alloca.o.  Then cc1 is newer, so it won't have to be relinked.
3008         $(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
3009         $(MAKE) stage2
3010         -if test $@ = bootstrap-lean; then rm -rf stage1; cd stage2 ; rm -f $(VOL_FILES); else true; fi
3011         $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
3012
3013 bootstrap2 bootstrap2-lean: force
3014         $(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
3015         $(MAKE) stage2
3016         -if test $@ = bootstrap2-lean; then rm -rf stage1; cd stage2 ; rm -f $(VOL_FILES); else true; fi
3017         $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
3018
3019 bootstrap3 bootstrap3-lean: force
3020         $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
3021
3022 bootstrap4 bootstrap4-lean: force
3023         $(MAKE) CC="stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage3/ LANGUAGES="$(LANGUAGES)"
3024
3025 # Compare the object files in the current directory with those in the
3026 # stage2 directory.
3027
3028 # ./ avoids bug in some versions of tail.
3029 compare compare3 compare4 compare-lean compare3-lean compare4-lean: force
3030         -rm -f .bad_compare
3031         case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
3032         for file in *$(objext); do \
3033           tail +16c ./$$file > tmp-foo1; \
3034           tail +16c stage$$stage/$$file > tmp-foo2 \
3035             && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
3036         done
3037         case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
3038         for dir in tmp-foo intl $(SUBDIRS); do \
3039           if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
3040             for file in $$dir/*$(objext); do \
3041               tail +16c ./$$file > tmp-foo1; \
3042               tail +16c stage$$stage/$$file > tmp-foo2 \
3043                 && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
3044             done; \
3045           else true; fi; \
3046         done
3047         -rm -f tmp-foo*
3048         case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
3049         if [ -f .bad_compare ]; then \
3050           echo "Bootstrap comparison failure!"; \
3051           cat .bad_compare; \
3052           exit 1; \
3053         else \
3054           case "$@" in \
3055             *-lean ) rm -rf stage$$stage ;; \
3056             *) ;; \
3057           esac; true; \
3058         fi
3059
3060 # Compare the object files in the current directory with those in the
3061 # stage2 directory.  Use gnu cmp (diffutils v2.4 or later) to avoid
3062 # running tail and the overhead of twice copying each object file.
3063
3064 gnucompare gnucompare3 gnucompare4 gnucompare-lean gnucompare3-lean gnucompare4-lean: force
3065         -rm -f .bad_compare
3066         case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \
3067         for file in *$(objext); do \
3068           (cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
3069         done
3070         case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \
3071         for dir in tmp-foo intl $(SUBDIRS); do \
3072           if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
3073             for file in $$dir/*$(objext); do \
3074               (cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
3075             done; \
3076           else true; fi; \
3077         done
3078         case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \
3079         if [ -f .bad_compare ]; then \
3080           echo "Bootstrap comparison failure!"; \
3081           cat .bad_compare; \
3082           exit 1; \
3083         else \
3084           case "$@" in \
3085             *-lean ) rm -rf stage$$stage ;; \
3086           esac; true; \
3087         fi
3088
3089 # Copy the object files from a particular stage into a subdirectory.
3090 stage1-start:
3091         -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
3092         -for dir in intl $(SUBDIRS) ; \
3093          do \
3094            if [ -d stage1/$$dir ] ; then true ; else mkdir stage1/$$dir ; fi ; \
3095          done
3096         -mv $(STAGESTUFF) stage1
3097         -mv intl/*$(objext) stage1/intl
3098 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
3099 # dir will work properly.
3100         -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage1 ; else true ; fi
3101         -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage1 ; else true ; fi
3102         -if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage1 ; else true ; fi
3103         -rm -f stage1/libgcc.a
3104         -cp libgcc.a stage1
3105         -if $(RANLIB_TEST_FOR_TARGET) ; then \
3106           $(RANLIB_FOR_TARGET) stage1/libgcc.a; \
3107         else true; fi
3108         -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
3109           cp stage1/$${f} . ; \
3110         else true; \
3111         fi; done
3112 stage1: force stage1-start lang.stage1
3113
3114 stage2-start:
3115         -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
3116         -for dir in intl $(SUBDIRS) ; \
3117          do \
3118            if [ -d stage2/$$dir ] ; then true ; else mkdir stage2/$$dir ; fi ; \
3119          done
3120         -mv $(STAGESTUFF) stage2
3121         -mv intl/*$(objext) stage2/intl
3122 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
3123 # dir will work properly.
3124         -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage2 ; else true ; fi
3125         -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage2 ; else true ; fi
3126         -if [ -f collect-ld ] ; then $(LN_S) ../collect-ld$(exeext) stage2 ; else true ; fi
3127         -rm -f stage2/libgcc.a
3128         -cp libgcc.a stage2
3129         -if $(RANLIB_TEST_FOR_TARGET) ; then \
3130           $(RANLIB_FOR_TARGET) stage2/libgcc.a; \
3131         else true; fi
3132         -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
3133           cp stage2/$${f} . ; \
3134         else true; \
3135         fi; done
3136 stage2: force stage2-start lang.stage2
3137
3138 stage3-start:
3139         -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
3140         -for dir in intl $(SUBDIRS) ; \
3141          do \
3142            if [ -d stage3/$$dir ] ; then true ; else mkdir stage3/$$dir ; fi ; \
3143          done
3144         -mv $(STAGESTUFF) stage3
3145         -mv intl/*$(objext) stage3/intl
3146 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
3147 # dir will work properly.
3148         -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage3 ; else true ; fi
3149         -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage3 ; else true ; fi
3150         -if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage3 ; else true ; fi
3151         -rm -f stage3/libgcc.a
3152         -cp libgcc.a stage3
3153         -if $(RANLIB_TEST_FOR_TARGET) ; then \
3154           $(RANLIB_FOR_TARGET) stage3/libgcc.a; \
3155         else true; fi
3156         -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
3157           cp stage3/$${f} . ; \
3158         else true; \
3159         fi; done
3160 stage3: force stage3-start lang.stage3
3161
3162 stage4-start:
3163         -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
3164         -for dir in intl $(SUBDIRS) ; \
3165          do \
3166            if [ -d stage4/$$dir ] ; then true ; else mkdir stage4/$$dir ; fi ; \
3167          done
3168         -mv $(STAGESTUFF) stage4
3169         -mv intl/*$(objext) stage4/intl
3170 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
3171 # dir will work properly.
3172         -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage4 ; else true ; fi
3173         -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage4 ; else true ; fi
3174         -if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage4 ; else true ; fi
3175         -rm -f stage4/libgcc.a
3176         -cp libgcc.a stage4
3177         -if $(RANLIB_TEST_FOR_TARGET) ; then \
3178           $(RANLIB_FOR_TARGET) stage4/libgcc.a; \
3179         else true; fi
3180         -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
3181           cp stage4/$${f} . ; \
3182         else true; \
3183         fi; done
3184 stage4: force stage4-start lang.stage4
3185
3186 # Copy just the executable files from a particular stage into a subdirectory,
3187 # and delete the object files.  Use this if you're just verifying a version
3188 # that is pretty sure to work, and you are short of disk space.
3189 risky-stage1: stage1
3190         -make clean
3191
3192 risky-stage2: stage2
3193         -make clean
3194
3195 risky-stage3: stage3
3196         -make clean
3197
3198 risky-stage4: stage4
3199         -make clean
3200
3201 #In GNU Make, ignore whether `stage*' exists.
3202 .PHONY: stage1 stage2 stage3 stage4 clean maintainer-clean TAGS bootstrap
3203 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
3204
3205 force:
3206
3207 # ---
3208 # The enquire rules are still useful for building new float-anything.h.
3209 # Special flags for compiling enquire.
3210 # We disable optimization to make floating point more reliable.
3211 ENQUIRE_CFLAGS = -DNO_MEM -DNO_LONG_DOUBLE_IO -O0
3212 ENQUIRE_LDFLAGS = $(LDFLAGS)
3213
3214 # Enquire target (This is a variable so that a target can choose not to
3215 # build it.)
3216 ENQUIRE = enquire
3217
3218 # Test to see whether <float.h> exists in the system header files,
3219 # and is not derived from GCC.
3220 FLOAT_H_TEST = \
3221   [ -f $(SYSTEM_HEADER_DIR)/float.h ] && \
3222   if grep 'ifndef _FLOAT_H___' $(SYSTEM_HEADER_DIR)/float.h >/dev/null; \
3223   then false; \
3224   else :; fi
3225 # We pretend to not having a usable <float.h>, hence disable the FLOAT_H_TEST
3226 # to ensure, we're emitting a full blown <float.h> ourselves.
3227 FLOAT_H_TEST = false
3228
3229 # Used to compile enquire with standard cc, but have forgotten why.
3230 # Let's try with GCC.
3231 enquire: enquire.o $(GCC_PARTS)
3232         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@
3233 enquire.o: $(srcdir)/enquire.c $(GCC_PASSES) stmp-int-hdrs
3234         if $(FLOAT_H_TEST); then \
3235           rm -f include/float.h; \
3236           SYS_FLOAT_H_WRAP=1; \
3237         else :; \
3238           SYS_FLOAT_H_WRAP=0; \
3239         fi; \
3240         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) \
3241           -DSYS_FLOAT_H_WRAP=$$SYS_FLOAT_H_WRAP \
3242           -I. -c $(srcdir)/enquire.c
3243
3244 # Create float.h source for the native machine.
3245 # Make it empty if we can use the system float.h without changes.
3246 float.h-nat: enquire
3247         -./enquire -f > tmp-float.h
3248         grep '#define [^_]' tmp-float.h >/dev/null || true > tmp-float.h
3249         mv tmp-float.h float.h-nat
3250
3251 # Create a dummy float.h source for a cross-compiler.
3252 # ??? This isn't used anymore.  Should we create config/float-unkn.h
3253 # and make that the default float_format in configure?
3254 float.h-cross:
3255         echo "#ifndef   __GCC_FLOAT_NOT_NEEDED" > t-float.h-cross
3256         echo "#error float.h values not known for cross-compiler" >> t-float.h-cross
3257         echo "#endif" >> t-float.h-cross
3258         mv t-float.h-cross float.h-cross