OSDN Git Service

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