The following files constitute the TOM makefiles.
This is what a minimal, example GNUmakefile looks like:
UNIT= hello TOM_SRC= Hello tom_prefix= /usr/local/tom include $(tom_prefix)/GNUmakefile.binTo 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.
UNIT
TOM_SRC
USES_UNITS
UNIT
. These
units will appear in the uses
clause of the unit
file. If unspecified, USES_UNITS defaults to tom
.
LINK_UNITS
UNIT
to
produce the final result. For bin and app targets,
this must include the tom
unit, and every unit
specified in the USES_UNITS
. For load targets,
this should include everything not already in the app into which
loading is performed.
If unspecified, the LINK_UNITS
are set equal to the
USES_UNITS
for bin and app targets, and
set to NONE
for load targets.
NONE
(case is important) means that the result will
be linked against no other units.
UNIT_PATH
$(tom_prefix)
. When looking for a unit u,
for each directory dir in the path, the directory
dir/u is checked for containing the unit
u. The first match will be used.
For example, if your project /home/me/src/myapp uses the units tom,
too, and the one calld mylib in /home/me/src/mylib, the UNIT_PATH
would be ..
, and USES_UNITS
would
include mylib
. Note that the makefiles use the fact
that a unit can reside in a subdirectory of the same name, in a
directory somewhere along the UNIT_PATH
. This is
especially handy when using a lot of units, each residing in a
subdirectory of a specific top-level directory.
SUBPROJECTS
C_SRC
C
unit has a file called
glue.c
which contains code that interfaces the TOM
Math
class with the C math library. Consequently,
the GNUmakefile of the C
unit specifies:
C_SRC= glueActually, the extension does not matter, since for every word mysrc only the replacement mysrc.o is used in the makefiles. The makefiles however only contain the rule to create
$(GENDIR)/%.o
for every C source file
%.c
.
GP_SRC
EXTRA_OBJ
TOMC
tomc
,
i.e. the compiler must reside in the user's path.
TOMR
tomr
,
GI
gi
,
$Id: makefiles.html,v 1.5 1998/02/14 22:42:54 tiggr Exp $