Author: hpoussin
Date: Thu Aug 2 18:14:19 2007
New Revision: 28102
URL:
http://svn.reactos.org/svn/reactos?rev=28102&view=rev
Log:
Support "root" attribute in <directory> elements
Modified:
trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp
trunk/reactos/tools/rbuild/module.cpp
trunk/reactos/tools/rbuild/project.cpp
trunk/reactos/tools/rbuild/rbuild.h
Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp Thu Aug 2 18:14:19 2007
@@ -426,7 +426,7 @@
fprintf ( fMakefile, "PROJECT_LFLAGS := %s\n",
GenerateProjectLFLAGS ().c_str () );
fprintf ( fMakefile, "PROJECT_CFLAGS += -Wall\n" );
- fprintf ( fMakefile, "PROJECT_CFLAGS += -march=$(OARCH)\n" );
+ fprintf ( fMakefile, "PROJECT_CFLAGS += -march=$(OARCH)\n" );
fprintf ( fMakefile, "PROJECT_CFLAGS += $(PROJECT_GCCOPTIONS)\n" );
fprintf ( fMakefile, "\n" );
}
Modified: trunk/reactos/tools/rbuild/module.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/module.cpp?re…
==============================================================================
--- trunk/reactos/tools/rbuild/module.cpp (original)
+++ trunk/reactos/tools/rbuild/module.cpp Thu Aug 2 18:14:19 2007
@@ -118,8 +118,10 @@
string
GetSubPath (
+ const Project& project,
const string& location,
const string& path,
+ const XMLAttribute* root,
const string& att_value )
{
if ( !att_value.size() )
@@ -132,7 +134,26 @@
"<directory> tag has invalid characters in 'name' attribute"
);
if ( !path.size() )
return att_value;
- return FixSeparator(path + cSep + att_value);
+
+ string path_prefix;
+ if ( root )
+ {
+ if ( root->value == "intermediate" )
+ path_prefix = Environment::GetIntermediatePath() + cSep;
+ else if ( root->value == "output" )
+ path_prefix = Environment::GetOutputPath() + cSep;
+ else
+ {
+ throw InvalidAttributeValueException (
+ location,
+ "root",
+ root->value );
+ }
+ }
+ else
+ path_prefix = "";
+
+ return FixSeparator(path_prefix + path + cSep + att_value);
}
string
@@ -617,8 +638,9 @@
else if ( e.name == "directory" )
{
const XMLAttribute* att = e.GetAttribute ( "name", true );
+ const XMLAttribute* base = e.GetAttribute ( "root", false );
assert(att);
- subpath = GetSubPath ( e.location, path, att->value );
+ subpath = GetSubPath ( this->project, e.location, path, base, att->value );
}
else if ( e.name == "include" )
{
Modified: trunk/reactos/tools/rbuild/project.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/project.cpp?r…
==============================================================================
--- trunk/reactos/tools/rbuild/project.cpp (original)
+++ trunk/reactos/tools/rbuild/project.cpp Thu Aug 2 18:14:19 2007
@@ -375,8 +375,9 @@
else if ( e.name == "directory" )
{
const XMLAttribute* att = e.GetAttribute ( "name", true );
+ const XMLAttribute* base = e.GetAttribute ( "root", false );
assert(att);
- subpath = GetSubPath ( e.location, path, att->value );
+ subpath = GetSubPath ( *this, e.location, path, base, att->value );
}
else if ( e.name == "include" )
{
Modified: trunk/reactos/tools/rbuild/rbuild.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.h?rev=…
==============================================================================
--- trunk/reactos/tools/rbuild/rbuild.h (original)
+++ trunk/reactos/tools/rbuild/rbuild.h Thu Aug 2 18:14:19 2007
@@ -986,8 +986,10 @@
extern std::string
GetSubPath (
+ const Project& project,
const std::string& location,
const std::string& path,
+ const XMLAttribute* root,
const std::string& att_value );
extern std::string