OSDN Git Service

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