ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/doc/html/configBuildFile.html
Revision: 1.4
Committed: Fri Jul 20 12:21:25 2001 UTC (23 years, 9 months ago) by sashby
Content type: text/html
Branch: MAIN
CVS Tags: V0_19_4_pre2, V0_19_4_pre1, V0_19_3, V0_19_2, V0_19_1, V0_19_0
Changes since 1.3: +3 -3 lines
Log Message:
Updated documentation.

File Contents

# Content
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 &lt;ClassPath> tags which associate <a href=#Structural>Structure BuildFiles</a>
23 with directory structure and set up the directory structures for the
24 BuildSystem. You may also want to set project wide defaults.
25 <p>
26 <h3>Defining Project Structure</h3>
27 You need to tell SCRAM where it can store such things as libraries, binaries
28 and other build products. You do this with the
29 <a href=BuildFile/tag_ProductStore.html>&lt;ProductStore></a> tag
30 <p>
31 <b>Example</b><p>
32 <font color=green>
33 &lt;ProductStore name=lib type=arch><br>
34 &lt;ProductStore name=bin type=arch><br>
35 </font>
36 <em>Note: Currently, bin and lib are hard-coded so you cannot point them elsewhere
37 without something breaking</em>
38 <h3>Using the <a href=BuildFile/tag_ClassPath.html>&lt;ClassPath></a> tag</h3>
39 This tag tells SCRAM which BuildFile to associate with a particular location in
40 the src tree.<p>
41 Format:<br>
42 &lt;ClassPath path=<em>[pattern_match]+BuildFileName/../....</em>>
43 <p>
44 <b>Example</b>
45 <font color=green>
46 <pre>
47 &lt;ClassPath path=+TopLevel/+SubSystem/+Package/src+library>
48 &lt;ClassPath path=+TopLevel/+SubSystem/+Package/test+UnitTest>
49 </pre>
50 </font>
51 This will associate the top level src directory with the BuildFile
52 <em>config/TopLevel_BuildFile</em> (or config/TopLevel_makefile.mk). Any
53 directory in the next level below with <em>config/SubSystem_BuildFile</em>
54 , the level below that with <em>config/Package_BuildFile</em>.
55 The last element in the path has a pattern matching string before the +, thus
56 only directories called <em>src</em> at the 3rd level below the top level
57 will be mapped to <em>config/library_BuildFile</em>.
58 The second tag in the BuildFile has the same structure except it maps
59 directories called <em>test</em> at this level to
60 <em>config/UnitTest_BuildFile</em>.
61 Any that do not match a ClassPath will be
62 mapped to DEFAULT_BuildFile (which must exist).
63 <br>
64 <p>
65 In a case where multiple &lt;ClassPath> tags are defined it is always the last
66 one that matches the stated path that is taken.
67 <h2>Structure BuildFiles</h2>
68 These are the BuildFles that the &lt;ClassPath> tags described above refer to.
69 They must exist in the project configuration directory. Their purpose is
70 to define default build behaviour and default settings that is to be associated
71 with a location. The &lt;Build> tag can be used here to specify build products
72 Note that anything outside of tags is standard gmake.
73 <p>
74 <b>Example <em>library_BuildFile</em></b>
75 <font color=green>
76 <pre>
77 # The called target is the name of the BuildFile
78 library : lib
79
80 # take packagename as being one directory up
81 packagetemp=$(shell echo $(dir $(ClassDir)) | sed -e 's/\(.*\)\//\1/' )
82 packagename=$(notdir $(packagetemp))
83
84 # Pick Up some source files - exclude by setting skip_files in local BuildFile
85 # $(LOCALTOP) and $(ClassDir) are defined by SCRAM - use like this point to
86 # the current src directory location
87 files:=$(notdir $(wildcard $(LOCALTOP)/$(ClassDir)/*.cc))
88 files+=$(notdir $(wildcard $(LOCALTOP)/$(ClassDir)/*.c))
89 files+=$(notdir $(wildcard $(LOCALTOP)/$(ClassDir)/*.cpp))
90 files:=$(filter-out $(skip_files), $(files))
91
92 # Build a library with the same name as the package from files
93 &lt;Build class=lib name="$(packagename)" src=$(files) default=shared_debug>
94 </pre>
95 </font>
96 <em>Note: Currently &lt;Build> is not yet implemented</em>
97
98
99 <! Style Sheet Footer ---------------Do not change anything after this line-->
100 <hr>
101 <table border=1 width=100%>
102 <td align=left>
103 <a href=mailto:Shaun.Ashby@cern.ch
104 >Shaun Ashby</a>
105 </td>
106 <td align=center>
107 <SCRIPT LANGUAGE="JAVASCRIPT">document.write("Last Updated "+ document.lastModified );</SCRIPT>
108 </td>
109 <td align=right><a href=/cgi-cmc/pagestat>Show Stats</a>
110 </td>
111 </table>
112 </body> </html>
113 <! End Style Sheet Footer>