aboutsummaryrefslogtreecommitdiff
path: root/src/build.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/build.cpp')
-rw-r--r--src/build.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/build.cpp b/src/build.cpp
index d3bd960..d9a8b39 100644
--- a/src/build.cpp
+++ b/src/build.cpp
@@ -1,5 +1,8 @@
1#include "build.h" 1#include "build.h"
2 2
3subExceptionDef( BuildException );
4
5
3Build::Build() 6Build::Build()
4{ 7{
5} 8}
@@ -7,3 +10,40 @@ Build::Build()
7Build::~Build() 10Build::~Build()
8{ 11{
9} 12}
13
14void Build::addTarget( Target *pTarget )
15{
16 TargetMap::iterator i = mTarget.find( pTarget->getName() );
17 if( i == mTarget.end() )
18 {
19 mTarget[pTarget->getName()] = pTarget;
20 }
21 else
22 {
23 throw BuildException("Merging targets isn't working yet.");
24 }
25}
26
27void Build::addRequires( const std::string &who, const std::string &what )
28{
29 mRequires[who].push_back( what );
30}
31
32void Build::debugDump()
33{
34 printf("Requires:\n");
35 for( ReqMap::iterator i = mRequires.begin(); i != mRequires.end(); i++ )
36 {
37 printf(" %s: ", (*i).first.c_str() );
38
39 for( StringList::iterator j = (*i).second.begin();
40 j != (*i).second.end(); j++ )
41 {
42 if( j != (*i).second.begin() )
43 printf(", ");
44 printf("%s", (*j).c_str() );
45 }
46 printf("\n");
47 }
48}
49