| 1 |
.TH REMAKE 1 "5 June 2020" "GNU" "User Commands" |
| 2 |
.SH NAME |
| 3 |
remake \- GNU make utility to maintain groups of programs |
| 4 |
.SH SYNOPSIS |
| 5 |
.B remake |
| 6 |
[\fIOPTION\fR]... [\fITARGET\fR]... |
| 7 |
.SH DESCRIPTION |
| 8 |
.LP |
| 9 |
The |
| 10 |
.I remake |
| 11 |
utility will determine automatically which pieces of a large program need to |
| 12 |
be recompiled, and issue the commands to recompile them. The manual describes |
| 13 |
the GNU implementation of |
| 14 |
.BR make |
| 15 |
from which remake is derived, |
| 16 |
which was written by Richard Stallman and Roland McGrath, and is |
| 17 |
currently maintained by Paul Smith. Extended error reporting, |
| 18 |
debugger, and profiling extensions were written by Rocky Bernstein. |
| 19 |
Our examples show C programs, since they are very common, but you can |
| 20 |
use |
| 21 |
.B remake |
| 22 |
with any programming language whose compiler can be run with a shell command. |
| 23 |
In fact, |
| 24 |
.B remake |
| 25 |
or |
| 26 |
.B make |
| 27 |
are not limited to programs. You can use it to describe any task where some |
| 28 |
files must be updated automatically from others whenever the others change. |
| 29 |
.LP |
| 30 |
To prepare to use |
| 31 |
.BR remake , |
| 32 |
you must write a file called the |
| 33 |
.I makefile |
| 34 |
that describes the relationships among files in your program, and the states |
| 35 |
the commands for updating each file. In a program, typically the executable |
| 36 |
file is updated from object files, which are in turn made by compiling source |
| 37 |
files. |
| 38 |
.LP |
| 39 |
Once a suitable makefile exists, each time you change some source files, |
| 40 |
this simple shell command: |
| 41 |
.sp 1 |
| 42 |
.RS |
| 43 |
.B remake |
| 44 |
.RE |
| 45 |
.sp 1 |
| 46 |
suffices to perform all necessary recompilations. |
| 47 |
The |
| 48 |
.B remake |
| 49 |
program uses the makefile description and the last-modification times of the |
| 50 |
files to decide which of the files need to be updated. For each of those |
| 51 |
files, it issues the commands recorded in the makefile. |
| 52 |
.LP |
| 53 |
.B remake |
| 54 |
executes commands in the |
| 55 |
.I makefile |
| 56 |
to update one or more target |
| 57 |
.IR names , |
| 58 |
where |
| 59 |
.I name |
| 60 |
is typically a program. |
| 61 |
If no |
| 62 |
.B \-f |
| 63 |
option is present, |
| 64 |
.B remake |
| 65 |
will look for the makefiles |
| 66 |
.IR GNUmakefile , |
| 67 |
.IR makefile , |
| 68 |
and |
| 69 |
.IR Makefile , |
| 70 |
in that order. |
| 71 |
.LP |
| 72 |
Normally you should call your makefile either |
| 73 |
.I makefile |
| 74 |
or |
| 75 |
.IR Makefile . |
| 76 |
(We recommend |
| 77 |
.I Makefile |
| 78 |
because it appears prominently near the beginning of a directory |
| 79 |
listing, right near other important files such as |
| 80 |
.IR README .) |
| 81 |
The first name checked, |
| 82 |
.IR GNUmakefile , |
| 83 |
is not recommended for most makefiles. You should use this name if you have a |
| 84 |
makefile that is specific to GNU |
| 85 |
.BR remake, |
| 86 |
and will not be understood by other versions of |
| 87 |
.BR remake . |
| 88 |
If |
| 89 |
.I makefile |
| 90 |
is '\-', the standard input is read. |
| 91 |
.LP |
| 92 |
.B remake |
| 93 |
updates a target if it depends on prerequisite files |
| 94 |
that have been modified since the target was last modified, |
| 95 |
or if the target does not exist. |
| 96 |
.SH OPTIONS |
| 97 |
.LP |
| 98 |
Below we give options that are specific to |
| 99 |
.BR remake . |
| 100 |
For the other options, please refer to the GNU Make documentation |
| 101 |
|
| 102 |
.TP 0.5i |
| 103 |
\fB\-c\fR, \fB\-\-search-parent\fR |
| 104 |
if a Makefile or goal target isn't found in the current directory, |
| 105 |
.B remake |
| 106 |
will search in the parent directory for a Makefile. On finding a parent the |
| 107 |
closest parent directory with a Makefile, |
| 108 |
.B remake |
| 109 |
will set its current working |
| 110 |
directory to the directory where the Makefile was found. |
| 111 |
.sp 1 |
| 112 |
In this respect the short option '\-c', is like '\-C' except no |
| 113 |
directory need to be specified. |
| 114 |
.sp 1 |
| 115 |
.TP 0.5i |
| 116 |
\fB\-!\fR, \fB\-\-post\-mortem\fR |
| 117 |
Go into the debugger on an error. This is the |
| 118 |
Same as options: \-\-debugger \-\-debugger\-stop=error |
| 119 |
|
| 120 |
.TP 0.5i |
| 121 |
.B \-P, " \-\-profile [=TYPE] |
| 122 |
Enables timing and dependency profiling output using the specified |
| 123 |
.I TYPE |
| 124 |
for formatting. |
| 125 |
.I TYPE |
| 126 |
can be either |
| 127 |
.I callgrind |
| 128 |
or |
| 129 |
.IR json . |
| 130 |
If omitted, it defaults to |
| 131 |
.IR callgrind . |
| 132 |
Files generated using |
| 133 |
.I callgrind |
| 134 |
can be analyzed with kcachegrind, callgrind_annotate, or |
| 135 |
gprof2dot. Files generated with |
| 136 |
.I json |
| 137 |
have the format specified in the |
| 138 |
.I info |
| 139 |
manual. |
| 140 |
|
| 141 |
.TP 0.5i |
| 142 |
.B \-\-profile\-directory=[PATH] |
| 143 |
Specifies the |
| 144 |
.I PATH |
| 145 |
that profiling files should be written to. Must exist |
| 146 |
before running |
| 147 |
.IR make . |
| 148 |
It is assumed to be a relative path to the initial directory |
| 149 |
where |
| 150 |
.I make |
| 151 |
is called, unless it begins with a ~ or /. |
| 152 |
|
| 153 |
.TP 0.5i |
| 154 |
.BR "\-\-targets" |
| 155 |
Print a list of explicitly-named targets found in read-in makefiles. |
| 156 |
|
| 157 |
.TP 0.5i |
| 158 |
.BR \-\-tasks |
| 159 |
Print a list of explicitly-named targets found in read-in makefiles which |
| 160 |
have description comments. A description comment is added by putting |
| 161 |
a single comment before the target that starts with '#:'. |
| 162 |
|
| 163 |
.TP 0.5i |
| 164 |
.B \-x, " \-\-trace [=FLAGS]" |
| 165 |
Set trace flags |
| 166 |
If the |
| 167 |
.I FLAGS |
| 168 |
are omitted, then the behavior is the same as if |
| 169 |
.B \-\-trace=normal |
| 170 |
was specified. |
| 171 |
.I FLAGS |
| 172 |
may be |
| 173 |
.I read |
| 174 |
for tracing Makefiles read in, |
| 175 |
.I noshell |
| 176 |
which is like \fInormal\fR but shell tracing |
| 177 |
is disabled, or |
| 178 |
.I full |
| 179 |
for maximum tracing. |
| 180 |
|
| 181 |
.TP 0.5i |
| 182 |
.B \-X, "\-\-debugger [=TYPE]" |
| 183 |
Enter debugger with |
| 184 |
If the |
| 185 |
.I TYPE |
| 186 |
are omitted, then the behavior is the same as if |
| 187 |
.B \-\-debugger=normal |
| 188 |
was specified. |
| 189 |
.I TYPE |
| 190 |
may be |
| 191 |
.I goal |
| 192 |
for all tracing Makefiles read |
| 193 |
.I preread |
| 194 |
which stop before any Makefiles are read |
| 195 |
.I goal |
| 196 |
which stops after the goal target is built |
| 197 |
.I normal |
| 198 |
which is the same as given no option |
| 199 |
.I preaction |
| 200 |
which is like \fInormal\fR but shell tracing |
| 201 |
is disabled |
| 202 |
.I full |
| 203 |
for maximum tracing. It is the same as giving all of the |
| 204 |
options except "normal" . |
| 205 |
.I fatal |
| 206 |
for entering the debugger on a fatal error, |
| 207 |
.I error |
| 208 |
for entering the debugger on an error |
| 209 |
|
| 210 |
.SH "SEE ALSO" |
| 211 |
The full documentation for |
| 212 |
.B remake |
| 213 |
is maintained as a Texinfo manual. If the |
| 214 |
.B info |
| 215 |
and |
| 216 |
.B remake |
| 217 |
programs are properly installed at your site, the command |
| 218 |
.IP |
| 219 |
.B info remake |
| 220 |
.PP |
| 221 |
should give you access to the |
| 222 |
.B remake |
| 223 |
manual. |
| 224 |
.SH BUGS |
| 225 |
Since this is derived from GNU Make, it most of its bugs. |
| 226 |
|
| 227 |
.LP |
| 228 |
See the chapter ``Problems and Bugs'' in |
| 229 |
.IR "The GNU Make Manual" . |
| 230 |
|
| 231 |
.LP |
| 232 |
For |
| 233 |
.B remake |
| 234 |
-specifc bugs see |
| 235 |
.IR https://github.com/rocky/remake/issues/ . |
| 236 |
.SH AUTHORS |
| 237 |
The |
| 238 |
.IR "GNU make" |
| 239 |
from which |
| 240 |
.IR remake |
| 241 |
is derived, was written by Richard Stallman and Roland McGrath, and is currently |
| 242 |
maintained by Paul Smith. |
| 243 |
|
| 244 |
However |
| 245 |
.IR remake |
| 246 |
is the brainstorm of Rocky Bernstein. The help of others though has been, and is, greatly appreciated. |
| 247 |
Michael Lord Welles however thought of the name, |
| 248 |
.IR remake . |
| 249 |
.SH "COPYRIGHT" |
| 250 |
Copyright \(co 1992-1993, 1996-2020 Free Software Foundation, Inc. |
| 251 |
This file is part of |
| 252 |
.IR "GNU make" . |
| 253 |
.LP |
| 254 |
GNU Make is free software; you can redistribute it and/or modify it under the |
| 255 |
terms of the GNU General Public License as published by the Free Software |
| 256 |
Foundation; either version 3 of the License, or (at your option) any later |
| 257 |
version. |
| 258 |
.LP |
| 259 |
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY |
| 260 |
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
| 261 |
A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
| 262 |
.LP |
| 263 |
You should have received a copy of the GNU General Public License along with |
| 264 |
this program. If not, see |
| 265 |
.IR http://www.gnu.org/licenses/ . |