1 # Makefile for GNU C compiler.
2 # Copyright (C) 1987, 88, 90-97, 1998 Free Software Foundation, Inc.
4 #This file is part of GNU CC.
6 #GNU CC is free software; you can redistribute it and/or modify
7 #it under the terms of the GNU General Public License as published by
8 #the Free Software Foundation; either version 2, or (at your option)
11 #GNU CC is distributed in the hope that it will be useful,
12 #but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 #GNU General Public License for more details.
16 #You should have received a copy of the GNU General Public License
17 #along with GNU CC; see the file COPYING. If not, write to
18 #the Free Software Foundation, 59 Temple Place - Suite 330,
19 #Boston MA 02111-1307, USA.
21 # The targets for external use include:
22 # all, doc, proto, install, install-cross, install-cross-rest,
23 # uninstall, TAGS, mostlyclean, clean, distclean, maintainer-clean,
24 # stage1, stage2, stage3, stage4.
26 # Suppress smart makes who think they know how to automake Yacc files
29 # Directory where sources are, from where we are.
33 # Variables that exist for you to override.
34 # See below for how to change them for certain systems.
36 # List of language subdirectories.
37 # This is overridden by configure.
40 # Selection of languages to be made.
41 # This is overridden by configure.
42 CONFIG_LANGUAGES = @all_languages@
43 LANGUAGES = c proto gcov$(exeext) $(CONFIG_LANGUAGES)
45 # Selection of languages to be made during stage1 build.
46 # This is overridden by configure.
47 BOOT_LANGUAGES = c @all_boot_languages@
53 # Various ways of specifying flags for compilations:
54 # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
55 # BOOT_CFLAGS is the value of CFLAGS to pass
56 # to the stage2 and stage3 compilations
57 # WARN_CFLAGS are the warning flags to pass to stage2 and stage3.
58 # (And for stage 1 if the native compiler is GCC.) It is
59 # separate from BOOT_CFLAGS because people tend to override optimization
60 # flags and we'd like them to still have warnings turned on. They are free
61 # to explicitly turn warnings off if they wish.
62 # XCFLAGS is used for most compilations but not when using the GCC just built.
63 # TCFLAGS is used for compilations with the GCC just built.
66 CFLAGS = -g @stage1_warn_cflags@
67 BOOT_CFLAGS = -O2 $(CFLAGS)
68 WARN_CFLAGS = -W -Wall
69 # These exists to be overridden by the x-* and t-* files, respectively.
77 # srcdir might be a relative pathname which won't be valid in a subdirectory,
78 # so we must use objdir/srcdir instead to make it safe. objdir is always
80 BISON = `if [ -f $(objdir)/../bison/bison ] ; then case $(srcdir) in \
81 /*) echo $(objdir)/../bison/bison -L $(srcdir)/../bison/ ;; \
82 *) echo $(objdir)/../bison/bison -L $(objdir)/$(srcdir)/../bison/ ;; \
83 esac; else echo bison ; fi`
85 LEX = `if [ -f $(objdir)/../flex/flex ] ; then echo $(objdir)/../flex/flex ; else echo flex ; fi`
92 # on sysV, define this as cp.
94 # Some systems may be missing symbolic links, regular links, or both.
95 # Allow configure to check this and use "ln -s", "ln", or "cp" as appropriate.
98 # These permit overriding just for certain files.
99 INSTALL_PROGRAM = @INSTALL_PROGRAM@
100 INSTALL_DATA = @INSTALL_DATA@
104 # For GNUmake: let us decide what gets passed to recursive makes.
108 # Define this as & to perform parallel make on a Sequent.
109 # Note that this has some bugs, and it seems currently necessary
110 # to compile all the gen* files first by hand to avoid erroneous results.
113 # How to invoke ranlib.
115 # Test to use to see whether ranlib exists on the system.
116 RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
121 HOST_RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
123 # Compiler to use for compiling libgcc1.a.
124 # OLDCC should not be the GNU C compiler,
125 # since that would compile typical libgcc1.a functions such as mulsi3
126 # into infinite recursions.
129 # CFLAGS for use with OLDCC, for compiling libgcc1.a.
130 # NOTE: -O does not work on some Unix systems!
133 # Version of ar to use when compiling libgcc1.a.
137 # Target to use when installing include directory. Either
138 # install-headers-tar or install-headers-cpio.
139 INSTALL_HEADERS_DIR = @build_install_headers_dir@
141 # Header files that are made available under the same name
142 # to programs compiled with GCC.
143 USER_H = $(srcdir)/ginclude/stdarg.h $(srcdir)/ginclude/stddef.h \
144 $(srcdir)/ginclude/varargs.h $(srcdir)/ginclude/va-alpha.h \
145 $(srcdir)/ginclude/va-h8300.h $(srcdir)/ginclude/va-i860.h \
146 $(srcdir)/ginclude/va-i960.h $(srcdir)/ginclude/va-mips.h \
147 $(srcdir)/ginclude/va-m88k.h $(srcdir)/ginclude/va-mn10200.h \
148 $(srcdir)/ginclude/va-mn10300.h $(srcdir)/ginclude/va-pa.h \
149 $(srcdir)/ginclude/va-pyr.h $(srcdir)/ginclude/va-sparc.h \
150 $(srcdir)/ginclude/va-clipper.h $(srcdir)/ginclude/va-spur.h \
151 $(srcdir)/ginclude/va-m32r.h $(srcdir)/ginclude/va-sh.h \
152 $(srcdir)/ginclude/va-v850.h $(srcdir)/ginclude/va-arc.h \
153 $(srcdir)/ginclude/iso646.h $(srcdir)/ginclude/va-ppc.h \
154 $(srcdir)/ginclude/va-c4x.h $(EXTRA_HEADERS) $(LANG_EXTRA_HEADERS) \
155 $(srcdir)/ginclude/proto.h $(srcdir)/ginclude/stdbool.h
157 # Target to use whe installing assert.h. Some systems may
158 # want to set this empty.
159 INSTALL_ASSERT_H = install-assert-h
161 # The GCC to use for compiling libgcc2.a, enquire, and libgcc1-test.
162 # Usually the one we just built.
163 # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
164 GCC_FOR_TARGET = ./xgcc -B./ -B$(build_tooldir)/bin/
166 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
167 # It omits XCFLAGS, and specifies -B./.
168 # It also specifies -I./include to find, e.g., stddef.h.
169 GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) -I./include $(TCFLAGS)
171 # Sed command to transform gcc to installed name. Overwritten by configure.
172 program_transform_name = @program_transform_name@
173 program_transform_cross_name = s,^,$(target_alias)-,
175 build_canonical = @build_canonical@
176 host_canonical = @host_canonical@
178 # Tools to use when building a cross-compiler.
179 # These are used because `configure' appends `cross-make'
180 # to the makefile when making a cross-compiler.
182 # Use the tools from the build tree, if they are available.
184 # objdir is set by configure.
188 if [ -f $(objdir)/../binutils/ar ] ; then \
189 echo $(objdir)/../binutils/ar ; \
191 if [ "$(host_canonical)" = "$(target)" ] ; then \
194 t='$(program_transform_name)'; echo ar | sed -e $$t ; \
197 AR_FOR_TARGET_FLAGS = rc
198 RANLIB_FOR_TARGET = ` \
199 if [ -f $(objdir)/../binutils/ranlib ] ; then \
200 echo $(objdir)/../binutils/ranlib ; \
202 if [ "$(host_canonical)" = "$(target)" ] ; then \
205 t='$(program_transform_name)'; echo ranlib | sed -e $$t ; \
208 RANLIB_TEST_FOR_TARGET = \
209 [ -f $(RANLIB_FOR_TARGET) ] \
210 || ( [ "$(host_canonical)" = "$(target)" ] \
211 && [ -f /usr/bin/ranlib -o -f /bin/ranlib ] )
213 # We always act like a cross-compiler, even when we're
214 # compiling native. This is because we want to use our own tools if
215 # we can. We don't just set RANLIB to a complicated expression,
216 # because the top level Makefile.in might override RANLIB_FOR_TARGET.
217 # These are from the FSF file "cross-make".
218 AR = $(AR_FOR_TARGET)
219 AR_FLAGS = $(AR_FOR_TARGET_FLAGS)
220 OLDAR = $(AR_FOR_TARGET)
221 OLDAR_FLAGS = $(AR_FOR_TARGET_FLAGS)
222 RANLIB = $(RANLIB_FOR_TARGET)
223 RANLIB_TEST = $(RANLIB_TEST_FOR_TARGET)
225 # Dir to search for system headers. Overridden by cross-make.
226 SYSTEM_HEADER_DIR = /usr/include
228 # Control whether to run fixproto.
229 STMP_FIXPROTO = stmp-fixproto
231 # Test to see whether <limits.h> exists in the system header files.
232 LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
234 # There may be a premade insn-attrtab.c for this machine.
235 # (You could rebuild it with genattrtab as usual, but it takes a long time.)
236 # PREMADE_ATTRTAB is the file name of the file to use.
237 # PREMADE_ATTRTAB_MD is the md file it corresponds to.
238 PREMADE_ATTRTAB_MD = Makefile # Guaranteed not to cmp equal to md.
242 target_alias=@target_alias@
243 xmake_file=@dep_host_xmake_file@
244 tmake_file=@dep_tmake_file@
245 out_file=$(srcdir)/config/@out_file@
246 out_object_file=@out_object_file@
247 md_file=$(srcdir)/config/@md_file@
248 tm_file=@tm_file_list@
249 build_xm_file=@build_xm_file_list@
250 host_xm_file=@host_xm_file_list@
251 lang_specs_files=@lang_specs_files@
252 lang_options_files=@lang_options_files@
253 lang_tree_files=@lang_tree_files@
254 GCC_THREAD_FILE=@thread_file@
255 OBJC_BOEHM_GC=@objc_boehm_gc@
257 GTHREAD_FLAGS=@gthread_flags@
258 # Be prepared for gcc2 merges.
259 gcc_version=@gcc_version@
260 gcc_version_trigger=@gcc_version_trigger@
261 version=$(gcc_version)
262 mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
264 # Common prefix for installation directories.
265 # NOTE: This directory must exist when you start installation.
267 # Directory in which to put localized header files. On the systems with
268 # gcc as the native cc, `local_prefix' may not be `prefix' which is
270 # NOTE: local_prefix *should not* default from prefix.
271 local_prefix = @local_prefix@
272 # Directory in which to put host dependent programs and libraries
273 exec_prefix = @exec_prefix@
274 # Directory in which to put the executable for the command `gcc'
276 # Directory in which to put the directories used by the compiler.
278 # Directory in which the compiler finds executables, libraries, etc.
279 libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(version)
280 # Used to produce a relative $(tooldir) in gcc.o
281 unlibsubdir = ../../..
282 # Directory in which the compiler finds g++ includes.
283 gxx_include_dir= @gxx_include_dir@
284 # Directory to search for site-specific includes.
285 includedir = $(local_prefix)/include
286 # assertdir is overridden in cross-make.
287 # (But this currently agrees with what is in cross-make.)
288 assertdir = $(tooldir)/include
289 # where the info files go
291 # Extension (if any) to put in installed man-page filename.
294 exeext = @host_exeext@
295 build_exeext = @build_exeext@
297 # Directory in which to put man pages.
299 man1dir = $(mandir)/man1
300 # Directory in which to find other cross-compilation tools and headers.
301 # Used in install-cross.
302 tooldir = $(libsubdir)/$(unlibsubdir)/../$(target_alias)
303 # Since tooldir does not exist at build-time, use -B$(build_tooldir)/bin/
304 build_tooldir = $(exec_prefix)/$(target_alias)
305 # Dir for temp files.
308 # Additional system libraries to link with.
311 # Change this to a null string if obstacks are installed in the
315 # Configure will set these if you need vfprintf and possibly _doprnt support.
319 # Specify the rule for actually making libgcc.a,
321 # and the rule for installing it.
322 INSTALL_LIBGCC = install-libgcc
324 # Specify the rule for actually making libgcc1.a.
325 # The value may be empty; that means to do absolutely nothing
326 # with or for libgcc1.a.
329 # Specify the rule for making libgcc1.a for a cross-compiler.
330 # The default rule assumes that libgcc1.a is supplied by the user.
331 CROSS_LIBGCC1 = libgcc1.cross
333 # Specify the rule for actually making libgcc2.a.
336 # Options to use when compiling libgcc2.a.
337 # -g1 causes output of debug info only for file-scope entities.
338 # we use this here because that should be enough, and also
339 # so that -g1 will be tested.
341 LIBGCC2_DEBUG_CFLAGS = -g1
342 LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED @inhibit_libc@
344 # Additional options to use when compiling libgcc2.a.
345 # Some targets override this to -Iinclude
348 # Additional target-dependent options for compiling libgcc2.a.
349 TARGET_LIBGCC2_CFLAGS =
351 # Things which must be built before building libgcc2.a.
352 # Some targets override this to stmp-int-hdrs
355 # libgcc1-test target (must also be overridable for a target)
356 LIBGCC1_TEST = libgcc1-test
358 # List of extra executables that should be compiled for this target machine
359 # that are used for compiling from source code to object code.
360 # The rules for compiling them should be in the t-* file for the machine.
361 EXTRA_PASSES =@extra_passes@
363 # Like EXTRA_PASSES, but these are used when linking.
364 EXTRA_PROGRAMS = @extra_programs@
366 # List of extra object files that should be compiled for this target machine.
367 # The rules for compiling them should be in the t-* file for the machine.
368 EXTRA_PARTS = @extra_parts@
370 # List of extra object files that should be compiled and linked with
371 # compiler proper (cc1, cc1obj, cc1plus).
372 EXTRA_OBJS = @extra_objs@
374 # List of extra object files that should be compiled and linked with
376 EXTRA_GCC_OBJS =@host_extra_gcc_objs@
378 # List of additional header files to install.
379 # Often this is edited directly by `configure'.
380 EXTRA_HEADERS =@extra_headers_list@
382 # Set this to `collect2' to enable use of collect2.
383 USE_COLLECT2 = @will_use_collect2@
384 MAYBE_USE_COLLECT2 = @maybe_use_collect2@
385 # It is convenient for configure to add the assignment at the beginning,
386 # so don't override it here.
387 USE_COLLECT2 = collect2$(exeext)
389 # List of extra C and assembler files to add to libgcc1.a.
390 # Assembler files should have names ending in `.asm'.
393 # List of extra C and assembler files to add to libgcc2.a.
394 # Assembler files should have names ending in `.asm'.
397 # Default float.h source to use for cross-compiler.
398 # This is overridden by configure.
399 CROSS_FLOAT_H=$(srcdir)/config/float-@float_format@.h
401 # We do not try to build float.h anymore. Let configure select the
402 # appropriate pre-built float.h file for the target.
403 FLOAT_H=$(srcdir)/config/float-@float_format@.h
405 # Program to convert libraries.
408 # Control whether header files are installed.
409 INSTALL_HEADERS=install-headers
411 # Options for tar when copying trees. So HPUX can override it.
414 # Select which version of fixincludes to use (I.E. regular versus SVR4)
415 # This value is overridden directly by configure.
416 FIXINCLUDES = @fixincludes@
418 # Additional directories of header files to run fixincludes on.
419 # These should be directories searched automatically by default
420 # just as /usr/include is.
421 # *Do not* use this for directories that happen to contain
422 # header files, but are not searched automatically by default.
423 # On most systems, this is empty.
424 OTHER_FIXINCLUDES_DIRS=
426 # A list of all the language-specific executables.
427 # This is overridden by configure.
428 COMPILERS = cc1$(exeext) @all_compilers@
430 # List of things which should already be built whenever we try to use xgcc
431 # to compile anything (without linking).
432 GCC_PASSES=xgcc$(exeext) cc1$(exeext) cpp$(exeext) $(EXTRA_PASSES)
434 # List of things which should already be built whenever we try to use xgcc
436 GCC_PARTS=$(GCC_PASSES) $(LIBGCC) $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
438 # Directory to link to, when using the target `maketest'.
441 # Guaranteed to not exist when not passing md through cpp.
442 # This value is overridden directly by configure.
443 MD_FILE = md-cpp-not-used
445 # Flags to use when cross-building GCC.
446 # Prefix to apply to names of object files when using them
447 # to run on the machine we are compiling on.
449 # Prefix to apply to names of object files when compiling them
450 # to run on the machine we are compiling on.
451 # The default for this variable is chosen to keep these rules
452 # out of the way of the other rules for compiling the same source files.
455 HOST_CFLAGS=$(ALL_CFLAGS)
457 HOST_LDFLAGS=$(LDFLAGS)
458 HOST_CPPFLAGS=$(ALL_CPPFLAGS)
459 HOST_ALLOCA=$(ALLOCA)
460 HOST_MALLOC=$(MALLOC)
461 HOST_OBSTACK=$(OBSTACK)
462 HOST_VFPRINTF=$(VFPRINTF)
463 HOST_DOPRINT=$(DOPRINT)
465 # Actual name to use when installing a native compiler.
466 GCC_INSTALL_NAME = `t='$(program_transform_name)'; echo gcc | sed -e $$t`
467 PROTOIZE_INSTALL_NAME = `t='$(program_transform_name)'; echo protoize | sed -e $$t`
468 UNPROTOIZE_INSTALL_NAME = `t='$(program_transform_name)'; echo unprotoize | sed -e $$t`
470 # Actual name to use when installing a cross-compiler.
471 GCC_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcc | sed -e $$t`
472 PROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo protoize | sed -e $$t`
473 UNPROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo unprotoize | sed -e $$t`
475 # Choose the real default target.
478 # Choose the real install target.
479 INSTALL_TARGET=install-normal
481 # Setup the testing framework, if you have one
482 EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
483 echo $${rootme}/../expect/expect ; \
484 else echo expect ; fi`
486 RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
487 echo $${srcdir}/../dejagnu/runtest ; \
488 else echo runtest; fi`
491 # Extra symbols for fixproto to define when parsing headers.
494 # Extra flags to use when compiling crt{begin,end}.o.
497 # Extra flags to use when compiling [m]crt0.o.
500 # "t" or nothing, for building multilibbed versions of, say, crtbegin.o.
503 # End of variables for you to override.
505 # Definition of `all' is here so that new rules inserted by sed
506 # do not specify the default target.
507 # The real definition is under `all.internal' (for native compilers)
508 # or `all.cross' (for cross compilers).
511 # This tells GNU Make version 3 not to put all variables in the environment.
514 # sed inserts variable overrides after the following line.
528 # Now figure out from those variables how to compile and link.
532 # IN_GCC tells various files that system.h, toplev.c, etc are available.
533 INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
535 # This is the variable actually used when we compile.
536 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) \
537 @DEFS@ $(SCHED_CFLAGS)
540 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
542 # Even if ALLOCA is set, don't use it if compiling with GCC.
543 USE_ALLOCA= ${ALLOCA}
544 USE_HOST_ALLOCA= ` case "${HOST_ALLOCA}" in ?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac `
545 USE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo ${HOST_PREFIX}${HOST_MALLOC} ;; esac `
546 USE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo ${HOST_PREFIX}${HOST_OBSTACK} ;; esac `
547 USE_HOST_VFPRINTF= ` case "${HOST_VFPRINTF}" in ?*) echo ${HOST_PREFIX}${HOST_VFPRINTF} ;; esac `
548 USE_HOST_DOPRINT= ` case "${HOST_DOPRINT}" in ?*) echo ${HOST_PREFIX}${HOST_DOPRINT} ;; esac `
550 # Dependency on obstack, alloca, malloc or whatever library facilities
551 # are not installed in the system libraries.
552 # We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
553 LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC) $(VFPRINTF) $(DOPRINT)
555 # Likewise, for use in the tools that must run on this machine
556 # even if we are cross-building GCC.
557 # We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
558 HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC) $(HOST_PREFIX)$(HOST_VFPRINTF) $(HOST_PREFIX)$(HOST_DOPRINT)
560 # How to link with both our special library facilities
561 # and the system's installed libraries.
562 LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(VFPRINTF) $(DOPRINT) $(CLIB) \
563 ../libiberty/libiberty.a
565 # Likewise, for use in the tools that must run on this machine
566 # even if we are cross-building GCC.
567 HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \
568 $(USE_HOST_VFPRINTF) $(USE_HOST_DOPRINT) $(HOST_CLIB)
570 HOST_RTL = $(HOST_PREFIX)rtl.o $(HOST_PREFIX)bitmap.o
571 HOST_RTLANAL = $(HOST_PREFIX)rtlanal.o
572 HOST_PRINT = $(HOST_PREFIX)print-rtl.o
574 # Specify the directories to be searched for header files.
575 # Both . and srcdir are used, in that order,
576 # so that tm.h and config.h will be found in the compilation
577 # subdirectory rather than in the source directory.
578 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config -I$(srcdir)/../include
580 # Always use -I$(srcdir)/config when compiling.
582 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
584 # This tells GNU make version 3 not to export all the variables
585 # defined in this file into the environment.
588 # Support for additional languages (other than c and objc).
589 # ??? objc can be supported this way too (leave for later).
591 # These next lines are overridden by configure.
592 LANG_MAKEFILES = @all_lang_makefiles@
593 LANG_STAGESTUFF = @all_stagestuff@
594 LANG_DIFF_EXCLUDES = @all_diff_excludes@
595 LANG_LIB2FUNCS = @all_lib2funcs@
596 LANG_EXTRA_HEADERS = @all_headers@
598 # Flags to pass to recursive makes.
599 # CC is set by configure. Hosts without symlinks need special handling
600 # because we need CC="stage1/xgcc -Bstage1/" to work in the language
602 # ??? The choices here will need some experimenting with.
604 "AR_FLAGS=$(AR_FOR_TARGET_FLAGS)" \
605 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
607 "BISONFLAGS=$(BISONFLAGS)" \
608 "CC=@cc_set_by_configure@" \
611 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
612 "LDFLAGS=$(LDFLAGS)" \
614 "LEXFLAGS=$(LEXFLAGS)" \
617 "MAKEINFO=$(MAKEINFO)" \
618 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
619 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
620 "RANLIB_TEST_FOR_TARGET=$(RANLIB_TEST_FOR_TARGET)" \
622 "STAGE_PREFIX=@stage_prefix_set_by_configure@" \
624 "build_exeext=$(build_exeext)" \
626 "exec_prefix=$(exec_prefix)" \
628 "local_prefix=$(local_prefix)" \
629 "gxx_include_dir=$(gxx_include_dir)" \
630 "tooldir=$(tooldir)" \
632 "libsubdir=$(libsubdir)"
634 # Lists of files for various purposes.
636 # Language-specific object files for C and Objective C.
637 C_AND_OBJC_OBJS = c-lex.o c-pragma.o c-decl.o c-typeck.o c-convert.o \
638 c-aux-info.o c-common.o c-iterate.o @extra_c_objs@
640 # Language-specific object files for C.
641 C_OBJS = c-parse.o c-lang.o $(C_AND_OBJC_OBJS)
643 SCHED_PREFIX = @sched_prefix@
644 SCHED_CFLAGS = @sched_cflags@
646 # Language-independent object files.
647 OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
648 function.o stmt.o except.o expr.o calls.o expmed.o explow.o optabs.o \
649 varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o genrtl.o real.o regmove.o \
650 dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o bitmap.o alias.o \
651 integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o varray.o \
652 regclass.o local-alloc.o global.o reload.o reload1.o caller-save.o gcse.o \
653 insn-peep.o reorg.o $(SCHED_PREFIX)sched.o final.o recog.o reg-stack.o \
654 insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o \
655 profile.o insn-attrtab.o $(out_object_file) getpwd.o $(EXTRA_OBJS) convert.o \
656 mbchar.o dyn-string.o splay-tree.o graph.o
658 # GEN files are listed separately, so they can be built before doing parallel
659 # makes for cc1 or cc1plus. Otherwise sequent parallel make attempts to load
660 # them before rtl.o is compiled.
661 GEN= genemit genoutput genrecog genextract genflags gencodes genconfig \
662 genpeep gengenrtl gencheck
666 # Files to be copied away after each stage in building.
667 STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
668 insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
669 insn-attr.h insn-attrtab.c insn-opinit.c genrtl.c genrtl.h tree-check.h \
670 s-flags s-config s-codes s-mlib s-under\
671 s-output s-recog s-emit s-extract s-peep s-check \
672 s-attr s-attrtab s-opinit s-crt s-crtS s-crt0 \
673 genemit$(build_exeext) genoutput$(build_exeext) genrecog$(build_exeext) \
674 genextract$(build_exeext) genflags$(build_exeext) gencodes$(build_exeext) \
675 genconfig$(build_exeext) genpeep$(build_exeext) genattrtab$(build_exeext) \
676 genattr$(build_exeext) genopinit$(build_exeext) gengenrtl$(build_exeext) \
677 gencheck$(build_exeext) \
678 xgcc$(exeext) cc1$(exeext) cpp$(exeext) $(EXTRA_PASSES) \
679 $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
680 $(CCCP)$(exeext) cc1obj$(exeext) enquire$(exeext) \
681 protoize$(exeext) unprotoize$(exeext) \
682 specs collect2$(exeext) $(USE_COLLECT2) underscore.c \
684 *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop \
685 *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack *.gcse \
689 # Members of libgcc1.a.
690 LIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
691 _lshrsi3 _ashrsi3 _ashlsi3 \
692 _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \
693 _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \
694 _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \
695 _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
696 _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
698 # Library members defined in libgcc2.c.
699 LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
700 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 \
701 _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
702 _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
703 _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \
704 _fixtfdi _fixunstfdi _floatditf \
705 __gcc_bcmp _varargs __dummy _eprintf \
706 _bb _shtab _clear_cache _trampoline __main _exit \
711 FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
712 _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
713 _lt_sf _le_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
716 DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
717 _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \
718 _lt_df _le_df _si_to_df _df_to_si _negate_df _make_df \
721 # The files that "belong" in CONFIG_H are deliberately omitted
722 # because having them there would not be useful in actual practice.
723 # All they would do is cause complete recompilation every time
724 # one of the machine description files is edited.
725 # That may or may not be what one wants to do.
726 # If it is, rm *.o is an easy way to do it.
727 # CONFIG_H = $(host_xm_file) $(tm_file)
729 RTL_BASE_H = rtl.h rtl.def machmode.h machmode.def
730 RTL_H = $(RTL_BASE_H) genrtl.h
731 TREE_H = tree.h real.h tree.def machmode.h machmode.def tree-check.h
732 BASIC_BLOCK_H = basic-block.h bitmap.h
733 DEMANGLE_H = demangle.h
735 EXPR_H = expr.h insn-codes.h
736 REGS_H = regs.h varray.h machmode.h machmode.def
738 # Language makefile fragments.
740 # The following targets define the interface between us and the languages.
742 # all.build, all.cross, start.encap, rest.encap,
744 # install-normal, install-common, install-info, install-man,
745 # uninstall, distdir,
746 # mostlyclean, clean, distclean, extraclean, maintainer-clean,
747 # stage1, stage2, stage3, stage4
749 # Each language is linked in with a series of hooks (since we can't use `::'
750 # targets). The name of each hooked is "lang.${target_name}" (eg: lang.info).
751 # Configure computes and adds these here.
756 # sed inserts language fragments after the following line.
757 ####language fragments
760 # End of language makefile fragments.
762 # The only suffixes we want for implicit rules are .c and .o, so clear
763 # the list and add them. This speeds up GNU Make, and allows -r to work.
767 Makefile: $(srcdir)/Makefile.in config.status $(srcdir)/version.c \
768 $(xmake_file) $(tmake_file) $(LANG_MAKEFILES)
769 $(SHELL) $(srcdir)/configure.frag $(srcdir) "$(SUBDIRS)" \
770 "$(xmake_file)" "$(tmake_file)"
771 cp config.status config.run
772 LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.run
775 $(srcdir)/configure: $(srcdir)/configure.in
776 cd $(srcdir); autoconf
778 # cstamp-h.in controls rebuilding of config.in.
779 # It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't
780 # delete it. A stamp file is needed as autoheader won't update the file if
781 # nothing has changed.
782 # It remains in the source directory and is part of the distribution.
783 # This follows what is done in shellutils, fileutils, etc.
784 # "echo timestamp" is used instead of touch to be consistent with other
785 # packages that use autoconf (??? perhaps also to avoid problems with patch?).
786 # ??? Newer versions have a maintainer mode that may be useful here.
787 $(srcdir)/config.in: $(srcdir)/cstamp-h.in
788 $(srcdir)/cstamp-h.in: $(srcdir)/configure.in $(srcdir)/acconfig.h
789 cd $(srcdir) && autoheader
790 @rm -f $(srcdir)/cstamp-h.in
791 echo timestamp > $(srcdir)/cstamp-h.in
792 auto-host.h: cstamp-h ; @true
793 cstamp-h: config.in config.status
794 CONFIG_HEADERS=auto-host.h:config.in LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status
796 # Really, really stupid make features, such as SUN's KEEP_STATE, may force
797 # a target to build even if it is up-to-date. So we must verify that
798 # config.status does not exist before failing.
799 config.status: configure version.c
800 @if [ ! -f config.status ] ; then \
801 echo You must configure gcc. Look at the INSTALL file for details.; \
804 LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status --recheck; \
807 all.internal: start.encap rest.encap
808 # This is what to compile if making a cross-compiler.
809 # Note that we can compile enquire using the cross-compiler just built,
810 # although we can't run it on this machine.
811 all.cross: native gcc-cross specs stmp-headers $(STMP_FIXPROTO) $(LIBGCC) \
812 $(LIBGCC1_TEST) $(EXTRA_PARTS) lang.all.cross
813 # This is what to compile if making gcc with a cross-compiler.
814 all.build: native xgcc$(exeext) $(EXTRA_PARTS) lang.all.build
815 # This is what must be made before installing GCC and converting libraries.
816 start.encap: native xgcc$(exeext) specs $(LIBGCC1) xlimits.h lang.start.encap
817 # These can't be made until after GCC can run.
818 rest.encap: stmp-headers $(STMP_FIXPROTO) $(LIBGCC) $(EXTRA_PARTS) lang.rest.encap
819 # This is what is made with the host's compiler
820 # whether making a cross compiler or not.
821 native: config.status auto-host.h cpp$(exeext) $(LANGUAGES) \
822 $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
824 # Define the names for selecting languages in LANGUAGES.
828 # Tell GNU make these are phony targets.
829 .PHONY: C c PROTO proto
831 # On the target machine, finish building a cross compiler.
832 # This does the things that can't be done on the host machine.
833 rest.cross: $(LIBGCC) gfloat.h specs
835 # Verify that it works to compile and link libgcc1-test.
836 # If it does, then there are sufficient replacements for libgcc1.a.
837 libgcc1-test: libgcc1-test.o native $(GCC_PARTS)
838 @echo "Testing libgcc1. Ignore linker warning messages."
839 $(GCC_FOR_TARGET) $(GCC_CFLAGS) libgcc1-test.o -o libgcc1-test \
840 -nostartfiles -nostdlib `$(GCC_FOR_TARGET) --print-libgcc-file-name`
841 libgcc1-test.o: libgcc1-test.c native xgcc$(exeext)
842 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -c $(srcdir)/libgcc1-test.c
844 # Recompile all the language-independent object files.
845 # This is used only if the user explicitly asks for it.
846 compilations: ${OBJS}
848 # Create a list of the language-independent object files so the language
849 # subdirectories needn't mention their names explicitly.
850 stamp-objlist: $(OBJS)
851 echo " $(OBJS)" | sed -e 's, \([a-z0-9]\), ../\1,g' -e 's/\.o/$(objext)/g' >stamp-objlist
853 # We call this executable `xgcc' rather than `gcc'
854 # to avoid confusion if the current directory is in the path
855 # and CC is `gcc'. It is renamed to `gcc' when it is installed.
856 xgcc$(exeext): gcc.o version.o choose-temp.o pexecute.o prefix.o version.o \
857 mkstemp.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
858 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o prefix.o version.o \
859 choose-temp.o pexecute.o mkstemp.o $(EXTRA_GCC_OBJS) $(LIBS)
861 # Dump a specs file to make -B./ read these specs over installed ones.
863 $(GCC_FOR_TARGET) -dumpspecs > tmp-specs
866 # We do want to create an executable named `xgcc', so we can use it to
868 # Also create gcc-cross, so that install-common will install properly.
869 gcc-cross: xgcc$(exeext)
870 cp xgcc$(exeext) gcc-cross$(exeext)
872 cc1$(exeext): $(P) $(OBJS) $(C_OBJS) $(LIBDEPS)
873 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(C_OBJS) $(LIBS)
875 # Copy float.h from its source.
878 cp $(FLOAT_H) gfloat.h
880 # Build the version of limits.h that we will install.
881 xlimits.h: glimits.h limitx.h limity.h
882 if $(LIMITS_H_TEST) ; then \
883 cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-xlimits.h; \
885 cat $(srcdir)/glimits.h > tmp-xlimits.h; \
887 mv tmp-xlimits.h xlimits.h
890 # This is done in two parts because some functions, in libgcc1.c,
891 # must be compiled with something other than GCC,
892 # while the rest, in libgcc2.c, must be compiled with xgcc.
893 # That means we can't do libgcc2.c until after xgcc, cc1, etc.
895 # Use this as value of LIBGCC1 to cause conversion to GNU library format.
896 # LIBCONVERT should put its output in libgcc1.conv.
897 libgcc1.conv: libgcc1.a
898 $(LIBCONVERT) libgcc1.a libgcc1.conv
900 # Use this as value of LIBGCC1 to inhibit use of libgcc1.c entirely.
901 # Make an empty file instead.
902 libgcc1.null: $(GCC_PASSES)
903 echo "void __foo () {}" > dummy.c
904 $(GCC_FOR_TARGET) $(GCC_CFLAGS) -c dummy.c
905 $(OLDAR) $(OLDAR_FLAGS) libgcc1.null dummy$(objext)
906 rm -f dummy$(objext) dummy.c
908 # This is $(LIBGCC1) for a cross-compiler.
909 # We have no automatic way of building libgcc1.a,
910 # so it's up to the installer to find a way to do that.
911 # This rule deliberately does not depend on libgcc1.a
912 # so that it will fail if the installer hasn't provided it.
914 mv libgcc1.a libgcc1.cross || (echo You must find a way to make libgcc1.a; false)
916 # Compile the library of arithmetic subroutines with the native compiler.
917 # Don't compile it with GCC!
918 # (That would cause most arithmetic functions to call themselves.)
920 # NOTE: If you modify these rules substantially, please be sure to
921 # check at least config/i386/t-sco5 and possibly other makefile
923 libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status
925 # Actually build it in tmplibgcc1.a, then rename at end,
926 # so that libgcc1.a itself remains nonexistent if compilation is aborted.
927 # -e causes any failing command to make this rule fail.
928 # -e doesn't work in certain shells, so we test $$? as well.
929 # lynx has a broken ar, it always complains when the initial library is
930 # empty, thus this command works only if we don't do -e
931 # There is a trailing backslash (\) deleted from the following line.
933 for name in $(LIB1FUNCS); \
936 rm -f $${name}$(objext); \
937 $(OLDCC) -DIN_LIBGCC1 $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $(srcdir)/libgcc1.c; \
938 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
939 mv libgcc1$(objext) $${name}$(objext); \
940 $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}$(objext); \
941 rm -f $${name}$(objext); \
943 # Some shells crash when a loop has no items.
944 # So make sure there is always at least one--`..'.
946 # We don't use -e here because there are if statements
947 # that should not make the command give up when the if condition is false.
948 # Instead, we test for failure after each command where it matters.
949 for file in .. $(LIB1FUNCS_EXTRA); \
951 if [ x$${file} != x.. ]; then \
952 name=`echo $${file} | sed -e 's/[.][cS]$$//' -e 's/[.]asm$$//'`; \
954 if [ $${name}.asm = $${file} ]; then \
955 cp $${file} $${name}.s || exit 1; file=$${name}.s; \
957 $(OLDCC) -DIN_LIBGCC1 $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \
958 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
959 $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}$(objext); \
960 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
961 rm -f $${name}.s $${name}$(objext); \
965 -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc1.a; else true; fi
966 mv tmplibgcc1.a libgcc1.a
968 # Build libgcc1.a from assembler source. LIB1ASMFUNCS is the list of
969 # functions. LIB1ASMSRC is the name of the source file in the config
971 libgcc1-asm.a: libgcc2.ready config.status $(srcdir)/config/$(LIB1ASMSRC)
972 -rm -f tmplibgcc1.a libgcc1.S
973 cp $(srcdir)/config/$(LIB1ASMSRC) libgcc1.S
974 # Actually build it in tmplibgcc1.a, then rename at end,
975 # so that libgcc1-asm.a itself remains nonexistent if compilation is aborted.
976 # -e causes any failing command to make this rule fail.
977 # -e doesn't work in certain shells, so we test $$? as well.
978 # lynx has a broken ar, it always complains when the initial library is
979 # empty, thus this command works only if we don't do -e
980 # There is a trailing backslash (\) deleted from the following line.
982 for name in $(LIB1ASMFUNCS); \
985 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} libgcc1.S; \
986 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
987 mv libgcc1$(objext) $${name}$(objext); \
988 $(AR) $(AR_FLAGS) tmplibgcc1.a $${name}$(objext); \
989 rm -f $${name}$(objext); \
992 mv tmplibgcc1.a libgcc1-asm.a
994 # Generate assembly versions of the functions required for libgcc1.
995 # You'll still need to massage the code by hand (possibly hacking
996 # underscores and local labels) but this will get you started.
997 libgcc1.S: libgcc1.c $(CONFIG_H) config.status
1000 for name in $(LIB1FUNCS); \
1003 $(OLDCC) -DIN_LIBGCC1 $(CCLIBFLAGS) $(INCLUDES) -S -DL$${name} $(srcdir)/libgcc1.c; \
1004 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1005 echo '#ifdef ' L$${name} >> libgcc1.S; \
1006 cat libgcc1.s >> libgcc1.S; \
1007 echo '#endif /*' L$${name} '*/' >> libgcc1.S; \
1008 echo "" >> libgcc1.S; \
1011 # Compiling libgcc2.a requires making sure that cc1, etc. have been compiled.
1012 # But recompiling cc1 should not force recompilation of libgcc2.a.
1013 # If you want to force recompilation, delete libgcc2.a.
1014 libgcc2.ready: $(GCC_PASSES) $(LIBGCC2_DEPS) stmp-int-hdrs $(STMP_FIXPROTO)
1015 -if [ -f libgcc2.ready ] ; then \
1018 touch libgcc2.ready; \
1021 LIB2ADD = $(srcdir)/frame.c $(LIB2FUNCS_EXTRA) $(LANG_LIB2FUNCS)
1022 libgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(FPBIT) $(DPBIT) $(LIB2ADD) \
1023 machmode.h longlong.h frame.h gbl-ctors.h config.status
1024 # Actually build it in tmplibgcc2.a, then rename at end,
1025 # so that libgcc2.a itself remains nonexistent if compilation is aborted.
1027 # -e causes any failing command to make this rule fail.
1028 # -e doesn't work in certain shells, so we test $$? as well.
1029 # lynx has a broken ar, it always complains when the initial library is
1030 # empty, thus this command works only if we don't do -e
1031 # There is a trailing backslash (\) deleted from the following line.
1033 for name in $(LIB2FUNCS); \
1036 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
1037 $(srcdir)/libgcc2.c -o $${name}$(objext); \
1038 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1039 $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}$(objext); \
1040 rm -f $${name}$(objext); \
1042 for name in $(LIB2FUNCS_EH); \
1045 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -fexceptions $(INCLUDES) -c \
1046 -DL$${name} $(srcdir)/libgcc2.c -o $${name}$(objext); \
1047 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1048 $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}$(objext); \
1049 rm -f $${name}$(objext); \
1051 if [ x$(FPBIT) != x ]; then \
1052 for name in $(FPBIT_FUNCS); \
1055 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
1056 -DFINE_GRAINED_LIBRARIES $(FPBIT) -o $${name}$(objext); \
1057 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1058 $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}$(objext); \
1059 rm -f $${name}$(objext); \
1062 if [ x$(DPBIT) != x ]; then \
1063 for name in $(DPBIT_FUNCS); \
1066 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
1067 -DFINE_GRAINED_LIBRARIES $(DPBIT) -o $${name}$(objext); \
1068 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1069 $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}$(objext); \
1070 rm -f $${name}$(objext); \
1073 # Some shells crash when a loop has no items.
1074 # So make sure there is always at least one--`..'.
1076 # We don't use -e here because there are if statements
1077 # that should not make the command give up when the if condition is false.
1078 # Instead, we test for failure after each command where it matters.
1079 for file in $(LIB2ADD); do \
1080 name=`echo $${file} | sed -e 's/[.][cSo]$$//' -e 's/[.]asm$$//' -e 's/[.]txt$$//'`; \
1081 oname=` echo $${name} | sed -e 's,.*/,,'`; \
1082 if [ $${name}.txt = $${file} ]; then \
1083 for f in .. `cat $${file}`; do if [ x$${f} != x.. ]; then \
1084 $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
1085 AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" \
1086 CFLAGS="$(CFLAGS)" HOST_PREFIX="$(HOST_PREFIX)" \
1087 HOST_PREFIX_1="$(HOST_PREFIX_1)" \
1088 LANGUAGES="$(LANGUAGES)" \
1089 LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" $${f}; \
1090 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1091 $(AR) $(AR_FLAGS) tmplibgcc2.a $${f}; \
1097 if [ $${name}.asm = $${file} ]; then \
1098 cp $${file} $${name}.s || exit 1; file=$${name}.s; \
1100 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
1101 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1102 $(AR) $(AR_FLAGS) tmplibgcc2.a $${oname}$(objext); \
1103 rm -f $${name}.s $${oname}$(objext); \
1106 mv tmplibgcc2.a libgcc2.a
1107 # These lines were deleted from above the mv command
1108 # because ranlibing libgcc.a itself should suffice.
1109 # -if [ x${HPUX_GAS} = x ] ; then \
1110 # if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc2.a; else true; fi; \
1113 # Combine the various libraries into a single library, libgcc.a.
1114 libgcc.a: $(LIBGCC1) $(LIBGCC2)
1115 -rm -rf tmplibgcc.a libgcc.a tmpcopy
1117 -if [ x$(LIBGCC1) != x ]; \
1118 then (cd tmpcopy; $(AR) x ../$(LIBGCC1)); \
1121 # Some versions of ar (specifically the one in RISC/os 5.x), create an
1122 # unwritable table of contents file, and then print an error message when
1123 # the second ar command tries to overwrite this file. To avoid the error
1124 # message from ar, we make sure all files are writable.
1125 -(cd tmpcopy; chmod +w * > /dev/null 2>&1)
1126 (cd tmpcopy; $(AR) x ../$(LIBGCC2))
1127 (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *$(objext))
1129 -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
1130 # Actually build it in tmplibgcc.a, then rename at end,
1131 # so that libgcc.a itself remains nonexistent if compilation is aborted.
1132 mv tmplibgcc.a libgcc.a
1134 # Use the genmultilib shell script to generate the information the gcc
1135 # driver program needs to select the library directory based on the
1137 multilib.h: s-mlib; @true
1138 s-mlib: $(srcdir)/genmultilib Makefile
1139 $(SHELL) $(srcdir)/genmultilib \
1140 "$(MULTILIB_OPTIONS)" \
1141 "$(MULTILIB_DIRNAMES)" \
1142 "$(MULTILIB_MATCHES)" \
1143 "$(MULTILIB_EXCEPTIONS)" \
1144 "$(MULTILIB_EXTRA_OPTS)" > tmp-mlib.h
1145 $(srcdir)/move-if-change tmp-mlib.h multilib.h
1148 # Build multiple copies of libgcc.a, one for each target switch.
1149 stmp-multilib: $(LIBGCC1) libgcc2.c libgcc2.ready $(CONFIG_H) \
1151 $(LIB2ADD) machmode.h longlong.h gbl-ctors.h config.status
1152 for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
1153 dir=`echo $$i | sed -e 's/;.*$$//'`; \
1154 flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
1155 $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
1156 AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
1157 RANLIB="$(RANLIB)" RANLIB_TEST="$(RANLIB_TEST)" \
1158 LANGUAGES="$(LANGUAGES)" \
1159 HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
1160 LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS) $${flags}" \
1161 MULTILIB_CFLAGS="$${flags}" \
1162 LIBGCC1="$(LIBGCC1)" LIBGCC2="$(LIBGCC2)" \
1163 dir="$${dir}" stmp-multilib-sub; \
1164 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
1168 # Subroutine of stmp-multilib so make -n works.
1171 if [ -d $(dir) ]; then \
1173 rm -f libgcc.a $(EXTRA_MULTILIB_PARTS); \
1176 $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
1177 AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
1178 HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
1179 LANGUAGES="$(LANGUAGES)" \
1180 LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" $(LIBGCC2)
1181 if [ x$(LIBGCC1) != xlibgcc1-asm.a ]; \
1183 else rm -f $(LIBGCC1); \
1185 if [ x$(LIBGCC1) != xlibgcc1-asm.a ]; \
1188 $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
1189 AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
1190 HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
1191 LANGUAGES="$(LANGUAGES)" \
1192 LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" $(LIBGCC1); \
1194 rm -rf tmplibgcc.a tmpcopy
1196 if [ x$(LIBGCC1) != x ]; \
1197 then (cd tmpcopy; $(AR) x ../$(LIBGCC1)); \
1200 (cd tmpcopy; $(AR) x ../$(LIBGCC2))
1201 (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *$(objext))
1202 rm -rf libgcc2.a tmpcopy
1203 if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
1204 if [ -d $(dir) ]; then true; else mkdir $(dir); fi
1205 mv tmplibgcc.a $(dir)/libgcc.a
1206 for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
1207 $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
1208 AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
1209 HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
1210 LANGUAGES="$(LANGUAGES)" \
1211 MULTILIB_CFLAGS="$(MULTILIB_CFLAGS)" T="t" t$${f}; \
1212 mv t$${f} $(dir)/$${f}; \
1216 # Compile two additional files that are linked with every program
1217 # linked using GCC on systems using COFF or ELF, for the sake of C++
1219 $(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
1220 defaults.h frame.h gbl-ctors.h
1221 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
1222 -finhibit-size-directive -fno-inline-functions -fno-exceptions $(CRTSTUFF_T_CFLAGS) \
1223 -c $(srcdir)/crtstuff.c -DCRT_BEGIN -o $(T)crtbegin$(objext)
1225 $(T)crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
1226 defaults.h frame.h gbl-ctors.h
1227 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
1228 -finhibit-size-directive -fno-inline-functions -fno-exceptions $(CRTSTUFF_T_CFLAGS) \
1229 -c $(srcdir)/crtstuff.c -DCRT_END -o $(T)crtend$(objext)
1231 # On some systems we also want to install versions of these files
1232 # compiled using PIC for use in shared libraries.
1233 crtbeginS.o crtendS.o: s-crtS ; @true
1235 s-crtS: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
1236 defaults.h frame.h gbl-ctors.h
1237 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
1238 -DCRT_BEGIN -DCRTSTUFFS_O -finhibit-size-directive -fno-inline-functions \
1239 -fno-exceptions -g0 -c $(srcdir)/crtstuff.c
1240 mv crtstuff$(objext) crtbeginS$(objext)
1241 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
1242 -DCRT_END -DCRTSTUFFS_O -finhibit-size-directive -fno-inline-functions \
1243 -fno-exceptions -g0 -c $(srcdir)/crtstuff.c -o crtendS$(objext)
1246 # Compile the start modules crt0.o and mcrt0.o that are linked with every program
1247 crt0.o: s-crt0 ; @true
1248 mcrt0.o: s-crt0; @true
1250 s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
1251 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
1252 -o crt0.o -c $(CRT0_S)
1253 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
1254 -o mcrt0.o -c $(MCRT0_S)
1257 # Compiling object files from source files.
1259 # Note that dependencies on obstack.h are not written
1260 # because that file is not part of GCC.
1262 # C language specific files.
1264 c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \
1265 $(srcdir)/c-parse.h c-tree.h input.h flags.h system.h toplev.h
1266 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
1267 $(srcdir)/c-parse.h: $(srcdir)/c-parse.c
1268 $(srcdir)/c-parse.c: $(srcdir)/c-parse.y
1269 cd $(srcdir); $(BISON) $(BISONFLAGS) -d c-parse.y -o c-parse.c
1270 $(srcdir)/c-parse.y: c-parse.in
1271 echo '/*WARNING: This file is automatically generated!*/' >tmp-c-parse.y
1272 sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
1273 -e "/^ifc$$/d" -e "/^end ifc$$/d" \
1274 $(srcdir)/c-parse.in >>tmp-c-parse.y
1275 $(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y
1277 $(srcdir)/c-gperf.h: c-parse.gperf
1278 gperf -L KR-C -F ', 0, 0' -p -j1 -i 1 -g -o -t -G -N is_reserved_word \
1279 -k1,3,$$ $(srcdir)/c-parse.gperf >tmp-gperf.h
1280 $(srcdir)/move-if-change tmp-gperf.h $(srcdir)/c-gperf.h
1282 c-decl.o : c-decl.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h flags.h \
1284 c-typeck.o : c-typeck.c $(CONFIG_H) system.h $(TREE_H) c-tree.h flags.h \
1285 output.h $(EXPR_H) $(RTL_H) toplev.h
1286 c-lang.o : c-lang.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h toplev.h \
1288 c-lex.o : c-lex.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-lex.h c-tree.h \
1289 $(srcdir)/c-parse.h input.h flags.h $(srcdir)/c-gperf.h c-pragma.h \
1290 toplev.h output.h mbchar.h
1291 c-aux-info.o : c-aux-info.c $(CONFIG_H) system.h $(TREE_H) c-tree.h flags.h
1292 c-convert.o : c-convert.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h
1293 c-pragma.o: c-pragma.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) except.h \
1294 function.h defaults.h c-pragma.h toplev.h
1295 c-iterate.o: c-iterate.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-tree.h \
1296 flags.h toplev.h $(EXPR_H)
1297 mbchar.o: mbchar.c $(CONFIG_H) system.h mbchar.h
1298 graph.o: graph.c $(CONFIG_H) system.h toplev.h flags.h output.h $(RTL_H) \
1299 hard-reg-set.h basic-block.h
1301 collect2$(exeext): collect2.o tlink.o hash.o cplus-dem.o underscore.o \
1302 version.o choose-temp.o mkstemp.o $(LIBDEPS)
1303 # Don't try modifying collect2 (aka ld) in place--it might be linking this.
1304 -rm -f collect2$(exeext)
1305 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ collect2.o tlink.o hash.o \
1306 cplus-dem.o underscore.o version.o choose-temp.o mkstemp.o $(LIBS)
1308 collect2.o : collect2.c $(CONFIG_H) system.h gstab.h \
1309 $(srcdir)/../include/obstack.h $(DEMANGLE_H)
1310 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1311 -DTARGET_MACHINE=\"$(target_alias)\" $(MAYBE_USE_COLLECT2) \
1312 -c `echo $(srcdir)/collect2.c | sed 's,^\./,,'`
1314 tlink.o: tlink.c $(DEMANGLE_H) hash.h $(CONFIG_H) system.h toplev.h
1315 hash.o: hash.c hash.h system.h toplev.h
1317 cplus-dem.o: $(srcdir)/../libiberty/cplus-dem.c $(DEMANGLE_H)
1319 $(LN_S) $(srcdir)/../libiberty/cplus-dem.c cplus-dem.c
1320 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) cplus-dem.c
1322 pexecute.o: $(srcdir)/../libiberty/pexecute.c $(CONFIG_H) system.h
1324 $(LN_S) $(srcdir)/../libiberty/pexecute.c pexecute.c
1325 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) pexecute.c
1327 vfprintf.o: $(srcdir)/../libiberty/vfprintf.c $(CONFIG_H) system.h
1329 $(LN_S) $(srcdir)/../libiberty/vfprintf.c vfprintf.c
1330 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) vfprintf.c
1332 splay-tree.o: $(srcdir)/../libiberty/splay-tree.c \
1333 $(srcdir)/../include/splay-tree.h $(srcdir)/../include/libiberty.h
1335 $(LN_S) $(srcdir)/../libiberty/splay-tree.c splay-tree.c
1336 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) splay-tree.c
1338 underscore.c: s-under ; @true
1340 s-under: $(GCC_PASSES)
1341 echo "int xxy_us_dummy;" >tmp-dum.c
1342 $(GCC_FOR_TARGET) -S tmp-dum.c
1343 echo '/*WARNING: This file is automatically generated!*/' >tmp-under.c
1344 if grep _xxy_us_dummy tmp-dum.s > /dev/null ; then \
1345 echo "int prepends_underscore = 1;" >>tmp-under.c; \
1347 echo "int prepends_underscore = 0;" >>tmp-under.c; \
1349 $(srcdir)/move-if-change tmp-under.c underscore.c
1350 -rm -f tmp-dum.c tmp-dum.s
1353 # A file used by all variants of C.
1355 c-common.o : c-common.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h \
1356 flags.h toplev.h output.h c-pragma.h $(RTL_H)
1358 # Language-independent files.
1361 -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
1362 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
1363 -DDEFAULT_TARGET_VERSION=\"$(version)\" \
1364 -DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \
1365 -DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\"
1366 gcc.o: gcc.c $(CONFIG_H) system.h multilib.h Makefile \
1368 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1370 -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
1372 tree-check.h: s-check ; @true
1373 s-check : gencheck $(srcdir)/move-if-change
1374 ./gencheck > tmp-check.h
1375 $(srcdir)/move-if-change tmp-check.h tree-check.h
1378 gencheck : gencheck.o tree.def $(lang_tree_files) $(HOST_LIBDEPS)
1379 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1380 gencheck.o $(HOST_LIBS)
1382 gencheck.o : gencheck.c hconfig.h system.h
1383 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencheck.c
1385 dumpvers: dumpvers.c
1387 version.o: version.c
1388 obstack.o: $(srcdir)/../libiberty/obstack.c $(CONFIG_H)
1390 $(LN_S) $(srcdir)/../libiberty/obstack.c obstack.c
1391 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) obstack.c
1393 choose-temp.o: $(srcdir)/../libiberty/choose-temp.c $(CONFIG_H) system.h
1395 $(LN_S) $(srcdir)/../libiberty/choose-temp.c choose-temp.c
1396 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) choose-temp.c
1398 mkstemp.o: $(srcdir)/../libiberty/mkstemp.c $(CONFIG_H) system.h
1400 $(LN_S) $(srcdir)/../libiberty/mkstemp.c mkstemp.c
1401 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) mkstemp.c
1403 prefix.o: prefix.c $(CONFIG_H) system.h Makefile
1404 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1405 -DPREFIX=\"$(prefix)\" \
1406 -c `echo $(srcdir)/prefix.c | sed 's,^\./,,'`
1408 convert.o: convert.c $(CONFIG_H) $(TREE_H) flags.h convert.h toplev.h
1410 tree.o : tree.c $(CONFIG_H) system.h $(TREE_H) flags.h function.h toplev.h except.h
1411 print-tree.o : print-tree.c $(CONFIG_H) system.h $(TREE_H)
1412 stor-layout.o : stor-layout.c $(CONFIG_H) system.h $(TREE_H) flags.h \
1413 function.h $(EXPR_H) $(RTL_H) toplev.h except.h
1414 fold-const.o : fold-const.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h \
1416 toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) \
1417 flags.h input.h insn-attr.h xcoffout.h defaults.h output.h \
1418 insn-codes.h insn-config.h $(RECOG_H) Makefile toplev.h dwarfout.h \
1419 dwarf2out.h sdbout.h dbxout.h $(EXPR_H) \
1420 $(lang_options_files)
1421 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(MAYBE_USE_COLLECT2) \
1422 -DTARGET_NAME=\"$(target_alias)\" \
1423 -c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
1425 rtl.o : rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h
1427 print-rtl.o : print-rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h
1428 rtlanal.o : rtlanal.c $(CONFIG_H) system.h $(RTL_H)
1430 varasm.o : varasm.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h \
1431 function.h defaults.h $(EXPR_H) hard-reg-set.h $(REGS_H) \
1432 xcoffout.h output.h c-pragma.h toplev.h except.h dbxout.h sdbout.h
1433 function.o : function.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1434 function.h insn-flags.h insn-codes.h $(EXPR_H) $(REGS_H) hard-reg-set.h \
1435 insn-config.h $(RECOG_H) output.h toplev.h except.h
1436 stmt.o : stmt.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h \
1437 insn-flags.h insn-config.h insn-codes.h hard-reg-set.h $(EXPR_H) except.h \
1438 loop.h $(RECOG_H) toplev.h output.h
1439 except.o : except.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1440 function.h insn-flags.h $(EXPR_H) $(REGS_H) hard-reg-set.h \
1441 insn-config.h $(RECOG_H) output.h except.h toplev.h
1442 expr.o : expr.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h \
1443 $(REGS_H) insn-flags.h insn-codes.h $(EXPR_H) insn-config.h $(RECOG_H) output.h \
1444 typeclass.h hard-reg-set.h toplev.h hard-reg-set.h except.h
1445 calls.o : calls.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h $(EXPR_H) \
1446 insn-flags.h $(REGS_H) toplev.h output.h
1447 expmed.o : expmed.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1448 insn-flags.h insn-config.h insn-codes.h $(EXPR_H) $(RECOG_H) real.h
1449 explow.o : explow.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1450 hard-reg-set.h insn-config.h $(EXPR_H) $(RECOG_H) insn-flags.h insn-codes.h
1451 optabs.o : optabs.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1452 insn-flags.h insn-config.h insn-codes.h $(EXPR_H) $(RECOG_H) reload.h
1453 dbxout.o : dbxout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h $(REGS_H) \
1454 insn-config.h reload.h gstab.h xcoffout.h defaults.h output.h dbxout.h \
1456 sdbout.o : sdbout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h except.h \
1457 function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) defaults.h real.h \
1458 insn-config.h $(srcdir)/../include/obstack.h xcoffout.h c-pragma.h \
1460 dwarfout.o : dwarfout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf.h \
1461 flags.h insn-config.h reload.h output.h defaults.h toplev.h dwarfout.h
1462 dwarf2out.o : dwarf2out.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf2.h \
1463 flags.h insn-config.h reload.h output.h defaults.h \
1464 hard-reg-set.h $(REGS_H) $(EXPR_H) toplev.h dwarf2out.h dyn-string.h
1465 xcoffout.o : xcoffout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) xcoffout.h \
1466 flags.h toplev.h output.h dbxout.h
1467 emit-rtl.o : emit-rtl.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1468 except.h function.h $(REGS_H) insn-config.h $(RECOG_H) real.h \
1469 $(EXPR_H) $(srcdir)/../include/obstack.h hard-reg-set.h bitmap.h
1470 real.o : real.c $(CONFIG_H) system.h $(TREE_H) toplev.h
1471 getpwd.o : getpwd.c $(CONFIG_H) system.h
1473 integrate.o : integrate.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1474 integrate.h insn-flags.h insn-config.h $(EXPR_H) real.h $(REGS_H) \
1475 function.h output.h $(RECOG_H) except.h toplev.h
1477 jump.o : jump.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \
1478 insn-config.h insn-flags.h $(RECOG_H) $(EXPR_H) real.h except.h \
1480 stupid.o : stupid.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h \
1481 $(BASIC_BLOCK_H) insn-config.h reload.h flags.h toplev.h
1483 cse.o : cse.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
1484 real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h output.h
1485 gcse.o : gcse.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
1486 real.h insn-config.h $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) output.h
1487 profile.o : profile.c $(CONFIG_H) system.h $(RTL_H) flags.h insn-flags.h \
1488 gcov-io.h $(TREE_H) output.h $(REGS_H) toplev.h insn-config.h
1489 loop.o : loop.c $(CONFIG_H) system.h $(RTL_H) flags.h loop.h insn-config.h \
1490 insn-flags.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) real.h \
1492 unroll.o : unroll.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
1493 integrate.h $(REGS_H) $(RECOG_H) flags.h $(EXPR_H) loop.h toplev.h
1494 flow.o : flow.c $(CONFIG_H) system.h $(RTL_H) flags.h insn-config.h \
1495 $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h recog.h
1496 combine.o : combine.c $(CONFIG_H) system.h $(RTL_H) flags.h \
1497 insn-config.h insn-flags.h insn-codes.h insn-attr.h $(REGS_H) $(EXPR_H) \
1498 $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h
1499 regclass.o : regclass.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h flags.h \
1500 $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h real.h toplev.h \
1502 local-alloc.o : local-alloc.c $(CONFIG_H) system.h $(RTL_H) flags.h \
1503 $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) output.h \
1504 insn-attr.h toplev.h
1505 bitmap.o : bitmap.c $(CONFIG_H) system.h $(RTL_H) flags.h $(BASIC_BLOCK_H) \
1507 global.o : global.c $(CONFIG_H) system.h $(RTL_H) flags.h reload.h \
1508 $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h toplev.h
1509 varray.o : varray.c $(CONFIG_H) system.h varray.h $(RTL_H) $(TREE_H) bitmap.h
1511 reload.o : reload.c $(CONFIG_H) system.h $(RTL_H) flags.h output.h $(EXPR_H) \
1512 reload.h $(RECOG_H) hard-reg-set.h insn-config.h insn-codes.h $(REGS_H) \
1514 reload1.o : reload1.c $(CONFIG_H) system.h $(RTL_H) real.h flags.h $(EXPR_H) \
1515 reload.h $(REGS_H) hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \
1516 $(BASIC_BLOCK_H) $(RECOG_H) output.h toplev.h
1517 caller-save.o : caller-save.c $(CONFIG_H) system.h $(RTL_H) flags.h \
1518 $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) \
1519 $(RECOG_H) reload.h $(EXPR_H) toplev.h
1520 reorg.o : reorg.c $(CONFIG_H) system.h $(RTL_H) conditions.h hard-reg-set.h \
1521 $(BASIC_BLOCK_H) $(REGS_H) insn-config.h insn-attr.h \
1522 insn-flags.h $(RECOG_H) flags.h output.h $(EXPR_H)
1523 alias.o : alias.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h \
1524 $(REGS_H) toplev.h output.h $(EXPR_H)
1525 regmove.o : regmove.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
1526 $(RECOG_H) output.h reload.h $(REGS_H) hard-reg-set.h flags.h \
1527 $(EXPR_H) insn-flags.h $(BASIC_BLOCK_H) toplev.h
1528 $(SCHED_PREFIX)sched.o : $(SCHED_PREFIX)sched.c $(CONFIG_H) system.h $(RTL_H) \
1529 $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h \
1530 insn-attr.h toplev.h recog.h
1531 final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h $(REGS_H) \
1532 $(RECOG_H) conditions.h insn-config.h insn-attr.h except.h real.h output.h \
1533 hard-reg-set.h insn-flags.h insn-codes.h gstab.h xcoffout.h defaults.h \
1534 toplev.h reload.h dwarfout.h dwarf2out.h sdbout.h dbxout.h
1535 recog.o : recog.c $(CONFIG_H) system.h $(RTL_H) \
1536 $(REGS_H) $(RECOG_H) hard-reg-set.h flags.h insn-config.h insn-attr.h \
1537 insn-flags.h insn-codes.h real.h toplev.h
1538 reg-stack.o : reg-stack.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) recog.h \
1539 $(REGS_H) hard-reg-set.h flags.h insn-config.h insn-flags.h toplev.h
1540 dyn-string.o: dyn-string.c dyn-string.h $(CONFIG_H) system.h
1542 $(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) \
1543 $(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \
1544 insn-flags.h output.h insn-attr.h insn-codes.h system.h toplev.h
1545 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(out_file)
1547 # Build auxiliary files that support ecoff format.
1548 mips-tfile: mips-tfile.o version.o $(LIBDEPS)
1549 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
1551 mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) system.h machmode.h
1553 mips-tdump: mips-tdump.o version.o $(LIBDEPS)
1554 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS)
1556 mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) system.h
1558 # Build file to support OSF/rose half-pic format.
1559 halfpic.o: halfpic.c $(CONFIG_H) $(RTL_H) $(TREE_H) system.h
1561 # Normally this target is not used; but it is used if you
1562 # define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c
1563 # from the GNU Emacs distribution.
1564 alloca.o: $(srcdir)/../libiberty/alloca.c
1566 $(LN_S) $(srcdir)/../libiberty/alloca.c alloca.c
1567 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ALLOCA_FLAGS) \
1568 -c `echo alloca.c | sed 's,^\./,,'`
1571 # Generate header and source files from the machine description,
1574 .PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
1575 insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
1576 insn-attr.h insn-attrtab.c
1578 # The following pair of rules has this effect:
1579 # genconfig is run only if the md has changed since genconfig was last run;
1580 # but the file insn-config.h is touched only when its contents actually change.
1582 # Each of the other insn-* files is handled by a similar pair of rules.
1584 # This causes an anomaly in the results of make -n
1585 # because insn-* is older than s-*
1586 # and thus make -n thinks that insn-* will be updated
1587 # and force recompilation of things that depend on it.
1588 # We use move-if-change precisely to avoid such recompilation.
1589 # But there is no way to teach make -n that it will be avoided.
1591 # Each of the insn-*.[ch] rules has a semicolon at the end,
1592 # for otherwise the system Make on SunOS 4.1 never tries
1593 # to recompile insn-*.o. To avoid problems and extra noise from
1594 # versions of make which don't like empty commands (nothing after the
1595 # trailing `;'), we call true for each.
1597 insn-config.h: s-config ; @true
1598 s-config : $(md_file) genconfig $(srcdir)/move-if-change
1599 ./genconfig $(md_file) > tmp-config.h
1600 $(srcdir)/move-if-change tmp-config.h insn-config.h
1603 insn-flags.h: s-flags ; @true
1604 s-flags : $(md_file) genflags $(srcdir)/move-if-change
1605 ./genflags $(md_file) > tmp-flags.h
1606 $(srcdir)/move-if-change tmp-flags.h insn-flags.h
1609 insn-codes.h: s-codes ; @true
1610 s-codes : $(md_file) gencodes $(srcdir)/move-if-change
1611 ./gencodes $(md_file) > tmp-codes.h
1612 $(srcdir)/move-if-change tmp-codes.h insn-codes.h
1615 insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) $(EXPR_H) real.h output.h \
1616 insn-config.h insn-flags.h insn-codes.h system.h reload.h recog.h
1617 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
1619 insn-emit.c: s-emit ; @true
1620 s-emit : $(md_file) genemit $(srcdir)/move-if-change
1621 ./genemit $(md_file) > tmp-emit.c
1622 $(srcdir)/move-if-change tmp-emit.c insn-emit.c
1625 insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h $(RECOG_H) \
1626 real.h output.h flags.h system.h
1627 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c
1629 insn-recog.c: s-recog ; @true
1630 s-recog : $(md_file) genrecog $(srcdir)/move-if-change
1631 ./genrecog $(md_file) > tmp-recog.c
1632 $(srcdir)/move-if-change tmp-recog.c insn-recog.c
1635 insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) insn-codes.h insn-flags.h \
1636 insn-config.h flags.h $(RECOG_H) $(EXPR_H) reload.h system.h
1637 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c
1639 insn-opinit.c: s-opinit ; @true
1640 s-opinit : $(md_file) genopinit $(srcdir)/move-if-change
1641 ./genopinit $(md_file) > tmp-opinit.c
1642 $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c
1645 insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H) system.h toplev.h \
1646 insn-config.h recog.h
1647 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c
1649 insn-extract.c: s-extract ; @true
1650 s-extract : $(md_file) genextract $(srcdir)/move-if-change
1651 ./genextract $(md_file) > tmp-extract.c
1652 $(srcdir)/move-if-change tmp-extract.c insn-extract.c
1655 insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) $(REGS_H) output.h real.h \
1656 system.h insn-config.h recog.h
1657 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c
1659 insn-peep.c: s-peep ; @true
1660 s-peep : $(md_file) genpeep $(srcdir)/move-if-change
1661 ./genpeep $(md_file) > tmp-peep.c
1662 $(srcdir)/move-if-change tmp-peep.c insn-peep.c
1665 insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) $(REGS_H) real.h \
1666 output.h insn-attr.h insn-config.h system.h toplev.h
1667 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c
1669 insn-attr.h: s-attr ; @true
1670 s-attr : $(md_file) genattr $(srcdir)/move-if-change
1671 ./genattr $(md_file) > tmp-attr.h
1672 $(srcdir)/move-if-change tmp-attr.h insn-attr.h
1675 insn-attrtab.c: s-attrtab ; @true
1676 s-attrtab : $(md_file) genattrtab $(srcdir)/move-if-change
1677 if cmp -s $(PREMADE_ATTRTAB_MD) $(md_file); \
1679 echo Using $(PREMADE_ATTRTAB); \
1680 cp $(PREMADE_ATTRTAB) tmp-attrtab.c; \
1682 ./genattrtab $(md_file) > tmp-attrtab.c; \
1684 $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
1687 insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) $(REGS_H) real.h conditions.h \
1688 hard-reg-set.h insn-config.h insn-flags.h insn-attr.h output.h $(RECOG_H) \
1689 insn-codes.h system.h
1690 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
1692 insn-output.c: s-output ; @true
1693 s-output : $(md_file) genoutput $(srcdir)/move-if-change
1694 ./genoutput $(md_file) > tmp-output.c
1695 $(srcdir)/move-if-change tmp-output.c insn-output.c
1698 genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H) system.h
1699 genrtl.c genrtl.h : s-genrtl
1700 @true # force gnu make to recheck modification times.
1702 s-genrtl: gengenrtl $(srcdir)/move-if-change $(RTL_BASE_H)
1703 ./gengenrtl tmp-genrtl.h tmp-genrtl.c
1704 $(srcdir)/move-if-change tmp-genrtl.h genrtl.h
1705 $(srcdir)/move-if-change tmp-genrtl.c genrtl.c
1709 # Compile the programs that generate insn-* from the machine description.
1710 # They are compiled with $(HOST_CC), and associated libraries,
1711 # since they need to run on this machine
1712 # even if GCC is being compiled to run on some other machine.
1714 # $(CONFIG_H) is omitted from the deps of the gen*.o
1715 # because these programs don't really depend on anything
1716 # about the target machine. They do depend on config.h itself,
1717 # since that describes the host machine.
1719 # Pass the md file through cpp if the target requests it.
1720 $(MD_FILE): $(MD_DEPS)
1722 $(MD_CPP) $(MD_CPPFLAGS) $(md_file) | sed 's/^# /; /g' > tmp-$@
1725 genconfig : genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBDEPS)
1726 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1727 genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBS)
1729 genconfig.o : genconfig.c $(RTL_H) $(build_xm_file) system.h
1730 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
1732 genflags : genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBDEPS)
1733 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1734 genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBS)
1736 genflags.o : genflags.c $(RTL_H) $(build_xm_file) system.h
1737 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
1739 gencodes : gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBDEPS)
1740 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1741 gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBS)
1743 gencodes.o : gencodes.c $(RTL_H) $(build_xm_file) system.h
1744 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
1746 genemit : genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBDEPS)
1747 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1748 genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBS)
1750 genemit.o : genemit.c $(RTL_H) $(build_xm_file) system.h
1751 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
1753 genopinit : genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBDEPS)
1754 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1755 genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBS)
1757 genopinit.o : genopinit.c $(RTL_H) $(build_xm_file) system.h
1758 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c
1760 genrecog : genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBDEPS)
1761 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1762 genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBS)
1764 genrecog.o : genrecog.c $(RTL_H) $(build_xm_file) system.h
1765 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
1767 genextract : genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBDEPS)
1768 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1769 genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBS)
1771 genextract.o : genextract.c $(RTL_H) $(build_xm_file) system.h insn-config.h
1772 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
1774 genpeep : genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBDEPS)
1775 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1776 genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBS)
1778 genpeep.o : genpeep.c $(RTL_H) $(build_xm_file) system.h
1779 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
1781 genattr : genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBDEPS)
1782 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1783 genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBS)
1785 genattr.o : genattr.c $(RTL_H) $(build_xm_file) system.h
1786 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
1788 genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBDEPS)
1789 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1790 genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBS)
1792 genattrtab.o : genattrtab.c $(RTL_H) $(build_xm_file) system.h insn-config.h
1793 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
1795 genoutput : genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBDEPS)
1796 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1797 genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_LIBS)
1799 genoutput.o : genoutput.c $(RTL_H) $(build_xm_file) system.h
1800 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
1802 gengenrtl : gengenrtl.o $(HOST_LIBDEPS)
1803 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1804 gengenrtl.o $(HOST_LIBS)
1806 gengenrtl.o : gengenrtl.c $(RTL_BASE_H) system.h
1807 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gengenrtl.c
1810 # Compile the libraries to be used by gen*.
1811 # If we are not cross-building, gen* use the same .o's that cc1 will use,
1812 # and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
1813 # with the rules for rtl.o, alloca.o, etc.
1814 $(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h
1815 rm -f $(HOST_PREFIX)rtl.c
1816 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c
1817 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c
1819 $(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) $(RTL_H)
1820 rm -f $(HOST_PREFIX)print-rtl.c
1821 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c
1822 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c
1824 $(HOST_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(CONFIG_H) system.h $(RTL_H) \
1825 flags.h $(BASIC_BLOCK_H) $(REGS_H)
1826 rm -f $(HOST_PREFIX)bitmap.c
1827 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/bitmap.c > $(HOST_PREFIX)bitmap.c
1828 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)bitmap.c
1830 $(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) $(RTL_H)
1831 rm -f $(HOST_PREFIX)rtlanal.c
1832 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtlanal.c > $(HOST_PREFIX)rtlanal.c
1833 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c
1835 $(HOST_PREFIX_1)alloca.o: $(srcdir)/../libiberty/alloca.c
1836 rm -f $(HOST_PREFIX)alloca.c
1837 $(LN_S) $(srcdir)/../libiberty/alloca.c $(HOST_PREFIX)alloca.c
1838 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c
1840 $(HOST_PREFIX_1)obstack.o: $(srcdir)/../libiberty/obstack.c
1841 rm -f $(HOST_PREFIX)obstack.c
1842 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/obstack.c > $(HOST_PREFIX)obstack.c
1843 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c
1845 $(HOST_PREFIX_1)vfprintf.o: $(srcdir)/../libiberty/vfprintf.c
1846 rm -f $(HOST_PREFIX)vfprintf.c
1847 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/vfprintf.c > $(HOST_PREFIX)vfprintf.c
1848 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)vfprintf.c
1850 $(HOST_PREFIX_1)doprint.o: doprint.c
1851 rm -f $(HOST_PREFIX)doprint.c
1852 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/doprint.c > $(HOST_PREFIX)doprint.c
1853 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)doprint.c
1855 $(HOST_PREFIX_1)malloc.o: malloc.c
1856 rm -f $(HOST_PREFIX)malloc.c
1857 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/malloc.c > $(HOST_PREFIX)malloc.c
1858 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c
1860 # This satisfies the dependency that we get if you cross-compile a compiler
1861 # that does not need to compile alloca, malloc or whatever.
1863 touch $(HOST_PREFIX_1)
1866 # Remake cpp and protoize.
1868 # Making the preprocessor
1869 cpp$(exeext): $(CCCP)$(exeext)
1871 $(LN) $(CCCP)$(exeext) cpp$(exeext)
1872 cccp$(exeext): cccp.o cexp.o version.o prefix.o mbchar.o @extra_cpp_objs@ $(LIBDEPS)
1873 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ cccp.o cexp.o prefix.o mbchar.o \
1874 version.o @extra_cpp_objs@ $(LIBS)
1875 cexp.o: $(srcdir)/cexp.c $(CONFIG_H) system.h
1876 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
1877 $(srcdir)/cexp.c: $(srcdir)/cexp.y
1878 cd $(srcdir); $(BISON) -o cexp.c cexp.y
1880 # We use $(libsubdir)/$(unlibsubdir) to match the
1881 # -iprefix argument which gcc will pass if GCC_EXEC_PREFIX is used.
1882 cccp.o: cccp.c $(CONFIG_H) pcp.h version.c config.status system.h \
1884 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1885 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1886 -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
1887 -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
1888 -DCROSS_INCLUDE_DIR=\"$(tooldir)/sys-include\" \
1889 -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
1890 -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
1892 LIBCPP_OBJS = cpplib.o cpphash.o cppalloc.o cpperror.o cppexp.o cppfiles.o \
1893 cppulp.o prefix.o version.o mbchar.o @extra_cpp_objs@
1895 # All the other archives built/used by this makefile are for targets. This
1896 # one is strictly for the host.
1898 # For various reasons AR, RANLIB, etc are all set to the target tools and
1899 # must not be used here. Instead explicitly use the host versions.
1901 libcpp.a: $(LIBCPP_OBJS)
1902 $(HOST_AR) $(HOST_AR_FLAGS) libcpp.a $(LIBCPP_OBJS)
1903 if $(HOST_RANLIB_TEST) ; then $(HOST_RANLIB) libcpp.a ; else true ; fi
1905 cppmain$(exeext): cppmain.o libcpp.a $(LIBDEPS)
1906 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cppmain$(exeext) cppmain.o \
1909 cppmain.o: cppmain.c $(CONFIG_H) cpplib.h system.h
1911 cpplib.o: cpplib.c $(CONFIG_H) cpplib.h cpphash.h config.status system.h
1912 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1913 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1914 -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
1915 -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
1916 -DCROSS_INCLUDE_DIR=\"$(tooldir)/sys-include\" \
1917 -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
1918 -c `echo $(srcdir)/cpplib.c | sed 's,^\./,,'`
1920 cpperror.o: cpperror.c $(CONFIG_H) cpplib.h system.h
1922 cppexp.o: cppexp.c $(CONFIG_H) cpplib.h system.h
1924 cppfiles.o: cppfiles.c $(CONFIG_H) cpplib.h system.h
1926 cpphash.o: cpphash.c cpplib.h cpphash.h $(CONFIG_H) system.h
1928 cppalloc.o: cppalloc.c $(CONFIG_H) cpplib.h system.h
1930 # Note for the stamp targets, we run the program `true' instead of
1931 # having an empty command (nothing following the semicolon).
1933 proto: config.status protoize$(exeext) unprotoize$(exeext) SYSCALLS.c.X
1935 protoize$(exeext): protoize.o getopt.o getopt1.o getpwd.o version.o \
1936 pexecute.o choose-temp.o mkstemp.o $(LIBDEPS)
1937 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
1938 protoize.o getopt.o getopt1.o getpwd.o version.o \
1939 pexecute.o choose-temp.o mkstemp.o $(LIBS)
1941 unprotoize$(exeext): unprotoize.o getopt.o getopt1.o getpwd.o version.o \
1942 pexecute.o choose-temp.o mkstemp.o $(LIBDEPS)
1943 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
1944 unprotoize.o getopt.o getopt1.o getpwd.o version.o \
1945 pexecute.o choose-temp.o mkstemp.o $(LIBS)
1947 protoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) system.h
1948 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1949 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1950 -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
1951 -DCROSS_INCLUDE_DIR=\"$(tooldir)/sys-include\" \
1952 -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
1953 -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
1954 -DSTD_PROTO_DIR=\"$(libsubdir)\" \
1955 $(srcdir)/protoize.c
1957 unprotoize.o: unprotoize.c protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) system.h
1958 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1959 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1960 -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
1961 -DCROSS_INCLUDE_DIR=\"$(tooldir)/sys-include\" \
1962 -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
1963 -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
1964 -DSTD_PROTO_DIR=\"$(libsubdir)\" \
1965 $(srcdir)/unprotoize.c
1967 getopt.o: $(srcdir)/../libiberty/getopt.c $(srcdir)/../include/getopt.h
1969 $(LN_S) $(srcdir)/../libiberty/getopt.c getopt.c
1970 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) getopt.c
1972 getopt1.o: $(srcdir)/../libiberty/getopt1.c $(srcdir)/../include/getopt.h
1974 $(LN_S) $(srcdir)/../libiberty/getopt1.c getopt1.c
1975 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) getopt1.c
1977 # This info describes the target machine, so compile with GCC just built.
1978 SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) \
1980 -rm -f SYSCALLS.c tmp-SYSCALLS.s
1981 cat $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c
1982 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1983 -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c
1984 -rm -f SYSCALLS.c tmp-SYSCALLS.s
1987 test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
1988 -rm -f tmp-proto.[cso]
1989 cp $(srcdir)/protoize.c tmp-proto.c
1990 chmod u+w tmp-proto.c
1991 ./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \
1992 $(CFLAGS) $(INCLUDES) \
1993 -DGCC_INCLUDE_DIR=0 \
1994 -DGPLUSPLUS_INCLUDE_DIR=0 \
1995 -DCROSS_INCLUDE_DIR=0 \
1996 -DTOOL_INCLUDE_DIR=0 \
1997 -DSTD_PROTO_DIR=0" tmp-proto.c
1998 @echo '**********' Expect 400 lines of differences.
1999 -diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff
2000 -wc -l tmp-proto.diff
2001 ./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \
2002 $(CFLAGS) $(INCLUDES) \
2003 -DGCC_INCLUDE_DIR=0 \
2004 -DGPLUSPLUS_INCLUDE_DIR=0 \
2005 -DCROSS_INCLUDE_DIR=0 \
2006 -DTOOL_INCLUDE_DIR=0 \
2007 -DSTD_PROTO_DIR=0" tmp-proto.c
2008 @echo Expect zero differences.
2009 diff $(srcdir)/protoize.c tmp-proto.c | cat
2010 -rm -f tmp-proto.[cs] tmp-proto$(objext)
2012 gcov.o: gcov.c gcov-io.h system.h
2014 # Only one of 'gcov' or 'gcov.exe' is actually built, depending
2015 # upon whether $(exeext) is empty or not.
2016 gcov$(exeext): gcov.o $(LIBDEPS)
2017 $(CC) $(ALL_CFLAGS) $(LDFLAGS) gcov.o $(LIBS) -o $@
2019 # Build the include directory. The stamp files are stmp-* rather than
2020 # s-* so that mostlyclean does not force the include directory to
2023 # Build the include directory including float.h (which no longer depends upon
2025 stmp-int-hdrs: stmp-fixinc $(USER_H) xlimits.h gfloat.h
2026 # Copy in the headers provided with gcc.
2027 # The sed command gets just the last file name component;
2028 # this is necessary because VPATH could add a dirname.
2029 # Using basename would be simpler, but some systems don't have it.
2030 # The touch command is here to workaround an AIX/Linux NFS bug.
2031 for file in .. $(USER_H); do \
2032 if [ X$$file != X.. ]; then \
2033 realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
2034 touch include/$$realfile; \
2035 rm -f include/$$realfile; \
2036 cp $$file include; \
2037 chmod a+r include/$$realfile; \
2040 rm -f include/limits.h
2041 cp xlimits.h include/limits.h
2042 chmod a+r include/limits.h
2043 rm -f include/float.h
2044 if [ -s gfloat.h ]; then \
2045 cp gfloat.h include/float.h && \
2046 chmod a+r include/float.h; \
2048 # Install the README
2049 rm -f include/README
2050 cp $(srcdir)/README-fixinc include/README
2051 chmod a+r include/README
2054 # Now that gfloat.h no longer depends upon enquire, this is actually a no-op.
2059 DEST=`cd $(srcdir) ; pwd`/$@ CC=$(CC) MAKE=$(MAKE) CFLAGS="$(CFLAGS)" \
2060 export DEST CC MAKE CFLAGS ; \
2061 echo DEST=$$DEST CC=$$CC MAKE=$$MAKE CFLAGS=$$CFLAGS ; \
2062 cd ../contrib/fixinc ; \
2063 $(SHELL) mkfixinc.sh $(target) $$DEST
2065 # Build fixed copies of system files.
2066 stmp-fixinc: $(FIXINCLUDES) gsyslimits.h
2069 if [ x$(FIXINCLUDES) != xMakefile.in ]; \
2071 for dir in $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); do \
2074 $(SHELL) $(srcdir)/$(FIXINCLUDES) include $$dir; \
2077 if [ x$(INSTALL_ASSERT_H) != x ] ; \
2079 rm -f include/assert.h; \
2080 cp $(srcdir)/assert.h include/assert.h; \
2081 chmod a+r include/assert.h; \
2085 rm -f include/syslimits.h
2086 if [ -f include/limits.h ]; then \
2087 mv include/limits.h include/syslimits.h; \
2089 cp $(srcdir)/gsyslimits.h include/syslimits.h; \
2091 chmod a+r include/syslimits.h
2092 # If $(SYSTEM_HEADER_DIR) is $(tooldir)/sys-include, and
2093 # that directory exists, then make sure that $(libsubdir) exists.
2094 # This is because cpp is compiled to find $(tooldir)/include via
2095 # $(libsubdir)/$(unlibsubdir), which will only work if $(libsubdir)
2097 if [ "$(SYSTEM_HEADER_DIR)" = "$(tooldir)/sys-include" ] \
2098 && [ -d $(tooldir)/sys-include ]; then \
2099 if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi; \
2100 if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib; fi; \
2101 if [ -d $(libdir)/gcc-lib/$(target_alias) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias) ; fi; \
2102 if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version) ; fi; \
2107 # Files related to the fixproto script.
2109 deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs
2110 if [ -d $(SYSTEM_HEADER_DIR) ]; \
2112 CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -I. -I$(srcdir) -Iinclude -I${SYSTEM_HEADER_DIR}"; \
2114 $(SHELL) $(srcdir)/scan-types.sh "$(srcdir)" >tmp-deduced.h; \
2115 mv tmp-deduced.h deduced.h; \
2120 gen-protos: gen-protos.o scan.o cppalloc.o $(HOST_LIBDEPS)
2121 ${HOST_CC} $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
2122 gen-protos.o scan.o cppalloc.o $(HOST_LIBS)
2124 gen-protos.o: gen-protos.c scan.h $(build_xm_file) system.h
2125 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gen-protos.c
2127 scan.o: scan.c scan.h $(build_xm_file) system.h
2128 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c
2130 xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos Makefile
2131 cat deduced.h $(srcdir)/sys-protos.h > tmp-fixtmp.c
2132 mv tmp-fixtmp.c fixtmp.c
2133 $(GCC_FOR_TARGET) fixtmp.c -w -U__SIZE_TYPE__ -U__PTRDIFF_TYPE__ -U__WCHAR_TYPE__ -E \
2134 | sed -e 's/ / /g' -e 's/ *(/ (/g' -e 's/ [ ]*/ /g' -e 's/( )/()/' \
2135 | ./gen-protos >xsys-protos.hT
2136 mv xsys-protos.hT xsys-protos.h
2139 fix-header: fix-header.o scan-decls.o scan.o xsys-protos.h $(HOST_LIBDEPS) \
2141 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ fix-header.o \
2142 scan-decls.o scan.o libcpp.a $(HOST_LIBS)
2144 fix-header.o: fix-header.c $(srcdir)/../include/obstack.h scan.h \
2145 xsys-protos.h $(build_xm_file) system.h cpplib.h cpphash.h
2146 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/fix-header.c
2148 scan-decls.o: scan-decls.c scan.h cpplib.h $(build_xm_file) system.h
2149 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan-decls.c
2151 # stmp-fixproto depends on this, not on fix-header directly.
2152 # The idea is to make sure fix-header gets built,
2153 # but not rerun fixproto after each stage
2154 # just because fix-header's mtime has changed.
2155 fixhdr.ready: fix-header
2156 -if [ -f fixhdr.ready ] ; then \
2159 touch fixhdr.ready; \
2162 # stmp-headers is to make sure fixincludes has already finished.
2163 # The if statement is so that we don't run fixproto a second time
2164 # if it has already been run on the files in `include'.
2165 stmp-fixproto: fixhdr.ready fixproto stmp-headers
2166 @echo "Various warnings and error messages from fixproto are normal"
2167 -if [ -d include ] ; then true; else mkdir include; fi
2168 -if [ -f include/fixed ] ; then true; \
2170 : This line works around a 'make' bug in BSDI 1.1.; \
2171 FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"; export FIXPROTO_DEFINES; \
2172 if [ -d $(SYSTEM_HEADER_DIR) ] ; then \
2173 $(SHELL) ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \
2175 touch include/fixed; \
2179 # Remake the info files.
2182 info: cpp.info gcc.info lang.info
2184 cpp.info: $(srcdir)/cpp.texi
2185 $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o cpp.info $(srcdir)/cpp.texi
2187 gcc.info: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \
2188 $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \
2189 $(srcdir)/tm.texi $(srcdir)/gcov.texi
2190 $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o gcc.info $(srcdir)/gcc.texi
2192 dvi: gcc.dvi cpp.dvi lang.dvi
2194 # This works with GNU Make's default rule.
2195 gcc.dvi: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \
2196 $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \
2197 $(srcdir)/tm.texi $(srcdir)/gcov.texi
2198 TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex gcc.texi
2200 TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex gcc.texi
2202 cpp.dvi: $(srcdir)/cpp.texi
2203 TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex cpp.texi
2205 TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex cpp.texi
2208 INSTALL: $(srcdir)/install1.texi $(srcdir)/install.texi
2209 cd $(srcdir); $(MAKEINFO) -D INSTALLONLY \
2210 --no-split -o INSTALL install1.texi
2212 # Deletion of files made during compilation.
2213 # There are four levels of this:
2214 # `mostlyclean', `clean', `distclean' and `maintainer-clean'.
2215 # `mostlyclean' is useful while working on a particular type of machine.
2216 # It deletes most, but not all, of the files made by compilation.
2217 # It does not delete libgcc.a or its parts, so it won't have to be recompiled.
2218 # `clean' deletes everything made by running `make all'.
2219 # `distclean' also deletes the files made by config.
2220 # `maintainer-clean' also deletes everything that could be regenerated
2221 # automatically, except for `configure'.
2222 # We remove as much from the language subdirectories as we can
2223 # (less duplicated code).
2226 mostlyclean: lang.mostlyclean
2227 -rm -f $(STAGESTUFF)
2228 # Delete the temporary source copies for cross compilation.
2229 -rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c
2230 -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
2231 -rm -f $(HOST_PREFIX_1)obstack.c
2232 # Delete the temp files made in the course of building libgcc.a.
2233 -rm -f tmplibgcc* tmpcopy xlimits.h libgcc1-test
2234 for name in $(LIB1FUNCS); do rm -f $${name}.c; done
2235 # Delete other built files.
2236 -rm -f t-float.h-cross xsys-protos.hT fp-bit.c dp-bit.c
2237 # Delete the stamp and temporary files.
2238 -rm -f s-* tmp-* stamp-* stmp-*
2239 -rm -f */stamp-* */tmp-*
2240 # Delete debugging dump files.
2241 -rm -f *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
2242 -rm -f *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack *.addressof
2243 -rm -f *.regmove *.mach *.bp *.gcse
2244 -rm -f */*.greg */*.lreg */*.combine */*.flow */*.cse */*.jump */*.rtl
2245 -rm -f */*.tree */*.loop */*.dbr */*.jump2 */*.sched */*.cse2
2246 -rm -f */*.sched2 */*.stack */*.regmove */*.gcse
2247 # Delete some files made during installation.
2248 -rm -f specs gfloat.h float.h-* enquire SYSCALLS.c.X SYSCALLS.c
2249 -rm -f collect collect2 mips-tfile mips-tdump alloca.s
2250 # Delete files generated for fixproto
2251 -rm -rf fix-header xsys-protos.h deduced.h tmp-deduced.h \
2252 gen-protos fixproto.list fixtmp.* fixhdr.ready
2253 # Delete unwanted output files from TeX.
2254 -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
2255 -rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg
2256 # Delete sorted indices we don't actually use.
2257 -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
2258 # Delete core dumps.
2262 # Delete all files made by compilation
2263 # that don't exist in the distribution.
2264 clean: mostlyclean lang.clean
2265 # It may not be quite desirable to delete unprotoize.c here,
2266 # but the spec for `make clean' requires it.
2267 # Using unprotoize.c is not quite right in the first place,
2268 # but what better way is there?
2269 -rm -f libgcc.a libgcc1.a libgcc1-asm.a libgcc2.a libgcc2.ready
2273 -if [ -f md.pre-cpp ]; then \
2276 # Delete the include directory.
2278 # Delete files used by the "multilib" facility (including libgcc subdirs).
2279 -rm -f multilib.h tmpmultilib*
2280 -if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \
2281 rm -rf $(MULTILIB_DIRNAMES); \
2282 else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \
2283 rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
2285 -rm -fr stage1 stage2 stage3 stage4
2287 # Delete all files that users would normally create
2288 # while building and installing GCC.
2289 distclean: clean lang.distclean
2290 -rm -f tm.h config.h auto-host.h auto-build.h tconfig.h hconfig.h
2292 -rm -f config.status config.run config.cache config.bak
2293 -rm -f Make-lang Make-hooks Make-host Make-target
2294 -rm -f Makefile specs.h options.h gencheck.h *.oaux
2295 -rm -f gthr-default.h
2296 -rm -f */stage1 */stage2 */stage3 */stage4 */include
2297 -rm -f c-parse.output
2300 -rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
2301 -rm -f testsuite/{gcc,g++}.{log,sum}
2303 # Delete anything likely to be found in the source directory
2304 # that shouldn't be in the distribution.
2305 extraclean: distclean lang.extraclean
2306 -rm -rf =* ./"#"* *~* config/=* config/"#"* config/*~*
2307 -rm -f patch* *.orig *.rej config/patch* config/*.orig config/*.rej
2308 -rm -f config/*/=* config/*/"#"* config/*/*~*
2309 -rm -f config/*/*.orig config/*/*.rej
2310 -rm -f *.dvi *.ps *.oaux *.d *.[zZ] *.gz
2311 -rm -f *.tar *.xtar *diff *.diff.* *.tar.* *.xtar.* *diffs
2312 -rm -f *lose config/*lose config/*/*lose
2313 -rm -f *.s *.s[0-9] *.i config/ChangeLog
2314 -rm -f */=* */"#"* */*~*
2315 -rm -f */patch* */*.orig */*.rej
2316 -rm -f */*.dvi */*.oaux */*.d */*.[zZ] */*.gz
2317 -rm -f */*.tar */*.xtar */*diff */*.diff.* */*.tar.* */*.xtar.* */*diffs
2318 -rm -f */*lose */*.s */*.s[0-9] */*.i
2320 # Get rid of every file that's generated from some other file, except for `configure'.
2321 # Most of these files ARE PRESENT in the GCC distribution.
2323 @echo 'This command is intended for maintainers to use; it'
2324 @echo 'deletes files that may need special tools to rebuild.'
2325 $(MAKE) distclean lang.maintainer-clean
2326 -rm -f c-parse.y c-gperf.h
2327 -rm -f c-parse.c c-parse.h c-parse.output
2328 -rm -f cexp.c cexp.output TAGS
2329 -rm -f cpp.info* cpp.??s cpp.*aux
2330 -rm -f gcc.info* gcc.??s gcc.*aux
2332 # Entry points `install' and `uninstall'.
2333 # Also use `install-collect2' to install collect2 when the config files don't.
2335 # The semicolon is to prevent the install.sh -> install default rule
2336 # from doing anything. Having it run true helps avoid problems and
2337 # noise from versions of make which don't like to have null commands.
2338 install: $(INSTALL_TARGET) ; @true
2340 # Copy the compiler files into directories where they will be run.
2341 # Install the driver last so that the window when things are
2343 install-normal: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \
2344 install-man install-info lang.install-normal install-driver
2346 # Do nothing while making gcc with a cross-compiler. The person who
2347 # makes gcc for the target machine has to know how to put a complete
2348 # gcc together by hand.
2349 install-build: force
2350 @echo You have to install gcc on your target machine by hand.
2352 # Run this on the target machine
2353 # to finish installation of cross compiler.
2354 install-cross-rest: install-float-h-cross
2356 # Install float.h for cross compiler.
2357 # Run this on the target machine!
2358 install-float-h-cross: installdirs
2359 # if [ -f enquire ] ; then true; else false; fi
2360 # Note: don't use -. We should fail right away if enquire was not made.
2361 ./enquire -f > $(tmpdir)/float.h
2362 -rm -f $(libsubdir)/include/float.h
2363 $(INSTALL_DATA) $(tmpdir)/float.h $(libsubdir)/include/float.h
2364 -rm -f $(tmpdir)/float.h
2365 chmod a-x $(libsubdir)/include/float.h
2367 # Create the installation directories.
2369 -if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; chmod a+rx $(prefix) ; fi
2370 -if [ -d $(exec_prefix) ] ; then true ; else mkdir $(exec_prefix) ; chmod a+rx $(exec_prefix) ; fi
2371 -if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; chmod a+rx $(libdir) ; fi
2372 -if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; chmod a+rx $(libdir)/gcc-lib ; fi
2373 # This dir isn't currently searched by cpp.
2374 # -if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; chmod a+rx $(libdir)/gcc-lib/include ; fi
2375 -fdir= ; for dir in `echo $(libsubdir) | tr '/' ' '`; do \
2376 fdir=$${fdir}/$${dir}; \
2377 if [ -d $${fdir} ] ; then true ; else mkdir $${fdir}; chmod a+rx $${fdir}; fi ; \
2379 -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; chmod a+rx $(bindir) ; fi
2380 -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; chmod a+rx $(includedir) ; fi
2381 -if [ -d $(tooldir) ] ; then true ; else mkdir $(tooldir) ; chmod a+rx $(tooldir) ; fi
2382 -if [ -d $(assertdir) ] ; then true ; else mkdir $(assertdir) ; chmod a+rx $(assertdir) ; fi
2383 -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; chmod a+rx $(infodir) ; fi
2384 # We don't use mkdir -p to create the parents of man1dir,
2385 # because some systems don't support it.
2386 # Instead, we use this technique to create the immediate parent of man1dir.
2387 -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
2388 if [ -d $$parent ] ; then true ; else mkdir $$parent ; chmod a+rx $$parent ; fi
2389 -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; chmod a+rx $(man1dir) ; fi
2391 # Install the compiler executables built during cross compilation.
2392 install-common: native installdirs $(EXTRA_PARTS) lang.install-common
2393 for file in $(COMPILERS); do \
2394 if [ -f $$file ] ; then \
2395 rm -f $(libsubdir)/$$file; \
2396 $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
2400 for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \
2401 if [ x"$$file" != x.. ]; then \
2402 rm -f $(libsubdir)/$$file; \
2403 $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
2406 for file in $(EXTRA_PARTS) ..; do \
2407 if [ x"$$file" != x.. ]; then \
2408 rm -f $(libsubdir)/$$file; \
2409 $(INSTALL_DATA) $$file $(libsubdir)/$$file; \
2410 chmod a-x $(libsubdir)/$$file; \
2413 # Don't mess with specs if it doesn't exist yet.
2414 -if [ -f specs ] ; then \
2415 rm -f $(libsubdir)/specs; \
2416 $(INSTALL_DATA) specs $(libsubdir)/specs; \
2417 chmod a-x $(libsubdir)/specs; \
2419 # Install protoize if it was compiled.
2420 -if [ -f protoize$(exeext) ]; \
2422 if [ -f gcc-cross$(exeext) ] ; then \
2423 rm -f $(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \
2424 $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \
2425 rm -f $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \
2426 $(INSTALL_PROGRAM) unprotoize$(exeext) $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \
2428 rm -f $(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
2429 $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
2430 rm -f $(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
2431 $(INSTALL_PROGRAM) unprotoize$(exeext) $(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
2433 rm -f $(libsubdir)/SYSCALLS.c.X; \
2434 $(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X; \
2435 chmod a-x $(libsubdir)/SYSCALLS.c.X; \
2437 -rm -f $(libsubdir)/cpp$(exeext)
2438 $(INSTALL_PROGRAM) cpp$(exeext) $(libsubdir)/cpp$(exeext)
2439 # Install gcov if it was compiled.
2440 -if [ -f gcov$(exeext) ]; \
2442 rm -f $(bindir)/gcov$(exeext); \
2443 $(INSTALL_PROGRAM) gcov$(exeext) $(bindir)/gcov$(exeext); \
2444 chmod a+x $(bindir)/gcov$(exeext); \
2447 # Install the driver program as $(target_alias)-gcc
2448 # and also as either gcc (if native) or $(tooldir)/bin/gcc.
2449 install-driver: xgcc$(exeext)
2450 -if [ -f gcc-cross$(exeext) ] ; then \
2451 rm -f $(bindir)/$(GCC_CROSS_NAME)$(exeext); \
2452 $(INSTALL_PROGRAM) gcc-cross$(exeext) $(bindir)/$(GCC_CROSS_NAME)$(exeext); \
2453 if [ -d $(tooldir)/bin/. ] ; then \
2454 rm -f $(tooldir)/bin/gcc$(exeext); \
2455 $(INSTALL_PROGRAM) gcc-cross$(exeext) $(tooldir)/bin/gcc$(exeext); \
2458 rm -f $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
2459 $(INSTALL_PROGRAM) xgcc$(exeext) $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
2460 rm -f $(bindir)/$(target_alias)-gcc-1$(exeext); \
2461 $(LN) $(bindir)/$(GCC_INSTALL_NAME)$(exeext) $(bindir)/$(target_alias)-gcc-1$(exeext); \
2462 mv $(bindir)/$(target_alias)-gcc-1$(exeext) $(bindir)/$(target_alias)-gcc$(exeext); \
2465 # Install the info files.
2466 # $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir
2467 # to do the install.
2468 install-info: doc installdirs lang.install-info
2469 -rm -f $(infodir)/cpp.info* $(infodir)/gcc.info*
2470 for f in cpp.info* gcc.info*; do \
2471 $(INSTALL_DATA) $$f $(infodir)/$$f; \
2473 -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
2474 if [ -f $(infodir)/dir ] ; then \
2475 for f in cpp.info gcc.info; do \
2476 install-info --dir-file=$(infodir)/dir $(infodir)/$$f; \
2480 -chmod a-x $(infodir)/cpp.info* $(infodir)/gcc.info*
2482 # Install the man pages.
2483 install-man: installdirs $(srcdir)/gcc.1 $(srcdir)/cccp.1 lang.install-man
2484 -if [ -f gcc-cross$(exeext) ] ; then \
2485 rm -f $(man1dir)/$(GCC_CROSS_NAME)$(manext); \
2486 $(INSTALL_DATA) $(srcdir)/gcc.1 $(man1dir)/$(GCC_CROSS_NAME)$(manext); \
2487 chmod a-x $(man1dir)/$(GCC_CROSS_NAME)$(manext); \
2489 rm -f $(man1dir)/$(GCC_INSTALL_NAME)$(manext); \
2490 $(INSTALL_DATA) $(srcdir)/gcc.1 $(man1dir)/$(GCC_INSTALL_NAME)$(manext); \
2491 chmod a-x $(man1dir)/$(GCC_INSTALL_NAME)$(manext); \
2493 -rm -f $(man1dir)/cccp$(manext)
2494 -$(INSTALL_DATA) $(srcdir)/cccp.1 $(man1dir)/cccp$(manext)
2495 -chmod a-x $(man1dir)/cccp$(manext)
2497 # Install the library.
2498 install-libgcc: libgcc.a installdirs
2499 -if [ -f libgcc.a ] ; then \
2500 rm -f $(libsubdir)/libgcc.a; \
2501 $(INSTALL_DATA) libgcc.a $(libsubdir)/libgcc.a; \
2502 if $(RANLIB_TEST) ; then \
2503 (cd $(libsubdir); $(RANLIB) libgcc.a); else true; fi; \
2504 chmod a-x $(libsubdir)/libgcc.a; \
2507 # Install multiple versions of libgcc.a.
2508 install-multilib: stmp-multilib installdirs
2509 for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
2510 dir=`echo $$i | sed -e 's/;.*$$//'`; \
2511 if [ -d $(libsubdir)/$${dir} ]; then true; else mkdir $(libsubdir)/$${dir}; fi; \
2512 for f in libgcc.a $(EXTRA_MULTILIB_PARTS); do \
2513 rm -f $(libsubdir)/$${dir}/$${f}; \
2514 $(INSTALL_DATA) $${dir}/$${f} $(libsubdir)/$${dir}/$${f}; \
2516 if $(RANLIB_TEST); then \
2517 (cd $(libsubdir)/$${dir}; $(RANLIB) libgcc.a); else true; fi; \
2518 chmod a-x $(libsubdir)/$${dir}/libgcc.a; \
2521 # Install all the header files built in the include subdirectory.
2522 install-headers: install-include-dir $(INSTALL_HEADERS_DIR) $(INSTALL_ASSERT_H)
2523 # Fix symlinks to absolute paths in the installed include directory to
2524 # point to the installed directory, not the build directory.
2525 # Don't need to use LN_S here since we really do need ln -s and no substitutes.
2526 -files=`cd $(libsubdir)/include; find . -type l -print 2>/dev/null`; \
2527 if [ $$? -eq 0 ]; then \
2528 dir=`cd include; pwd`; \
2529 for i in $$files; do \
2530 dest=`ls -ld $(libsubdir)/include/$$i | sed -n 's/.*-> //p'`; \
2531 if expr "$$dest" : "$$dir.*" > /dev/null; then \
2532 rm -f $(libsubdir)/include/$$i; \
2533 ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(libsubdir)/include/$$i; \
2538 # Create or recreate the gcc private include file directory.
2539 install-include-dir: installdirs
2540 -rm -rf $(libsubdir)/include
2541 mkdir $(libsubdir)/include
2542 -chmod a+rx $(libsubdir)/include
2544 # Install the include directory using tar.
2545 install-headers-tar: stmp-headers $(STMP_FIXPROTO) install-include-dir
2547 tar -cf - .; exit 0) | (cd $(libsubdir)/include; tar $(TAROUTOPTS) - )
2548 # /bin/sh on some systems returns the status of the first tar,
2549 # and that can lose with GNU tar which always writes a full block.
2550 # So use `exit 0' to ignore its exit status.
2552 # Install the include directory using cpio.
2553 install-headers-cpio: stmp-headers $(STMP_FIXPROTO) install-include-dir
2554 (cd include; find . -print) | (cd include; cpio -pdum $(libsubdir)/include)
2556 # Put assert.h where it won't override GNU libc's assert.h.
2557 # It goes in a dir that is searched after GNU libc's headers;
2558 # thus, the following conditionals are no longer needed.
2559 # But it's not worth deleting them now.
2560 ## Don't replace the assert.h already there if it is not from GCC.
2561 ## This code would be simpler if it tested for -f ... && ! grep ...
2562 ## but supposedly the ! operator is missing in sh on some systems.
2563 install-assert-h: assert.h installdirs
2564 if [ -f $(assertdir)/assert.h ]; \
2566 if grep "__eprintf" $(assertdir)/assert.h >/dev/null; \
2568 rm -f $(assertdir)/assert.h; \
2569 $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
2570 chmod a-x $(assertdir)/assert.h; \
2574 rm -f $(assertdir)/assert.h; \
2575 $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
2576 chmod a-x $(assertdir)/assert.h; \
2579 # Use this target to install the program `collect2' under the name `collect2'.
2580 install-collect2: collect2 installdirs
2581 $(INSTALL_PROGRAM) collect2$(exeext) $(libsubdir)/collect2$(exeext)
2582 # Install the driver program as $(libsubdir)/gcc for collect2.
2583 $(INSTALL_PROGRAM) xgcc$(exeext) $(libsubdir)/gcc$(exeext)
2585 # Cancel installation by deleting the installed files.
2586 uninstall: lang.uninstall
2587 -rm -rf $(libsubdir)
2588 -rm -rf $(bindir)/$(GCC_INSTALL_NAME)$(exeext)
2589 -rm -rf $(bindir)/$(GCC_CROSS_NAME)$(exeext)
2590 -rm -rf $(bindir)/protoize$(exeext)
2591 -rm -rf $(bindir)/unprotoize$(exeext)
2592 -rm -rf $(bindir)/gcov$(exeext)
2593 -rm -rf $(man1dir)/$(GCC_INSTALL_NAME)$(manext)
2594 -rm -rf $(man1dir)/$(GCC_CROSS_NAME)$(manext)
2595 -rm -rf $(man1dir)/cccp$(manext)
2596 -rm -rf $(man1dir)/protoize$(manext)
2597 -rm -rf $(man1dir)/unprotoize$(manext)
2598 -rm -f $(infodir)/cpp.info* $(infodir)/gcc.info*
2600 # These targets are for the dejagnu testsuites. The file site.exp
2601 # contains global variables that all the testsuites will use.
2603 # Set to $(target_alias)/ for cross.
2604 target_subdir = @target_subdir@
2606 site.exp: ./config.status Makefile
2607 @echo "Making a new config file..."
2610 -@mv site.exp site.bak
2611 @echo "## these variables are automatically generated by make ##" > ./tmp0
2612 @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
2613 @echo "# add them to the last section" >> ./tmp0
2614 @echo "set rootme \"`pwd`\"" >> ./tmp0
2615 @echo "set srcdir \"`cd ${srcdir}; pwd`\"" >> ./tmp0
2616 @echo "set host_triplet $(host_canonical)" >> ./tmp0
2617 @echo "set build_triplet $(build_canonical)" >> ./tmp0
2618 @echo "set target_triplet $(target)" >> ./tmp0
2619 @echo "set target_alias $(target_alias)" >> ./tmp0
2620 # CFLAGS is set even though it's empty to show we reserve the right to set it.
2621 @echo "set CFLAGS \"\"" >> ./tmp0
2622 @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
2623 # If newlib has been configured, we need to pass -B to gcc so it can find
2624 # newlib's crt0.o if it exists. This will cause a "path prefix not used"
2625 # message if it doesn't, but the testsuite is supposed to ignore the message -
2626 # it's too difficult to tell when to and when not to pass -B (not all targets
2627 # have crt0's). We could only add the -B if ../newlib/crt0.o exists, but that
2628 # seems like too selective a test.
2629 # ??? Another way to solve this might be to rely on linker scripts. Then
2630 # theoretically the -B won't be needed.
2631 # We also need to pass -L ../ld so that the linker can find ldscripts.
2632 @if [ -d $(objdir)/../$(target_subdir)newlib ] ; then \
2633 echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./tmp0; \
2634 echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)newlib/\"" >> ./tmp0; \
2635 echo "append CFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
2636 echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
2637 echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./tmp0; \
2640 @if [ -d $(objdir)/../ld ] ; then \
2641 echo "append LDFLAGS \" -L$(objdir)/../ld\"" >> ./tmp0; \
2644 echo "set tmpdir $(objdir)/testsuite" >> ./tmp0
2645 @echo "set srcdir \"\$${srcdir}/testsuite\"" >> ./tmp0
2646 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
2647 @cat ./tmp0 > site.exp
2648 @cat site.bak | sed \
2649 -e '1,/^## All variables above are.*##/ d' >> site.exp
2652 CHECK_TARGETS = check-gcc check-g++ check-g77 check-objc
2654 check: $(CHECK_TARGETS)
2656 testsuite/site.exp: site.exp
2657 if [ -d testsuite ]; then \
2662 rm -rf testsuite/site.exp
2663 cp site.exp testsuite/site.exp
2665 check-g++: testsuite/site.exp
2666 -rootme=`pwd`; export rootme; \
2667 srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
2669 EXPECT=${EXPECT} ; export EXPECT ; \
2670 if [ -f $${rootme}/../expect/expect ] ; then \
2671 TCL_LIBRARY=$${srcdir}/../tcl/library ; \
2672 export TCL_LIBRARY ; fi ; \
2673 $(RUNTEST) --tool g++ $(RUNTESTFLAGS)
2675 check-gcc: testsuite/site.exp
2676 -rootme=`pwd`; export rootme; \
2677 srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
2679 EXPECT=${EXPECT} ; export EXPECT ; \
2680 if [ -f $${rootme}/../expect/expect ] ; then \
2681 TCL_LIBRARY=$${srcdir}/../tcl/library ; \
2682 export TCL_LIBRARY ; fi ; \
2683 $(RUNTEST) --tool gcc $(RUNTESTFLAGS)
2685 check-g77: testsuite/site.exp
2686 -rootme=`pwd`; export rootme; \
2687 srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
2689 EXPECT=${EXPECT} ; export EXPECT ; \
2690 if [ -f $${rootme}/../expect/expect ] ; then \
2691 TCL_LIBRARY=$${srcdir}/../tcl/library ; \
2692 export TCL_LIBRARY ; fi ; \
2693 $(RUNTEST) --tool g77 $(RUNTESTFLAGS)
2695 check-objc: testsuite/site.exp
2696 -rootme=`pwd`; export rootme; \
2697 srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
2699 EXPECT=${EXPECT} ; export EXPECT ; \
2700 if [ -f $${rootme}/../expect/expect ] ; then \
2701 TCL_LIBRARY=$${srcdir}/../tcl/library ; \
2702 export TCL_LIBRARY ; fi ; \
2703 $(RUNTEST) --tool objc $(RUNTESTFLAGS)
2705 # These exist for maintenance purposes.
2707 # Update the tags table.
2711 mv -f c-parse.[ch] cexp.c =*.[chy] tmp-tags; \
2712 etags *.y *.h *.c; \
2716 # Create the distribution tar.gz file.
2718 gzip --best < tmp-gcc.xtar > tmp-gcc.xtar.gz
2719 mv tmp-gcc.xtar.gz gcc-$(version).tar.gz
2721 tmp-gcc.xtar: distdir
2722 # Make the distribution.
2723 tar -chf tmp-gcc.xtar gcc-$(version)
2726 if [ -d $(srcdir)/CVS ]; then cd $(srcdir) && cvs -r update; fi
2728 # This target exists to do the initial work before the language specific
2730 distdir-start: doc $(srcdir)/INSTALL $(srcdir)/c-parse.y $(srcdir)/c-gperf.h \
2731 $(srcdir)/c-parse.c $(srcdir)/cexp.c $(srcdir)/config.in \
2732 $(srcdir)/version.c TAGS
2733 @if grep -s "for version ${mainversion}" gcc.texi > /dev/null; \
2735 else echo "You must update the version number in \`gcc.texi'"; sleep 10;\
2737 # Update the version number in README
2738 awk '$$1 " " $$2 " " $$3 == "This directory contains" \
2739 { $$6 = version; print $$0 } \
2740 $$1 " " $$2 " " $$3 != "This directory contains"' \
2741 version=$(version) $(srcdir)/README > tmp.README
2742 mv tmp.README README
2743 -rm -rf gcc-$(version) tmp
2744 # Put all the files in a temporary subdirectory
2745 # which has the name that we want to have in the tar file.
2750 for file in `(cd $(srcdir) && echo *[0-9a-zA-Z+])`; do \
2751 test -f $(srcdir)/$$file && $(LN_S) $(srcdir)/$$file tmp; \
2753 if test "$(srcdir)" != "." ; then \
2754 for file in c-parse.c cexp.c ; do \
2755 test -f ./$$file && $(LN_S) ../$$file tmp; \
2758 for file in `(cd $(srcdir)/config && echo *[0-9a-zA-Z+])`; do \
2759 if test -d $(srcdir)/config/$$file \
2760 && test "$$file" != RCS && test "$$file" != CVS; then \
2761 mkdir tmp/config/$$file; \
2762 for subfile in `(cd $(srcdir)/config/$$file && echo *[0-9a-zA-Z+])`; do \
2763 $(LN_S) $(srcdir)/config/$$file/$$subfile tmp/config/$$file; \
2766 $(LN_S) $(srcdir)/config/$$file tmp/config; \
2769 for file in `(cd $(srcdir)/ginclude && echo *[0-9a-zA-Z+])`; do \
2770 $(LN_S) $(srcdir)/ginclude/$$file tmp/ginclude; \
2772 for file in `(cd $(srcdir)/objc && echo *[0-9a-zA-Z+])`; do \
2773 $(LN_S) $(srcdir)/objc/$$file tmp/objc; \
2775 $(LN_S) .gdbinit tmp
2777 # Finish making `distdir', after the languages have done their thing.
2779 mv tmp gcc-$(version)
2780 # Get rid of everything we don't want in the distribution. We'd want
2781 # this to use Makefile.in, but it doesn't have the `lang.foo' targets
2783 cd gcc-$(version); make extraclean VERSION_DEP=
2785 distdir: distdir-cvs distdir-start lang.distdir distdir-finish
2787 # make diff oldversion=M.N
2788 # creates a diff file between an older distribution and this one.
2789 # The -P option assumes this is GNU diff.
2791 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h \
2792 -x cexp.c -x -x TAGS -x INSTALL \
2793 -x configure -x config.in \
2794 -x "gcc.??" -x "gcc.??s" -x gcc.aux -x "gcc.info*" \
2795 -x "cpp.??" -x "cpp.??s" -x cpp.aux -x "cpp.info*" \
2796 $(LANG_DIFF_EXCLUDES) \
2797 gcc-$(oldversion) gcc-$(version) > gcc-$(oldversion)-$(version).diff
2799 bootstrap bootstrap-lean: force
2800 # Only build the C compiler for stage1, because that is the only one that
2801 # we can guarantee will build with the native compiler, and also it is the
2802 # only thing useful for building stage2.
2803 $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)"
2805 # This used to define ALLOCA as empty, but that would lead to bad results
2806 # for a subsequent `make install' since that would not have ALLOCA empty.
2807 # To prevent `make install' from compiling alloca.o and then relinking cc1
2808 # because alloca.o is newer, we permit these recursive makes to compile
2809 # alloca.o. Then cc1 is newer, so it won't have to be relinked.
2810 $(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)"
2812 -if test $@ = bootstrap-lean; then rm -rf stage1; else true; fi
2813 $(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)"
2815 bootstrap2 bootstrap2-lean: force
2816 $(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)"
2818 -if test $@ = bootstrap2-lean; then rm -rf stage1; else true; fi
2819 $(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)"
2821 bootstrap3 bootstrap3-lean: force
2822 $(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)"
2824 bootstrap4 bootstrap4-lean: force
2825 $(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)"
2827 # Compare the object files in the current directory with those in the
2830 # ./ avoids bug in some versions of tail.
2831 compare compare3 compare4 compare-lean compare3-lean compare4-lean: force
2833 case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
2834 for file in *$(objext); do \
2835 tail +16c ./$$file > tmp-foo1; \
2836 tail +16c stage$$stage/$$file > tmp-foo2 \
2837 && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
2839 case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
2840 for dir in tmp-foo $(SUBDIRS); do \
2841 if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
2842 for file in $$dir/*$(objext); do \
2843 tail +16c ./$$file > tmp-foo1; \
2844 tail +16c stage$$stage/$$file > tmp-foo2 \
2845 && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
2850 case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
2851 if [ -f .bad_compare ]; then \
2852 echo "Bootstrap comparison failure!"; \
2857 *-lean ) rm -rf stage$$stage ;; \
2862 # Compare the object files in the current directory with those in the
2863 # stage2 directory. Use gnu cmp (diffutils v2.4 or later) to avoid
2864 # running tail and the overhead of twice copying each object file.
2866 gnucompare gnucompare3 gnucompare4 gnucompare-lean gnucompare3-lean gnucompare4-lean: force
2868 case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \
2869 for file in *$(objext); do \
2870 (cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
2872 case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \
2873 for dir in tmp-foo $(SUBDIRS); do \
2874 if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
2875 for file in $$dir/*$(objext); do \
2876 (cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
2880 case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \
2881 if [ -f .bad_compare ]; then \
2882 echo "Bootstrap comparison failure!"; \
2887 *-lean ) rm -rf stage$$stage ;; \
2891 # Copy the object files from a particular stage into a subdirectory.
2893 -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
2894 -for dir in . $(SUBDIRS) ; \
2896 if [ -d stage1/$$dir ] ; then true ; else mkdir stage1/$$dir ; fi ; \
2898 -mv $(STAGESTUFF) stage1
2899 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2900 # dir will work properly.
2901 -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage1 ; else true ; fi
2902 -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage1 ; else true ; fi
2903 -if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage1 ; else true ; fi
2904 -rm -f stage1/libgcc.a
2906 -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libgcc.a; else true; fi
2907 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
2908 cp stage1/$${f} . ; \
2911 stage1: force stage1-start lang.stage1
2914 -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
2915 -for dir in . $(SUBDIRS) ; \
2917 if [ -d stage2/$$dir ] ; then true ; else mkdir stage2/$$dir ; fi ; \
2919 -mv $(STAGESTUFF) stage2
2920 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2921 # dir will work properly.
2922 -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage2 ; else true ; fi
2923 -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage2 ; else true ; fi
2924 -if [ -f collect-ld ] ; then $(LN_S) ../collect-ld$(exeext) stage2 ; else true ; fi
2925 -rm -f stage2/libgcc.a
2927 -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libgcc.a; else true; fi
2928 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
2929 cp stage2/$${f} . ; \
2932 stage2: force stage2-start lang.stage2
2935 -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
2936 -for dir in . $(SUBDIRS) ; \
2938 if [ -d stage3/$$dir ] ; then true ; else mkdir stage3/$$dir ; fi ; \
2940 -mv $(STAGESTUFF) stage3
2941 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2942 # dir will work properly.
2943 -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage3 ; else true ; fi
2944 -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage3 ; else true ; fi
2945 -if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage3 ; else true ; fi
2946 -rm -f stage3/libgcc.a
2948 -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libgcc.a; else true; fi
2949 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
2950 cp stage3/$${f} . ; \
2953 stage3: force stage3-start lang.stage3
2956 -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
2957 -for dir in . $(SUBDIRS) ; \
2959 if [ -d stage4/$$dir ] ; then true ; else mkdir stage4/$$dir ; fi ; \
2961 -mv $(STAGESTUFF) stage4
2962 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2963 # dir will work properly.
2964 -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage4 ; else true ; fi
2965 -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage4 ; else true ; fi
2966 -if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage4 ; else true ; fi
2967 -rm -f stage4/libgcc.a
2969 -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libgcc.a; else true; fi
2970 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
2971 cp stage4/$${f} . ; \
2974 stage4: force stage4-start lang.stage4
2976 # Copy just the executable files from a particular stage into a subdirectory,
2977 # and delete the object files. Use this if you're just verifying a version
2978 # that is pretty sure to work, and you are short of disk space.
2979 risky-stage1: stage1
2982 risky-stage2: stage2
2985 risky-stage3: stage3
2988 risky-stage4: stage4
2991 #In GNU Make, ignore whether `stage*' exists.
2992 .PHONY: stage1 stage2 stage3 stage4 clean maintainer-clean TAGS bootstrap
2993 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
2998 # The enquire rules are still useful for building new float-anything.h.
2999 # Special flags for compiling enquire.
3000 # We disable optimization to make floating point more reliable.
3001 ENQUIRE_CFLAGS = -DNO_MEM -DNO_LONG_DOUBLE_IO -O0
3002 ENQUIRE_LDFLAGS = $(LDFLAGS)
3004 # Enquire target (This is a variable so that a target can choose not to
3008 # Test to see whether <float.h> exists in the system header files,
3009 # and is not derived from GCC.
3011 [ -f $(SYSTEM_HEADER_DIR)/float.h ] && \
3012 if grep 'ifndef _FLOAT_H___' $(SYSTEM_HEADER_DIR)/float.h >/dev/null; \
3015 # We pretend to not having a usable <float.h>, hence disable the FLOAT_H_TEST
3016 # to ensure, we're emitting a full blown <float.h> ourselves.
3017 FLOAT_H_TEST = false
3019 # Used to compile enquire with standard cc, but have forgotten why.
3020 # Let's try with GCC.
3021 enquire: enquire.o $(GCC_PARTS)
3022 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@
3023 enquire.o: $(srcdir)/enquire.c $(GCC_PASSES) stmp-int-hdrs
3024 if $(FLOAT_H_TEST); then \
3025 rm -f include/float.h; \
3026 SYS_FLOAT_H_WRAP=1; \
3028 SYS_FLOAT_H_WRAP=0; \
3030 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) \
3031 -DSYS_FLOAT_H_WRAP=$$SYS_FLOAT_H_WRAP \
3032 -I. -c $(srcdir)/enquire.c
3034 # Create float.h source for the native machine.
3035 # Make it empty if we can use the system float.h without changes.
3036 float.h-nat: enquire
3037 -./enquire -f > tmp-float.h
3038 grep '#define [^_]' tmp-float.h >/dev/null || true > tmp-float.h
3039 mv tmp-float.h float.h-nat
3041 # Create a dummy float.h source for a cross-compiler.
3042 # ??? This isn't used anymore. Should we create config/float-unkn.h
3043 # and make that the default float_format in configure?
3045 echo "#ifndef __GCC_FLOAT_NOT_NEEDED" > t-float.h-cross
3046 echo "#error float.h values not known for cross-compiler" >> t-float.h-cross
3047 echo "#endif" >> t-float.h-cross
3048 mv t-float.h-cross float.h-cross