1 |
williamc |
1.1 |
<h1>BuildFile Examples</h1>
|
2 |
|
|
<p>
|
3 |
|
|
The Default Build is configured at the project level. The default can be
|
4 |
|
|
overridden or parameters passed to the default build rules through the
|
5 |
|
|
BuildFile.
|
6 |
|
|
|
7 |
williamc |
1.4.2.1 |
|
8 |
williamc |
1.1 |
<p>
|
9 |
|
|
Examples of different build files are shown below
|
10 |
|
|
<ol>
|
11 |
|
|
<li>The Binary Executable<p>
|
12 |
|
|
The binary building rules require explicit specification of the binary targets
|
13 |
|
|
e.g.
|
14 |
|
|
<p>
|
15 |
williamc |
1.4 |
<font color=green>
|
16 |
williamc |
1.1 |
<pre>
|
17 |
williamc |
1.4.2.1 |
<Group name=G3>
|
18 |
williamc |
1.1 |
<External ref=X11>
|
19 |
williamc |
1.4.2.1 |
<Use name=CARF>
|
20 |
williamc |
1.4 |
<Lib name=examplelib></lib>
|
21 |
williamc |
1.1 |
<bin file=example1.cpp>
|
22 |
williamc |
1.2 |
You can write between bin tags some documentation to describe what the binary
|
23 |
|
|
does
|
24 |
williamc |
1.1 |
</bin>
|
25 |
|
|
<bin file=example2.cpp name=mytestexe>
|
26 |
williamc |
1.2 |
Here we call the final binary a different name from the default.
|
27 |
williamc |
1.1 |
</bin>
|
28 |
|
|
</Use>
|
29 |
|
|
</External>
|
30 |
|
|
</External>
|
31 |
|
|
</pre>
|
32 |
williamc |
1.4 |
</font>
|
33 |
williamc |
1.1 |
This file will build two executables called (example1 and mytestexe) from files example1.cpp and example2.cpp respectively. Both are built in the context of
|
34 |
|
|
external libraries cmsim and X11 as well as a local package from the same
|
35 |
williamc |
1.2 |
project called CARF <p>
|
36 |
|
|
<em><b>Note: Theres still much work to be done here</b></em><br>
|
37 |
|
|
<ul>
|
38 |
williamc |
1.4 |
<li> </External> and </Use> tags do not remove the
|
39 |
williamc |
1.2 |
external package as you might expect.
|
40 |
|
|
<li> Anything Outside of the bin tags will be included in the
|
41 |
|
|
GNUmakefile. This allows you the full functionality of gmake
|
42 |
|
|
to make up for any inadequacies. Hopefully as full scram
|
43 |
|
|
binary functionality is achieved this will be phased out
|
44 |
williamc |
1.3 |
</ul>
|
45 |
williamc |
1.1 |
<p>
|
46 |
|
|
<li>The library BuildFile
|
47 |
williamc |
1.4.2.2 |
You may wish to exclude some files from a
|
48 |
williamc |
1.1 |
build or include external package headers or assign the module to a group.
|
49 |
|
|
<br>e.g.<p>
|
50 |
williamc |
1.4 |
<font color=green>
|
51 |
williamc |
1.1 |
<pre>
|
52 |
|
|
<Group name=G3>
|
53 |
|
|
skip_files := FakeClusterizer.cc SigmaClusterizer.cc
|
54 |
|
|
</pre>
|
55 |
williamc |
1.4 |
</font>
|
56 |
williamc |
1.4.2.2 |
|
57 |
|
|
<br>
|
58 |
|
|
It is also possible to override the default type of library that is built
|
59 |
|
|
<br>e.g.<p>
|
60 |
|
|
<font color=green>
|
61 |
|
|
<pre>
|
62 |
|
|
<LibType type=shared>
|
63 |
|
|
<LibType type=debugshared>
|
64 |
|
|
</pre>
|
65 |
|
|
</font>
|
66 |
|
|
To build two shared objects - one with and one without debug information
|
67 |
|
|
<p>
|
68 |
williamc |
1.1 |
<li>Empty Group
|
69 |
|
|
Sometimes the default builds arn't wanted at all. Switch them off with
|
70 |
|
|
<p>
|
71 |
williamc |
1.4 |
<font color=green>
|
72 |
williamc |
1.1 |
<pre>
|
73 |
|
|
<AssociateGroup>
|
74 |
|
|
none
|
75 |
|
|
</AssociateGroup>
|
76 |
|
|
</pre>
|
77 |
williamc |
1.4 |
</font>
|
78 |
williamc |
1.4.2.1 |
<p>
|
79 |
|
|
<h2>Avoiding Processing Parts of BuildFiles</h2>
|
80 |
|
|
Anything between <ignore> and </ignore> tags will be excluded
|
81 |
|
|
from processing during the build. This is a convenient mechanism to cut
|
82 |
|
|
out sections of the BuildFile and is not intended for comments. Comments
|
83 |
|
|
should be provided where apppropriate e.g. in between <binb> and </bin>
|
84 |
|
|
tags.
|