1 |
<! Style Sheet Header>
|
2 |
<html>
|
3 |
<head>
|
4 |
<title>configBuildFile.html</title>
|
5 |
<body bgcolor=beige>
|
6 |
<! End Style Sheet Header -----------Insert Text Here --------------------->
|
7 |
<center>
|
8 |
<h1>Project Level BuildFiles</h1>
|
9 |
<font color=red>S</font>oftware <font color=red>C</font>onfiguration,
|
10 |
<font color=red>R</font>elease <font color=red>A</font>nd
|
11 |
<font color=red>M</font>anagement
|
12 |
</center>
|
13 |
<hr>
|
14 |
<h2>Purpose of the BuildFiles</h2>
|
15 |
|
16 |
At the configuration level the BuildFile is generally used to set up project
|
17 |
wide defaults and associate src code structure with building rules.
|
18 |
<p>
|
19 |
<h2>The main configuration BuildFile</h2>
|
20 |
The file <em>config/BuildFile</em> is resourced by all others in the entire
|
21 |
tree. It controls everything else. The most important thing to set here is the
|
22 |
<ClassPath> tags which associate <a href=#Structural>Structure BuildFiles</a>
|
23 |
with directory structure. You may also want to set project wide defaults.
|
24 |
<p>
|
25 |
<h3>Using the <ClassPath> tag</h3>
|
26 |
This tag tells SCRAM which BuildFile to associate with a particular location in
|
27 |
the src tree.<p>
|
28 |
Format:<br>
|
29 |
<ClassPath path=<em>[pattern_match]+BuildFileName/../....</em>>
|
30 |
<p>
|
31 |
<b>Example</b>
|
32 |
<font color=green>
|
33 |
<pre>
|
34 |
<ClassPath path=+TopLevel/+SubSystem/+Package/src+library>
|
35 |
<ClassPath path=+TopLevel/+SubSystem/+Package/test+UnitTest>
|
36 |
</pre>
|
37 |
</font>
|
38 |
This will associate the top level src directory with the BuildFile
|
39 |
<em>config/TopLevel_BuildFile</em> (or config/TopLevel_makefile.mk). Any
|
40 |
directory in the next level below with <em>config/SubSystem_BuildFile</em>
|
41 |
, the level below that with <em>config/Package_BuildFile</em>.
|
42 |
The last element in the path has a pattern matching string before the +, thus
|
43 |
only directories called <em>src</em> at the 3rd level below the top level
|
44 |
will be mapped to <em>config/library_BuildFile</em>.
|
45 |
The second tag in the BuildFile has the same structure except it maps
|
46 |
directories called <em>test</em> at this level to
|
47 |
<em>config/UnitTest_BuildFile</em>.
|
48 |
Any that do not match a ClassPath will be
|
49 |
mapped to DEFAULT_BuildFile (which must exist).
|
50 |
<br>
|
51 |
<p>
|
52 |
In a case where multiple <ClassPath> tags are defined it is always the last
|
53 |
one that matches the stated path that is taken.
|
54 |
<h2>Structure BuildFiles</h2>
|
55 |
These are the BuildFles that the <ClassPath> tags described above refer to.
|
56 |
They must exist in the project configuration directory. Their purpose is
|
57 |
to define default build behaviour and default settings that is to be associated
|
58 |
with a location. The <Build> tag can be used here to specify build products
|
59 |
Note that anything outside of tags is standard gmake.
|
60 |
<p>
|
61 |
<b>Example <em>library_BuildFile</em></b>
|
62 |
<font color=green>
|
63 |
<pre>
|
64 |
# The called target is the name of the BuildFile
|
65 |
library : lib
|
66 |
|
67 |
# take packagename as being one directory up
|
68 |
packagetemp=$(shell echo $(dir $(ClassDir)) | sed -e 's/\(.*\)\//\1/' )
|
69 |
packagename=$(notdir $(packagetemp))
|
70 |
|
71 |
# Pick Up some source files - exclude by setting skip_files in local BuildFile
|
72 |
# $(LOCALTOP) and $(ClassDir) are defined by SCRAM - use like this point to
|
73 |
# the current src directory location
|
74 |
files:=$(notdir $(wildcard $(LOCALTOP)/$(ClassDir)/*.cc))
|
75 |
files+=$(notdir $(wildcard $(LOCALTOP)/$(ClassDir)/*.c))
|
76 |
files+=$(notdir $(wildcard $(LOCALTOP)/$(ClassDir)/*.cpp))
|
77 |
files:=$(filter-out $(skip_files), $(files))
|
78 |
|
79 |
# Build a library with the same name as the package from files
|
80 |
<Build class=lib name="$(packagename)" src=$(files) default=shared_debug>
|
81 |
</pre>
|
82 |
</font>
|
83 |
|
84 |
|
85 |
<! Style Sheet Footer ---------------Do not change anything after this line-->
|
86 |
<hr>
|
87 |
<table border=1 width=100%>
|
88 |
<td align=left>
|
89 |
<a href=mailto:Christopher.Williams@cern.ch
|
90 |
>Chris Williams</a>
|
91 |
</td>
|
92 |
<td align=center>
|
93 |
Last Updated Thu Jun 15 18:57:17 2000
|
94 |
</td>
|
95 |
<td align=right><a href=/cgi-cmc/pagestat>Show Stats</a>
|
96 |
</td>
|
97 |
</table>
|
98 |
</body> </html>
|
99 |
<! End Style Sheet Footer>
|