File: rules.html

package info (click to toggle)
boost-build 2.0-m12-2
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 8,692 kB
  • ctags: 6,963
  • sloc: ansic: 39,914; sh: 9,086; python: 6,120; xml: 5,524; cpp: 1,467; yacc: 456; asm: 353; makefile: 184
file content (153 lines) | stat: -rw-r--r-- 8,652 bytes parent folder | download
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Builtin rules</title>
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="../../index.html" title="Boost.Build V2 User Manual">
<link rel="up" href="../reference.html" title="Chapter7.Detailed reference">
<link rel="prev" href="../reference.html" title="Chapter7.Detailed reference">
<link rel="next" href="../advanced/builtins/features.html" title="Builtin features">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../reference.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../advanced/builtins/features.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="bbv2.reference.rules"></a>Builtin rules</h2></div></div></div>
<p>This section contains the list of all rules that
    can be used in Jamfile&#8212;both rules that define new
    targets and auxiliary rules.</p>
<div class="variablelist"><dl>
<dt><span class="term"><code class="literal">exe</code></span></dt>
<dd><p>Creates an executable file. See 
        <a href="../tasks.html#bbv2.tasks.programs" title="Programs">the section called &#8220;Programs&#8221;</a>.</p></dd>
<dt><span class="term"><code class="literal">lib</code></span></dt>
<dd><p>Creates an library file. See 
        <a href="../tasks/libraries.html" title="Libraries">the section called &#8220;Libraries&#8221;</a>.</p></dd>
<dt><span class="term"><code class="literal">install</code></span></dt>
<dd><p>Installs built targets and other files. See 
        <a href="../tasks/installing.html" title="Installing">the section called &#8220;Installing&#8221;</a>.</p></dd>
<dt><span class="term"><code class="literal">alias</code></span></dt>
<dd><p>Creates an alias for other targets. See 
        <a href="../tasks/alias.html" title="Alias">the section called &#8220;Alias&#8221;</a>.</p></dd>
<dt><span class="term"><code class="literal">unit-test</code></span></dt>
<dd><p>Creates an executable that will be automatically run. See 
        <a href="../tutorial/testing.html" title="Testing">the section called &#8220;Testing&#8221;</a>.</p></dd>
<dt>
<span class="term"><code class="literal">compile</code>, </span><span class="term"><code class="literal">compile-fail</code>, </span><span class="term"><code class="literal">link</code>, </span><span class="term"><code class="literal">link-fail</code>, </span><span class="term"><code class="literal">run</code>, </span><span class="term"><code class="literal">run-fail</code></span>
</dt>
<dd><p>Specialized rules for testing. See 
        <a href="../tutorial/testing.html" title="Testing">the section called &#8220;Testing&#8221;</a>.</p></dd>
<dt><span class="term"><code class="literal">obj</code></span></dt>
<dd><p>Creates an object file. Useful when a single source
        file must be compiled with special properties.</p></dd>
<dt><span class="term"><code class="literal">glob</code></span></dt>
<dd>
<p>The <code class="computeroutput">glob</code> rule takes a list shell pattern 
        and returns the list of files in the project's source directory that
        match the pattern. For example:
        </p>
<pre class="programlisting">
lib tools : [ glob *.cpp ] ;
        </pre>
<p>
        It is possible to also pass a second argument&#8212;the list of
        exclude patterns. The result will then include the list of
        files patching any of include patterns, and not matching any
        of the exclude patterns. For example:
        </p>
<pre class="programlisting">
lib tools : [ glob *.cpp : file_to_exclude.cpp bad*.cpp ] ;
        </pre>
<p>
        </p>
</dd>
<dt><span class="term"><code class="literal">glob-tree</code></span></dt>
<dd>
<p>The <code class="computeroutput">glob-tree</code> is similar to the
        <code class="computeroutput">glob</code> except that it operates recursively from
        the directory of the containing Jamfile. For example:
        </p>
<pre class="programlisting">
ECHO [ glob-tree *.cpp : .svn ] ;
        </pre>
<p>
        will print the names of all C++ files in your project. The 
        <code class="literal">.svn</code> exclude pattern prevents the 
        <code class="computeroutput">glob-tree</code> rule from entering administrative
        directories of the Subverion version control system.
        </p>
</dd>
<dt><span class="term"><code class="literal">project</code></span></dt>
<dd><p>Declares project id and attributes, including
        project requirements. See <a href="../advanced/projects.html" title="Projects">the section called &#8220;Projects&#8221;</a>.
        </p></dd>
<dt><span class="term"><code class="literal">use-project</code></span></dt>
<dd><p>Assigns a symbolic project ID to a project at 
        a given path. This rule must be better documented!
        </p></dd>
<dt><span class="term"><code class="literal">explicit</code></span></dt>
<dd><p>The <code class="literal">explicit</code> rule takes a single
        parameter&#8212;a list of target names. The named targets will
        be marked explicit, and will be built only if they are explicitly
        requested on the command line, or if their dependents are built.
        Compare this to ordinary targets, that are built implicitly when
        their containing project is built.</p></dd>
<dt><span class="term"><code class="literal">constant</code></span></dt>
<dd>
<p>Sets project-wide constant. Takes two
        parameters: variable name and a value and makes the specified
        variable name accessible in this Jamfile and any child Jamfiles.
        For example:
        </p>
<pre class="programlisting">
constant VERSION : 1.34.0 ;
        </pre>
<p>
        </p>
</dd>
<dt><span class="term"><code class="literal">path-constant</code></span></dt>
<dd>
<p>Same as <code class="literal">constant</code> except that
        the value is treated as path relative to Jamfile location. For example,
        if <span><strong class="command">bjam</strong></span> is invoked in the current directory,
        and Jamfile in <code class="filename">helper</code> subdirectory has:
        </p>
<pre class="programlisting">
path-constant DATA : data/a.txt ;
        </pre>
<p>
        then the variable <code class="varname">DATA</code> will be set to 
        <code class="literal">helper/data/a.txt</code>, and if <span><strong class="command">bjam</strong></span>
        is invoked from the <code class="filename">helper</code> directory, then
        the variable <code class="varname">DATA</code> will be set to 
        <code class="literal">data/a.txt</code>.
        </p>
</dd>
<dt><span class="term"><code class="literal">build-project</code></span></dt>
<dd><p>Cause some other project to be built. This rule
        takes a single parameter&#8212;a directory name relative to
        the containing Jamfile. When the containing Jamfile is built,
        the project located at that directory will be built as well.
        At the moment, the parameter to this rule should be a directory
        name. Project ID or general target references are not allowed.
        </p></dd>
<dt><span class="term"><code class="literal">test-suite</code></span></dt>
<dd><p>This rule is deprecated and equivalent to
        <code class="computeroutput">alias</code>.</p></dd>
</dl></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small></small></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../reference.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../advanced/builtins/features.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>