4 There are three basic main commands, originally suggested by DJB in his
10 Forcefully and sequentially build specified targets. This is the
11 main command you will explicitly use from the command line. If no
12 targets are given, then @file{all} target will be used by default.
16 Rebuild specified targets if they are out-of-date and record them as
17 a dependency for the currently run target. This is the main command
18 you will use in @file{.do} files.
22 Record the non-existent file dependency for the currently run
23 target. Target will be rebuilt if any of the given files appear. Can
24 be used only inside @file{.do} file.
27 Pay attention that @command{redo-ifchange} enables parallel builds of
28 the given targets, but ordinary @command{redo} is not: it builds
29 specified targets sequentially and stops when error happens.
32 @option{-x} option can be used to enable tracing (@code{set -x}) of the
33 currently run shell script @file{.do} file. @option{-xx} option enables
34 tracing for all invoked @file{.do} files further.
36 @cindex parallel build
37 With @option{-j} option you can enable parallel builds, probably with an
38 infinite number of workers (@code{=0}). Also you can set
39 @env{$REDO_JOBS} to automatically apply that setting globally.
41 Read about @ref{Logs, log storage capabilities}.
46 @option{-log-pid} (@env{$REDO_LOG_PID=1}) can be used to prefix job's
47 @code{stderr} with the PID, that could be useful during parallel builds.
48 @option{-d} (@env{$REDO_DEBUG=1}) enables debug messages.
51 @vindex REDO_NO_PROGRESS
52 @vindex REDO_NO_STATUS
54 @option{-no-progress} (@env{$REDO_NO_PROGRESS=1}) and
55 @option{-no-status} (@env{$REDO_NO_STATUS=1}) disable statusline and
56 progress display. @env{$NO_COLOR=1} disables progress/debug messages
61 By default all build commands use @code{fsync} to assure data is reached
62 the disk. You can disable its usage with @env{$REDO_NO_SYNC=1}
63 environment variable, for speeding up the build process.
65 @vindex REDO_STOP_IF_MODIFIED
66 If redo sees some target modified externally, then by default it warns
67 user about that, does not build that target, but continues the build
68 process further. That is convenient in most cases: you can build your
69 project with manual targets alterings, without touching possibly more
70 complicated @file{.do} files. With @env{$REDO_STOP_IF_MODIFIED=1} redo
71 won't continue and will exit with failure message.
73 There are other commands that could be found in other implementations too:
78 Record current target as an always-do dependency. By definition it
79 should be always build. @command{goredo} tries to build it once per
84 Record "stamp" dependency. It reads @code{stdin} and stores its hash
85 in the dependency database. It is not used anyhow, it is dummy. Read
86 about @ref{Stamping, stamping} in the FAQ. It is left only for
87 compatibility with some other implementations.
91 @item redo-targets, redo-ood
92 Show all known targets, possibly limited by specified directories.
93 @command{redo-ood} shows only the out-of-date ones.
97 Recursively show all source files the given targets depend on.
101 It is not in other distributions, but it is some kind of opposite of
102 @command{redo-sources} -- shows the targets that will be affected by
103 specified files change.
106 And there are some maintenance and debug commands:
111 Removes either temporary (@option{tmp}), log files (@option{log}),
112 lock files (@option{lock}), or everything related to @command{goredo}
117 Display @file{.do} search paths for specified target (similar to
118 @command{apenwarr/redo}):
120 $ redo-whichdo x/y/a.b.o
139 @url{https://en.wikipedia.org/wiki/DOT_(graph_description_language), DOT}
140 graph generator. For example to visualize your dependencies with GraphViz:
142 $ redo target [...] # to assure that **/.redo/*.dep are filled up
143 $ redo-dot target [...] > whatever.dot
144 $ dot -Tpng whatever.dot > whatever.png # possibly add -Gsplines=ortho
149 When you copy your worktree to different place, then copied files
150 ctime will change. And because recorded dependency information
151 differs from updated ctimes, out-of-date algorithm will fallback to
152 rereading the whole files for hash calculation, that is much slower.
153 If you do not want to rebuild your targets from the ground, then
154 @command{redo-depfix} can traverse through all dependency files and
155 recalculate dependency information.
157 Also if it finds legacy @command{.rec} dependency files, it converts
158 them to binary format.
162 Convert specified @file{.dep} file to recfile on stdout.
163 Aimed to be used mainly for debugging purposes.