OSDN Git Service

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