diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-06-15 23:30:05 +0200 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-06-15 23:30:05 +0200 |
commit | d831434e95c6a3b33a8af04e630d34f078d26e4f (patch) | |
tree | 93965830662798a4c8674634110eac88bdb3a6ab /man/man1 | |
download | spiewnik-d831434e95c6a3b33a8af04e630d34f078d26e4f.tar.gz spiewnik-d831434e95c6a3b33a8af04e630d34f078d26e4f.zip |
Init
Diffstat (limited to 'man/man1')
-rw-r--r-- | man/man1/redo-always.1 | 92 | ||||
-rw-r--r-- | man/man1/redo-dot.1 | 73 | ||||
-rw-r--r-- | man/man1/redo-ifchange.1 | 159 | ||||
-rw-r--r-- | man/man1/redo-ifcreate.1 | 94 | ||||
-rw-r--r-- | man/man1/redo-ood.1 | 43 | ||||
-rw-r--r-- | man/man1/redo-sources.1 | 49 | ||||
-rw-r--r-- | man/man1/redo-stamp.1 | 91 | ||||
-rw-r--r-- | man/man1/redo-targets.1 | 45 | ||||
-rw-r--r-- | man/man1/redo-whichdo.1 | 127 | ||||
-rw-r--r-- | man/man1/redo.1 | 226 |
10 files changed, 999 insertions, 0 deletions
diff --git a/man/man1/redo-always.1 b/man/man1/redo-always.1 new file mode 100644 index 0000000..709ade6 --- /dev/null +++ b/man/man1/redo-always.1 @@ -0,0 +1,92 @@ +.de URL +\\$2 \(laURL: \\$1 \(ra\\$3 +.. +.if \n[.g] .mso www.tmac +.TH REDO-ALWAYS 1 +.SH NAME +redo-always \- mark the current +.I redo +target as always needing to be rebuilt +.SH SYNOPSIS +.B redo-always +.SH DESCRIPTION +.IR redo(1) +is a tool for building files and for rebuilding them if any of their dependencies have changed. +.IR redo-always , +when invoked from a dofile, adds a dependency on the current target that is impossible to satisfy. The target will always be rebuilt if given as an argument to +.IR redo-ifchange(1) . +.SH EXAMPLES +.PP +Consider the following three dofiles +.IR all.do , +.IR b.do +and +.IR c.do : +.TP +.I all.do +.br +#!/bin/sh +.br +redo-ifchange b +.TP +.I b.do +.br +#!/bin/sh +.br +redo-ifchange c +.br +sleep 1 +.br +date +%s +.TP +.I c.do +.br +#!/bin/sh +.br +redo-always +.br +date +%s +.PP +Invoking +.IR redo(1) +in a directory with these three files will build a file named +.I c +containing a timestamp and a file named +.I b +containing a timestamp that is at least one second later. Both +.I b +and +.I c +will always be rebuilt when +.IR redo(1) +is invoked, as the default target +.I all +depends on +.I b +which in turn depends on +.I c +which has an impossible to satisfy dependency. +.SH HISTORY +.I redo-always +was designed by Avery Pennarun as part of his +.I redo +implementation and implemented by Nils Dagsson Moskopp. +.SH AUTHOR +.I redo-always +and this man page were written by Nils Dagsson Moskopp. +.SH COPYRIGHT +Copyright © 2014-2016 Nils Dagsson 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. +.SH SEE ALSO +.IR redo(1) , +.IR redo-dot(1) , +.IR redo-ifchange(1) , +.IR redo-ifcreate(1) , +.IR redo-ood(1) , +.IR redo-sources(1) , +.IR redo-stamp(1) , +.IR redo-targets(1) +.SH BUGS +.I redo-always +may break if the target filename contains a tab or a newline. diff --git a/man/man1/redo-dot.1 b/man/man1/redo-dot.1 new file mode 100644 index 0000000..33f77cf --- /dev/null +++ b/man/man1/redo-dot.1 @@ -0,0 +1,73 @@ +.de URL +\\$2 \(laURL: \\$1 \(ra\\$3 +.. +.if \n[.g] .mso www.tmac +.TH REDO-DOT 1 +.SH NAME +redo-dot \- print +.I redo +dependency graph for the current directory +.SH SYNOPSIS +.B redo-dot +.RI [pattern] +.SH DESCRIPTION +.IR redo(1) +is a tool for building files and for rebuilding them if any of their dependencies have changed. +.I redo-dot +prints the dependency graph for the current directory in the file format consumed by +.IR dot(1) +from the Graphviz layout programs. If the current working directory is not a +.IR redo(1) +build directory, +.I redo-dot +exits with a status code indicating failure. +.PP +In the dependency graph, targets and sources are represented by nodes, dependencies are represented by solid edges, and non-existence dependencies are represented by dotted edges. Targets that have impossible to satisfy dependencies have a bold outline. Targets that are rebuilt depending on input to +.IR redo-stamp(1) +have a dashed outline. +.PP +A pattern contains characters that match themselves and the meta-characters “!”, “*”, “?”, and “[”, which lose their special meanings if they are quoted. Asterisks (“*”) match any string of characters. Question marks (“?”) match any single character. Left brackets (“[”) and right brackets (“]”) indicate start and end of a character class. Character classes match any characters between brackets or a range of characters specified using a minus (“-”); to include literal minus, make it the first or last character. Exclamation marks (“!”) as the first character of any character class negates it. +.SH EXAMPLES +.TP +.B redo-dot |dot -Tx11 +shows the full dependency graph in an X11 window using +.IR dot(1). +.TP +.B redo-dot '*/stdio.h' +outputs a dependency graph with only nodes that match the pattern +.IR */stdio.h , +dependencies of nodes that match the pattern, and nodes that depend on nodes that match the pattern. +.TP +.B redo-dot |sed s%"$(pwd)"/%%g >deps.dot; dot deps.dot -Tpng >deps.png +outputs the full dependency graph into a file named +.IR deps.dot , +then generates a PNG (Portable Network Graphics) file named +.IR deps.png +from it using +.IR dot(1) . +The +.IR sed(1) +invocation removes the current working directory from the node names. +.SH HISTORY +.I redo-dot +was designed and implemented by Nils Dagsson Moskopp. +.SH AUTHOR +.I redo-dot +and this man page were written by Nils Dagsson Moskopp. +.SH COPYRIGHT +Copyright © 2015-2016 Nils Dagsson 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. +.SH SEE ALSO +.IR sh(1) , +.IR redo(1) , +.IR redo-always(1) , +.IR redo-ifchange(1) , +.IR redo-ifcreate(1) , +.IR redo-ood(1) , +.IR redo-sources(1) , +.IR redo-stamp(1) , +.IR redo-targets(1) +.SH BUGS +.I redo-dot +may break if the target filename contains a tab or newline character. diff --git a/man/man1/redo-ifchange.1 b/man/man1/redo-ifchange.1 new file mode 100644 index 0000000..c787f32 --- /dev/null +++ b/man/man1/redo-ifchange.1 @@ -0,0 +1,159 @@ +.de URL +\\$2 \(laURL: \\$1 \(ra\\$3 +.. +.if \n[.g] .mso www.tmac +.TH REDO-IFCHANGE 1 +.SH NAME +redo-ifchange \- rebuild target files when source files have changed +.SH SYNOPSIS +.B redo-ifchange +.I target +.RI [ target ]... +.SH DESCRIPTION +.IR redo(1) +is a tool for building files and for rebuilding them if any of their dependencies have changed. +.IR redo-ifchange , +when invoked from a dofile, adds dependencies of the current +.IR redo(1) +target on all files given as arguments, (re)builds those files if necessary and rebuilds the current target if the files given as arguments have changed since the last build. +.PP +Internally +.I redo-ifchange +uses +.IR stat(1) +and +.IR md5sum(1) +or +.IR openssl(1) +or +.IR md5(1) +to determine if a file is out of date. If the ctime of a file did not change since the last build, +.I redo-ifchange +considers the file up to date. If the checksum of a file did not change, +.I redo-ifchange +updates the stored ctime and considers the file up to date. Otherwise, +.I redo-ifchange +considers the file out of date. +.PP +When +.I redo(1) +is invoked with the +.B -j +or +.B --jobs +option and an integer argument greater than 1, +.I redo-ifchange(1) +can build multiple targets in parallel. The integer argument specifies the maximum number of targets that +.I redo-ifchange(1) +is allowed to build in parallel. +.PP +.I redo-ifchange(1) +processes started as a result of the same +.I redo(1) +invocation share knowledge of a temporary “canary” path. +If any +.I redo-ifchange(1) +process exits with a status code indicating error or receives a +.B SIGINT +signal (interrupt from keyboard), it creates a file at the “canary” path. When +.I redo-ifchange(1) +notices such a “canary” file, it exits as soon as possible with a status code indicating error. +.SH EXAMPLES +.PP +Consider the following four files +.IR all.do , +.IR b.do , +.IR c +and +.IR d : +.TP +.I all.do +.br +#!/bin/sh +.br +redo-ifchange b +.TP +.I b.do +.br +#!/bin/sh +.br +redo-ifchange c d +.br +date +%s +.TP +.I c +.br +foo +.TP +.I d +.br +bar +.PP +Invoking +.IR redo(1) +in a directory with these files will build a file named +.I b +containing a timestamp. The next time +.IR redo(1) +is invoked, it will only rebuild +.I b +if the contents of +.IR b , +.IR c +or +.IR d +have changed since the last build. This can be verified by invoking +.IR redo(1) , +repeatedly and examining the timestamp in +.IR b , +after each invocation, then changing the contents of +.IR b , +.IR c +or +.IR d +and invoking +.IR redo(1) +again. +.SH HISTORY +.I redo-ifchange +was designed by D. J. Bernstein and implemented by Nils Dagsson Moskopp. +.TP +.URL https://cr.yp.to/redo/atomic.html "Rebuilding target files atomically" " by D. J. Bernstein" +.SH AUTHOR +.I redo-ifchange +and this man page were written by Nils Dagsson Moskopp. +.SH COPYRIGHT +Copyright © 2014-2016 Nils Dagsson 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. +.SH SEE ALSO +.IR redo(1) , +.IR redo-always(1) , +.IR redo-dot(1) , +.IR redo-ifcreate(1) , +.IR redo-ood(1) , +.IR redo-sources(1) , +.IR redo-stamp(1) , +.IR redo-targets(1) , +.IR signal(7) +.SH BUGS +.I redo-ifchange +erroneously considers target files always out of date if their name contains a tab or a newline character. +.PP +On a computer with a +.IR stat(1) +implementation that does not accept the +.B -c%Y +option, +.I redo-ifchange +considers target files to be always out of date. +.PP +When building in parallel and sending a +.B SIGINT +signal (interrupt from keyboard) to a +.I redo-ifchange(1) +process, other +.I redo-ifchange(1) +processes started from the same +.I redo(1) +invocation might not immediately notice the existence of the “canary“ file and linger for a short time. diff --git a/man/man1/redo-ifcreate.1 b/man/man1/redo-ifcreate.1 new file mode 100644 index 0000000..f7d803e --- /dev/null +++ b/man/man1/redo-ifcreate.1 @@ -0,0 +1,94 @@ +.de URL +\\$2 \(laURL: \\$1 \(ra\\$3 +.. +.if \n[.g] .mso www.tmac +.TH REDO-IFCREATE 1 +.SH NAME +redo-ifcreate \- rebuild target files when source files are created +.SH SYNOPSIS +.B redo-ifcreate +.I target +.RI [ target ]... +.SH DESCRIPTION +.IR redo(1) +is a tool for building files and for rebuilding them if any of their dependencies have changed. +.IR redo-ifcreate , +when invoked from a dofile, adds non-existence dependencies of the current +.IR redo(1) +target on all files given as arguments. This means that the current target will be rebuilt on invocation of +.IR redo(1) +if any of the files given as arguments to +.IR redo-ifcreate +exist. If an argument to +.IR redo-ifcreate +exists, it exits with a status code indicating failure. +.SH EXAMPLES +.PP +Consider the following two files +.IR all.do +and +.IR b.do : +.TP +.I all.do +.br +#!/bin/sh +.br +redo-ifchange b +.TP +.I b.do +.br +#!/bin/sh +.br +if [ ! -e c ]; then +.br + redo-ifcreate c +.br +fi +.br +date +%s +.PP +Invoking +.IR redo(1) +in a directory with these files that does not contain a file named +.I c +will build a file named +.I b +containing a timestamp. The next time +.IR redo(1) +is invoked, it will only rebuild +.I b +if a file named +.I c +was created since the last build. This can be verified by invoking +.IR redo(1) +repeatedly and examining the timestamp +.IR b +after each invocation, then creating a file named +.IR c , +invoking +.IR redo(1) +again and examining the timestamp again. +.SH HISTORY +.I redo-ifcreate +was designed by D. J. Bernstein and implemented by Nils Dagsson Moskopp. +.TP +.URL https://cr.yp.to/redo/honest-nonfile.html "Target files depend on nonexistent files" " by D. J. Bernstein" +.SH AUTHOR +.I redo-ifcreate +and this man page were written by Nils Dagsson Moskopp. +.SH COPYRIGHT +Copyright © 2014-2016 Nils Dagsson 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 create and redistribute it. There is NO WARRANTY, to the extent permitted by law. +.SH SEE ALSO +.IR redo(1) , +.IR redo-always(1) , +.IR redo-dot(1) , +.IR redo-ifchange(1) , +.IR redo-ood(1) , +.IR redo-sources(1) , +.IR redo-stamp(1) , +.IR redo-targets(1) +.SH BUGS +.I redo-ifcreate +may break if a source filename contains a tab or newline character. diff --git a/man/man1/redo-ood.1 b/man/man1/redo-ood.1 new file mode 100644 index 0000000..7bd7f1c --- /dev/null +++ b/man/man1/redo-ood.1 @@ -0,0 +1,43 @@ +.de URL +\\$2 \(laURL: \\$1 \(ra\\$3 +.. +.if \n[.g] .mso www.tmac +.TH REDO-OOD 1 +.SH NAME +redo-ood \- print list of +.I redo +targets that are out of date +.SH SYNOPSIS +.B redo-ood +.SH DESCRIPTION +.IR redo(1) +is a tool for building files and for rebuilding them if any of their dependencies have changed. +.I redo-ood +prints the list of redo targets in the current directory and its subdirectories that exist and are out of date, i.e. files that would be rebuilt if given as an argument to +.IR redo-ifchange(1) . +.PP +Files that do not exist are not listed because they might not be targets anymore. For example, if you build a file and later remove it and change the build to no longer generate it, it will not be listed. +.SH HISTORY +.I redo-ood +was designed by Avery Pennarun as part of his +.I redo +implementation and implemented by Nils Dagsson Moskopp. +.SH AUTHOR +.I redo-ood +and this man page were written by Nils Dagsson Moskopp. +.SH COPYRIGHT +Copyright © 2014-2016 Nils Dagsson 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. +.SH SEE ALSO +.IR redo(1) , +.IR redo-always(1) , +.IR redo-dot(1) , +.IR redo-ifchange(1) , +.IR redo-ifcreate(1) , +.IR redo-sources(1) , +.IR redo-stamp(1) , +.IR redo-targets(1) +.SH BUGS +.I redo-ood +may break if the target filename contains a tab or a newline. diff --git a/man/man1/redo-sources.1 b/man/man1/redo-sources.1 new file mode 100644 index 0000000..59dc56d --- /dev/null +++ b/man/man1/redo-sources.1 @@ -0,0 +1,49 @@ +.de URL +\\$2 \(laURL: \\$1 \(ra\\$3 +.. +.if \n[.g] .mso www.tmac +.TH REDO-SOURCES 1 +.SH NAME +redo-sources \- print list of +.IR redo(1) +sources +.SH SYNOPSIS +.B redo-sources +.SH DESCRIPTION +.IR redo(1) +is a tool for building files and for rebuilding them if any of their dependencies have changed. +.I redo-sources +prints the list of +.IR redo(1) +sources in the current directory and its subdirectories that exist. A source is a file that has been listed as a dependency of another file using +.IR redo-ifchange(1) +but can not be built with +.IR redo(1) . +.PP +Files that do not exist are not listed because they might not be sources anymore. For example, if you declare a dependency on a file using +.IR redo-ifchange(1) +and later remove the file and create a dofile to generate it, it will not be listed. +.SH HISTORY +.I redo-sources +was designed by Avery Pennarun as part of his +.I redo +implementation and implemented by Nils Dagsson Moskopp. +.SH AUTHOR +.I redo-sources +and this man page were written by Nils Dagsson Moskopp. +.SH COPYRIGHT +Copyright © 2014-2016 Nils Dagsson 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. +.SH SEE ALSO +.IR redo(1) , +.IR redo-always(1) , +.IR redo-dot(1) , +.IR redo-ifchange(1) , +.IR redo-ifcreate(1) , +.IR redo-ood(1) , +.IR redo-stamp(1) , +.IR redo-targets(1) +.SH BUGS +.I redo-sources +may break if the target filename contains a tab or a newline. diff --git a/man/man1/redo-stamp.1 b/man/man1/redo-stamp.1 new file mode 100644 index 0000000..02be28f --- /dev/null +++ b/man/man1/redo-stamp.1 @@ -0,0 +1,91 @@ +.de URL +\\$2 \(laURL: \\$1 \(ra\\$3 +.. +.if \n[.g] .mso www.tmac +.TH REDO-STAMP 1 +.SH NAME +redo-stamp \- rebuild target files depending on data given on standard input +.SH SYNOPSIS +.RI [command] +| +.B redo-stamp +.SH DESCRIPTION +.IR redo(1) +is a tool for building files and for rebuilding them if any of their dependencies have changed. +.IR redo-stamp , +when invoked from a dofile, adds a dependency of the current +.IR redo(1) +target on the data given on standard input. If the data given on standard input to +.IR redo-stamp +has not changed since the last build, the current +.IR redo(1) +target is not rebuilt and marked as up to date. To ensure that +.IR redo-stamp +checks the current target's validity, one can use +.IR redo-always(1) +to mark the current target as always out of date. +.SH EXAMPLES +.PP +Consider the following two files +.IR all.do +and +.IR b.do : +.TP +.I all.do +.br +#!/bin/sh +.br +redo-ifchange b +.TP +.I b.do +.br +#!/bin/sh +.br +redo-always +.br +echo 'input a line of text:' >&2 +.br +line | redo-stamp +.br +date +%s +.PP +Invoking +.IR redo(1) +in a directory with these files will build a file named +.I b +containing a timestamp. The next time +.IR redo(1) +is invoked, it will only rebuild +.I b +if the output of +.IR line(1) +changed since the last build. This can be verified by invoking +.IR redo(1) +repeatedly and examining the timestamp +.IR b +after each invocation, then changing the input to +.IR line(1) , +invoking +.IR redo(1) +again and examining the timestamp again. +.SH HISTORY +.I redo-stamp +was designed by Avery Pennarun and implemented by Nils Dagsson Moskopp. +.SH AUTHOR +.I redo-stamp +and this man page were written by Nils Dagsson Moskopp. +.SH COPYRIGHT +Copyright © 2014-2017 Nils Dagsson 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 create and redistribute it. There is NO WARRANTY, to the extent permitted by law. +.SH SEE ALSO +.IR redo(1) , +.IR redo-always(1) , +.IR redo-dot(1) , +.IR redo-ifchange(1) , +.IR redo-ifcreate(1) , +.IR redo-ood(1) , +.IR redo-sources(1) , +.IR redo-targets(1) +.SH BUGS +None so far. diff --git a/man/man1/redo-targets.1 b/man/man1/redo-targets.1 new file mode 100644 index 0000000..dc8dcb8 --- /dev/null +++ b/man/man1/redo-targets.1 @@ -0,0 +1,45 @@ +.de URL +\\$2 \(laURL: \\$1 \(ra\\$3 +.. +.if \n[.g] .mso www.tmac +.TH REDO-TARGETS 1 +.SH NAME +redo-targets \- print list of +.IR redo(1) +targets +.SH SYNOPSIS +.B redo-targets +.SH DESCRIPTION +.IR redo(1) +is a tool for building files and for rebuilding them if any of their dependencies have changed. +.I redo-targets +prints the list of +.IR redo(1) +targets in the current directory and its subdirectories that exist, i.e. files that would be rebuilt if given as an argument to +.IR redo-ifchange(1) . +.PP +Files that do not exist are not listed because they might not be targets anymore. For example, if you build a file and later remove it and change the build to no longer generate it, it will not be listed. +.SH HISTORY +.I redo-targets +was designed by Avery Pennarun as part of his +.IR redo(1) +implementation and implemented by Nils Dagsson Moskopp. +.SH AUTHOR +.I redo-targets +and this man page were written by Nils Dagsson Moskopp. +.SH COPYRIGHT +Copyright © 2014-2016 Nils Dagsson 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. +.SH SEE ALSO +.IR redo(1) , +.IR redo-always(1) , +.IR redo-dot(1) , +.IR redo-ifchange(1) , +.IR redo-ifcreate(1) , +.IR redo-ood(1) , +.IR redo-sources(1) , +.IR redo-stamp(1) +.SH BUGS +.I redo-targets +may break if the target filename contains a tab or a newline. diff --git a/man/man1/redo-whichdo.1 b/man/man1/redo-whichdo.1 new file mode 100644 index 0000000..89b135b --- /dev/null +++ b/man/man1/redo-whichdo.1 @@ -0,0 +1,127 @@ +.de URL +\\$2 \(laURL: \\$1 \(ra\\$3 +.. +.if \n[.g] .mso www.tmac +.TH REDO-WHICHDO 1 +.SH NAME +redo-whichdo \- print search paths for dofiles to build a +.I redo +target +.SH SYNOPSIS +.B redo-whichdo +.I target +.SH DESCRIPTION +.I redo(1) +is a tool for building files and for rebuilding them if any of their dependencies have changed. +.I redo-whichdo +prints all dofiles that +.I redo(1) +will look for to build the target. +If the exit code of +.I redo-whichdo +indicates success, the last filename is the filename of the dofile that +.I redo(1) +will actually use to build the target. +.PP +.I redo-whichdo +prints the filename for a dofile that +.I redo(1) +could use to build the target. +If the dofile exists, +.I redo-whichdo +exits with a status code indicating success. +If the dofile does not exist, +.I redo-whichdo +either repeats the previous action with a fallback filename or exits with a status code indicating error if +.I redo-whichdo +can not find a dofile to build the target. +.PP +If standard output is a terminal, +.I redo-whichdo +separates filenames by newline characters. Otherwise, +.I redo-whichdo +separates filenames by null characters. +Shell scripts that act on the output of +.I redo-whichdo +can pipe it to +.I xargs(1) +invoked with the +.B -0 +option to handle the filenames. +.SH EXAMPLES +.PP +Consider a root directory containing only the three dofiles +.IR a.do , +.IR default.b.do , +.IR default.c.do , +and a folder +.IR d . +For the targets, +.IR a , +.IR a.b , +and +.IR a.b.c , +.IR d/a.b.c , +the output of +.I redo-whichdo(1) +would be these: +.TP +.I a +.br +/a.do +.TP +.I a.b +.br +/a.b.do +.br +/default.b.do +.TP +.I a.b.c +.br +/a.b.c.do +.br +/default.b.c.do +.br +/default.c.do +.TP +.I d/a.b.c +.br +/d/a.b.c.do +.br +/d/default.b.c.do +.br +/d/default.c.do +.br +/d/default.do +.br +/default.b.c.do +.br +/default.c.do +.SH NOTES +.PP +A dofile used to build a target is a dependency of that target: +If +.I redo(1) +determines that the dofile used to build a target has changed, the target will be rebuilt. +.PP +All non-existent dofiles searched for while building a target are non-existence dependencies of that target: +If +.I redo(1) +finds that a previously searched for non-existent dofile exists, the target will be rebuilt. +.SH HISTORY +.I redo-whichdo +was designed by Avery Pennarun and Nils Dagsson Moskopp as part of Avery Pennarun's +.I redo +implementation and independently implemented by Nils Dagsson Moskopp. +.SH AUTHOR +.I redo-whichdo +and this man page were written by Nils Dagsson Moskopp. +.SH COPYRIGHT +Copyright © 2018-2019 Nils Dagsson 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. +.SH SEE ALSO +.IR redo(1) , +.IR redo-ifchange(1) , +.IR redo-ifcreate(1) , +.IR redo-targets(1) diff --git a/man/man1/redo.1 b/man/man1/redo.1 new file mode 100644 index 0000000..fe2b9e7 --- /dev/null +++ b/man/man1/redo.1 @@ -0,0 +1,226 @@ +.de URL +\\$2 \(laURL: \\$1 \(ra\\$3 +.. +.if \n[.g] .mso www.tmac +.TH REDO 1 +.SH NAME +redo \- rebuild target files when source files have changed +.SH SYNOPSIS +.B redo +.RB [ option ] +.RI [ target ]... +.SH DESCRIPTION +.I 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 +.IR sh(1) . +.PP +.I redo +uses a simple algorithm to find dofiles: First it looks for the filename of the target with the suffix +.IR .do , +then it looks for filenames consisting of +.I default +plus the target's filename extension plus +.IR .do , +recursively removing the last component of the target's filename extension. +.PP +For example, if +.I redo +is asked to build a file called +.B +.IR example.x.y.z , +it will look for dofiles with the following filenames to build the file: +.RS +.PP +example.x.y.z.do +.PP +default.x.y.z.do +.PP +default.y.z.do +.PP +default.z.do +.PP +default.do +.RE +.PP +.I redo +considers the first existing file found this way the dofile for the target and executes it. If +.I redo +is not given a target, it builds a target named +.IR all . +If +.I redo +can not find a dofile for a target, it exits with a status code indicating failure. +.PP +.I redo +passes three arguments to a dofile that is executed: +.TP +.B $1 +is the name of the target. +.TP +.B $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 file +.I +example.a.b.c +that is built with a dofile +.I default.b.c.do +will be considered to have the extension +.IR b.c , +so +.B $2 +will be set to +.IR example.a . +.TP +.B $3 +is the name of a temporary file which replaces the target atomically after the dofile has exited successfully. Instead of writing to +.BR $3 , +a dofile can also write to standard output. +.PP +If the current target should be rebuilt if other files change, this can be declared with +.IR redo-ifchange(1) : +When +.IR redo-ifchange(1) +is executed from a dofile, +.I redo +builds the targets given to +.IR redo-ifchange(1) +and will rebuild the current target on the next invocation of +.I redo +if any of the targets given to +.IR redo-ifchange(1) +have changed since the last build. +.PP +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 +.IR redo-ifcreate(1) : +When +.IR redo-ifcreate(1) +is executed from a dofile, +.I redo +will rebuild the current target on the next invocation of +.I redo +if any of the targets given to +.IR redo-ifcreate(1) +exist. +.PP +If the current target should be rebuilt if the output of a command changes, this can be declared with +.IR redo-stamp(1) : +When +.IR redo-stamp(1) +is executed from a dofile and given data on standard input, +.I redo +will rebuild the current target on the next invocation of +.I redo +if the the output of the command that piped data to it changes. +.PP +If the current target should always be rebuilt, this can be declared with +.IR redo-always(1) : +When +.IR redo-always(1) +is executed from a dofile, +.I redo +will rebuild the current target on the next invocation of +.IR redo . +.SH OPTIONS +If the +.B -d +or +.B --debug +option is given, +.I redo +prints information about all dependency checks. +.PP +If the +.B -h +or +.B --help +option is given, +.I redo +prints a short notice about its command line options. +.PP +If the +.B -j +or +.B --jobs +option is given followed by an integer, an invocation of +.I redo(1) +or +.I redo-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, +.I redo(1) +only builds it once, unless the dependency dofile uses +.I redo-always(1) +to rebuild every time, +or the dependency becomes out of date during a build in some other way. +.PP +If the +.B --version +option is given, +.I redo +prints version information and exits. +.PP +If the +.B -x +or +.B --xtrace +option is given, +.I redo +prints commands inside dofiles as they are executed. +.SH EXAMPLES +.TP +.B redo +makes +.I redo +search for a dofile called +.BR all.do , +which it executes to build the target +.BR all . +Usually, executing +.B all.do +will yield no output on standard output and +.I redo +will not create a file called +.BR all . +.TP +.B redo example.x.y.z +makes +.I redo +search for dofiles called +.BR example.x.y.z.do , +.BR default.x.y.z.do , +.BR default.x.y.do , +.BR default.x.do , +.BR default.do . +.I redo +executes the first file that exists to build +.BR example.x.y.z . +.SH HISTORY +.I redo +was designed by D. J. Bernstein and implemented multiple times by Alan Grosskurth, Avery Pennarun, Jonathan de Boyne Pollard and Nils Dagsson Moskopp. +.TP +.URL http://cr.yp.to/redo.html "Rebuilding target files when source files have changed" " by D. J. Bernstein" +.TP +.URL http://grosskurth.ca/papers/mmath-thesis.pdf "Purely top-down software rebuilding" " by Alan Grosskurth" +.TP +.URL https://github.com/apenwarr/redo#readme "redo: a top-down software build system" " by Avery Pennarun" +.TP +.URL http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/introduction-to-redo.html "Introduction to redo" " by Jonathan de Boyne Pollard" +.TP +.URL http://news.dieweltistgarnichtso.net/bin/redo-sh.html "Redo implementation in Bourne Shell" " by Nils Dagsson Moskopp" +.SH AUTHOR +.I redo +and this man page were written by Nils Dagsson Moskopp. +.SH COPYRIGHT +Copyright © 2014-2016 Nils Dagsson 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. +.SH SEE ALSO +.IR redo-always(1) , +.IR redo-ifchange(1) , +.IR redo-ifcreate(1) , +.IR redo-ood(1) , +.IR redo-sources(1) , +.IR redo-stamp(1) , +.IR redo-targets(1) +.SH BUGS +This implementation of +.I redo +may break if the target filename contains a tab or newline. |