OSDN Git Service

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