Docs: recommend adding redo-ifchange with a lot of targets at a time.

Some people don't know to do this, and their scripts are unnecessarily slow
because of it.
This commit is contained in:
Avery Pennarun 2011-05-08 04:25:51 -04:00
commit 656c3c583c
2 changed files with 49 additions and 2 deletions

View file

@ -38,7 +38,7 @@ redo-ifchange returns only after all the given
*targets* are known to be up to date.
# TIP
# TIP 1
You don't have to run redo-ifchange *before* generating
your target; you can generate your target first, then
@ -60,6 +60,24 @@ requires that you declare all your dependencies before
running the target build commands.
# TIP 2
Try to list as many dependencies as possible in a single
call to redo-ifchange. Every time you run redo-ifchange,
the shell has to fork+exec it, which takes time. Plus redo
can only parallelize your build if you give it multiple
targets to build at once. It's fine to have a couple of
separate redo-ifchange invocations for a particular target
when necessary (as in TIP 1 above), but try to keep it to a
minimum. For example here's a trick for generating a list
of targets, but redo-ifchanging them all at once:
for d in *.c; do
echo ${d%.c}.o
done |
xargs redo-ifchange
# REDO
Part of the `redo`(1) suite.