Appendix A. TOM makefiles

Table of Contents
A.1. Basics
A.2. Important macros
A.3. Targets
A.4. More macros
A.5. Secondary GNUmakefiles
A.6. Environment Variables

A.1. Basics

The TOM makefiles is a collection of makefiles that enable easy building and rebuilding of TOM program units, library units, and dynamically loadable units. When using the TOM makefiles, you do not need to be concerned with the details of compilation or of the particular system you are using, or will be using in the future.

The following makefiles constitute the TOM makefiles:

GNUmakefile.app

Build a program into which dynamic loading is possible.

GNUmakefile.bin

Build a program into which dynamic loading is not necessarily possible. It depends on the operating system being used whether GNUmakefile.app and GNUmakefile.bin actualy create different executables (on NeXTSTEP, for instance, they do not differ).

GNUmakefile.lib

Build a library unit.

GNUmakefile.load

Build a unit which is to be dynamically loaded.

GNUmakefile.top

Build only subprojects.

GNUmakefile.common

The heart of the TOM makefiles. The others are just front-ends to this file.

This is what a minimal, example GNUmakefile looks like:


UNIT=               hello
TOM_SRC=            hello

TOM_MAKEFILES_DIR=  /usr/lib/tom/makefiles
include $(TOM_MAKEFILES_DIR)/GNUmakefile.bin

To start with the last line, we see the GNUmakefile.bin being included. This means the GNUmakefile is for a program. The UNIT is called hello; this will also be the name of the resulting program. This simple program contains only one TOM source file, hello.t. Note that the extension is not specified.