(GNU make does), running make in each of these directories builds the gdb program specified there.

To build gdb in a separate directory, run configure with the --srcdiroption to specify where to find the source. (You also need to specify a path to find configure itself from your working directory. If the path to configure would be the same as the argument to --srcdir, you can leave out the --srcdiroption; it is assumed.)

For example, with version gdb-199991101, you can build GDB in a separate directory for a Sun 4 like this:

cd gdb-gdb-199991101 mkdir ../gdb-sun4 cd ../gdb-sun4

../gdb-gdb-199991101/configure sun4 make

When configure builds a configuration using a remote source directory, it creates a tree for the binaries with the same structure (and using the same names) as the tree under the source directory. In the example, you'd nd the Sun 4 library `libiberty.a' in the directory gdb-sun4/libiberty, and GDB itself in `gdb-sun4/gdb.

One popular reason to build several GDB configurations in separate directories is to configure GDB for cross-compiling (where GDB runs on one machine — the host — while debugging programs that run on another machine — the target). You specify a cross-debugging target by giving the --target=targetoption to configure.

When you run make to build a program or library, you must run it in a configured directory — whatever directory you were in when you called configure (or one of its subdirectories).

The Makefile that configure generates in each source directory also runs recursively. If you type make in a source directory such as gdb-gdb-199991101 (or in a separate configured directory configured with `--srcdir=dirname/gdb-gdb-199991101), you will build all the required libraries, and then build GDB.

When you have multiple hosts or targets configured in separate directories, you can run make on them in parallel (for example, if they are NFS-mounted on each of the hosts); they will not interfere with each other.

A.2 Specifying names for hosts and targets

The specifications used for hosts and targets in the configure script are based on a three-part naming scheme, but some short predefined aliases are also supported. The full naming scheme encodes three pieces of information in the following pattern:

architecture-vendor-os

For example, you can use the alias sun4 as a host argument, or as the value for target in a --target=targetoption. The equivalent full name is sparc-sun-sunos4.

The configure script accompanying GDB does not provide any query facility to list all supported host and target names or aliases. configure calls the Bourne shell script config.sub to map abbreviations to full names; you can read the script, if you wish, or you can use it to test your guesses on abbreviationsfor example:

A.2 Specifying names for hosts and targets 367

Page 367
Image 367
HP gnu source-level debugger 5992-4701 manual Specifying names for hosts and targets