OSDN Git Service

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