Machine specific code in TONTO

When generating code which can be used on many platforms, invariably there are pieces of code which are needed only on certain platforms and not others. For example, compiler options, which are contained in a Makefile are specific to a platform.

TONTO uses a perl script Makefile.pl to generate machine specfic files such as Makefiles. It also uses the C preprocessor to make sure certain lines of code are compiled only for certain machines.

This is the way it works:

In the top directory are files Makefile.pl and Makefile.in. When you type perl -w Makefile.pl, the perl script Makefile.pl is executed to determine what kind of operating system you have, what kind of compiler, and if everything you need to make TONTO is available.

Once this information is known, Makefile.pl decides the correct site_config file to use by looking in the directory site_config which contains a series of files for machine specific compile options. Makefile.pl then includes the appropriate machine specific compile-option file, and any other machine specific information it knows about, into the generic template Makefile.in to make the correct Makefile.