ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/doc/html/configBuildFile.html
Revision: 1.5
Committed: Wed May 15 14:23:32 2002 UTC (23 years ago) by sashby
Content type: text/html
Branch: MAIN
CVS Tags: V0_19_6, V0_19_6p1, V0_19_5, SFATEST, V0_19_4, V0_19_4_pre3
Branch point for: V0_19_4_B
Changes since 1.4: +28 -21 lines
Log Message:
Updated documentation.

File Contents

# User Rev Content
1 williamc 1.2 <! 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 sashby 1.5 &lt;ClassPath> tags which associate structure BuildFiles
23 williamc 1.3 with directory structure and set up the directory structures for the
24 sashby 1.5 BuildSystem. You may also want to set project-wide defaults.
25 williamc 1.2 <p>
26 williamc 1.3 <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 sashby 1.5 &lt;ProductStore name=module type=arch><br>
36 williamc 1.3 </font>
37 sashby 1.5
38 williamc 1.3 <h3>Using the <a href=BuildFile/tag_ClassPath.html>&lt;ClassPath></a> tag</h3>
39 williamc 1.2 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 sashby 1.5 <em>config/TopLevel_BuildFile</em> (and the corresponding makefile
53     config/TopLevel_makefile.mk), any directory in the next level
54     with <em>config/SubSystem_BuildFile</em>
55     and the level below that with <em>config/Package_BuildFile</em>.
56    
57    
58     The last element in the path has a pattern matching string before the "+" sign, so
59 williamc 1.2 only directories called <em>src</em> at the 3rd level below the top level
60 sashby 1.5 will be mapped to <em>config/library_BuildFile</em>.
61 williamc 1.2 The second tag in the BuildFile has the same structure except it maps
62 sashby 1.5 directories called <em>test</em> at this level to <em>config/UnitTest_BuildFile</em>.
63     Any that do not match a ClassPath will be mapped to DEFAULT_BuildFile (which must exist).
64 williamc 1.2 <br>
65     <p>
66     In a case where multiple &lt;ClassPath> tags are defined it is always the last
67     one that matches the stated path that is taken.
68 sashby 1.5
69 williamc 1.2 <h2>Structure BuildFiles</h2>
70     These are the BuildFles that the &lt;ClassPath> tags described above refer to.
71     They must exist in the project configuration directory. Their purpose is
72     to define default build behaviour and default settings that is to be associated
73 sashby 1.5 with a location. The &lt;Build> tag can be used here to specify build products.
74     Note that anything outside a tag is standard makefile syntax and will be parsed directly
75     by gmake.
76 williamc 1.2 <p>
77 sashby 1.5 <b>Example: <em>library_BuildFile</em></b>
78 williamc 1.2 <font color=green>
79     <pre>
80     # The called target is the name of the BuildFile
81     library : lib
82    
83     # take packagename as being one directory up
84     packagetemp=$(shell echo $(dir $(ClassDir)) | sed -e 's/\(.*\)\//\1/' )
85     packagename=$(notdir $(packagetemp))
86    
87     # Pick Up some source files - exclude by setting skip_files in local BuildFile
88     # $(LOCALTOP) and $(ClassDir) are defined by SCRAM - use like this point to
89     # the current src directory location
90     files:=$(notdir $(wildcard $(LOCALTOP)/$(ClassDir)/*.cc))
91     files+=$(notdir $(wildcard $(LOCALTOP)/$(ClassDir)/*.c))
92     files+=$(notdir $(wildcard $(LOCALTOP)/$(ClassDir)/*.cpp))
93     files:=$(filter-out $(skip_files), $(files))
94    
95 sashby 1.5 ifneq ($(strip $(files)),)
96     # Library Defaults
97     DefaultShared=yes
98     else
99     lib:
100     @echo "Warning : No files found. Library not built"
101     endif
102    
103 williamc 1.2 </pre>
104     </font>
105 sashby 1.5 <p>
106 williamc 1.2 <! Style Sheet Footer ---------------Do not change anything after this line-->
107     <hr>
108     <table border=1 width=100%>
109     <td align=left>
110 sashby 1.4 <a href=mailto:Shaun.Ashby@cern.ch
111     >Shaun Ashby</a>
112 williamc 1.2 </td>
113     <td align=center>
114 sashby 1.4 <SCRIPT LANGUAGE="JAVASCRIPT">document.write("Last Updated "+ document.lastModified );</SCRIPT>
115 williamc 1.2 </td>
116     <td align=right><a href=/cgi-cmc/pagestat>Show Stats</a>
117     </td>
118     </table>
119     </body> </html>
120     <! End Style Sheet Footer>