REDO(1)

NAME
redo - rebuild target files when source files have changed

SYNOPSIS
redo [ -d ] [ -h ] [ -x ] [ -s ] [ target ]

DESCRIPTION
redo is a tool for building target files and their dependencies. The build rules are contained in files with the extension .do that are called dofiles. Usually, dofiles are shell scripts executed by sh(1).

redo uses a simple algorithm to find dofiles: First it looks for the filename of the target with the suffix .do, then it looks for filenames consisting of default plus the target's filename extension plus .do, recursively removing the last component of the target's filename extension. redo considers the first existing file found this way the dofile for the target and executes it. If redo is not given a target, it builds a target named all.

redo passes three arguments to a dofile that is executed:

$1  is the name of the target.

$2  is the basename of the target (name of the target minus its extension).

$3  is the name of a temporary file which replaces the target atomically after the dofile has exited successfully. Instead of writing to $3 , dofiles can also write to standard output.

Normally, dofiles will declare dependencies using redo-ifchange(1): If redo-ifchange(1) is executed from a dofile, redo builds the targets given to redo-ifchange(1) and rebuilds the target corresponding to the dofile if any of the targets given to redo-ifchange(1) have changed since the last build.

Dependencies on the creation of currently non-existing files can be declared with redo-ifcreate(1). Dependencies on the output of a command can be declared by piping its output to redo-stamp(1). If redo-always(1) is executed from a dofile, redo always rebuilds the current target.

OPTIONS
If the -d or --debug option is given, redo prints information about all dependency checks.

If the -h or --help option is given, redo prints a short notice about its command line options.

If the -s or --shuffle option is given, redo randomizes the build order (to find dependency bugs).

If the -x or --xtrace option is given, redo prints commands inside dofiles as they are executed.

EXAMPLES

redo
    makes redo search for a dofile called all.do, which it executes to build the target all. Usually, executing all.do will yield no output on standard output and redo will not create a file called all.

redo example.x.y.z
    makes redo search for dofiles called example.x.y.z.do, default.x.y.z.do, default.x.y.do, default.x.do, default.do. redo executes the first file that exists to build example.x.y.z.

HISTORY
redo was designed by D. J. Bernstein and implemented separately by Alan Grosskurth, Avery Pennarun and Jonathan de Boyne Pollard. A comprehensive history of redo can be found at <http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/introduction-to-redo.html>.

AUTHOR
redo and this man page were written by Nils Dagsson Moskopp.

COPYRIGHT
Copyright © 2014 Nils Dagsson Moskopp. License AGPLv3+: GNU Affero GPL version 3 or later <http://www.gnu.org/licenses/agpl-3.0.html>.

SEE ALSO
redo-always(1), redo-ifchange(1), redo-ifcreate(1), redo-ood(1), redo-sources(1), redo-stamp(1), redo-targets(1)

BUGS
This implementation of redo may break if the target filename contains a space, tab or newline.