-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMake-Control-Functions.html
More file actions
61 lines (48 loc) · 2.15 KB
/
Make-Control-Functions.html
File metadata and controls
61 lines (48 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<html lang="en">
<head>
<title>GNU `make'</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU `make'">
<meta name="generator" content="makeinfo 4.3">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
</head>
<body>
<div class="node">
<p>
Node:<a name="Make%20Control%20Functions">Make Control Functions</a>,
Previous:<a rel="previous" accesskey="p" href="Shell-Function.html#Shell%20Function">Shell Function</a>,
Up:<a rel="up" accesskey="u" href="Functions.html#Functions">Functions</a>
<hr><br>
</div>
<h3 class="section">Functions That Control Make</h3>
<p>These functions control the way make runs. Generally, they are used to
provide information to the user of the makefile or to cause make to stop
if some sort of environmental error is detected.
<dl>
<dt><code>$(error </code><var>text</var><code>...)</code>
<dd>Generates a fatal error where the message is <var>text</var>. Note that the
error is generated whenever this function is evaluated. So, if you put
it inside a command script or on the right side of a recursive variable
assignment, it won't be evaluated until later. The <var>text</var> will be
expanded before the error is generated.
<p>For example,
<pre class="example"> ifdef ERROR1
$(error error is $(ERROR1))
endif
</pre>
<p>will generate a fatal error during the read of the makefile if the
<code>make</code> variable <code>ERROR1</code> is defined. Or,
<pre class="example"> ERR = $(error found an error!)
.PHONY: err
err: ; $(ERR)
</pre>
<p>will generate a fatal error while <code>make</code> is running, if the
<code>err</code> target is invoked.
<br><dt><code>$(warning </code><var>text</var><code>...)</code>
<dd>This function works similarly to the <code>error</code> function, above,
except that <code>make</code> doesn't exit. Instead, <var>text</var> is expanded
and the resulting message is displayed, but processing of the makefile
continues.
<p>The result of the expansion of this function is the empty string.
</dl>
</body></html>