/* static */ string
Environment::GetIntermediatePath ()
{
+ string defaultIntermediate =
+ string( "obj-" ) + GetEnvironmentVariablePathOrDefault ( "ROS_CDOUTPUT", "i386" );
return GetEnvironmentVariablePathOrDefault ( "ROS_INTERMEDIATE",
- "obj-i386" );
+ defaultIntermediate );
}
/* static */ string
Environment::GetOutputPath ()
{
+ string defaultOutput =
+ string( "output-" ) + GetEnvironmentVariablePathOrDefault ( "ROS_CDOUTPUT", "i386" );
return GetEnvironmentVariablePathOrDefault ( "ROS_OUTPUT",
- "output-i386" );
+ defaultOutput );
}
/* static */ string
Environment::GetInstallPath ()
{
+ string defaultInstall =
+ string( "reactos." ) + GetEnvironmentVariablePathOrDefault ( "ROS_CDOUTPUT", "" );
return GetEnvironmentVariablePathOrDefault ( "ROS_INSTALL",
+ defaultInstall );
+}
+
+/* static */ string
+Environment::GetCdOutputPath ()
+{
+ return GetEnvironmentVariablePathOrDefault ( "ROS_CDOUTPUT",
"reactos" );
}
+/* static */ string
+Environment::GetAutomakeFile ( const std::string& defaultFile )
+{
+ return GetEnvironmentVariablePathOrDefault ( "ROS_AUTOMAKE",
+ defaultFile );
+}
+
ParseContext::ParseContext ()
: ifData (NULL),
compilationUnit (NULL)
head (NULL),
configuration (configuration)
{
+ _backend = NULL;
ReadXml();
}
s = s + sprintf ( s, "#endif /* __INCLUDE_CONFIG_H */\n" );
- FileSupportCode::WriteIfChanged ( buf, "include" + sSep + "roscfg.h" );
+ FileSupportCode::WriteIfChanged ( buf, Environment::GetIntermediatePath() + sSep + "include" + sSep + "roscfg.h" );
free ( buf );
}
void
Project::ExecuteInvocations ()
{
- fprintf( stderr, "ExecuteInvocations\n" );
for ( size_t i = 0; i < modules.size (); i++ )
modules[i]->InvokeModule ();
}
{
node = head->subElements[i];
string path;
- this->ProcessXML ( path );
+ ProcessXML ( path );
return;
}
}
att = node->GetAttribute ( "makefile", true );
assert(att);
- makefile = att->value;
+ makefile = Environment::GetAutomakeFile ( att->value );
size_t i;
for ( i = 0; i < node->subElements.size (); i++ )
If * if_data = non_if_data.ifs[i];
non_if_data.ifs.erase ( non_if_data.ifs.begin () + i );
delete if_data;
+ i--;
}
}
for ( i = 0; i < linkerFlags.size (); i++ )
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" )
{
return NULL;
}
-std::string
+const std::string&
Project::GetProjectFilename () const
{
return xmlfile;