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