OSDN Git Service

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