aboutsummaryrefslogtreecommitdiff
path: root/src/build.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-08-23 03:22:03 +0000
committerMike Buland <eichlan@xagasoft.com>2006-08-23 03:22:03 +0000
commit7a7390337e04d0163b97c1da7bdaa198bacaff72 (patch)
tree019eb3f455b0e8b35be9ae4560da319f377ea14e /src/build.cpp
parentf5cf5725026ecb2fa63d729fb6745b4da15e69d8 (diff)
downloadbuild-7a7390337e04d0163b97c1da7bdaa198bacaff72.tar.gz
build-7a7390337e04d0163b97c1da7bdaa198bacaff72.tar.bz2
build-7a7390337e04d0163b97c1da7bdaa198bacaff72.tar.xz
build-7a7390337e04d0163b97c1da7bdaa198bacaff72.zip
Loads more stuff...it's nearly working now.
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