OSDN Git Service

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