OSDN Git Service

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