When you declare another tree as a tree dependency of your tree,
you declare your dependency on the other tree by mentioning its
name in the tree-deps of your tree's root
Abuild.conf
. In order for this dependency
to work, abuild must know where to find the tree. Abuild
finds items and trees in the same way: it traverses the build
forest from the top down and creates a table mapping names to
paths. If the tree your tree depends on is
inside of your tree, this poses no problem.
But what if it is an external tree that is not inside your tree?
In this instance, you must place the external tree somewhere
within your overall build area, such as in another subdirectory
of the parent of your own tree's root. Then you must create an
Abuild.conf
file in that common parent
directory that knows about the root directories of the two
trees. This is illustrated in Figure 7.1, “Top-Level Abuild.conf
”.
Figure 7.1. Top-Level Abuild.conf
Tree A
declares a tree dependency on
tree B
. In order for
A
to find B
, an
Abuild.conf
file that points to both
trees' locations must be created in a common ancestor
directory. The ovals show the contents of each directory's
Abuild.conf
files.
The tree named B
has an
Abuild.conf
that that declares no tree
dependencies. It is a self-contained tree. However,
A
's Abuild.conf
file
mentions B
by name.
How does A
find B
?
When you start abuild, it walks up the tree to find the
highest-level Abuild.conf
(or the highest
level one not referenced as a child of the next higher
Abuild.conf
) and traverses downward from
there. In this case, the Abuild.conf
in
A
's parent directory knows the locations of
both A
and B
. In this
way, abuild has figured out where to find
B
when A
declares the
tree dependency. This is illustrated with a concrete example
below.