cook man page
cook — a file construction tool
[ option... ][ filename... ]
The program is a tool for constructing files. It is given a set of files to create, and instructions detailing how to construct them. In any non-trivial program there will be prerequisites to performing the actions necessary to creating any file, such as extraction from a source-control system. The program provides a mechanism to define these.
When a program is being developed or maintained, the programmer will typically change one file of several which comprise the program. The program examines the last-modified times of the files to see when the prerequisites of a file have changed, implying that the file needs to be recreated as it is logically out of date.
The program also provides a facility for implicit recipes, allowing users to specify how to form a file with a given suffix from a file with a different suffix. For example, to create filename.o from filename.c
Options and filenames may be arbitrarily mixed on the command line; no processing is done until all options and filenames on the command line have been scanned.
The program will attempt to create the named files from the recipes given to it. The recipes are contained in a file called Howto.cook in the current directory. This file may, in turn, include other files containing additional recipes.
If no filenames are given on the command line the targets of the first recipe defined are cooked.
The valid options for are listed below. Any other options (words on the command line beginning with `-') will cause a diagnostic message to be issued.
Execute the commands given in the recipes. This is the default.
Do not execute the commands given in the recipes.
- -Book filename
Tells to used the named cookbook, rather than the default “Howto.cook” file.
This option may be used to enable the use of cascaded ingredients. This is the default.
This option may be used to disable the use of cascaded ingredients.
If cooking a target should fail, continue with other recipes for which the failed target is not an ingredient, directly or indirectly.
If cooking a target should fail, will exit. This is the default.
The inode st_ctime data is used to supplement the st_mtime data when determining whether or not files have changed. This is the default. (If you have no idea what this is, don't mess with it.)
Do not supplement st_mtime with st_ctime. This may be important when st_nlink changes at critical times, because making and breaking hard links touches st_ctime. (If you have no idea what this is, seriously, don't mess with it.)
When a command is executed, the exit code will be ignored.
When a command is executed, if the exit code is positive it will be deemed to fail, and thus the recipe containing it to have failed. This is the default.
When cook examines a file to determine if it has changed, it uses the last-modified time information available in the file system. There are times when this is altered, but the file contents do not actually change. The fingerprinting facility examines the file contents when it appears to have changed, and compares the old fingerprint against the present file contents. (See cookfp(1) for a description of the fingerprinting algorithm.) If the fingerprint did not change, the last-modified time in the file system is ignored. Note that this has implications if you are in the habit of using the touch(1) command - cook will do nothing until you actually change the file.
Do not use fingerprints to supplement the last-modified time file information. This is the default.
This option may be used to scan the directory tree below the current directory and update the file fingerprints. This helps when you use another tool (such as RCS or ClearCase) which alters the file but preserves the file's modification time.
Always perform the actions of recipes, irrespective of the last-modified times of any of the ingredients. This option is useful if something beyond the scope of the cookbook has been modified; for example, a bug fix in a compiler.
Perform the actions of the recipes if any of the ingredients are logically out of date. This is the default.
Provide information about how to execute on stdout, and perform no other function.
- -Include filename
Search the named directory before the standard places for included cookbooks. Each directory so named will be scanned in the order given. The standard places are $HOME/.cook then .
This option may be used to require the cooking of files named on #include-cooked and #include-cooked-nowarn include lines in cookbooks. The files named will be included, if present. If the files named need to be updated or created, this will be done, and then the cookbook re-read. This is the default.
This option may be used to inhibit the implicit cooking of files named on #include-cooked and #include-cooked-nowarn include lines in cookbooks. The files will be included, if present, but they will not be updated or created, even if required.
This option enables the warnings about derived dependencies in derived cookbooks. This is usually the default.
This option disables the warnings about derived dependencies in derived cookbooks.
Causes to automatically redirect the stdout and stderr of the session. Output will continue to come to the terminal, unless is executing in the background. The name of the file will be the name of the cookbook with any suffix removed and "
.list" appended; this will usually be Howto.list. This is the default.
- -List filename
Causes to automatically redirect the stdout and stderr of the session into the named file. Output will continue to come to the terminal, unless is executing in the background.
No automatic redirection of the output of the session will be made.
- -No_List filename
No automatic redirection of the output of the session will be made, however subsequent -List options will default to listing to the named file.
After each command is executed, print a summary of the command's CPU usage.
Do not print a CPU usage summary after each command. This is the default.
This option may be used to generate a list of pair-wise file dependencies, similar to lorder(1) output. This may be used to draw file dependency diagrams. It can also be useful when debugging cookbooks.
- -Page-Length number
This option may be used to set the length of the page, used when Cook needs to paginate output. Defaults to what the LINES environment variable tells it, or the terminal emulator tells it if LINES isn't set. -Page-Width number This option may be used to set the width of the page, used when Cook needs to wrap output (e.g. when it prints commends being executed). Defaults to what the COLS environment variable tells it, or the terminal emulator tells it if COLS isn't set. The maximum value for number is 32767.
- -PARallel [ number ]
This option may be used to specify the number of parallel executions threads. The number defaults to 4 if no specific number of threads is specified. See also the parallel_jobs variable.
Use of this option on single-processor machines needs to be done with great care, as it can bring other processing to a complete halt. Several users doing so simultaneously on a multi-processor machine will have a similar effect. It is also to rapidly run out of virtual memory and temporary disk space if the parallel tasks are complex.
This option may be used to specify that a single execution thread is to be used. This is the default.
When commands in the body of a recipe fail, do not delete the targets of the recipe.
When commands in the body of a recipe fail, delete the targets of the recipe. This is the default.
Two options are provided for tracing the inferences makes when attempting to cook a target. The -Reason option will cause will emit copious amounts of information about the inferences it is making when cooking targets. This option may be used when you think is acting strangely, or are just curious.
This option may be used to cause will not emit information about the inferences it is making when cooking targets. This is the default.
This option may be used to request a shell script be printed on the standard output. This shell script may be used to construct the files; it captures many of the semantics of the cookbook. This can be useful when a project needs to be distributed, and the recipients do not have cook(1) installed. It can also be very useful when debugging cookbooks.
Do not echo commands before they are executed.
Echo commands before they are executed. This is the default.
Emit progress indicators once a second. These progress indicators include
+ Reading the cookbook - Executing a collect function * Building the dependency graph # Walking the dependency graph @ Writing fingerprint files.
Do not emit progress indicators. This is the default.
Remove leading "./" from filenames before attempting to cook them; applies to all filenames and all recipes. This is the default.
Leave leading "./" on filenames while cooking.
The option asks that, when using a search path, that non-top-level recipe ingredients get a top-level symlink to the actual file. This is intended for brain dead tools, like GNU Autoconf, that don't grok search paths.
Do not create top level symlinks to ingredients. This is the default.
This option may be used to cause the position of commands (filename and line number) to be printed along with the command just before it is executed (provided the -No_Silent option is in force).
This option may be used to suppress printing the position of commands (filename and line number) along with the command just before it is executed. This is the default.
Update the last-modified times of the target files, rather than execute the actions bound to recipes. This can be useful if you have made a modification to a file that you know will make a system of files logically out of date, but has no significance; for example, adding a comment to a widely used include file.
Execute the actions bound to recipes, rather than update the last-modified times of the target files. This is the default.
When listing, also send the output stream to the terminal. This is the default.
When listing, do not send the output to the terminal.
This option causes cook to check the last-modified time of the targets of recipes, and updates them if necessary, to make sure they are consistent with (younger than) the last-modified times of the ingredients. This results in more system calls, and can slow things down on some systems. This corresponds to the time-adjust recipe flag.
Do not update the file last-modified times after performing the body of a recipe. This is the default. This corresponds to the no-time-adjust recipe flag.
This option may be used to request a HTML web page be printed on the standard output. This web page may be used to document the file dependencies; it captures many of the semantics of the cookbook. It can also be very useful when debugging cookbooks.
Assign the value to the named variable. The value may contain spaces if you can convince the shell to pass them through.
The following files are used by cook:
This file contains instructions to cook for how to construct files.
This directory contains "system" cookbooks for various tools and activities.
This text file is used to remember fingerprints between invocations.
The following environment variables are used by cook:
May be set to contain command-line options, changing the default behavior of cook. May be overridden by the command line.
Use to paginate the output of the -Help and -VERSion options. Defaults to more(1) if not set.
A colon-separated list of directories which the automounter may use to mount file systems. Use with extreme care, as this distorts Cook's idea of the shape of the file system.
This feature assumes that paths below the automounter's mount directory are echoes of paths without it. E.g. When
/homeis the trigger, and
/tmp_mnt/homeis where the on-demand NFS mount is performed, with
/homeappearing to processes to be a symlink.
This is the behavior of the Sun automounter. The AMD automounter is capable of being configured in this way, though it is not typical of the examples in the manual. Nor is it typical of the out-of-the-box Linux AMD configuration in many distributions.
Defaults to “
/tmp_mnt:/a:/.automount” if not set.
c_incl(1), cook_bom(1), find_libs(1).