OSDN Git Service

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