1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
.\"
.\" cook - file construction tool
.\" Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998 Peter Miller;
.\" All rights reserved.
.\"
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program; if not, write to the Free Software
.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
.\"
.\" MANIFEST: User Guide, Predefined Variables
.\"
.H 1 "Predefined Variables"
A number of variables are defined by
.B cook
at run-time.
.H 2 arg
This is the arguments list for user-defined functions. Individual
arguments are split out into ``@1'' to ``@9''. These can also be used
at automatic variables. Caution: \fIarg\fP and the automatic variables
are \fIshared\fP for parallel execution, causing weird interactions if
you execute a command within the function.
.H 2 command-line-goals
The value of this variable is the goals specified on the command line,
if any. If none were specified, and the default goal is in effect, the
value will be empty.
.H 2 __FILE__
The value of this variable is the logical name of the
file which contains it.
In the case of \f[CW]#include-cooked\fP files,
the physical name may be obtained using the [resolve] function.
The logical name may be set using the \f[CW]#line\fP directive.
.H 2 graph_leaf_file
File names which are listed in this variable
could be leaf files of the dependency graph.
.H 2 graph_exterior_file
File names which are listed in this variable
cannot be present in any way in the dependency graph.
.H 2 graph_interior_file
File names which are listed in this variable
could be interior files of the dependency graph.
.H 2 graph_leaf_pattern
File names which match the patterns in this variable
could be leaf files of the dependency graph.
.H 2 graph_exterior_pattern
File names which match the patterns in this variable
cannot be present in any way in the dependency graph.
.H 2 grapg_interior_pattern
File names which match the patterns in this variable
could be interior files of the dependency graph.
.H 2 __LINE__
The value of this variable is the line number within of the
file which contains it.
The line number may be set using the \f[CW]#line\fP directive.
.H 2 need
The ingredients of the recipe currently being cooked.
.H 2 "search_list"
This variable may be set to a list of directories to be searched for
targets and ingredients.
This list is initially the current directory (.)
and will always have the current directory prepended if it is not present.
This is useful when taking partial copies of a source
to perform controlled updates.
Use the
.I "resolve"
built-in function to determine what file name cook actually found.
The targets of recipes are always cooked into the current directory.
.P
The cookbooks distributed with Cook contain full support for the
\f[CW]search_list\fP functionality. They are a good source of examples
of how to write recipes which take this into account.
.H 2 parallel_jobs
This variable may be set to the number of parallel execution threads to
perform simultaneously. Defaults to 1 if not set.
.H 2 self
The name
.B cook
was invoked as,
usually "cook".
Be careful what you call cook,
because anything with the string "cook" in it will be changed,
including (but not limited to) file suffixes and environment variable names.
.H 2 target
The target of the recipe currently being cooked,
or the first target if there is more than one.
.H 2 targets
The targets of the recipe currently being cooked.
This includes all targets of the recipe,
should there be more than one.
.H 2 thread-id
This variable has a unique value for each execution thread, for the
lifetime of that thread. This value may be used to construct
thread-unique variable names, thread-unique temporary file names, or
anything else that needs to be unique to each execution thread. The
thread IDs are re-used, and so several threads in sequence may have the
same thread ID; it is only guaranteed that no other simultaneous thread
will have the same thread ID. By re-using thread IDs, generated
variable names are also re-used, avoiding memory bloat.
.H 2 younger
The subset of the ingredients of the recipe currently being cooked
which are younger than the target.
.H 2 version
The version of
.B cook
currently executing.
|