These targets are available from the ‘gcc’ directory:
all
doc
dvi
pdf
html
man
info
mostlyclean
clean
distclean
maintainer-clean
srcextra
srcinfo
srcman
install
uninstall
check
make check-gcc RUNTESTFLAGS="execute.exp=19980413-*"
Note that running the testsuite may require additional tools be installed, such as Tcl or DejaGnu.
The toplevel tree from which you start GCC compilation is not the GCC directory, but rather a complex Makefile that coordinates the various steps of the build, including bootstrapping the compiler and using the new compiler to build target libraries.
When GCC is configured for a native configuration, the default action for make is to do a full three-stage bootstrap. This means that GCC is built three times—once with the native compiler, once with the native-built compiler it just built, and once with the compiler it built the second time. In theory, the last two should produce the same results, which ‘make compare’ can check. Each stage is configured separately and compiled into a separate directory, to minimize problems due to ABI incompatibilities between the native compiler and GCC.
If you do a change, rebuilding will also start from the first stage and “bubble” up the change through the three stages. Each stage is taken from its build directory (if it had been built previously), rebuilt, and copied to its subdirectory. This will allow you to, for example, continue a bootstrap after fixing a bug which causes the stage2 build to crash. It does not provide as good coverage of the compiler as bootstrapping from scratch, but it ensures that the new code is syntactically correct (e.g., that you did not use GCC extensions by mistake), and avoids spurious bootstrap comparison failures1.
Other targets available from the top level include:
bootstrap-lean
bootstrap
, except that the various stages are removed once
they're no longer needed. This saves disk space.
bootstrap2
bootstrap2-lean
stage
N-bubble (
N = 1...4, profile, feedback)
all-stage
N (
N = 1...4, profile, feedback)
cleanstrap
compare
profiledbootstrap
restrap
stage
N-start (
N = 1...4, profile, feedback)
You will invoke this target if you need to test or debug the
stageN GCC. If you only need to execute GCC (but you need
not run ‘make’ either to rebuild it or to run test suites),
you should be able to work directly in the stageN-gcc
directory. This makes it easier to debug multiple stages in
parallel.
stage
If you wish to use non-default GCC flags when compiling the stage2 and
stage3 compilers, set BOOT_CFLAGS
on the command line when doing
‘make’.
Usually, the first stage only builds the languages that the compiler
is written in: typically, C and maybe Ada. If you are debugging a
miscompilation of a different stage2 front-end (for example, of the
Fortran front-end), you may want to have front-ends for other languages
in the first stage as well. To do so, set STAGE1_LANGUAGES
on the command line when doing ‘make’.
For example, in the aforementioned scenario of debugging a Fortran front-end miscompilation caused by the stage1 compiler, you may need a command like
make stage2-bubble STAGE1_LANGUAGES=c,fortran
Alternatively, you can use per-language targets to build and test languages that are not enabled by default in stage1. For example, make f951 will build a Fortran compiler even in the stage1 build directory.