OSDN Git Service

(extraclean): Delete *.z as well.
[pf3gnuchains/gcc-fork.git] / gcc / Makefile.in
1 # Makefile for GNU C compiler.
2 #   Copyright (C) 1987, 88, 90, 91, 92, 1993 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, 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 # The targets for external use include:
21 # all, doc, proto, install, install-cross, install-cross-rest,
22 # uninstall, TAGS, mostlyclean, clean, distclean, realclean,
23 # stage1, stage2, stage3, stage4.
24
25 # Suppress smart makes who think they know how to automake Yacc files
26 .y.c:
27
28 # Variables that exist for you to override.
29 # See below for how to change them for certain systems.
30
31 # Selection of languages to be made.
32 LANGUAGES = c c++ objective-c proto
33
34 ALLOCA =
35 ALLOCA_FLAGS =
36 ALLOCA_FINISH = true
37
38 # Various ways of specifying flags for compilations:  
39 # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
40 # BOOT_CFLAGS is the value of CFLAGS to pass
41 # to the stage2 and stage3 compilations
42 # XCFLAGS is used for most compilations but not when using the GCC just built.
43 XCFLAGS =
44 CFLAGS = -g
45 BOOT_CFLAGS = -O $(CFLAGS)
46 # These exists to be overridden by the x-* and t-* files, respectively.
47 X_CFLAGS =
48 T_CFLAGS =
49
50 X_CPPFLAGS =
51 T_CPPFLAGS =
52
53 CC = cc
54 BISON = bison
55 BISONFLAGS = -v
56 AR = ar
57 OLDAR_FLAGS = qc
58 AR_FLAGS = rc
59 SHELL = /bin/sh
60 # on sysV, define this as cp.
61 INSTALL = install -c
62 # These permit overriding just for certain files.
63 INSTALL_PROGRAM = $(INSTALL)
64 INSTALL_DATA = $(INSTALL)
65 SYMLINK = ln -s
66 MAKEINFO = makeinfo
67
68 # Define this as & to perform parallel make on a Sequent.
69 # Note that this has some bugs, and it seems currently necessary 
70 # to compile all the gen* files first by hand to avoid erroneous results.
71 P =
72
73 # How to invoke ranlib.
74 RANLIB = ranlib
75 # Test to use to see whether ranlib exists on the system.
76 RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
77
78 # Compiler to use for compiling libgcc1.a.
79 # OLDCC should not be the GNU C compiler,
80 # since that would compile typical libgcc1.a functions such as mulsi3
81 # into infinite recursions.
82 OLDCC = cc
83
84 # CFLAGS for use with OLDCC, for compiling libgcc1.a.
85 # NOTE: -O does not work on some Unix systems!
86 CCLIBFLAGS = -O
87
88 # Version of ar to use when compiling libgcc1.a.
89 OLDAR = ar
90
91 # Target to use when installing include directory.  Either
92 # install-headers-tar or install-headers-cpio.
93 INSTALL_HEADERS_DIR = install-headers-tar
94
95 # The GCC to use for compiling libgcc2.a, enquire, and cross-test.
96 # Usually the one we just built.
97 # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
98 GCC_FOR_TARGET = ./xgcc -B./
99
100 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
101 # It omits XCFLAGS, and specifies -B./.
102 # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
103 GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
104
105 # Special flags for compiling enquire.
106 # We disable optimization to make floating point more reliable.
107 ENQUIRE_CFLAGS = -DNO_MEM -DNO_STDDEF -DNO_LONG_DOUBLE_IO -O0
108 ENQUIRE_LDFLAGS = $(LDFLAGS)
109
110 # Tools to use when building a cross-compiler.
111 # These are used because `configure' appends `cross-make'
112 # to the makefile when making a cross-compiler.
113
114 TARGET_TOOLPREFIX = $(tooldir)/bin/
115 AR_FOR_TARGET = $(TARGET_TOOLPREFIX)ar
116 AR_FOR_TARGET_FLAGS = rc
117 RANLIB_FOR_TARGET = $(TARGET_TOOLPREFIX)ranlib
118 RANLIB_TEST_FOR_TARGET = [ -f $(TARGET_TOOLPREFIX)ranlib ]
119
120 # Dir to search for system headers.  Overridden by cross-make.
121 SYSTEM_HEADER_DIR = /usr/include
122
123 # There may be a premade insn-attrtab.c for this machine.
124 # (You could rebuild it with genattrtab as usual, but it takes a long time.)
125 # PREMADE_ATTRTAB is the file name of the file to use.
126 # PREMADE_ATTRTAB_MD is the md file it corresponds to.
127 PREMADE_ATTRTAB_MD = Makefile  # Guaranteed not to cmp equal to md.
128 PREMADE_ATTRTAB = 
129
130 target= ... `configure' substitutes actual target name here.
131 xmake_file= ... `configure' substitutes actual x- file name here.
132 tmake_file= ... `configure' substitutes actual t- file name here.
133 version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
134
135 # Directory where sources are, from where we are.
136 srcdir = .
137 # Common prefix for installation directories.
138 # NOTE: This directory must exist when you start installation.
139 prefix = /usr/local
140 # Directory in which to put localized header files. On the systems with
141 # gcc as the native cc, `local_prefix' may not be `prefix' which is
142 # `/usr'.
143 local_prefix = $(prefix)
144 # Directory in which to put host dependent programs and libraries
145 exec_prefix = $(prefix)
146 # Directory in which to put the executable for the command `gcc'
147 bindir = $(exec_prefix)/bin
148 # Directory in which to put the directories used by the compiler.
149 libdir = $(exec_prefix)/lib
150 # Directory in which the compiler finds executables, libraries, etc.
151 libsubdir = $(libdir)/gcc-lib/$(target)/$(version)
152 # Directory for header file assert.h.
153 includedir = $(local_prefix)/include
154 # assertdir is overridden in cross-make.
155 assertdir = $(includedir)
156 # Extension (if any) to put in installed man-page filename.
157 manext = .1
158 # Directory in which to put man pages.
159 mandir = $(prefix)/man/man1
160 # Directory in which to find other cross-compilation tools and headers.
161 # Used in install-cross.
162 tooldir = $(prefix)/$(target)
163 # Dir for temp files.
164 tmpdir = /tmp
165
166 # Additional system libraries to link with.
167 CLIB=
168
169 # Change this to a null string if obstacks are installed in the
170 # system library.
171 OBSTACK=obstack.o
172
173 # Specify the rule for actually making libgcc1.a.
174 # The value may be empty; that means to do absolutely nothing
175 # with or for libgcc1.a.
176 LIBGCC1 = libgcc1.a
177
178 # Specify the rule for actually making libgcc2.a.
179 LIBGCC2 = libgcc2.a
180
181 # Options to use when compiling libgcc2.a.
182 # -g1 causes output of debug info only for file-scope entities.
183 # we use this here because that should be enough, and also
184 # so that -g1 will be tested.
185 LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) -g1
186
187 # Additional options to use when compiling libgcc2.a.
188 # Some targets override this to -Iinclude
189 LIBGCC2_INCLUDES =
190
191 # Things which must be built before building libgcc2.a.
192 # Some targets override this to stmp-int-hdrs
193 LIBGCC2_DEPS =
194
195 # List of extra executables that should be compiled for this target machine
196 # that are used for compiling from source code to object code.
197 # The rules for compiling them should be in the t-* file for the machine.
198 EXTRA_PASSES =
199
200 # Like EXTRA_PASSES, but these are used when linking.
201 EXTRA_PROGRAMS = 
202
203 # List of extra object files that should be compiled for this target machine.
204 # The rules for compiling them should be in the t-* file for the machine.
205 EXTRA_PARTS =
206
207 # List of extra object files that should be compiled and linked with
208 # compiler proper (cc1, cc1obj, cc1plus).
209 EXTRA_OBJS =
210
211 # List of additional header files to install.
212 # Often this is edited directly by `configure'.
213 EXTRA_HEADERS =
214
215 # Set this to `ld' to enable use of collect2.
216 # USE_COLLECT2 =
217 # It is convenient for configure to add the assignment at the beginning,
218 # so don't override it here.
219
220 # List of extra C and assembler files to add to libgcc1.a.
221 # Assembler files should have names ending in `.asm'.
222 LIB1FUNCS_EXTRA = 
223
224 # List of extra C and assembler files to add to libgcc2.a.
225 # Assembler files should have names ending in `.asm'.
226 LIB2FUNCS_EXTRA = 
227
228 # Default float.h source to use for cross-compiler.
229 CROSS_FLOAT_H=float.h-cross
230
231 # Program to convert libraries.
232 LIBCONVERT = 
233
234 # Control whether header files are installed.
235 INSTALL_HEADERS=install-headers
236
237 # Select which version of fixincludes to use (I.E. regular versus SVR4)
238 # This value is overridden directly by configure.
239 FIXINCLUDES=fixincludes
240
241 # Additional directories of header files to run fixincludes on.
242 # On most systems, this is empty.
243 OTHER_FIXINCLUDES_DIRS=
244
245 # List of things which should already be built whenever we try to use xgcc
246 # to compile anything (without linking).
247 GCC_PASSES=xgcc cc1 cpp $(EXTRA_PASSES)
248
249 # List of things which should already be built whenever we try to use xgcc
250 # to link anything.
251 GCC_PARTS=$(GCC_PASSES) libgcc.a $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
252
253 # Directory to link to, when using the target `maketest'.
254 DIR = ../gcc
255
256 # Flags to use when cross-building GCC.
257 # Prefix to apply to names of object files when using them
258 # to run on the machine we are compiling on.
259 HOST_PREFIX=
260 # Prefix to apply to names of object files when compiling them
261 # to run on the machine we are compiling on.
262 # The default for this variable is chosen to keep these rules 
263 # out of the way of the other rules for compiling the same source files.
264 HOST_PREFIX_1=loser-
265 HOST_CC=$(CC)
266 HOST_CFLAGS=$(ALL_CFLAGS)
267 HOST_CLIB=$(CLIB)
268 HOST_LDFLAGS=$(LDFLAGS)
269 HOST_CPPFLAGS=$(ALL_CPPFLAGS)
270 HOST_ALLOCA=$(ALLOCA)
271 HOST_MALLOC=$(MALLOC)
272 HOST_OBSTACK=$(OBSTACK)
273
274 # Choose the real default target.
275 ALL=all.internal
276
277 # Choose the real install target.
278 INSTALL_TARGET=install-normal
279
280 # Source for float.h.  Overridden by cross-make.
281 FLOAT_H=float.h-nat
282
283 # End of variables for you to override.
284
285 # Definition of `all' is here so that new rules inserted by sed
286 # do not specify the default target.
287 # The real definition is under `all.internal' (for native compilers)
288 # or `all.cross' (for cross compilers).
289 all: all.indirect
290
291 # This tells GNU Make version 3 not to put all variables in the environment.
292 .NOEXPORT:
293
294 # sed inserts variable overrides after the following line.
295 ####target overrides
296 ####host overrides
297 ####cross overrides
298 ####build overrides
299 \f
300 # Now figure out from those variables how to compile and link.
301
302 all.indirect: $(ALL)
303
304 # IN_GCC tells obstack.h to use gstddef.h.
305 INTERNAL_CFLAGS = $(CROSS) -DIN_GCC
306
307 # This is the variable actually used when we compile.
308 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
309
310 # Likewise.
311 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
312
313 # Even if ALLOCA is set, don't use it if compiling with GCC.
314 USE_ALLOCA= ` case "${CC}" in "${OLDCC}") echo ${ALLOCA} ;; esac `
315 USE_HOST_ALLOCA= ` case "${HOST_CC}"@"${HOST_ALLOCA}" in "${OLDCC}"@?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac `
316 USE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo ${HOST_PREFIX}${HOST_MALLOC} ;; esac `
317 USE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo ${HOST_PREFIX}${HOST_OBSTACK} ;; esac `
318
319 # Dependency on obstack, alloca, malloc or whatever library facilities
320 # are not installed in the system libraries.
321 # We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
322 LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC)
323
324 # Likewise, for use in the tools that must run on this machine
325 # even if we are cross-building GCC.
326 # We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
327 HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC)
328
329 # How to link with both our special library facilities
330 # and the system's installed libraries.
331 LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(CLIB)
332
333 # Likewise, for use in the tools that must run on this machine
334 # even if we are cross-building GCC.
335 HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC)  \
336             $(HOST_CLIB)
337
338 HOST_RTL = $(HOST_PREFIX)rtl.o
339 HOST_RTLANAL = $(HOST_PREFIX)rtlanal.o
340 HOST_PRINT = $(HOST_PREFIX)print-rtl.o
341
342 # Specify the directories to be searched for header files.
343 # Both . and srcdir are used, in that order,
344 # so that tm.h and config.h will be found in the compilation
345 # subdirectory rather than in the source directory.
346 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config
347 SUBDIR_INCLUDES = -I.. -I../$(srcdir) -I../$(srcdir)/config
348
349 # Always use -I$(srcdir)/config when compiling.
350 .c.o:
351         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
352
353 # This tells GNU make version 3 not to export all the variables
354 # defined in this file into the environment.
355 .NOEXPORT:
356 \f
357 # Lists of files for various purposes.
358
359 # A list of all the language-specific executables.
360 COMPILERS = cc1 cc1plus cc1obj
361
362 # Language-specific object files for C.
363 C_OBJS = c-parse.o c-lang.o c-lex.o c-pragma.o \
364    c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-iterate.o
365
366 # Language-specific object files for Objectionable C.
367 OBJC_OBJS = objc-parse.o objc-act.o c-lex.o c-pragma.o \
368    c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-iterate.o
369
370 # Language-specific object files for C++.
371 CPLUS_OBJS = cp-parse.o cp-decl.o cp-decl2.o \
372    cp-typeck.o cp-type2.o cp-tree.o cp-ptree.o \
373    cp-cvt.o cp-search.o cp-lex.o cp-gc.o cp-call.o \
374    cp-class.o cp-init.o cp-method.o cp-except.o \
375    cp-expr.o cp-pt.o cp-edsel.o cp-xref.o \
376    $(CPLUS_INPUT) cp-spew.o c-common.o
377
378 # Language-independent object files.
379 OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
380  function.o stmt.o expr.o calls.o expmed.o explow.o optabs.o varasm.o \
381  rtl.o print-rtl.o rtlanal.o emit-rtl.o real.o \
382  dbxout.o sdbout.o dwarfout.o xcoffout.o \
383  integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o \
384  regclass.o local-alloc.o global.o reload.o reload1.o caller-save.o \
385  insn-peep.o reorg.o sched.o final.o recog.o reg-stack.o \
386  insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o \
387  insn-attrtab.o aux-output.o getpwd.o convert.o $(EXTRA_OBJS)
388
389 # GEN files are listed separately, so they can be built before doing parallel
390 #  makes for cc1 or cc1plus.  Otherwise sequent parallel make attempts to load
391 #  them before rtl.o is compiled.
392 GEN= genemit genoutput genrecog genextract genflags gencodes genconfig genpeep
393
394 # Files to be copied away after each stage in building.
395 STAGESTUFF = *.o insn-flags.h insn-config.h insn-codes.h \
396  insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
397  insn-attr.h insn-attrtab.c insn-opinit.c \
398  stamp-flags stamp-config stamp-codes \
399  stamp-output stamp-recog stamp-emit stamp-extract stamp-peep \
400  stamp-attr stamp-attrtab stamp-opinit stamp-proto \
401  genemit genoutput genrecog genextract genflags gencodes genconfig genpeep \
402  genattrtab genattr genopinit \
403  $(GCC_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross cccp \
404  cc1plus cc1obj enquire protoize unprotoize specs collect2 $(USE_COLLECT2)
405
406 # Members of libgcc1.a.
407 LIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
408    _lshrsi3 _lshlsi3 _ashrsi3 _ashlsi3 \
409    _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \
410    _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \
411    _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \
412    _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
413    _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
414
415 # Library members defined in libgcc2.c.
416 LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
417      _lshrdi3 _lshldi3 _ashldi3 _ashrdi3 _ffsdi2 \
418     _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
419     _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
420     _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \
421     __gcc_bcmp _varargs _eprintf _op_new _new_handler _op_delete \
422     _bb _shtab _clear_cache _trampoline __main _exit _ctors
423
424 # Header files that are made available under the same name
425 # to programs compiled with GCC.
426 USER_H = va-alpha.h va-i860.h va-i960.h va-mips.h va-m88k.h \
427     va-pa.h va-pyr.h va-sparc.h va-clipper.h va-spur.h proto.h $(EXTRA_HEADERS)
428
429 # The files that "belong" in CONFIG_H are deliberately omitted
430 # because having them there would not be useful in actual practice.
431 # All they would do is cause complete recompilation every time
432 # one of the machine description files is edited.
433 # That may or may not be what one wants to do.
434 # If it is, rm *.o is an easy way to do it.
435 # CONFIG_H = config.h tm.h
436 CONFIG_H =
437 RTL_H = rtl.h rtl.def machmode.h machmode.def
438 TREE_H = tree.h real.h tree.def machmode.h machmode.def
439 CPLUS_TREE_H = $(TREE_H) cp-tree.h cp-tree.def
440 \f
441 # Avoid a lot of time thinking about remaking Makefile.in and *.def.
442 .SUFFIXES: .in .def
443
444 Makefile: $(srcdir)/Makefile.in $(srcdir)/configure $(srcdir)/version.c \
445    $(srcdir)/config/$(xmake_file) $(srcdir)/config/$(tmake_file)
446         sh config.status
447
448 all.internal: start.encap rest.encap
449 # This is what to compile if making a cross-compiler.
450 # Note that we can compile enquire using the cross-compiler just build,
451 # although we can't run it on this machine.
452 all.cross: native gcc-cross specs libgcc.a stmp-headers cross-test enquire $(EXTRA_PARTS)
453 # This is what to compile if making gcc with a cross-compiler.
454 all.build: native xgcc $(EXTRA_PARTS)
455 # This is what must be made before installing GCC and converting libraries.
456 start.encap: native xgcc specs $(LIBGCC1) xlimits.h
457 # Use this to make a GCC that will be used only to recompile GCC.
458 for-bootstrap: start.encap libgcc.a
459 # These can't be made, with COFF encapsulation, until after GCC can run.
460 rest.encap: libgcc.a stmp-headers $(EXTRA_PARTS)
461 # This is what is made with the host's compiler
462 # whether making a cross compiler or not.
463 native: config.status cpp $(LANGUAGES) $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
464
465 # Define the names for selecting languages in LANGUAGES.
466 C c: cc1
467 C++ c++: cc1plus
468 OBJC objc: cc1obj objc-runtime
469 OBJECTIVE-C objective-c: cc1obj objc-runtime
470 PROTO: proto
471
472 # Really, really stupid make features, such as SUN's KEEP_STATE, may force
473 # a target to build even if it is up-to-date.  So we must verify that
474 # config.status does not exist before failing.
475 config.status:
476         @if [ ! -f config.status ] ; then \
477           echo You must configure gcc.  Look at the INSTALL file for details.; \
478           false; \
479         else \
480           true; \
481         fi
482
483 # On the target machine, finish building a cross compiler.
484 # This does the things that can't be done on the host machine.
485 rest.cross: libgcc.a gfloat.h specs
486
487 # Verify that it works to compile and link cross-test.
488 # If it does, then there are sufficient replacements for libgcc1.a.
489 cross-test: cross-test.o native gcc-cross libgcc.a $(GCC_PARTS)
490         $(GCC_FOR_TARGET) $(GCC_CFLAGS) cross-test.o -o $@
491 cross-test.o: cross-test.c native gcc-cross
492         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -c $(srcdir)/cross-test.c
493
494 # Recompile all the language-independent object files.
495 # This is used only if the user explicitly asks for it.
496 compilations: ${OBJS}
497
498 # We call this executable `xgcc' rather than `gcc'
499 # to avoid confusion if the current directory is in the path
500 # and CC is `gcc'.  It is renamed to `gcc' when it is installed.
501 xgcc: gcc.o version.o $(LIBDEPS)
502         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o xgcc gcc.o version.o $(LIBS)
503
504 # Dump a specs file to make -B./ read these specs over installed ones.
505 specs: xgcc
506         $(GCC_FOR_TARGET) -dumpspecs > specs
507
508 # We do want to create an executable named `xgcc', so we can use it to
509 # compile libgcc2.a.
510 # Also create gcc-cross, so that install-common will install properly.
511 gcc-cross: xgcc
512         cp xgcc gcc-cross
513
514 cc1:$(P) $(C_OBJS) $(OBJS) $(LIBDEPS)
515         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1 $(C_OBJS) $(OBJS) $(LIBS)
516
517 cc1plus:$(P) $(CPLUS_OBJS) $(OBJS) $(LIBDEPS)
518         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1plus $(CPLUS_OBJS) $(OBJS) $(LIBS)
519
520 cc1obj:$(P) $(OBJC_OBJS) $(OBJS) $(LIBDEPS)
521         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1obj $(OBJC_OBJS) $(OBJS) $(LIBS)
522
523 # Copy float.h from its source.
524 gfloat.h: $(FLOAT_H)
525         cp $(FLOAT_H) gfloat.h
526
527 # Create float.h source for the native machine.
528 float.h-nat: enquire
529         -./enquire -f > float.h-nat
530
531 # Create a dummy float.h source for a cross-compiler.
532 float.h-cross:
533         echo "#error float.h values not known for cross-compiler" > float.h-cross
534
535 # Used to compile enquire with standard cc, but have forgotten why.
536 # Let's try with GCC.
537 enquire: enquire.o $(GCC_PARTS)
538         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@
539 enquire.o: $(srcdir)/enquire.c $(GCC_PASSES)
540 #       -if [ "$(srcdir)" != "." ]; then rm -f ./enquire.c; else true; fi
541 #       -cp $(srcdir)/enquire.c . > /dev/null 2>&1
542 # Breaking this line caused a problem with one version of GNU make.
543         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) -I. -c $(srcdir)/enquire.c
544
545 # Build the version of limits.h that we will install.
546 xlimits.h: glimits.h limitx.h limity.h
547         if [ -f $(SYSTEM_HEADER_DIR)/limits.h ] ; then \
548           cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > xlimits.h; \
549         else \
550           cat $(srcdir)/glimits.h > xlimits.h; \
551         fi
552 \f
553 # Build libgcc.a.
554 # This is done in two parts because some functions, in libgcc1.c,
555 # must be compiled with something other than GCC,
556 # while the rest, in libgcc2.c, must be compiled with xgcc.
557 # That means we can't do libgcc2.c until after xgcc, cc1, etc.
558
559 # Use this as value of LIBGCC1 to cause conversion to GNU library format.
560 # LIBCONVERT should put its output in libgcc1.conv.
561 libgcc1.conv: libgcc1.a
562         $(LIBCONVERT) libgcc1.a libgcc1.conv
563
564 # Use this as value of LIBGCC1 to inhibit use of libgcc1.c entirely.
565 # Make an empty file instead.
566 libgcc1.null: $(GCC_PASSES)
567         echo "__foo () {}" > dummy.c
568         $(GCC_FOR_TARGET) $(GCC_CFLAGS) -c dummy.c
569         $(OLDAR) $(OLDAR_FLAGS) libgcc1.null dummy.o
570         rm -f dummy.o dummy.c
571
572 # This is $(LIBGCC1) for a cross-compiler.
573 # We have no automatic way of building libgcc1.a, 
574 # so it's up to the installer to find a way to do that.
575 # This rule deliberately does not depend on libgcc1.a
576 # so that it will fail if the installer hasn't provided it.
577 libgcc1.cross:
578         mv libgcc1.a libgcc1.cross || (echo You must find a way to make libgcc1.a; false)
579
580 # Compile the library of arithmetic subroutines with the native compiler.
581 # Don't compile it with GCC!
582 # (That would cause most arithmetic functions to call themselves.)
583 libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status
584         -rm -f tmplibgcc1.a
585 # Actually build it in tmplibgcc1.a, then rename at end,
586 # so that libgcc1.a itself remains nonexistent if compilation is aborted.
587 # -e causes any failing command to make this rule fail.
588 # -e doesn't work in certain shells, so we test $$? as well.
589         set -e; \
590         for name in $(LIB1FUNCS); \
591         do \
592           echo $${name}; \
593           rm -f $${name}.o; \
594           $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $(srcdir)/libgcc1.c; \
595           if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
596           mv libgcc1.o $${name}.o; \
597           $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
598           rm -f $${name}.o; \
599         done
600 # Some shells crash when a loop has no items.
601 # So make sure there is always at least one--`..'.
602 # Then ignore it.
603 # We don't use -e here because there are if statements
604 # that should not make the command give up when the if condition is false.
605 # Instead, we test for failure after each command where it matters.
606         -for file in .. $(LIB1FUNCS_EXTRA); \
607         do \
608           if [ x$${file} != x.. ]; then \
609             name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
610             echo $${name}; \
611             if [ $${name}.asm = $${file} ]; then \
612               cp $${file} $${name}.s || exit 1; file=$${name}.s; \
613             else true; fi; \
614             $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \
615             if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
616             $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
617             if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
618             rm -f $${name}.[so]; \
619           else true; \
620           fi; \
621         done
622         mv tmplibgcc1.a libgcc1.a
623
624 # Compiling libgcc2.a requires making sure that cc1, etc. have been compiled.
625 # But recompiling cc1 should not force recompilation of libgcc2.a.
626 # If you want to force recompilation, delete libgcc2.a.
627 libgcc2.ready: $(GCC_PASSES) $(LIBGCC2_DEPS)
628         -if [ -f libgcc2.ready ] ; then \
629                 true; \
630         else \
631                 touch libgcc2.ready; \
632         fi
633
634 libgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \
635    machmode.h longlong.h gbl-ctors.h config.status
636 # Actually build it in tmplibgcc2.a, then rename at end,
637 # so that libgcc2.a itself remains nonexistent if compilation is aborted.
638         -rm -f tmplibgcc2.a
639 # -e causes any failing command to make this rule fail.
640 # -e doesn't work in certain shells, so we test $$? as well.
641         set -e; \
642         for name in $(LIB2FUNCS); \
643         do \
644           echo $${name}; \
645           $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
646               $(srcdir)/libgcc2.c -o $${name}.o; \
647           if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
648           $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
649           rm -f $${name}.o; \
650         done
651 # Some shells crash when a loop has no items.
652 # So make sure there is always at least one--`..'.
653 # Then ignore it.
654 # We don't use -e here because there are if statements
655 # that should not make the command give up when the if condition is false.
656 # Instead, we test for failure after each command where it matters.
657         -for file in .. $(LIB2FUNCS_EXTRA); \
658         do \
659           if [ x$${file} != x.. ]; then \
660             name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
661             echo $${name}; \
662             if [ $${name}.asm = $${file} ]; then \
663               cp $${file} $${name}.s || exit 1; file=$${name}.s; \
664             else true; fi; \
665             $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
666             if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
667             $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
668             rm -f $${name}.[so]; \
669           else true; \
670           fi; \
671         done
672         mv tmplibgcc2.a libgcc2.a
673 # These lines were deleted from above the mv command
674 # because ranlibing libgcc.a itself should suffice.
675 #       -if [ x${HPUX_GAS} = x ] ; then \
676 #         if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc2.a; else true; fi \
677 #       else true; fi
678
679 # Combine the various libraries into a single library, libgcc.a.
680 libgcc.a: $(LIBGCC1) $(LIBGCC2)
681         -rm -rf tmplibgcc.a libgcc.a tmpcopy
682         mkdir tmpcopy
683         -if [ x$(LIBGCC1) != x ];                       \
684         then (cd tmpcopy; $(AR) x ../$(LIBGCC1));       \
685         else true;                                      \
686         fi
687         (cd tmpcopy; $(AR) x ../$(LIBGCC2))
688         (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o)
689         rm -rf tmpcopy
690         -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
691 # Actually build it in tmplibgcc.a, then rename at end,
692 # so that libgcc.a itself remains nonexistent if compilation is aborted.
693         mv tmplibgcc.a libgcc.a
694
695 objc-runtime: libobjc.a
696
697 # Build the Objective C runtime library.
698 libobjc.a: cc1obj libgcc2.ready
699         if [ -d objc ]; then true; else mkdir objc; fi
700         thisdir1=`pwd`; \
701         srcdir1=`cd $(srcdir); pwd`; \
702         cd objc; \
703         $(MAKE) -f $${srcdir1}/objc/Makefile libobjc.a \
704           srcdir=$${srcdir1} tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
705           GCC_FOR_TARGET="$${thisdir1}/xgcc -B$${thisdir1}/" \
706           GCC_CFLAGS="$(GCC_CFLAGS)"
707         -rm -f libobjc.a
708         ln objc/libobjc.a . >/dev/null 2>&1 || cp objc/libobjc.a .
709         -if $(RANLIB_TEST) ; then $(RANLIB) libobjc.a; else true; fi
710
711 # This is used by objc/Makefile if the user runs that directly.
712 sublibobjc.a: cc1obj libgcc2.ready
713         thisdir1=`pwd`; \
714         srcdir1=`cd $(srcdir); pwd`; \
715         cd objc; \
716         $(MAKE) -f $$srcdir1/objc/Makefile libobjc.a \
717           srcdir=$$srcdir1 tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
718           GCC_FOR_TARGET="$$thisdir1/xgcc -B$$thisdir1/" \
719           GCC_CFLAGS="$(GCC_CFLAGS)"
720
721 # Compile two additional files that are linked with every program
722 # linked using GCC on system V, for the sake of C++ constructors.
723 crtbegin.o:     crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
724         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) -DCRT_BEGIN \
725           -finhibit-size-directive -g0 -c $(srcdir)/crtstuff.c -o crtbegin.o
726
727 crtend.o:       crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
728         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) -DCRT_END \
729           -finhibit-size-directive -g0 -c $(srcdir)/crtstuff.c -o crtend.o
730 \f
731 # Compiling object files from source files.
732
733 # Note that dependencies on obstack.h are not written
734 # because that file is not part of GCC.
735 # Dependencies on gvarargs.h are not written
736 # because all that file does, when not compiling with GCC,
737 # is include the system varargs.h.
738
739 # C language specific files.
740
741 c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h c-parse.h \
742     c-tree.h input.h flags.h
743         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
744 $(srcdir)/c-parse.c $(srcdir)/c-parse.h: $(srcdir)/c-parse.y
745         cd $(srcdir); $(BISON) $(BISONFLAGS) -d c-parse.y -o c-parse.c
746 $(srcdir)/c-parse.y: $(srcdir)/c-parse.in
747         sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
748           -e "/^ifc$$/d" -e "/^end ifc$$/d" \
749           $(srcdir)/c-parse.in > $(srcdir)/c-parse.y
750
751 c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h
752 c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
753 c-lang.o : c-lang.c $(CONFIG_H) $(TREE_H)
754 c-lex.o : c-lex.c $(CONFIG_H) $(TREE_H) c-lex.h c-tree.h c-parse.h \
755     input.h flags.h
756 c-aux-info.o : c-aux-info.c  $(CONFIG_H) $(TREE_H) c-tree.h flags.h
757 c-convert.o : c-convert.c $(CONFIG_H) $(TREE_H) flags.h
758 c-pragma.o: c-pragma.c $(CONFIG_H) $(TREE_H)
759 c-iterate.o: c-iterate.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-tree.h flags.h
760
761 # C++ language specific files.
762
763 cp-parse.o : $(srcdir)/cp-parse.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h cp-lex.h
764         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
765   `echo $(srcdir)/cp-parse.c | sed 's,^\./,,'`
766
767 $(srcdir)/cp-parse.c $(srcdir)/cp-parse.h : $(srcdir)/cp-parse.y
768         @echo expect 29 shift/reduce conflicts and 14 reduce/reduce conflicts
769         cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o cp-parse.c cp-parse.y
770         cd $(srcdir); grep '^#define[   ]*YYEMPTY' cp-parse.c >>cp-parse.h
771
772 cp-spew.o : cp-spew.c $(CONFIG_H) $(CPLUS_TREE_H) \
773    $(srcdir)/cp-parse.h flags.h cp-lex.h
774 cp-lex.o : cp-lex.c $(CONFIG_H) $(CPLUS_TREE_H) \
775    $(srcdir)/cp-parse.h $(srcdir)/cp-input.c flags.h cp-hash.h cp-lex.h
776 cp-decl.o : cp-decl.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \
777   cp-lex.h cp-decl.h stack.h
778 cp-decl2.o : cp-decl2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \
779   cp-lex.h cp-decl.h
780 cp-type2.o : cp-type2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
781 cp-typeck.o : cp-typeck.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h $(RTL_H)
782 cp-class.o : cp-class.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
783 cp-call.o : cp-call.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
784 cp-init.o : cp-init.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h $(RTL_H)
785 cp-method.o : cp-method.c $(CONFIG_H) $(CPLUS_TREE_H)
786 cp-cvt.o : cp-cvt.c $(CONFIG_H) $(CPLUS_TREE_H)
787 cp-search.o : cp-search.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h flags.h
788 cp-tree.o : cp-tree.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
789 cp-ptree.o : cp-ptree.c $(CONFIG_H) $(CPLUS_TREE_H)
790 cp-gc.o : cp-gc.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
791 cp-except.o : cp-except.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h $(RTL_H)
792 cp-expr.o : cp-expr.c $(CONFIG_H) $(CPLUS_TREE_H) $(RTL_H) flags.h \
793   expr.h insn-codes.h
794 cp-edsel.o : cp-edsel.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h flags.h
795 cp-xref.o : cp-xref.c $(CONFIG_H) $(CPLUS_TREE_H) input.h
796 cp-pt.o : cp-pt.c $(CONFIG_H) $(CPLUS_TREE_H) cp-decl.h cp-parse.h
797
798 # To make a configuration always use collect2, set USE_COLLECT2 to ld.
799 ld: collect2
800         rm -f ld
801         ln collect2 ld
802
803 collect2 : collect2.o version.o $(LIBDEPS)
804 # Don't try modifying collect2 (aka ld) in place--it might be linking this.
805         -rm -f collect2
806         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o collect2 collect2.o version.o $(LIBS)
807
808 collect2.o : collect2.c $(CONFIG_H) gstab.h
809         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES)  \
810         -DTARGET_MACHINE=\"$(target)\" \
811         -c `echo $(srcdir)/collect2.c | sed 's,^\./,,'`
812
813 # Objectionable C language specific files.
814
815 objc-parse.o : $(srcdir)/objc-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \
816    c-tree.h input.h flags.h objc-act.h
817         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/objc-parse.c
818 $(srcdir)/objc-parse.c : $(srcdir)/objc-parse.y
819         cd $(srcdir); $(BISON) $(BISONFLAGS) objc-parse.y -o objc-parse.c
820 $(srcdir)/objc-parse.y: $(srcdir)/c-parse.in
821         sed -e "/^ifc$$/,/^end ifc$$/d" \
822           -e "/^ifobjc$$/d" -e "/^end ifobjc$$/d" \
823           $(srcdir)/c-parse.in > $(srcdir)/objc-parse.y
824
825 objc-act.o : objc-act.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-tree.h c-lex.h \
826    flags.h objc-act.h input.h function.h $(srcdir)/c-parse.h
827
828 # A file used by all variants of C.
829
830 c-common.o : c-common.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h
831
832 # Language-independent files.
833
834 gcc.o: gcc.c $(CONFIG_H) gvarargs.h config.status
835         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
836   -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
837   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
838   -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
839   -DTOOLDIR_BASE_PREFIX=\"$(prefix)/\" \
840   -DTOOLDIR=\"$(tooldir)/\" \
841   $(MAYBE_TARGET_DEFAULT) \
842   -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
843
844 dumpvers: dumpvers.c
845
846 version.o: version.c
847 obstack.o: obstack.c
848
849 convert.o: convert.c $(CONFIG_H) $(TREE_H) flags.h convert.h
850
851 tree.o : tree.c $(CONFIG_H) $(TREE_H) gvarargs.h flags.h function.h
852 print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
853 stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) function.h
854 fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) flags.h 
855 toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h input.h \
856    insn-attr.h xcoffout.h defaults.h
857         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
858           $(MAYBE_TARGET_DEFAULT) $(MAYBE_USE_COLLECT2) \
859           -c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
860
861 rtl.o : rtl.c $(CONFIG_H) $(RTL_H)
862
863 print-rtl.o : print-rtl.c $(CONFIG_H) $(RTL_H)
864 rtlanal.o : rtlanal.c $(CONFIG_H) $(RTL_H)
865
866 varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h function.h \
867    defaults.h insn-codes.h expr.h hard-reg-set.h regs.h xcoffout.h
868 function.o : function.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h  \
869    insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h insn-config.h \
870    recog.h output.h
871 stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h  \
872    insn-flags.h insn-config.h insn-codes.h hard-reg-set.h expr.h loop.h recog.h
873 expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h  \
874    insn-flags.h insn-codes.h expr.h insn-config.h recog.h output.h typeclass.h
875 calls.o : calls.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h \
876    insn-flags.h gvarargs.h 
877 expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h  \
878    insn-flags.h insn-config.h insn-codes.h expr.h recog.h real.h
879 explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h hard-reg-set.h \
880    insn-config.h expr.h recog.h insn-flags.h insn-codes.h
881 optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h  \
882    insn-flags.h insn-config.h insn-codes.h expr.h recog.h reload.h
883 dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h regs.h \
884    insn-config.h reload.h gstab.h xcoffout.h defaults.h output.h
885 sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H) gsyms.h flags.h \
886    insn-config.h reload.h
887 dwarfout.o : dwarfout.c $(CONFIG_H) $(TREE_H) $(RTL_H) dwarf.h flags.h \
888    insn-config.h reload.h output.h defaults.h
889 xcoffout.o : xcoffout.c $(CONFIG_H) $(TREE_H) $(RTL_H) xcoffout.h flags.h
890 emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) flags.h gvarargs.h function.h  \
891    regs.h insn-config.h insn-codes.h real.h expr.h
892 real.o : real.c $(CONFIG_H) $(TREE_H)
893 getpwd.o : getpwd.c $(CONFIG_H)
894
895 integrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h integrate.h \
896    insn-flags.h insn-config.h insn-codes.h expr.h real.h function.h
897
898 jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h hard-reg-set.h regs.h \
899    insn-config.h insn-flags.h insn-codes.h expr.h real.h
900 stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h
901
902 cse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h real.h \
903    insn-config.h recog.h
904 loop.o : loop.c $(CONFIG_H) $(RTL_H) flags.h loop.h insn-config.h \
905    insn-flags.h insn-codes.h regs.h hard-reg-set.h recog.h expr.h real.h
906 unroll.o : unroll.c $(CONFIG_H) $(RTL_H) insn-config.h insn-codes.h \
907    integrate.h regs.h flags.h expr.h loop.h
908 flow.o : flow.c $(CONFIG_H) $(RTL_H) flags.h insn-config.h \
909    basic-block.h regs.h hard-reg-set.h output.h
910 combine.o : combine.c $(CONFIG_H) $(RTL_H) gvarargs.h flags.h  \
911    insn-config.h insn-flags.h insn-codes.h insn-attr.h regs.h expr.h \
912    basic-block.h recog.h real.h hard-reg-set.h
913 regclass.o : regclass.c $(CONFIG_H) $(RTL_H) hard-reg-set.h flags.h \
914    basic-block.h regs.h insn-config.h recog.h reload.h real.h
915 local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) flags.h basic-block.h \
916    regs.h hard-reg-set.h insn-config.h recog.h output.h
917 global.o : global.c $(CONFIG_H) $(RTL_H) flags.h  \
918    basic-block.h regs.h hard-reg-set.h insn-config.h output.h
919
920 reload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h \
921    reload.h recog.h hard-reg-set.h insn-config.h insn-codes.h regs.h real.h
922 reload1.o : reload1.c $(CONFIG_H) $(RTL_H) flags.h expr.h \
923    reload.h regs.h hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \
924    basic-block.h recog.h output.h
925 caller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \
926    regs.h hard-reg-set.h insn-config.h basic-block.h recog.h reload.h expr.h
927 reorg.o : reorg.c $(CONFIG_H) $(RTL_H) conditions.h hard-reg-set.h \
928    basic-block.h regs.h insn-config.h insn-attr.h insn-flags.h recog.h \
929    flags.h output.h
930 sched.o : sched.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h \
931    flags.h insn-config.h insn-attr.h
932 final.o : final.c $(CONFIG_H) $(RTL_H) gvarargs.h flags.h regs.h \
933    recog.h conditions.h insn-config.h insn-attr.h real.h output.h \
934    hard-reg-set.h insn-flags.h insn-codes.h gstab.h xcoffout.h defaults.h
935 recog.o : recog.c $(CONFIG_H) $(RTL_H)  \
936    regs.h recog.h hard-reg-set.h flags.h insn-config.h insn-attr.h \
937    insn-flags.h insn-codes.h real.h
938 reg-stack.o : reg-stack.c $(CONFIG_H) $(RTL_H) $(TREE_H) \
939    regs.h hard-reg-set.h flags.h insn-config.h
940
941 aux-output.o : aux-output.c $(CONFIG_H) \
942    $(RTL_H) regs.h hard-reg-set.h real.h insn-config.h conditions.h \
943    insn-flags.h output.h insn-attr.h insn-codes.h
944
945 # Normally this target is not used; but it is used if you
946 # define ALLOCA=alloca.o.  In that case, you must get a suitable alloca.c
947 # from the GNU Emacs distribution.
948 alloca.o:       alloca.c
949         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ALLOCA_FLAGS) \
950           -c `echo $(srcdir)/alloca.c | sed 's,^\./,,'`
951         $(ALLOCA_FINISH)
952 \f
953 # Generate header and source files from the machine description, 
954 # and compile them.
955
956 .PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
957   insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
958   insn-attr.h insn-attrtab.c
959
960 # The following pair of rules has this effect:
961 # genconfig is run only if the md has changed since genconfig was last run;
962 # but the file insn-config.h is touched only when its contents actually change.
963
964 # Each of the other insn-* files is handled by a similar pair of rules.
965
966 # This causes an anomaly in the results of make -n
967 # because insn-* is older than stamp-*
968 # and thus make -n thinks that insn-* will be updated
969 # and force recompilation of things that depend on it.
970 # We use move-if-change precisely to avoid such recompilation.
971 # But there is no way to teach make -n that it will be avoided.
972
973 # Each of the insn-*.[ch] rules has a semicolon at the end,
974 # for otherwise the system Make on SunOS 4.1 never tries
975 # to recompile insn-*.o.  To avoid problems and extra noise from
976 # versions of make which don't like empty commands (nothing after the
977 # trailing `;'), we call true for each.
978
979 insn-config.h: stamp-config ; @true
980 stamp-config : md genconfig $(srcdir)/move-if-change
981         ./genconfig md > tmp-config.h
982         $(srcdir)/move-if-change tmp-config.h insn-config.h
983         touch stamp-config
984
985 insn-flags.h: stamp-flags ; @true
986 stamp-flags : md genflags $(srcdir)/move-if-change
987         ./genflags md > tmp-flags.h
988         $(srcdir)/move-if-change tmp-flags.h insn-flags.h
989         touch stamp-flags
990
991 insn-codes.h: stamp-codes ; @true
992 stamp-codes : md gencodes $(srcdir)/move-if-change
993         ./gencodes md > tmp-codes.h
994         $(srcdir)/move-if-change tmp-codes.h insn-codes.h
995         touch stamp-codes
996
997 insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h real.h output.h \
998   insn-config.h insn-flags.h insn-codes.h
999         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
1000
1001 insn-emit.c: stamp-emit ; @true
1002 stamp-emit : md genemit $(srcdir)/move-if-change
1003         ./genemit md > tmp-emit.c
1004         $(srcdir)/move-if-change tmp-emit.c insn-emit.c
1005         touch stamp-emit
1006
1007 insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h recog.h \
1008   real.h output.h flags.h
1009         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c
1010
1011 insn-recog.c: stamp-recog ; @true
1012 stamp-recog : md genrecog $(srcdir)/move-if-change
1013         ./genrecog md > tmp-recog.c
1014         $(srcdir)/move-if-change tmp-recog.c insn-recog.c
1015         touch stamp-recog
1016
1017 insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) insn-codes.h insn-flags.h \
1018   insn-config.h flags.h rtl.h recog.h expr.h reload.h
1019         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c
1020
1021 insn-opinit.c: stamp-opinit ; @true
1022 stamp-opinit : md genopinit $(srcdir)/move-if-change
1023         ./genopinit md > tmp-opinit.c
1024         $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c
1025         touch stamp-opinit
1026
1027 insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H)
1028         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c
1029
1030 insn-extract.c: stamp-extract ; @true
1031 stamp-extract : md genextract $(srcdir)/move-if-change
1032         ./genextract md > tmp-extract.c
1033         $(srcdir)/move-if-change tmp-extract.c insn-extract.c
1034         touch stamp-extract
1035
1036 insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h output.h real.h
1037         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c
1038
1039 insn-peep.c: stamp-peep ; @true
1040 stamp-peep : md genpeep $(srcdir)/move-if-change
1041         ./genpeep md > tmp-peep.c
1042         $(srcdir)/move-if-change tmp-peep.c insn-peep.c
1043         touch stamp-peep
1044
1045 insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) regs.h real.h output.h \
1046      insn-attr.h insn-config.h
1047         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c
1048
1049 insn-attr.h: stamp-attr ; @true
1050 stamp-attr : md genattr $(srcdir)/move-if-change
1051         ./genattr md > tmp-attr.h
1052         $(srcdir)/move-if-change tmp-attr.h insn-attr.h
1053         touch stamp-attr
1054
1055 insn-attrtab.c: stamp-attrtab ; @true
1056 stamp-attrtab : md genattrtab $(srcdir)/move-if-change
1057         if cmp -s $(PREMADE_ATTRTAB_MD) md;     \
1058         then                                    \
1059           echo Using $(PREMADE_ATTRTAB);        \
1060           cp $(PREMADE_ATTRTAB) tmp-attrtab.c;  \
1061         else                                    \
1062           ./genattrtab md > tmp-attrtab.c;      \
1063         fi
1064         $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
1065         touch stamp-attrtab
1066
1067 insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h real.h conditions.h \
1068     hard-reg-set.h insn-config.h insn-flags.h insn-attr.h output.h recog.h \
1069     insn-codes.h
1070         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
1071
1072 insn-output.c: stamp-output ; @true
1073 stamp-output : md genoutput $(srcdir)/move-if-change
1074         ./genoutput md > tmp-output.c
1075         $(srcdir)/move-if-change tmp-output.c insn-output.c
1076         touch stamp-output
1077 \f
1078 # Compile the programs that generate insn-* from the machine description.
1079 # They are compiled with $(HOST_CC), and associated libraries,
1080 # since they need to run on this machine
1081 # even if GCC is being compiled to run on some other machine.
1082
1083 # $(CONFIG_H) is omitted from the deps of the gen*.o
1084 # because these programs don't really depend on anything 
1085 # about the target machine.  They do depend on config.h itself,
1086 # since that describes the host machine.
1087
1088 genconfig : genconfig.o $(HOST_RTL) $(HOST_LIBDEPS)
1089         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genconfig \
1090           genconfig.o $(HOST_RTL) $(HOST_LIBS)
1091
1092 genconfig.o : genconfig.c $(RTL_H) hconfig.h
1093         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
1094
1095 genflags : genflags.o $(HOST_RTL) $(HOST_LIBDEPS)
1096         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genflags \
1097          genflags.o $(HOST_RTL) $(HOST_LIBS)
1098
1099 genflags.o : genflags.c $(RTL_H) hconfig.h
1100         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
1101
1102 gencodes : gencodes.o $(HOST_RTL) $(HOST_LIBDEPS)
1103         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gencodes \
1104          gencodes.o $(HOST_RTL) $(HOST_LIBS)
1105
1106 gencodes.o : gencodes.c $(RTL_H) hconfig.h
1107         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
1108
1109 genemit : genemit.o $(HOST_RTL) $(HOST_LIBDEPS)
1110         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genemit \
1111          genemit.o $(HOST_RTL) $(HOST_LIBS)
1112
1113 genemit.o : genemit.c $(RTL_H) hconfig.h
1114         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
1115
1116 genopinit : genopinit.o $(HOST_RTL) $(HOST_LIBDEPS)
1117         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genopinit \
1118          genopinit.o $(HOST_RTL) $(HOST_LIBS)
1119
1120 genopinit.o : genopinit.c $(RTL_H) hconfig.h
1121         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c
1122
1123 genrecog : genrecog.o $(HOST_RTL) $(HOST_LIBDEPS)
1124         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genrecog \
1125          genrecog.o $(HOST_RTL) $(HOST_LIBS)
1126
1127 genrecog.o : genrecog.c $(RTL_H) hconfig.h
1128         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
1129
1130 genextract : genextract.o $(HOST_RTL) $(HOST_LIBDEPS)
1131         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genextract \
1132          genextract.o $(HOST_RTL) $(HOST_LIBS)
1133
1134 genextract.o : genextract.c $(RTL_H) hconfig.h insn-config.h
1135         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
1136
1137 genpeep : genpeep.o $(HOST_RTL) $(HOST_LIBDEPS)
1138         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genpeep \
1139          genpeep.o $(HOST_RTL) $(HOST_LIBS)
1140
1141 genpeep.o : genpeep.c $(RTL_H) hconfig.h
1142         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
1143
1144 genattr : genattr.o $(HOST_RTL) $(HOST_LIBDEPS)
1145         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattr \
1146          genattr.o $(HOST_RTL) $(HOST_LIBS)
1147
1148 genattr.o : genattr.c $(RTL_H) hconfig.h
1149         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
1150
1151 genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBDEPS)
1152         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattrtab \
1153          genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBS)
1154
1155 genattrtab.o : genattrtab.c $(RTL_H) hconfig.h insn-config.h
1156         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
1157
1158 genoutput : genoutput.o $(HOST_RTL) $(HOST_LIBDEPS)
1159         $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genoutput \
1160          genoutput.o $(HOST_RTL) $(HOST_LIBS)
1161
1162 genoutput.o : genoutput.c $(RTL_H) hconfig.h
1163         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
1164 \f
1165 # Compile the libraries to be used by gen*.
1166 # If we are not cross-building, gen* use the same .o's that cc1 will use,
1167 # and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
1168 # with the rules for rtl.o, alloca.o, etc.
1169 $(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) $(RTL_H)
1170         rm -f $(HOST_PREFIX)rtl.c
1171         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c
1172         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c
1173
1174 $(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) $(RTL_H)
1175         rm -f $(HOST_PREFIX)print-rtl.c
1176         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c
1177         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c
1178
1179 $(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) $(RTL_H)
1180         rm -f $(HOST_PREFIX)rtlanal.c
1181         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtlanal.c > $(HOST_PREFIX)rtlanal.c
1182         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c
1183
1184 $(HOST_PREFIX_1)alloca.o: alloca.c
1185         rm -f $(HOST_PREFIX)alloca.c
1186         cp $(srcdir)/alloca.c $(HOST_PREFIX)alloca.c
1187         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c
1188
1189 $(HOST_PREFIX_1)obstack.o: obstack.c
1190         rm -f $(HOST_PREFIX)obstack.c
1191         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/obstack.c > $(HOST_PREFIX)obstack.c
1192         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c
1193
1194 $(HOST_PREFIX_1)malloc.o: malloc.c
1195         rm -f $(HOST_PREFIX)malloc.c
1196         sed -e 's/config[.]h/hconfig.h/' $(srcdir)/malloc.c > $(HOST_PREFIX)malloc.c
1197         $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c
1198
1199 # This satisfies the dependency that we get if you cross-compile a compiler
1200 # that does not need to compile alloca, malloc or whatever.
1201 $(HOST_PREFIX_1): 
1202         touch $(HOST_PREFIX_1)
1203 \f
1204 # Remake cpp and protoize.
1205
1206 # Making the preprocessor
1207 cpp: cccp
1208         -rm -f cpp
1209         ln cccp cpp
1210 cccp: cccp.o cexp.o version.o $(LIBDEPS)
1211         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cccp cccp.o cexp.o version.o $(LIBS)
1212 cexp.o: $(srcdir)/cexp.c $(CONFIG_H)
1213         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
1214 $(srcdir)/cexp.c: $(srcdir)/cexp.y
1215         cd $(srcdir); $(BISON) -o cexp.c cexp.y
1216 cccp.o: cccp.c $(CONFIG_H) pcp.h version.c config.status
1217 # The reason we use $(libdir)/g++-include rather than using libsubdir
1218 # is for compatibility with the current version of libg++.
1219         $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1220           -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1221           -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
1222           -DLOCAL_INCLUDE_DIR=\"$(local_prefix)/include\" \
1223           -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
1224           -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
1225           -DTOOLDIR=\"$(tooldir)/\" \
1226           -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
1227
1228 # Note for the stamp targets, we run the program `true' instead of
1229 # having an empty command (nothing following the semicolon).
1230
1231 proto: config.status protoize unprotoize SYSCALLS.c.X
1232
1233 protoize: protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS)
1234         $(CC) $(ALL_CFLAGS) $(LDFLAGS) \
1235           protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) -o $@
1236 protoize.o: stamp-proto ; @true
1237
1238 unprotoize: unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS)
1239         $(CC) $(ALL_CFLAGS) $(LDFLAGS) \
1240           unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) -o $@
1241 unprotoize.o:   stamp-proto ; @true
1242
1243 stamp-proto:    $(srcdir)/protoize.c getopt.h $(CONFIG_H)
1244         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1245           -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1246           -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
1247           -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
1248           -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
1249           -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
1250           -DSTD_PROTO_DIR=\"$(libsubdir)\" \
1251           -DUNPROTOIZE $(srcdir)/protoize.c
1252         mv protoize.o unprotoize.o
1253         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1254           -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1255           -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
1256           -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
1257           -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
1258           -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
1259           -DSTD_PROTO_DIR=\"$(libsubdir)\" \
1260           $(srcdir)/protoize.c
1261         touch stamp-proto
1262
1263 getopt.o: $(srcdir)/getopt.c getopt.h
1264         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt.c
1265 getopt1.o: $(srcdir)/getopt1.c getopt.h
1266         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt1.c
1267
1268 # This info describes the target machine, so compile with GCC just built.
1269 SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES)
1270         -rm -f SYSCALLS.c tmp-SYSCALLS.s
1271         cat $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c
1272         $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1273           -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c
1274         -rm -f SYSCALLS.c tmp-SYSCALLS.s
1275
1276 test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
1277         -rm -f tmp-proto.[cso]
1278         cp $(srcdir)/protoize.c tmp-proto.c
1279         chmod u+w tmp-proto.c
1280         ./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \
1281           $(CFLAGS) $(INCLUDES) \
1282           -DGCC_INCLUDE_DIR=0 \
1283           -DGPLUSPLUS_INCLUDE_DIR=0 \
1284           -DCROSS_INCLUDE_DIR=0 \
1285           -DTOOL_INCLUDE_DIR=0 \
1286           -DSTD_PROTO_DIR=0" tmp-proto.c
1287         @echo '**********' Expect 400 lines of differences.
1288         -diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff
1289         -wc -l tmp-proto.diff
1290         ./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \
1291           $(CFLAGS) $(INCLUDES) \
1292           -DGCC_INCLUDE_DIR=0 \
1293           -DGPLUSPLUS_INCLUDE_DIR=0 \
1294           -DCROSS_INCLUDE_DIR=0 \
1295           -DTOOL_INCLUDE_DIR=0 \
1296           -DSTD_PROTO_DIR=0" tmp-proto.c
1297         @echo Expect zero differences.
1298         diff $(srcdir)/protoize.c tmp-proto.c | cat
1299         -rm -f tmp-proto.[cso]
1300 \f
1301 # Build the include directory.  The stamp files are stmp-* rather than
1302 # stamp-* so that mostlyclean does not force the include directory to
1303 # be rebuilt.
1304
1305 # Build the include directory except for float.h (which depends upon
1306 # enquire).
1307 stmp-int-hdrs: stmp-fixinc $(USER_H) gvarargs.h gstdarg.h gstddef.h \
1308   xlimits.h objc-headers
1309 # Copy in the headers provided with gcc.
1310 # The sed command gets just the last file name component;
1311 # this is necessary because VPATH could add a dirname.
1312 # Using basename would be simpler, but some systems don't have it.
1313         objdir=`pwd`; \
1314         cd $(srcdir); \
1315         for file in $(USER_H); do \
1316           realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
1317           rm -f $$objdir/include/$$realfile; \
1318           cp $$realfile $$objdir/include; \
1319           chmod a+r $$objdir/include/$$realfile; \
1320         done
1321         rm -f include/varargs.h
1322         cp $(srcdir)/gvarargs.h include/varargs.h
1323         chmod a+r include/varargs.h
1324         rm -f include/stdarg.h
1325         cp $(srcdir)/gstdarg.h include/stdarg.h
1326         chmod a+r include/stdarg.h
1327         rm -f include/stddef.h
1328         cp $(srcdir)/gstddef.h include/stddef.h
1329         chmod a+r include/stddef.h
1330         rm -f include/limits.h
1331         cp xlimits.h include/limits.h
1332         chmod a+r include/limits.h
1333 # Install the README
1334         rm -f include/README
1335         cp $(srcdir)/README-fixinc include/README
1336         chmod a+r include/README
1337         touch stmp-int-hdrs
1338
1339 # Build the complete include directory.
1340 stmp-headers: stmp-int-hdrs gfloat.h
1341         rm -f include/float.h
1342         cp gfloat.h include/float.h
1343         chmod a+r include/float.h
1344         touch stmp-headers
1345
1346 # Build fixed copies of system files.
1347 stmp-fixinc: $(srcdir)/$(FIXINCLUDES) gsyslimits.h
1348         rm -rf include
1349         mkdir include
1350         if [ x$(FIXINCLUDES) != xMakefile.in ]; \
1351         then \
1352           for dir in $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); do \
1353             if [ -d $$dir ]; \
1354             then \
1355               $(srcdir)/$(FIXINCLUDES) include $$dir $(srcdir); \
1356             else true; fi; \
1357           done; \
1358         else true; \
1359         fi
1360         rm -f include/syslimits.h
1361         if [ -f include/limits.h ]; then \
1362           mv include/limits.h include/syslimits.h; \
1363         else \
1364           cp $(srcdir)/gsyslimits.h include/syslimits.h; \
1365         fi
1366         chmod a+r include/syslimits.h
1367         touch stmp-fixinc
1368
1369 # copy objc header files
1370 objc-headers: force
1371         if [ -d objc ]; then true; else mkdir objc; fi
1372         thisdir1=`pwd`; \
1373         srcdir1=`cd $(srcdir); pwd`; \
1374         cd objc; \
1375         $(MAKE) -f $${srcdir1}/objc/Makefile copy-headers \
1376         srcdir=$${srcdir1} tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
1377         GCC_FOR_TARGET="$${thisdir1}/xgcc -B$${thisdir1}/" \
1378         GCC_CFLAGS="$(GCC_CFLAGS)" incinstalldir=$${thisdir1}/include
1379   
1380 \f
1381 # Remake the info files.
1382
1383 doc: $(srcdir)/cpp.info $(srcdir)/gcc.info
1384
1385 $(srcdir)/cpp.info: cpp.texi
1386         $(MAKEINFO) `echo $(srcdir)/cpp.texi | sed 's,^\./,,'`
1387
1388 #$(srcdir)/gplus.info: gplus.texi
1389 #       $(MAKEINFO) `echo $(srcdir)/gplus.texi | sed 's,^\./,,'`
1390
1391 $(srcdir)/gcc.info: gcc.texi extend.texi install.texi invoke.texi \
1392                 md.texi rtl.texi tm.texi 
1393         $(MAKEINFO) `echo $(srcdir)/gcc.texi | sed 's,^\./,,'`
1394
1395 # This works with GNU Make's default rule.
1396 $(srcdir)/gcc.dvi: gcc.texi extend.texi install.texi invoke.texi \
1397                 md.texi rtl.texi tm.texi 
1398
1399 # This works with GNU Make's default rule.
1400 $(srcdir)/cpp.dvi: cpp.texi
1401
1402 $(srcdir)/INSTALL: install1.texi install.texi
1403         $(MAKEINFO) -D INSTALLONLY --no-header `echo $(srcdir)/install1.texi | sed 's,^\./,,'`
1404 \f
1405 # Deletion of files made during compilation.
1406 # There are four levels of this:
1407 #   `mostlyclean', `clean', `distclean' and `realclean'.
1408 # `mostlyclean' is useful while working on a particular type of machine.
1409 # It deletes most, but not all, of the files made by compilation.
1410 # It does not delete libgcc.a or its parts, so it won't have to be recompiled.
1411 # `clean' deletes everything made by running `make all'.
1412 # `distclean' also deletes the files made by config.
1413 # `realclean' also deletes everything that could be regenerated automatically.
1414
1415
1416 mostlyclean:
1417         -rm -f $(STAGESTUFF)
1418 # Clean the objc subdir if we created one.
1419         if [ -d objc ]; then \
1420           srcdir1=`cd $(srcdir); pwd`; \
1421           cd objc; $(MAKE) -f $$srcdir1/objc/Makefile mostlyclean; \
1422         else true; fi
1423         -rm -f libobjc.a
1424 # Delete the temporary source copies for cross compilation.
1425         -rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c
1426         -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
1427         -rm -f $(HOST_PREFIX_1)obstack.c 
1428 # Delete the temp files made in the course of building libgcc.a.
1429         -rm -f tmplibgcc* tmpcopy xlimits.h
1430         for name in $(LIB1FUNCS); do rm -f $${name}.c; done
1431 # Delete other temporary files.
1432         -rm -f tmp-float.h tmp-gcc.xtar.Z
1433         -rm -f tmp-foo1 tmp-foo2 tmp-proto.* tmp-unproto.1 tmp-SYSCALLS.s
1434 # Delete the stamp files.
1435         -rm -f stamp-* tmp-*
1436 # Delete debugging dump files.
1437         -rm -f *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
1438         -rm -f *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack
1439 # Delete some files made during installation.
1440         -rm -f specs gfloat.h float.h-* enquire SYSCALLS.c.X SYSCALLS.c
1441         -rm -f collect collect2 ld mips-tfile mips-tdump alloca.s
1442 # Delete unwanted output files from TeX.
1443         -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
1444 # Delete sorted indices we don't actually use.
1445         -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
1446 # Delete core dumps.
1447         -rm -f core config/core
1448
1449 # Delete all files made by compilation
1450 # that don't exist in the distribution.
1451 clean: mostlyclean
1452 # It may not be quite desirable to delete unprotoize.c here,
1453 # but the spec for `make clean' requires it.
1454 # Using unprotoize.c is not quite right in the first place, 
1455 # but what better way is there?
1456         -rm -f libgcc.a libgcc1.a libgcc2.a libgcc2.ready libgcc1.null
1457         -rm -f *.dvi
1458 # Delete the include directory.
1459         -rm -rf stmp-* include
1460
1461 # Delete all files that users would normally create
1462 # while building and installing GCC.
1463 distclean: clean
1464         -rm -f tm.h aux-output.c config.h md config.status tconfig.h hconfig.h
1465         -rm -f Makefile *.oaux
1466         -rm -fr stage1 stage2 stage3 stage4
1467
1468 # Delete anything likely to be found in the source directory
1469 # that shouldn't be in the distribution.
1470 extraclean: distclean
1471         -rm -rf =* ./"#"* *~* config/=* config/"#"* config/*~*
1472         -rm -f patch* *.orig *.rej config/patch* config/*.orig config/*.rej
1473         -rm -f *.dvi *.oaux *.d *.[zZ] *.tar *.xtar *diff
1474         -rm -f *lose config/*lose
1475         -rm -f *.s *.s[0-9] *.i install1.texi config/ChangeLog
1476
1477 # Get rid of every file that's generated from some other file.
1478 # Most of these files ARE PRESENT in the GCC distribution.
1479 realclean: distclean
1480         -rm -f c-parse.y objc-parse.y
1481         -rm -f cp-parse.c cp-parse.h cp-parse.output
1482         -rm -f objc-parse.c objc-parse.output
1483         -rm -f c-parse.c c-parse.h c-parse.output
1484         -rm -f cexp.c cexp.output TAGS 
1485         -rm -f cpp.info* cpp.??s cpp.*aux
1486         -rm -f gcc.info* gcc.??s gcc.*aux
1487         -rm -f gplus.info* gplus.??s gplus.*aux
1488 \f
1489 # Entry points `install' and `uninstall'.
1490 # Also use `install-collect2' to install collect2 when the config files don't.
1491
1492 # The semicolon is to prevent the install.sh -> install default rule
1493 # from doing anything.  Having it run true helps avoid problems and
1494 # noise from versions of make which don't like to have null commands.
1495 install: $(INSTALL_TARGET) ; @true
1496
1497 # Copy the compiler files into directories where they will be run.
1498 install-normal: install-common install-libgcc $(INSTALL_HEADERS) install-man
1499
1500 # Do nothing while making gcc with a cross-compiler. The person who
1501 # makes gcc for the target machine has to know how to put a complete
1502 # gcc together by hand.
1503 install-build: force
1504         @echo You have to install gcc on your target machine by hand.
1505
1506 # Run this on the target machine
1507 # to finish installation of cross compiler.
1508 install-cross-rest: install-float-h-cross
1509
1510 # Install float.h for cross compiler.
1511 # Run this on the target machine!
1512 install-float-h-cross:
1513 #       if [ -f enquire ] ; then true; else false; fi
1514 # Note: don't use -.  We should fail right away if enquire was not made.
1515         ./enquire -f > $(tmpdir)/float.h
1516         -rm -f $(libsubdir)/include/float.h
1517         $(INSTALL_DATA) $(tmpdir)/float.h $(libsubdir)/include/float.h
1518         -rm -f $(tmpdir)/float.h
1519         chmod a-x $(libsubdir)/include/float.h
1520
1521 # Create the installation directory.
1522 install-dir:
1523         -if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi
1524         -if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; fi
1525 # This dir isn't curretly searched by cpp.
1526 #       -if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; fi
1527         -if [ -d $(libdir)/gcc-lib/$(target) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target) ; fi
1528         -if [ -d $(libdir)/gcc-lib/$(target)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target)/$(version) ; fi
1529         -if [ -d $(libdir)/gcc-lib/$(target)/$(version)/include ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target)/$(version)/include ; fi
1530         -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
1531         -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; fi
1532         -if [ -f gcc-cross ] ; \
1533         then \
1534           if [ -d $(tooldir) ] ; then true ; else mkdir $(tooldir) ; fi ; \
1535           if [ -d $(assertdir) ] ; then true ; else mkdir $(assertdir) ; fi ; \
1536         else true; \
1537         fi
1538 # We don't use mkdir -p to create the parents of mandir,
1539 # because some systems don't support it.
1540 # Instead, we use this technique to create the immediate parent of mandir.
1541         -parent=`echo $(mandir)|sed -e 's@/[^/]*$$@@'`; \
1542         if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
1543         -if [ -d $(mandir) ] ; then true ; else mkdir $(mandir) ; fi
1544
1545 # Install the compiler executables built during cross compilation.
1546 # Deps on  $(srcdir)/g++ $(srcdir)/c++  would be natural here,
1547 # but the latter would get confused with the target `c++'.
1548 install-common: native install-dir xgcc $(EXTRA_PARTS)
1549         for file in $(COMPILERS); do \
1550           if [ -f $$file ] ; then \
1551             rm -f $(libsubdir)/$$file; \
1552             $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
1553           else true; \
1554           fi; \
1555         done
1556         for file in $(EXTRA_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \
1557           if [ x"$$file" != x.. ]; then \
1558             rm -f $(libsubdir)/$$file; \
1559             $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
1560           else true; fi; \
1561         done
1562 # Don't mess with specs if it doesn't exist yet.
1563         -if [ -f specs ] ; then \
1564           rm -f $(libsubdir)/specs; \
1565           $(INSTALL_DATA) specs $(libsubdir)/specs; \
1566         fi
1567 # Install the driver program as $(target)-gcc
1568 # and also as either gcc (if native) or $(tooldir)/bin/gcc.
1569         -if [ -f gcc-cross ] ; then \
1570           rm -f $(bindir)/$(target)-gcc; \
1571           $(INSTALL_PROGRAM) gcc-cross $(bindir)/$(target)-gcc; \
1572           if [ -d $(tooldir)/bin/. ] ; then \
1573             rm -f $(tooldir)/bin/gcc; \
1574             $(INSTALL_PROGRAM) gcc-cross $(tooldir)/bin/gcc; \
1575           else true; fi; \
1576         else \
1577           rm -f $(bindir)/gcc; \
1578           $(INSTALL_PROGRAM) xgcc $(bindir)/gcc; \
1579           rm -f $(bindir)/$(target)-gcc-1; \
1580           ln $(bindir)/gcc $(bindir)/$(target)-gcc-1; \
1581           mv $(bindir)/$(target)-gcc-1 $(bindir)/$(target)-gcc; \
1582         fi
1583 # Install protoize if it was compiled.
1584         -if [ -f protoize ]; \
1585         then \
1586             rm -f $(bindir)/protoize; \
1587             $(INSTALL_PROGRAM) protoize $(bindir)/protoize; \
1588             rm -f $(bindir)/unprotoize; \
1589             $(INSTALL_PROGRAM) unprotoize $(bindir)/unprotoize; \
1590             rm -f $(libsubdir)/SYSCALLS.c.X; \
1591             $(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X; \
1592             chmod a-x $(libsubdir)/SYSCALLS.c.X; \
1593         fi
1594         -if [ -f cc1plus ] ; then \
1595           rm -f $(bindir)/c++ ; \
1596           $(INSTALL_PROGRAM) $(srcdir)/c++ $(bindir)/c++ ; \
1597           rm -f $(bindir)/g++ ; \
1598           $(INSTALL_PROGRAM) $(srcdir)/g++ $(bindir)/g++ ; \
1599         fi
1600         -rm -f $(libsubdir)/cpp
1601         $(INSTALL_PROGRAM) cpp $(libsubdir)/cpp
1602
1603 # Install the man pages.
1604 install-man: install-dir $(srcdir)/gcc.1 $(srcdir)/cccp.1 $(srcdir)/g++.1
1605         -rm -f $(mandir)/gcc$(manext)
1606         -$(INSTALL_DATA) $(srcdir)/gcc.1 $(mandir)/gcc$(manext)
1607         -chmod a-x $(mandir)/gcc$(manext)
1608         -rm -f $(mandir)/cccp$(manext)
1609         -$(INSTALL_DATA) $(srcdir)/cccp.1 $(mandir)/cccp$(manext)
1610         -chmod a-x $(mandir)/cccp$(manext)
1611         -$(INSTALL_DATA) $(srcdir)/g++.1 $(mandir)/g++$(manext)
1612         -chmod a-x $(mandir)/g++$(manext)
1613
1614 # Install the library.
1615 install-libgcc: libgcc.a install-dir
1616         -if [ -f libgcc.a ] ; then \
1617           rm -f $(libsubdir)/libgcc.a; \
1618           $(INSTALL_DATA) libgcc.a $(libsubdir)/libgcc.a; \
1619           if $(RANLIB_TEST) ; then \
1620             (cd $(libsubdir); $(RANLIB) libgcc.a); else true; fi; \
1621           chmod a-x $(libsubdir)/libgcc.a; \
1622         else true; fi
1623
1624 # Install the objc run time library.
1625 install-libobjc: libobjc.a install-dir
1626         -if [ -f libobjc.a ] ; then \
1627           rm -f $(libsubdir)/libobjc.a; \
1628           $(INSTALL_DATA) libobjc.a $(libsubdir)/libobjc.a; \
1629           if $(RANLIB_TEST) ; then \
1630             (cd $(libsubdir); $(RANLIB) libobjc.a); else true; fi; \
1631           chmod a-x $(libsubdir)/libobjc.a; \
1632         else true; fi
1633
1634 # Install all the header files built in the include subdirectory.
1635 install-headers: install-include-dir $(INSTALL_HEADERS_DIR) install-assert-h
1636 # Fix symlinks to absolute paths in the installed include directory to
1637 # point to the installed directory, not the build directory.
1638         -files=`cd $(libsubdir)/include; find . -type l -print 2>/dev/null`; \
1639         if [ $$? -eq 0 ]; then \
1640           dir=`cd include; pwd`; \
1641           for i in $$files; do \
1642             dest=`ls -ld $(libsubdir)/include/$$i | sed -n 's/.*-> //p'`; \
1643             if expr "$$dest" : "$$dir.*" > /dev/null; then \
1644               rm -f $(libsubdir)/include/$$i; \
1645               ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(libsubdir)/include/$$i; \
1646             fi; \
1647           done; \
1648         fi
1649
1650 # Create or recreate the gcc private include file directory.
1651 install-include-dir: install-dir
1652         -rm -rf $(libsubdir)/include
1653         mkdir $(libsubdir)/include
1654         -chmod a+rx $(libsubdir)/include
1655
1656 # Install the include directory using tar.
1657 install-headers-tar: stmp-headers install-include-dir
1658         cd include; tar cf - . | (cd $(libsubdir)/include; tar xpBf - )
1659
1660 # Install the include directory using cpio.
1661 install-headers-cpio: stmp-headers install-include-dir
1662         cd include; find . -print | cpio -pdum $(libsubdir)/include
1663
1664 # Put assert.h in /usr/local/include, so it won't override GNU libc's assert.h.
1665 # Don't replace the assert.h already there if it is not from GCC.
1666 # This code would be simpler if it tested for -f ... && ! grep ...
1667 # but supposedly the ! operator is missing in sh on some systems.
1668 install-assert-h: assert.h install-dir
1669         if [ -f $(assertdir)/assert.h ]; \
1670         then \
1671           if grep "__eprintf" $(assertdir)/assert.h >/dev/null; \
1672             then \
1673             rm -f $(assertdir)/assert.h; \
1674             $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
1675             chmod a-x $(assertdir)/assert.h; \
1676           else true; \
1677           fi; \
1678         else \
1679           rm -f $(assertdir)/assert.h; \
1680           $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
1681           chmod a-x $(assertdir)/assert.h; \
1682         fi
1683
1684 # Use this target to install the program `collect2' under the name `ld'.
1685 install-collect2: collect2
1686         $(INSTALL_PROGRAM) collect2 $(libsubdir)/ld
1687 # Install the driver program as $(libsubdir)/gcc for collect2.
1688         $(INSTALL_PROGRAM) xgcc $(libsubdir)/gcc
1689
1690 # Cancel installation by deleting the installed files.
1691 uninstall:
1692         -rm -rf $(libsubdir)
1693         -rm -rf $(bindir)/gcc
1694         -rm -rf $(bindir)/protoize
1695         -rm -rf $(bindir)/unprotoize
1696         -rm -rf $(mandir)/gcc$(manext)
1697         -rm -rf $(mandir)/g++$(manext)
1698         -rm -rf $(mandir)/cccp$(manext)
1699         -rm -rf $(mandir)/protoize$(manext)
1700         -rm -rf $(mandir)/unprotoize$(manext)
1701 \f
1702 # These exist for maintenance purposes.
1703
1704 # Update the tags table.
1705 TAGS: force
1706         cd $(srcdir);                                                   \
1707         mkdir temp;                                                     \
1708         mv -f c-parse.[ch] cp-parse.[ch] objc-parse.c cexp.c =*.[chy] temp; \
1709         etags *.y *.h *.c;                                              \
1710         mv temp/* .;                                                    \
1711         rmdir temp
1712
1713 # Create the distribution tar file.
1714 #dist: gcc-$(version).tar.Z
1715 dist: gcc.xtar.Z
1716
1717 gcc.xtar.Z: gcc.xtar
1718         compress < gcc.xtar > tmp-gcc.xtar.Z
1719         mv tmp-gcc.xtar.Z gcc.xtar.Z
1720
1721 #gcc-$(version).tar.Z: gcc-$(version).tar
1722 #       compress < gcc-$(version).tar > gcc-$(version).tar.Z
1723
1724 #gcc-$(version).tar:
1725 gcc.xtar: distdir
1726 # Make the distribution.
1727         tar chf gcc.xtar gcc-$(version)
1728
1729 distdir: doc $(srcdir)/INSTALL c-parse.y objc-parse.y cp-parse.y \
1730   c-parse.c cp-parse.c objc-parse.c cexp.c
1731         if grep -s "for version ${version}" gcc.texi; \
1732         then true; \
1733         else echo "You must update the version number in \`gcc.texi'"; sleep 10;\
1734         fi
1735 # Update the version number in README
1736         awk '$$1 " " $$2 " " $$3 == "This directory contains" \
1737                 { $$6 = version; print $$0 } \
1738              $$1 " " $$2 " " $$3 != "This directory contains"' \
1739           version=$(version) README > tmp.README
1740         mv tmp.README README
1741         -rm -rf gcc-$(version) tmp      
1742 # Put all the files in a temporary subdirectory
1743 # which has the name that we want to have in the tar file.
1744         mkdir tmp
1745         mkdir tmp/config
1746         mkdir tmp/objc
1747         for file in *[0-9a-zA-Z+]; do \
1748           ln $$file tmp > /dev/null 2>&1 || cp $$file tmp; \
1749         done
1750         cd config; \
1751         for file in *[0-9a-zA-Z+]; do \
1752           ln $$file ../tmp/config >/dev/null 2>&1 || cp $$file ../tmp/config; \
1753         done
1754         cd objc; \
1755         for file in *[0-9a-zA-Z+]; do \
1756           ln $$file ../tmp/objc >/dev/null 2>&1 || cp $$file ../tmp/objc; \
1757         done
1758         ln .gdbinit tmp
1759         mv tmp gcc-$(version)
1760 # Get rid of everything we don't want in the distribution.
1761         cd gcc-$(version); make -f Makefile.in extraclean
1762
1763 # do make -f ../gcc/Makefile maketest DIR=../gcc
1764 # in the intended test directory to make it a suitable test directory.
1765 # THIS IS OBSOLETE; use the -srcdir operand in configure instead. 
1766 maketest:
1767         ln -s $(DIR)/*.[chy] .
1768         ln -s $(DIR)/configure .
1769         ln -s $(DIR)/*.def .
1770         -rm -f =*
1771         ln -s $(DIR)/.gdbinit .
1772         ln -s $(DIR)/$(FIXINCLUDES) .
1773         -ln -s $(DIR)/bison.simple .
1774         ln -s $(DIR)/config .
1775         ln -s $(DIR)/move-if-change .
1776 # The then and else were swapped to avoid a problem on Ultrix.
1777         if [ ! -f Makefile ] ; then ln -s $(DIR)/Makefile .; else false; fi
1778         -rm tm.h aux-output.c config.h md
1779         make clean
1780 # You must then run config to set up for compilation.
1781
1782 bootstrap: force
1783 # Only build the C compiler for stage1, because that is the only one that
1784 # we can guarantee will build with the native compiler, and also it is the
1785 # only thing useful for building stage2.
1786         $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES=c
1787         $(MAKE) stage1
1788 # This used to define ALLOCA as empty, but that would lead to bad results
1789 # for a subsequent `make install' since that would not have ALLOCA empty.
1790 # To prevent `make install' from compiling alloca.o and then relinking cc1
1791 # because alloca.o is newer, we permit these recursive makes to compile
1792 # alloca.o.  Then cc1 is newer, so it won't have to be relinked.
1793         $(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
1794         $(MAKE) stage2
1795         $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
1796
1797 bootstrap2: force
1798         $(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
1799         $(MAKE) stage2
1800         $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
1801
1802 bootstrap3: force
1803         $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
1804
1805 # Compare the object files in the current directory with those in the
1806 # stage2 directory.
1807
1808 compare: force
1809         for file in *.o; do \
1810           tail +16c $$file > tmp-foo1; \
1811           tail +16c stage2/$$file > tmp-foo2 2>/dev/null \
1812             && (cmp tmp-foo1 tmp-foo2 || echo $$file differs); \
1813         done
1814         -rm -f tmp-foo*
1815
1816 # Similar, but compare with stage3 directory
1817 compare3: force
1818         for file in *.o; do \
1819           tail +16c $$file > tmp-foo1; \
1820           tail +16c stage3/$$file > tmp-foo2 2>/dev/null \
1821             && (cmp tmp-foo1 tmp-foo2 || echo $$file differs); \
1822         done
1823         -rm -f tmp-foo*
1824
1825 # Copy the object files from a particular stage into a subdirectory.
1826 stage1: force
1827         -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
1828         -mv $(STAGESTUFF) stage1
1829         -rm -f stage1/libgcc.a
1830         -cp libgcc.a stage1
1831         -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libgcc.a; else true; fi
1832
1833 stage2: force
1834         -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
1835         -mv $(STAGESTUFF) stage2
1836         -rm -f stage2/libgcc.a
1837         -cp libgcc.a stage2
1838         -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libgcc.a; else true; fi
1839
1840 stage3: force
1841         -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
1842         -mv $(STAGESTUFF) stage3
1843         -rm -f stage3/libgcc.a
1844         -cp libgcc.a stage3
1845         -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libgcc.a; else true; fi
1846
1847 stage4: force
1848         -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
1849         -mv $(STAGESTUFF) stage4
1850         -rm -f stage4/libgcc.a
1851         -cp libgcc.a stage4
1852         -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libgcc.a; else true; fi
1853
1854 # Copy just the executable files from a particular stage into a subdirectory,
1855 # and delete the object files.  Use this if you're just verifying a version
1856 # that is pretty sure to work, and you are short of disk space.
1857 risky-stage1: force
1858         -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
1859         -mv $(GCC_PARTS) stage1
1860         -rm -f stage1/libgcc.a
1861         -cp libgcc.a stage1 && $(RANLIB) stage1/libgcc.a
1862         -make clean
1863
1864 risky-stage2: force
1865         -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
1866         -mv $(GCC_PARTS) stage2
1867         -rm -f stage2/libgcc.a
1868         -cp libgcc.a stage2 && $(RANLIB) stage2/libgcc.a
1869         -make clean
1870
1871 risky-stage3: force
1872         -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
1873         -mv $(GCC_PARTS) stage3
1874         -rm -f stage3/libgcc.a
1875         -cp libgcc.a stage3 && $(RANLIB) stage3/libgcc.a
1876         -make clean
1877
1878 risky-stage4: force
1879         -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
1880         -mv $(GCC_PARTS) stage4
1881         -rm -f stage4/libgcc.a
1882         -cp libgcc.a stage4 && $(RANLIB) stage4/libgcc.a
1883         -make clean
1884
1885 #In GNU Make, ignore whether `stage*' exists.
1886 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
1887 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
1888
1889 force: