### 10.2 Compiling and Installing the Source Code Distribution

> BUG: This section is out of date. `Geomview` follows the GNU-installation habits, data goes to `PREFIX/share/geomview/`, user executables to `PREFIX/bin/`, private executables to `PREFIX/libexec/geomview/`, libraries to `PREFIX/lib/` where `PREFIX` denotes the installation prefiex specified for the `TOPSRCDIR/configure` script. Please have a look at the files `TOPSRCDIR/INSTALL` and `TOPSRCDIR/INSTALL.Geomview` for installation instructions.

The main reason to get the source code distribution is to look at and/or work with the source code. If you are only concered with using Geomview it is better to get the binary distribution. It takes anywhere from a few minutes to an hour or more to compile the entire source distribution, depending on what kind of computer you have.

Let `$GEOMROOT` denote the full pathname of the Geomview source code directory; this is the directory called `Geomview` that is created when you unpack the distribution. This directory contains the Geomview source code as well as various other files and subdirectories that Geomview needs when it runs.

Before doing any compilation you should edit the file `$GEOMROOT/makefiles/mk.site.default`. This file defines some `make` variables which specify your local configuration. This includes the pathnames of the directories into which Geomview will be installed, and possibly some other settings as well. There are comments in the file telling you what to do. This file is included by every Makefile in the source tree, so the settings you specify here are used throughout the source.

If you will be compiling for multiple systems, you can do them all in the same directory tree. By default the Makefiles are set up to put the objects files, libraries, and executables in directories which depend on the type of computer, so the two architectures will not interfere with each other. The Makefiles use a variable called `CPU` to determine the type of machine. Before doing any compilation you must arrange for this variable to have a value. There are two ways you can do this.

1. If you will always be compiling Geomview on the same type of computer edit the file `$GEOMROOT/makefiles/Makedefs.global` to set the `CPU` variable to one of the values `linux`, `FreeBSD`, `sgi`, `hpux`, `hpux-gcc`, `solaris`, `sun4os4` (for Suns with SunOS 4, not Solaris), `rs6000`, or `alpha`. If you're using a type of system not in this list, make up a new value for CPU, and write a `mk.<CPU>` file for it patterned after the other `mk.*` in the `makefiles` subdirectory.
2. If you will be compiling on more than one type of computer you can set a shell environment variable named `CPU` to one of the values above and the Makefiles will inherit the value from the environment.

Note that many of the Makefiles refer to a variable called `MACHTYPE`; this variable tells which type of graphics system to compile Geomview for. The `mk.<CPU>` files set this variable for you; in most cases its value is `x11`, which specifies that Geomview should be compiled for X windows.

Once you have configured your source tree by editing the files as described above and setting the `CPU` variable, you can compile and install Geomview by typing `make install` in the `$GEOMROOT` directory. You can also type `make all`, or equivalently just `make`, to compile without installing, and then type `make install` later to install.

You can use these same `make` comands in any subdirectory in the tree to recompile and/or install a part of Geomview or a module.

If you want to modify the complier flags used during compilation, edit the file `$GEOMROOT/makefiles/Makedefs.global`; the `COPTS` variable specifies the flags passed to the C compiler (cc).