REDO(1)
okay bestie, this is REDO(1) from the General Commands Manual β the build-tool page that's about to make your targets feel seen. no cap, it's giving "rebuild me when my source files change" main character energy π
β¨
π NAME π
redo β rebuild target files when source files have changed.
β¨ SYNOPSIS β¨
redo [option] [target]...
π¦ DESCRIPTION π¦
redo is a tool for building files and for rebuilding them if any of their dependencies have changed. The build rules are contained in files with the extension .do that are called dofiles. Usually, dofiles are shell scripts executed by sh(1).
π how redo finds dofiles (the search order) π
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.
For example, if redo is asked to build a file called example.x.y.z, it will look for dofiles with the following filenames to build the file:
example.x.y.z.do
default.x.y.z.do
default.y.z.do
default.z.do
default.do
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. If redo can not find a dofile for a target, it exits with a status code indicating failure.
π«Ά the three arguments a dofile gets π«Ά
redo passes three arguments to a dofile that is executed:
$1β is the name of the target.$2β is the basename of the target, i.e. the name of the target minus leading directory components and extensions. Note that the extension is determined from the dofile: a fileexample.a.b.cthat is built with a dofiledefault.b.c.dowill be considered to have the extensionb.c, so$2will be set toexample.a.$3β is the name of a temporary file which replaces the target atomically after the dofile has exited successfully. Instead of writing to$3, a dofile can also write to standard output.
πΈ "pls rebuild me" declarations (the dependency squad) πΈ
If the current target should be rebuilt if other files change, this can be declared with redo-ifchange(1): When redo-ifchange(1) is executed from a dofile, redo builds the targets given to redo-ifchange(1) and will rebuild the current target on the next invocation of redo if any of the targets given to redo-ifchange(1) have changed since the last build.
If the current target should be rebuilt if a file that does not exist at the time of the build exists, this can be declared with redo-ifcreate(1): When redo-ifcreate(1) is executed from a dofile, redo will rebuild the current target on the next invocation of redo if any of the targets given to redo-ifcreate(1) exist.
If the current target should be rebuilt if the output of a command changes, this can be declared with redo-stamp(1): When redo-stamp(1) is executed from a dofile and given data on standard input, redo will rebuild the current target on the next invocation of redo if the the output of the command that piped data to it changes.
If the current target should always be rebuilt, this can be declared with redo-always(1): When redo-always(1) is executed from a dofile, redo will rebuild the current target on the next invocation of redo.
π OPTIONS π
-d,--debugβ if given,redoprints information about all dependency checks.-h,--helpβ if given,redoprints a short notice about its command line options.-j,--jobsβ if given followed by an integer, an invocation ofredo(1)orredo-ifchange(1)with multiple arguments builds targets in parallel. The integer argument specifies the maximum number of targets allowed to be built in parallel. Targets are locked, so if targets built in parallel share a dependency,redo(1)only builds it once, unless the dependency dofile usesredo-always(1)to rebuild every time, or the dependency becomes out of date during a build in some other way.--versionβ if given,redoprints version information and exits.-x,--xtraceβ if given,redoprints commands inside dofiles as they are executed.
π EXAMPLES π
redoβ makesredosearch for a dofile calledall.do, which it executes to build the targetall. Usually, executingall.dowill yield no output on standard output andredowill not create a file calledall.redo example.x.y.zβ makesredosearch for dofiles calledexample.x.y.z.do,default.x.y.z.do,default.y.z.do,default.z.do,default.do.redoexecutes the first file that exists to buildexample.x.y.z.
π HISTORY π
redo was designed by D. J. Bernstein and implemented multiple times by Alan Grosskurth, Avery Pennarun, Jonathan de Boyne Pollard and Γlla Chiana Moskopp.
- Rebuilding target files when source files have changed β
http://cr.yp.to/redo.htmlby D. J. Bernstein - Purely top-down software rebuilding β
http://grosskurth.ca/papers/mmath-thesis.pdfby Alan Grosskurth - redo: a top-down software build system β
https://github.com/apenwarr/redo#readmeby Avery Pennarun - Introduction to redo β
http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/introduction-to-redo.htmlby Jonathan de Boyne Pollard - Redo implementation in Bourne Shell β
http://news.dieweltistgarnichtso.net/bin/redo-sh.htmlby Γlla Chiana Moskopp
π AUTHOR π
redo and this man page were written by Γlla Chiana Moskopp.
βοΈ COPYRIGHT βοΈ
Copyright Β© 2014-2016 Γlla Chiana Moskopp. License AGPLv3+: GNU Affero GPL version 3 or later <http://www.gnu.org/licenses/agpl-3.0.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
π 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 tab or newline.
that's the whole REDO(1) page from the General Commands Manual β source/version: REDO(1) / General Commands Manual, and the date isn't listed here, so consider this your cute footer πβ¨
π¦ where this page comes from
- arch rolling: redo-sh 4.0.7-1 Β· AGPL-3.0-or-later
- nixos 26.05: redo-sh 4.0.7
- nixpkgs unstable: redo-sh 4.0.7
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms