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> |
22 |
> |
<ClassPath> tags which associate structure BuildFiles |
23 |
|
with directory structure and set up the directory structures for the |
24 |
< |
BuildSystem. You may also want to set project wide defaults. |
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 |
32 |
|
<font color=green> |
33 |
|
<ProductStore name=lib type=arch><br> |
34 |
|
<ProductStore name=bin type=arch><br> |
35 |
+ |
<ProductStore name=module type=arch><br> |
36 |
|
</font> |
37 |
< |
<em>Note: Currently, bin and lib are hard-coded so you cannot point them elsewhere |
37 |
< |
without something breaking</em> |
37 |
> |
|
38 |
|
<h3>Using the <a href=BuildFile/tag_ClassPath.html><ClassPath></a> tag</h3> |
39 |
|
This tag tells SCRAM which BuildFile to associate with a particular location in |
40 |
|
the src tree.<p> |
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 |
52 |
> |
<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 |
|
only directories called <em>src</em> at the 3rd level below the top level |
60 |
< |
will be mapped to <em>config/library_BuildFile</em>. |
60 |
> |
will be mapped to <em>config/library_BuildFile</em>. |
61 |
|
The second tag in the BuildFile has the same structure except it maps |
62 |
< |
directories called <em>test</em> at this level to |
63 |
< |
<em>config/UnitTest_BuildFile</em>. |
61 |
< |
Any that do not match a ClassPath will be |
62 |
< |
mapped to DEFAULT_BuildFile (which must exist). |
62 |
> |
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 |
|
<br> |
65 |
|
<p> |
66 |
|
In a case where multiple <ClassPath> tags are defined it is always the last |
67 |
|
one that matches the stated path that is taken. |
68 |
+ |
|
69 |
|
<h2>Structure BuildFiles</h2> |
70 |
|
These are the BuildFles that the <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 |
< |
with a location. The <Build> tag can be used here to specify build products |
74 |
< |
Note that anything outside of tags is standard gmake. |
73 |
> |
with a location. The <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 |
|
<p> |
77 |
< |
<b>Example <em>library_BuildFile</em></b> |
77 |
> |
<b>Example: <em>library_BuildFile</em></b> |
78 |
|
<font color=green> |
79 |
|
<pre> |
80 |
|
# The called target is the name of the BuildFile |
92 |
|
files+=$(notdir $(wildcard $(LOCALTOP)/$(ClassDir)/*.cpp)) |
93 |
|
files:=$(filter-out $(skip_files), $(files)) |
94 |
|
|
95 |
< |
# Build a library with the same name as the package from files |
96 |
< |
<Build class=lib name="$(packagename)" src=$(files) default=shared_debug> |
95 |
> |
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 |
|
</pre> |
104 |
|
</font> |
105 |
< |
<em>Note: Currently <Build> is not yet implemented</em> |
97 |
< |
|
98 |
< |
|
105 |
> |
<p> |
106 |
|
<! Style Sheet Footer ---------------Do not change anything after this line--> |
107 |
|
<hr> |
108 |
|
<table border=1 width=100%> |