OSDN Git Service

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