Author: hpoussin
Date: Sun Sep 9 11:53:40 2007
New Revision: 28964
URL:
http://svn.reactos.org/svn/reactos?rev=28964&view=rev
Log:
Continue rbuild cleanup (Module class)
Modified:
trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp
trunk/reactos/tools/rbuild/backend/dependencymap/dependencymap.cpp
trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp
trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h
trunk/reactos/tools/rbuild/backend/mingw/proxymakefile.cpp
trunk/reactos/tools/rbuild/backend/msbuild/msbuild.cpp
trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp
trunk/reactos/tools/rbuild/backend/msvc/msvcmaker.cpp
trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
trunk/reactos/tools/rbuild/backend/versionreport/versionreport.cpp
trunk/reactos/tools/rbuild/bootstrap.cpp
trunk/reactos/tools/rbuild/compilationunit.cpp
trunk/reactos/tools/rbuild/include.cpp
trunk/reactos/tools/rbuild/linkerscript.cpp
trunk/reactos/tools/rbuild/module.cpp
trunk/reactos/tools/rbuild/rbuild.h
trunk/reactos/tools/rbuild/syssetupgenerator.cpp
trunk/reactos/tools/rbuild/testsupportcode.cpp
trunk/reactos/tools/rbuild/wineresource.cpp
Modified: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/codeb…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp Sun Sep 9 11:53:40 2007
@@ -198,7 +198,7 @@
CBBackend::CbpFileName ( const Module& module ) const
{
return DosSeparator(
- ReplaceExtension ( module.GetPath(), + "_auto.cbp" )
+ ReplaceExtension ( module.output->relative_path + "\\" +
module.output->name, "_auto.cbp" )
);
}
@@ -206,7 +206,7 @@
CBBackend::LayoutFileName ( const Module& module ) const
{
return DosSeparator(
- ReplaceExtension ( module.GetPath(), + "_auto.layout" )
+ ReplaceExtension ( module.output->relative_path + "\\" +
module.output->name, "_auto.layout" )
);
}
@@ -214,14 +214,14 @@
CBBackend::DependFileName ( const Module& module ) const
{
return DosSeparator(
- ReplaceExtension ( module.GetPath(), + "_auto.depend" )
+ ReplaceExtension ( module.output->relative_path + "\\" +
module.output->name, "_auto.depend" )
);
}
void
CBBackend::_get_object_files ( const Module& module, vector<string>& out)
const
{
- string basepath = module.GetBasePath ();
+ string basepath = module.output->relative_path;
size_t i;
string intenv = Environment::GetIntermediatePath () + "\\" + basepath +
"\\";
string outenv = Environment::GetOutputPath () + "\\" + basepath +
"\\";
@@ -273,12 +273,12 @@
{
Module& module = *ProjectNode.modules[i];
vector<string> out;
- printf("Cleaning project %s %s\n", module.name.c_str (), module.GetBasePath
().c_str () );
+ printf("Cleaning project %s %s\n", module.name.c_str (),
module.output->relative_path.c_str () );
- string basepath = module.GetBasePath ();
- remove ( CbpFileName ( module ).c_str () );
- remove ( DependFileName ( module ).c_str () );
- remove ( LayoutFileName ( module ).c_str () );
+ string basepath = module.output->relative_path;
+ remove ( CbpFileName ( module ).c_str () );
+ remove ( DependFileName ( module ).c_str () );
+ remove ( LayoutFileName ( module ).c_str () );
_get_object_files ( module, out );
for ( size_t j = 0; j < out.size (); j++)
@@ -321,7 +321,7 @@
ifs_list.pop_back();
const vector<Library*>& libs = data.libraries;
for ( size_t j = 0; j < libs.size(); j++ )
- fprintf ( OUT, "\t\t\t<Depends filename=\"%s\\%s_auto.cbp\"
/>\r\n", libs[j]->importedModule->GetBasePath().c_str(),
libs[j]->name.c_str() );
+ fprintf ( OUT, "\t\t\t<Depends filename=\"%s\\%s_auto.cbp\"
/>\r\n", libs[j]->importedModule->output->relative_path.c_str(),
libs[j]->name.c_str() );
}
fprintf ( OUT, "\t\t</Project>\r\n" );
}
@@ -342,8 +342,8 @@
string path_basedir = module.GetPathToBaseDir ();
string intenv = Environment::GetIntermediatePath ();
string outenv = Environment::GetOutputPath ();
- string module_type = GetExtension(module.GetTargetName());
- string cbproj_path = module.GetBasePath();
+ string module_type = GetExtension(module.output->name);
+ string cbproj_path = module.output->relative_path;
string CompilerVar;
string baseaddr;
string windres_defines;
@@ -383,7 +383,7 @@
{
string pch_path = Path::RelativeFromDirectory (
module.pch->file.name,
- module.GetBasePath() );
+ module.output->relative_path );
header_files.push_back ( pch_path );
}
@@ -430,7 +430,7 @@
{
string path = Path::RelativeFromDirectory (
incs[i]->directory,
- module.GetBasePath() );
+ module.output->relative_path );
includes.push_back ( path );
widl_options += "-I" + path + " ";
@@ -438,7 +438,7 @@
const vector<Library*>& libs = data.libraries;
for ( i = 0; i < libs.size(); i++ )
{
- string libpath = intdir + "\\" +
libs[i]->importedModule->GetBasePath();
+ string libpath = intdir + "\\" +
libs[i]->importedModule->output->relative_path;
libraries.push_back ( libs[i]->name );
libpaths.push_back ( libpath );
}
@@ -507,25 +507,25 @@
if ( configuration.UseConfigurationInPath )
{
if ( module.type == StaticLibrary ||module.type == ObjectLibrary )
- fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s%s\\%s%s\"
prefix_auto=\"0\" extension_auto=\"0\" />\r\n", intdir.c_str
(), module.GetBasePath ().c_str (), cfg.name.c_str(), module.name.c_str(),
module_type.c_str());
+ fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s%s\\%s%s\"
prefix_auto=\"0\" extension_auto=\"0\" />\r\n", intdir.c_str
(), module.output->relative_path.c_str (), cfg.name.c_str(), module.name.c_str(),
module_type.c_str());
else
- fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s%s\\%s%s\"
prefix_auto=\"0\" extension_auto=\"0\" />\r\n", outdir.c_str
(), module.GetBasePath ().c_str (), cfg.name.c_str(), module.name.c_str(),
module_type.c_str());
- fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s%s\"
/>\r\n", intdir.c_str(), module.GetBasePath ().c_str (), cfg.name.c_str() );
+ fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s%s\\%s%s\"
prefix_auto=\"0\" extension_auto=\"0\" />\r\n", outdir.c_str
(), module.output->relative_path.c_str (), cfg.name.c_str(), module.name.c_str(),
module_type.c_str());
+ fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s%s\"
/>\r\n", intdir.c_str(), module.output->relative_path.c_str (),
cfg.name.c_str() );
}
else
{
if ( module.type == StaticLibrary || module.type == ObjectLibrary )
- fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s\\%s%s\"
prefix_auto=\"0\" extension_auto=\"0\" />\r\n", intdir.c_str
(), module.GetBasePath ().c_str (), module.name.c_str(), module_type.c_str() );
+ fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s\\%s%s\"
prefix_auto=\"0\" extension_auto=\"0\" />\r\n", intdir.c_str
(), module.output->relative_path.c_str (), module.name.c_str(), module_type.c_str() );
else
- fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s\\%s%s\"
prefix_auto=\"0\" extension_auto=\"0\" />\r\n", outdir.c_str
(), module.GetBasePath ().c_str (), module.name.c_str(), module_type.c_str() );
- fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s\"
/>\r\n", intdir.c_str(), module.GetBasePath ().c_str () );
+ fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s\\%s%s\"
prefix_auto=\"0\" extension_auto=\"0\" />\r\n", outdir.c_str
(), module.output->relative_path.c_str (), module.name.c_str(), module_type.c_str() );
+ fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s\"
/>\r\n", intdir.c_str(), module.output->relative_path.c_str () );
}
if ( lib )
{
fprintf ( OUT, "\t\t\t\t<Option type=\"2\" />\r\n" );
}
- else if ( dll )
+ else if ( dll )
fprintf ( OUT, "\t\t\t\t<Option type=\"3\" />\r\n" );
else if ( sys )
fprintf ( OUT, "\t\t\t\t<Option type=\"5\" />\r\n" );
Modified: trunk/reactos/tools/rbuild/backend/dependencymap/dependencymap.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/depen…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/dependencymap/dependencymap.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/dependencymap/dependencymap.cpp Sun Sep 9 11:53:40
2007
@@ -166,10 +166,10 @@
fprintf ( m_DepMapFile, "\t<component>\r\n" );
fprintf ( m_DepMapFile, "\t\t<name>%s</name>\r\n",
module.name.c_str () );
- fprintf ( m_DepMapFile, "\t\t<base>%s</base>\r\n",
module.GetBasePath ().c_str () );
+ fprintf ( m_DepMapFile, "\t\t<base>%s</base>\r\n",
module.output->relative_path.c_str () );
fprintf ( m_DepMapFile, "\t\t<ref_count>%u</ref_count>\r\n",
(unsigned int)data->references.size () );
fprintf ( m_DepMapFile, "\t\t<lib_count>%u</lib_count>\r\n",
(unsigned int)data->libraries.size () );
-#if 0
+#if 0
if ( data->references.size () )
{
fprintf ( m_DepMapFile, "\t<references>\r\n" );
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 Sun Sep 9 11:53:40 2007
@@ -587,7 +587,7 @@
{
if ( dependencies.length () > 0 )
dependencies += " ";
- dependencies += module.GetDependencyPath ();
+ dependencies += strFile ( module.dependency );
}
}
return dependencies;
@@ -1165,12 +1165,8 @@
const Module& module = *ProjectNode.modules[i];
if ( !module.enabled )
continue;
- if ( module.installName.length () > 0 )
- {
- out.push_back ( FileLocation ( InstallDirectory,
- module.installBase,
- module.installName ) );
- }
+ if ( module.install )
+ out.push_back ( *module.install );
}
}
@@ -1230,13 +1226,10 @@
const Module& module = *ProjectNode.modules[i];
if ( !module.enabled )
continue;
- if ( module.installName.length () > 0 )
+ if ( module.install )
{
const Module& aliasedModule = GetAliasedModuleOrModule ( module );
-
- FileLocation source ( OutputDirectory, aliasedModule.GetBasePath (),
aliasedModule.GetTargetName () );
- FileLocation target ( InstallDirectory, module.installBase, module.installName );
- OutputInstallTarget ( source, target );
+ OutputInstallTarget ( *aliasedModule.output, *module.install );
}
}
}
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Sun Sep 9 11:53:40 2007
@@ -124,21 +124,12 @@
return file;
}
-/*static*/ DirectoryLocation
-MingwModuleHandler::GetTargetDirectoryTree (
- const Module& module )
-{
- if ( module.type == StaticLibrary )
- return IntermediateDirectory;
- return OutputDirectory;
-}
-
/*static*/ const FileLocation*
MingwModuleHandler::GetTargetFilename (
const Module& module,
string_list* pclean_files )
{
- FileLocation *target = new FileLocation ( GetTargetDirectoryTree ( module ),
module.GetBasePath (), module.GetTargetName () );
+ FileLocation *target = new FileLocation ( *module.output );
if ( pclean_files )
{
string_list& clean_files = *pclean_files;
@@ -152,7 +143,7 @@
const Module& module,
string_list* pclean_files )
{
- FileLocation *target = new FileLocation ( IntermediateDirectory, module.GetBasePath (),
module.GetDependencyTargetName () );
+ FileLocation *target = new FileLocation ( *module.dependency );
if ( pclean_files )
{
string_list& clean_files = *pclean_files;
@@ -354,7 +345,7 @@
if ( module.type == StaticLibrary )
return new FileLocation ( *GetTargetFilename ( module, NULL ) );
return new FileLocation ( IntermediateDirectory,
- module.GetBasePath (),
+ module.output->relative_path,
ReplaceExtension ( module.name, ".temp.a" ) );
}
@@ -581,16 +572,13 @@
void
MingwModuleHandler::GenerateInstallTarget () const
{
- if ( module.installName.length () == 0 )
+ if ( !module.install )
return;
fprintf ( fMakefile, ".PHONY: %s_install\n", module.name.c_str() );
- string normalizedTargetFilename =
- NormalizeFilename ( module.installBase + sSep + module.installName );
- fprintf ( fMakefile,
- "%s_install: $(INSTALL)%c%s\n",
+ fprintf ( fMakefile,
+ "%s_install: %s\n",
module.name.c_str (),
- cSep,
- normalizedTargetFilename.c_str() );
+ strFile ( module.install ).c_str () );
}
void
@@ -1473,8 +1461,8 @@
"ifeq ($(ROS_BUILDMAP),full)\n" );
FileLocation mapFilename ( OutputDirectory,
- module.GetBasePath (),
- GetBasename ( module.GetTargetName () ) + ".map"
);
+ module.output->relative_path,
+ GetBasename ( module.output->name ) + ".map" );
CLEAN_FILE ( &mapFilename );
fprintf ( fMakefile,
@@ -1509,16 +1497,13 @@
fprintf ( fMakefile,
"ifeq ($(ROS_BUILDNOSTRIP),yes)\n" );
- string filename = module.GetTargetName ();
- FileLocation outputFilename ( OutputDirectory,
- module.GetBasePath (),
- filename );
+ string filename = module.output->name;
FileLocation nostripFilename ( OutputDirectory,
- module.GetBasePath (),
+ module.output->relative_path,
GetBasename ( filename ) + ".nostrip" +
GetExtension ( filename ) );
CLEAN_FILE ( &nostripFilename );
- OutputCopyCommand ( outputFilename, nostripFilename );
+ OutputCopyCommand ( *module.output, nostripFilename );
fprintf ( fMakefile,
"endif\n" );
@@ -1626,7 +1611,7 @@
dependencies.c_str (),
target_folder.c_str () );
fprintf ( fMakefile, "\t$(ECHO_LD)\n" );
- string targetName ( module.GetTargetName () );
+ string targetName ( module.output->name );
if ( !module.IsDLL () )
{
@@ -1682,7 +1667,7 @@
* one has been provided... */
/* See bug 1244 */
//printf ( "%s will have all its functions exported\n",
- // module.GetTargetName ().c_str () );
+ // module.target->name.c_str () );
fprintf ( fMakefile,
"\t%s %s %s -o %s %s %s %s\n",
linker.c_str (),
@@ -2011,7 +1996,7 @@
fMakefile,
"%s += $(PROJECT_WIDLFLAGS) -I%s\n",
widlflagsMacro.c_str (),
- module.GetBasePath ().c_str () );
+ module.output->relative_path.c_str () );
fprintf (
fMakefile,
@@ -2076,7 +2061,7 @@
if ( module.name != "zlib" ) /* Avoid make warning */
{
FileLocation proxyMakefile ( OutputDirectory,
- module.GetBasePath (),
+ module.output->relative_path,
"makefile" );
CLEAN_FILE ( &proxyMakefile );
}
@@ -2172,11 +2157,11 @@
invoke_targets[i].c_str () );
fprintf ( fMakefile,
": %s\n",
- NormalizeFilename ( invoke.invokeModule->GetPath () ).c_str () );
+ NormalizeFilename ( strFile ( invoke.invokeModule->output ) ).c_str () );
fprintf ( fMakefile, "\t$(ECHO_INVOKE)\n" );
fprintf ( fMakefile,
"\t%s %s\n\n",
- NormalizeFilename ( invoke.invokeModule->GetPath () ).c_str (),
+ NormalizeFilename ( strFile ( invoke.invokeModule->output ) ).c_str (),
invoke.GetParameters ().c_str () );
}
}
@@ -2296,7 +2281,7 @@
fprintf ( fMakefile,
"\t${dlltool} --dllname %s --def %s --output-lib %s %s %s\n\n",
- module.GetTargetName ().c_str (),
+ module.output->name.c_str (),
strFile ( defFilename ).c_str (),
strFile ( library_target ).c_str (),
module.mangledSymbols ? "" : "--kill-at",
@@ -2457,7 +2442,7 @@
string dependencies = linkDepsMacro + " " + objectsMacro;
string linkerParameters = ssprintf ( "-Wl,-T,%s%cntoskrnl.lnk
-Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000
-Wl,--section-alignment,0x1000 -nostartfiles -shared",
- module.GetBasePath ().c_str (),
+ module.output->relative_path.c_str (),
cSep,
module.GetEntryPoint(true).c_str (),
module.baseaddress.c_str () );
@@ -3037,7 +3022,7 @@
void
MingwBootLoaderModuleHandler::GenerateBootLoaderModuleTarget ()
{
- string targetName ( module.GetTargetName () );
+ string targetName ( module.output->name );
string targetMacro ( GetTargetMacro (module) );
string workingDirectory = GetWorkingDirectory ();
FileLocation junk_tmp ( TemporaryDirectory,
@@ -3118,7 +3103,7 @@
void
MingwBootProgramModuleHandler::GenerateBootProgramModuleTarget ()
{
- string targetName ( module.GetTargetName () );
+ string targetName ( module.output->name );
string targetMacro ( GetTargetMacro (module) );
string workingDirectory = GetWorkingDirectory ();
FileLocation junk_tmp ( TemporaryDirectory,
@@ -3151,7 +3136,7 @@
fprintf ( fMakefile, "\t$(%s_PREPARE) $(OUTPUT)$(SEP)%s %s\n",
module.buildtype.c_str (),
- NormalizeFilename( payload->GetPath() ).c_str (),
+ NormalizeFilename( strFile ( payload->output ) ).c_str (),
strFile ( &junk_cpy ).c_str () );
fprintf ( fMakefile, "\t${objcopy} $(%s_FLATFORMAT) %s %s\n",
@@ -3168,7 +3153,7 @@
fprintf ( fMakefile, "\t${objcopy} $(%s_COPYFORMAT) %s
$(INTERMEDIATE)$(SEP)%s\n",
module.buildtype.c_str (),
strFile ( &junk_elf ).c_str (),
- module.GetPath().c_str () );
+ strFile ( module.output ) .c_str () );
fprintf ( fMakefile,
"\t-@${rm} %s %s %s 2>$(NUL)\n",
@@ -3200,13 +3185,10 @@
continue;
if ( m.bootstrap != NULL )
{
- FileLocation sourceFile ( OutputDirectory,
- m.GetBasePath (),
- m.GetTargetName () );
FileLocation targetFile ( OutputDirectory,
bootcdDirectory + sSep + m.bootstrap->base,
m.bootstrap->nameoncd );
- OutputCopyCommand ( sourceFile, targetFile );
+ OutputCopyCommand ( *m.output, targetFile );
}
}
}
@@ -3281,10 +3263,7 @@
continue;
if ( m.bootstrap != NULL )
{
- FileLocation file ( OutputDirectory,
- m.GetBasePath (),
- m.GetTargetName () );
- out.push_back ( file );
+ out.push_back ( *m.output );
}
}
}
@@ -3434,18 +3413,15 @@
const Module& m = *module.project.modules[i];
if ( !m.enabled )
continue;
- if ( m.installName.length () > 0 )
+ if ( m.install )
{
const Module& aliasedModule = backend->GetAliasedModuleOrModule ( m );
- FileLocation source ( OutputDirectory,
- aliasedModule.GetBasePath (),
- aliasedModule.GetTargetName () );
FileLocation destination ( OutputDirectory,
- m.installBase.length () > 0
- ? livecdDirectory + sSep + reactosDirectory + sSep +
m.installBase
+ m.install->relative_path.length () > 0
+ ? livecdDirectory + sSep + reactosDirectory + sSep +
m.install->relative_path
: livecdDirectory + sSep + reactosDirectory,
- m.installName );
- OutputCopyCommand ( source,
+ m.install->name );
+ OutputCopyCommand ( *aliasedModule.output,
destination);
}
}
@@ -3584,7 +3560,7 @@
void
MingwTestModuleHandler::GetModuleSpecificCompilationUnits (
vector<CompilationUnit*>& compilationUnits )
{
- string basePath = "$(INTERMEDIATE)" + sSep + module.GetBasePath ();
+ string basePath = "$(INTERMEDIATE)" + sSep + module.output->relative_path;
compilationUnits.push_back ( new CompilationUnit ( new File ( basePath + sSep +
"_hooks.c", false, "", false ) ) );
compilationUnits.push_back ( new CompilationUnit ( new File ( basePath + sSep +
"_stubs.S", false, "", false ) ) );
compilationUnits.push_back ( new CompilationUnit ( new File ( basePath + sSep +
"_startup.c", false, "", false ) ) );
@@ -3693,7 +3669,7 @@
void
MingwElfExecutableModuleHandler::Process ()
{
- string targetName ( module.GetTargetName () );
+ string targetName ( module.output->name );
string targetMacro ( GetTargetMacro (module) );
string workingDirectory = GetWorkingDirectory ();
string objectsMacro = GetObjectsMacro ( module );
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h Sun Sep 9 11:53:40 2007
@@ -42,9 +42,6 @@
void EnablePreCompiledHeaderSupport ();
static const FileLocation* PassThruCacheDirectory (const FileLocation* fileLocation );
-
- static DirectoryLocation GetTargetDirectoryTree (
- const Module& module );
static const FileLocation* GetTargetFilename (
const Module& module,
Modified: trunk/reactos/tools/rbuild/backend/mingw/proxymakefile.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/proxymakefile.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/proxymakefile.cpp Sun Sep 9 11:53:40 2007
@@ -35,7 +35,7 @@
bool
ProxyMakefile::GenerateProxyMakefile ( Module& module )
{
- return module.GenerateInOutputTree ();
+ return module.output->directory == OutputDirectory;
}
void
@@ -72,7 +72,7 @@
ProxyMakefile::GetPathToTopDirectory ( Module& module )
{
int numberOfDirectories = 1;
- string basePath = NormalizeFilename ( module.GetBasePath () );
+ string basePath = module.output->relative_path;
for ( size_t i = 0; i < basePath.length (); i++ )
{
if ( basePath[i] == cSep )
@@ -99,12 +99,12 @@
string pathToTopDirectory;
if ( outputTree.length () > 0 )
{
- base = outputTree + sSep + module.GetBasePath ();
+ base = outputTree + sSep + module.output->relative_path;
pathToTopDirectory = working_directory;
}
else
{
- base = module.GetBasePath ();
+ base = module.output->relative_path;
pathToTopDirectory = GetPathToTopDirectory ( module );
}
string proxyMakefile = NormalizeFilename ( base + sSep + "GNUmakefile" );
Modified: trunk/reactos/tools/rbuild/backend/msbuild/msbuild.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msbui…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/msbuild/msbuild.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/msbuild/msbuild.cpp Sun Sep 9 11:53:40 2007
@@ -72,7 +72,7 @@
void
MsBuildBackend::_generate_makefile ( const Module& module )
{
- string makefile = module.GetBasePath() + "\\makefile";
+ string makefile = module.output->relative_path + "\\makefile";
FILE* OUT = fopen ( makefile.c_str(), "wb" );
fprintf ( OUT, "!INCLUDE $(NTMAKEENV)\\makefile.def\r\n" );
fclose ( OUT );
@@ -83,12 +83,12 @@
{
size_t i;
- string module_type = GetExtension(module.GetTargetName());
+ string module_type = GetExtension(module.output->name);
vector<string> source_files, resource_files, includes, libraries;
vector<string> header_files, common_defines, compiler_flags;
vector<string> vars, values;
- string sourcesfile = module.GetBasePath() + "\\sources";
- string proj_path = module.GetBasePath();
+ string sourcesfile = module.output->relative_path + "\\sources";
+ string proj_path = module.output->relative_path;
FILE* OUT = fopen ( sourcesfile.c_str(), "wb" );
fprintf ( OUT, "TARGETNAME=%s\r\n", module.name.c_str() );
@@ -121,7 +121,7 @@
{
string path = Path::RelativeFromDirectory (
incs[i]->directory,
- module.GetBasePath() );
+ module.output->relative_path );
includes.push_back ( path );
}
@@ -220,14 +220,14 @@
for ( size_t i = 0; i < ProjectNode.modules.size(); i++ )
{
Module& module = *ProjectNode.modules[i];
- printf("Cleaning project %s %s\n", module.name.c_str (), module.GetBasePath
().c_str () );
+ printf("Cleaning project %s %s\n", module.name.c_str (),
module.output->relative_path.c_str () );
- string makefile = module.GetBasePath() + "\\makefile";
- string sourcesfile = module.GetBasePath() + "\\sources";
-
- string basepath = module.GetBasePath ();
- remove ( makefile.c_str() );
- remove ( sourcesfile.c_str() );
+ string makefile = module.output->relative_path + "\\makefile";
+ string sourcesfile = module.output->relative_path + "\\sources";
+
+ string basepath = module.output->relative_path;
+ remove ( makefile.c_str() );
+ remove ( sourcesfile.c_str() );
}
}
Modified: trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp Sun Sep 9 11:53:40 2007
@@ -225,7 +225,7 @@
MSVCBackend::OptFileName ( const Module& module ) const
{
return FixSeparatorForSystemCommand(
- ReplaceExtension ( module.GetPath(), "_" + _get_vc_dir() +
"_auto.opt" )
+ ReplaceExtension ( module.output->relative_path + "\\" +
module.output->name, "_" + _get_vc_dir() + "_auto.opt" )
);
}
@@ -233,7 +233,7 @@
MSVCBackend::SuoFileName ( const Module& module ) const
{
return FixSeparatorForSystemCommand(
- ReplaceExtension ( module.GetPath(), "_" + _get_vc_dir() +
"_auto.suo" )
+ ReplaceExtension ( module.output->relative_path + "\\" +
module.output->name, "_" + _get_vc_dir() + "_auto.suo" )
);
}
@@ -241,7 +241,7 @@
MSVCBackend::DswFileName ( const Module& module ) const
{
return FixSeparatorForSystemCommand(
- ReplaceExtension ( module.GetPath(), "_auto.dsw" )
+ ReplaceExtension ( module.output->relative_path + "\\" +
module.output->name, "_auto.dsw" )
);
}
@@ -249,7 +249,7 @@
MSVCBackend::SlnFileName ( const Module& module ) const
{
return FixSeparatorForSystemCommand(
- ReplaceExtension ( module.GetPath(), "_" + _get_vc_dir() +
"_auto.sln" )
+ ReplaceExtension ( module.output->relative_path + "\\" +
module.output->name, "_" + _get_vc_dir() + "_auto.sln" )
);
}
@@ -257,7 +257,7 @@
MSVCBackend::NcbFileName ( const Module& module ) const
{
return FixSeparatorForSystemCommand(
- ReplaceExtension ( module.GetPath(), "_" + _get_vc_dir() +
"_auto.ncb" )
+ ReplaceExtension ( module.output->relative_path + "\\" +
module.output->name, "_" + _get_vc_dir() + "_auto.ncb" )
);
}
@@ -265,7 +265,7 @@
MSVCBackend::DspFileName ( const Module& module ) const
{
return FixSeparatorForSystemCommand(
- ReplaceExtension ( module.GetPath(), "_auto.dsp" )
+ ReplaceExtension ( module.output->relative_path + "\\" +
module.output->name, "_auto.dsp" )
);
}
@@ -273,7 +273,7 @@
MSVCBackend::VcprojFileName ( const Module& module ) const
{
return FixSeparatorForSystemCommand(
- ReplaceExtension ( module.GetPath(), "_" + _get_vc_dir() +
"_auto.vcproj" )
+ ReplaceExtension ( module.output->relative_path + "\\" +
module.output->name, "_" + _get_vc_dir() + "_auto.vcproj" )
);
}
@@ -296,7 +296,7 @@
void
MSVCBackend::_get_object_files ( const Module& module, vector<string>& out)
const
{
- string basepath = module.GetBasePath ();
+ string basepath = module.output->relative_path;
string vcdir = _get_vc_dir ();
size_t i;
string intenv = Environment::GetIntermediatePath () + DEF_SSEP + basepath + DEF_SSEP;
@@ -361,7 +361,7 @@
//files in the output dir
for ( i = cfgs.size () / 2; i < cfgs.size (); i++ )
{
- out.push_back ( cfgs[i] + module.GetTargetName () );
+ out.push_back ( cfgs[i] + module.output->name );
out.push_back ( cfgs[i] + module.name + ".pdb" );
out.push_back ( cfgs[i] + module.name + ".lib" );
out.push_back ( cfgs[i] + module.name + ".exp" );
@@ -395,9 +395,9 @@
{
Module& module = *ProjectNode.modules[i];
vector<string> out;
- printf("Cleaning project %s %s %s\n", module.name.c_str (),
module.GetBasePath ().c_str (), NcbFileName ( module ).c_str () );
+ printf("Cleaning project %s %s %s\n", module.name.c_str (),
module.output->relative_path.c_str (), NcbFileName ( module ).c_str () );
- string basepath = module.GetBasePath ();
+ string basepath = module.output->relative_path;
remove ( NcbFileName ( module ).c_str () );
remove ( DspFileName ( module ).c_str () );
remove ( DswFileName ( module ).c_str () );
@@ -461,11 +461,11 @@
for ( size_t i = 0; i < ProjectNode.modules.size(); i++ )
{
Module& module = *ProjectNode.modules[i];
- if ( module.installBase == "" || module.installName == "" )
+ if ( !module.install )
continue;
- string inputname = Environment::GetOutputPath () + DEF_SSEP + module.GetBasePath () +
DEF_SSEP + vcdir + DEF_SSEP + config + DEF_SSEP + module.GetTargetName ();
- string installdir = Environment::GetInstallPath () + DEF_SSEP + module.installBase +
DEF_SSEP + module.installName;
+ string inputname = Environment::GetOutputPath () + DEF_SSEP +
module.output->relative_path + DEF_SSEP + vcdir + DEF_SSEP + config + DEF_SSEP +
module.output->name;
+ string installdir = Environment::GetInstallPath () + DEF_SSEP +
module.install->relative_path + DEF_SSEP + module.install->name;
if ( _copy_file( inputname, installdir ) )
printf ("Installed File :'%s'\n",installdir.c_str () );
}
Modified: trunk/reactos/tools/rbuild/backend/msvc/msvcmaker.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/msvc/msvcmaker.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/msvc/msvcmaker.cpp Sun Sep 9 11:53:40 2007
@@ -56,7 +56,7 @@
imports.push_back ( module.non_if_data.libraries[i]->name );
}
- string module_type = GetExtension(module.GetTargetName());
+ string module_type = GetExtension(module.output->name);
bool lib = (module_type == ".lib") || (module_type == ".a");
bool dll = (module_type == ".dll") || (module_type == ".cpl");
bool exe = (module_type == ".exe") || (module_type == ".scr");
@@ -82,7 +82,7 @@
//$output->progress("$dsp_file (file $progress_current of
$progress_max)");
// TODO FIXME - what's diff. betw. 'c_srcs' and 'source_files'?
- string dsp_path = module.GetBasePath();
+ string dsp_path = module.output->relative_path;
vector<string> c_srcs, source_files, header_files, resource_files, includes,
libraries;
StringSet common_defines;
vector<const IfableData*> ifs_list;
@@ -127,7 +127,7 @@
string path = Path::RelativeFromDirectory (
incs[i]->directory,
- module.GetBasePath() );
+ module.output->relative_path );
includes.push_back ( path );
}
const vector<Library*>& libs = data.libraries;
Modified: trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp Sun Sep 9 11:53:40 2007
@@ -98,7 +98,7 @@
FILE* OUT = fopen ( vcproj_file.c_str(), "wb" );
vector<string> imports;
- string module_type = GetExtension(module.GetTargetName());
+ string module_type = GetExtension(module.output->name);
bool lib = (module.type == ObjectLibrary) || (module.type == RpcClient) ||(module.type
== RpcServer) || (module_type == ".lib") || (module_type == ".a");
bool dll = (module_type == ".dll") || (module_type == ".cpl");
bool exe = (module_type == ".exe") || (module_type == ".scr");
@@ -131,7 +131,7 @@
bool console = exe && (module.type == Win32CUI);
bool include_idl = false;
- string vcproj_path = module.GetBasePath();
+ string vcproj_path = module.output->relative_path;
vector<string> source_files, resource_files, header_files, includes, includes_ros,
libraries;
StringSet common_defines;
vector<const IfableData*> ifs_list;
@@ -172,7 +172,7 @@
{
string path = Path::RelativeFromDirectory (
incs[i]->directory,
- module.GetBasePath() );
+ module.output->relative_path );
if ( module.type != RpcServer && module.type != RpcClient )
{
if ( path.find ("/include/reactos/idl") != string::npos)
@@ -199,7 +199,7 @@
const vector<Library*>& libs = data.libraries;
for ( i = 0; i < libs.size(); i++ )
{
- string libpath = outdir + "\\" +
libs[i]->importedModule->GetBasePath() + "\\" + _get_vc_dir() +
"\\---\\" + libs[i]->name + ".lib";
+ string libpath = outdir + "\\" +
libs[i]->importedModule->output->relative_path + "\\" + _get_vc_dir() +
"\\---\\" + libs[i]->name + ".lib";
libraries.push_back ( libpath );
}
const vector<Define*>& defs = data.defines;
@@ -267,13 +267,13 @@
if ( configuration.UseConfigurationInPath )
{
- fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s%s\\%s\"\r\n",
outdir.c_str (), module.GetBasePath ().c_str (), vcdir.c_str (), cfg.name.c_str() );
- fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s%s\\%s\"\r\n",
intdir.c_str (), module.GetBasePath ().c_str (), vcdir.c_str (), cfg.name.c_str() );
+ fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s%s\\%s\"\r\n",
outdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str (),
cfg.name.c_str() );
+ fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s%s\\%s\"\r\n",
intdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str (),
cfg.name.c_str() );
}
else
{
- fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s%s\"\r\n",
outdir.c_str (), module.GetBasePath ().c_str (), vcdir.c_str () );
- fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s%s\"\r\n",
intdir.c_str (), module.GetBasePath ().c_str (), vcdir.c_str () );
+ fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s%s\"\r\n",
outdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str () );
+ fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s%s\"\r\n",
intdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str () );
}
fprintf ( OUT, "\t\t\tConfigurationType=\"%d\"\r\n", exe ? 1 : dll
? 2 : lib ? 4 : -1 );
@@ -375,7 +375,7 @@
fprintf ( OUT, "\t\t\t\tUsePrecompiledHeader=\"2\"\r\n" );
string pch_path = Path::RelativeFromDirectory (
module.pch->file.name,
- module.GetBasePath() );
+ module.output->relative_path );
string::size_type pos = pch_path.find_last_of ("/");
if ( pos != string::npos )
pch_path.erase(0, pos+1);
Modified: trunk/reactos/tools/rbuild/backend/versionreport/versionreport.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/versi…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/versionreport/versionreport.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/versionreport/versionreport.cpp Sun Sep 9 11:53:40
2007
@@ -108,7 +108,7 @@
{
fprintf ( m_VReportFile, "\t<component>\r\n" );
fprintf ( m_VReportFile, "\t\t<name>%s</name>\r\n",
module.name.c_str () );
- fprintf ( m_VReportFile, "\t\t<base>%s</base>\r\n",
module.GetBasePath().c_str () );
+ fprintf ( m_VReportFile, "\t\t<base>%s</base>\r\n",
module.output->relative_path.c_str () );
fprintf ( m_VReportFile, "\t\t<version>%s</version>\r\n",
module.metadata->version.c_str () );
fprintf ( m_VReportFile, "\t\t<date>%s</date>\r\n",
module.metadata->date.c_str () );
fprintf ( m_VReportFile, "\t\t<owner>%s</owner>\r\n",
module.metadata->owner.c_str () );
Modified: trunk/reactos/tools/rbuild/bootstrap.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/bootstrap.cpp…
==============================================================================
--- trunk/reactos/tools/rbuild/bootstrap.cpp (original)
+++ trunk/reactos/tools/rbuild/bootstrap.cpp Sun Sep 9 11:53:40 2007
@@ -107,7 +107,7 @@
if ( att != NULL )
nameoncd = att->value;
else
- nameoncd = module->GetTargetName ();
+ nameoncd = module->output->name;
}
void
Modified: trunk/reactos/tools/rbuild/compilationunit.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/compilationun…
==============================================================================
--- trunk/reactos/tools/rbuild/compilationunit.cpp (original)
+++ trunk/reactos/tools/rbuild/compilationunit.cpp Sun Sep 9 11:53:40 2007
@@ -34,8 +34,8 @@
}
CompilationUnit::CompilationUnit ( const Project* project,
- const Module* module,
- const XMLElement* node )
+ const Module* module,
+ const XMLElement* node )
: project(project),
module(module),
node(node)
@@ -43,7 +43,7 @@
const XMLAttribute* att = node->GetAttribute ( "name", true );
assert(att);
local_name = att->value;
- name = module->GetBasePath () + cSep + att->value;
+ name = module->output->relative_path + cSep + att->value;
}
CompilationUnit::~CompilationUnit ()
@@ -101,7 +101,7 @@
if ( files.size () == 0 || files.size () > 1 )
{
return new FileLocation ( IntermediateDirectory,
- module ? module->GetBasePath () : "",
+ module ? module->output->relative_path : "",
local_name );
}
Modified: trunk/reactos/tools/rbuild/include.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/include.cpp?r…
==============================================================================
--- trunk/reactos/tools/rbuild/include.cpp (original)
+++ trunk/reactos/tools/rbuild/include.cpp Sun Sep 9 11:53:40 2007
@@ -87,7 +87,7 @@
if ( base != NULL )
{
baseModule = base;
- basePath = base->GetBasePath ();
+ basePath = base->output->relative_path;
referenceResolved = true;
}
}
Modified: trunk/reactos/tools/rbuild/linkerscript.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/linkerscript.…
==============================================================================
--- trunk/reactos/tools/rbuild/linkerscript.cpp (original)
+++ trunk/reactos/tools/rbuild/linkerscript.cpp Sun Sep 9 11:53:40 2007
@@ -57,7 +57,7 @@
if ( base != NULL )
{
baseModule = base;
- basePath = base->GetBasePath ();
+ basePath = base->output->relative_path;
referenceResolved = true;
}
}
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 Sun Sep 9 11:53:40 2007
@@ -265,8 +265,6 @@
xmlbuildFile = Path::RelativeFromWorkingDirectory ( moduleNode.xmlFile->filename ()
);
- path = FixSeparator ( modulePath );
-
enabled = true;
const XMLAttribute* att = moduleNode.GetAttribute ( "if", false );
@@ -430,17 +428,16 @@
if ( att != NULL )
prefix = att->value;
- att = moduleNode.GetAttribute ( "installbase", false );
- if ( att != NULL )
- installBase = att->value;
- else
- installBase = "";
-
att = moduleNode.GetAttribute ( "installname", false );
if ( att != NULL )
- installName = att->value;
- else
- installName = "";
+ {
+ const XMLAttribute* installbase = moduleNode.GetAttribute ( "installbase",
false );
+ install = new FileLocation ( InstallDirectory,
+ installbase ? installbase->value : "",
+ att->value );
+ }
+ else
+ install = NULL;
att = moduleNode.GetAttribute ( "usewrc", false );
if ( att != NULL )
@@ -487,6 +484,11 @@
buildtype = "BOOTPROG";
}
}
+
+ output = new FileLocation ( GetTargetDirectoryTree (),
+ modulePath,
+ name + extension );
+ SetImportLibrary ( NULL );
}
Module::~Module ()
@@ -535,7 +537,7 @@
for ( i = 0; i < node.subElements.size(); i++ )
{
ParseContext parseContext;
- ProcessXMLSubElement ( *node.subElements[i], path, "", parseContext );
+ ProcessXMLSubElement ( *node.subElements[i], output->relative_path, "",
parseContext );
}
for ( i = 0; i < invocations.size(); i++ )
invocations[i]->ProcessXML ();
@@ -719,7 +721,7 @@
e.location,
"Only one <importlibrary> is valid per module" );
}
- importLibrary = new ImportLibrary ( project, e, *this );
+ SetImportLibrary ( new ImportLibrary ( project, e, *this ) );
subs_invalid = true;
}
else if ( e.name == "if" )
@@ -910,6 +912,45 @@
attribute.value );
}
+DirectoryLocation
+Module::GetTargetDirectoryTree () const
+{
+ switch ( type )
+ {
+ case Kernel:
+ case KernelModeDLL:
+ case NativeDLL:
+ case Win32DLL:
+ case Win32OCX:
+ case KernelModeDriver:
+ case NativeCUI:
+ case Win32CUI:
+ case Test:
+ case Win32SCR:
+ case Win32GUI:
+ case BuildTool:
+ case BootLoader:
+ case BootSector:
+ case BootProgram:
+ case Iso:
+ case LiveIso:
+ case IsoRegTest:
+ case LiveIsoRegTest:
+ case EmbeddedTypeLib:
+ case ElfExecutable:
+ return OutputDirectory;
+ case StaticLibrary:
+ case ObjectLibrary:
+ case RpcServer:
+ case RpcClient:
+ case Alias:
+ case IdlHeader:
+ return IntermediateDirectory;
+ }
+ throw InvalidOperationException ( __FILE__,
+ __LINE__ );
+}
+
string
Module::GetDefaultModuleExtension () const
{
@@ -1103,94 +1144,16 @@
__LINE__ );
}
-bool
-Module::GenerateInOutputTree () const
-{
- switch ( type )
- {
- case Kernel:
- case KernelModeDLL:
- case NativeDLL:
- case Win32DLL:
- case Win32OCX:
- case KernelModeDriver:
- case NativeCUI:
- case Win32CUI:
- case Test:
- case Win32SCR:
- case Win32GUI:
- case BuildTool:
- case BootLoader:
- case BootSector:
- case BootProgram:
- case Iso:
- case LiveIso:
- case IsoRegTest:
- case LiveIsoRegTest:
- case EmbeddedTypeLib:
- case ElfExecutable:
- return true;
- case StaticLibrary:
- case ObjectLibrary:
- case RpcServer:
- case RpcClient:
- case Alias:
- case IdlHeader:
- return false;
- }
- throw InvalidOperationException ( __FILE__,
- __LINE__ );
-}
-
-string
-Module::GetTargetName () const
-{
- return name + extension;
-}
-
-string
-Module::GetDependencyPath () const
-{
- if ( HasImportLibrary () )
- return ReplaceExtension ( GetPathWithPrefix ( "lib" ), ".a" );
- else
- return GetPath();
-}
-
-string
-Module::GetDependencyTargetName () const
-{
- if ( HasImportLibrary () )
- return "lib" + name + ".a";
- else
- return GetTargetName();
-}
-
-string
-Module::GetBasePath () const
-{
- return path;
-}
-
-string
-Module::GetPath () const
-{
- if ( path.length() > 0 )
- return path + cSep + GetTargetName ();
- else
- return GetTargetName ();
-}
-
string
Module::GetPathWithPrefix ( const string& prefix ) const
{
- return path + cSep + prefix + GetTargetName ();
+ return output->relative_path + cSep + prefix + output->name;
}
string
Module::GetPathToBaseDir () const
{
- string temp_path = path;
+ string temp_path = output->relative_path;
string result = "..\\";
while(temp_path.find ('\\') != string::npos)
{
@@ -1247,13 +1210,23 @@
for ( size_t i = 0; i < invocations.size (); i++ )
{
Invoke& invoke = *invocations[i];
- string command = FixSeparatorForSystemCommand(invoke.invokeModule->GetPath ()) +
" " + invoke.GetParameters ();
+ string command =
FixSeparatorForSystemCommand(invoke.invokeModule->output->relative_path +
"/" + invoke.invokeModule->output->name ) + " " +
invoke.GetParameters ();
printf ( "Executing '%s'\n\n", command.c_str () );
int exitcode = system ( command.c_str () );
if ( exitcode != 0 )
throw InvocationFailedException ( command,
exitcode );
}
+}
+
+
+void
+Module::SetImportLibrary ( ImportLibrary* importLibrary )
+{
+ this->importLibrary = importLibrary;
+ dependency = new FileLocation ( IntermediateDirectory,
+ output->relative_path,
+ HasImportLibrary () ? "lib" + name +
".a" : output->name );
}
@@ -1406,7 +1379,7 @@
if ( e.name == "inputfile" && e.value.size () > 0 )
{
input.push_back ( new InvokeFile (
- e, FixSeparator ( module.path + cSep + e.value ) ) );
+ e, FixSeparator ( module.output->relative_path + cSep + e.value ) ) );
subs_invalid = true;
}
if ( subs_invalid && e.subElements.size() > 0 )
@@ -1425,7 +1398,7 @@
if ( e.name == "outputfile" && e.value.size () > 0 )
{
output.push_back ( new InvokeFile (
- e, FixSeparator ( module.path + cSep + e.value ) ) );
+ e, FixSeparator ( module.output->relative_path + cSep + e.value ) ) );
subs_invalid = true;
}
if ( subs_invalid && e.subElements.size() > 0 )
@@ -1603,7 +1576,7 @@
if ( index == string::npos )
{
source = new FileLocation ( directory,
- module.GetBasePath (),
+ module.output->relative_path,
definition->value );
}
else
@@ -1611,7 +1584,7 @@
string dir = definition->value.substr ( 0, index );
string name = definition->value.substr ( index + 1);
source = new FileLocation ( directory,
- NormalizeFilename ( module.GetBasePath () + sSep + dir ),
+ NormalizeFilename ( module.output->relative_path + sSep
+ dir ),
name );
}
}
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 Sun Sep 9 11:53:40 2007
@@ -302,6 +302,15 @@
HostTrue
};
+enum DirectoryLocation
+{
+ SourceDirectory,
+ IntermediateDirectory,
+ OutputDirectory,
+ InstallDirectory,
+ TemporaryDirectory,
+};
+
class Module
{
public:
@@ -314,7 +323,6 @@
std::string baseaddress;
std::string payload;
std::string buildtype;
- std::string path;
ModuleType type;
ImportLibrary* importLibrary;
Metadata* metadata;
@@ -335,14 +343,15 @@
bool cplusplus;
std::string prefix;
HostType host;
- std::string installBase;
- std::string installName;
std::string aliasedModuleName;
bool useWRC;
bool allowWarnings;
bool enabled;
bool useHostStdlib;
bool isStartupLib;
+ FileLocation *output; // "path/foo.exe"
+ FileLocation *dependency; // "path/foo.exe" or "path/libfoo.a"
+ FileLocation *install;
Module ( const Project& project,
const XMLElement& moduleNode,
@@ -352,12 +361,6 @@
const XMLAttribute& attribute );
bool HasImportLibrary () const;
bool IsDLL () const;
- bool GenerateInOutputTree () const;
- std::string GetTargetName () const; // "foo.exe"
- std::string GetDependencyPath () const; // "path/foo.exe" or
"path/libfoo.a"
- std::string GetDependencyTargetName () const; // "foo.exe" or
"libfoo.a"
- std::string GetBasePath () const; // "path"
- std::string GetPath () const; // "path/foo.exe"
std::string GetPathWithPrefix ( const std::string& prefix ) const; //
"path/prefixfoo.exe"
std::string GetPathToBaseDir() const; // "../" offset to rootdirectory
std::string GetEntryPoint(bool leadingUnderscore) const;
@@ -366,9 +369,9 @@
bool HasFileWithExtension ( const IfableData&, const std::string& extension )
const;
void InvokeModule () const;
void ProcessXML ();
- void GetSourceFilenames ( string_list& list,
- bool includeGeneratedFiles ) const;
-private:
+private:
+ void SetImportLibrary ( ImportLibrary* importLibrary );
+ DirectoryLocation GetTargetDirectoryTree () const;
std::string GetDefaultModuleExtension () const;
std::string GetDefaultModuleEntrypoint () const;
std::string GetDefaultModuleBaseaddress () const;
@@ -828,16 +831,6 @@
};
-enum DirectoryLocation
-{
- SourceDirectory,
- IntermediateDirectory,
- OutputDirectory,
- InstallDirectory,
- TemporaryDirectory,
-};
-
-
class FileLocation
{
public:
Modified: trunk/reactos/tools/rbuild/syssetupgenerator.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/syssetupgener…
==============================================================================
--- trunk/reactos/tools/rbuild/syssetupgenerator.cpp (original)
+++ trunk/reactos/tools/rbuild/syssetupgenerator.cpp Sun Sep 9 11:53:40 2007
@@ -65,7 +65,7 @@
string
SysSetupGenerator::GetDirectoryId ( const Module& module )
{
- if ( ToLower ( module.installBase ) == "system32" )
+ if ( module.install && ToLower ( module.install->relative_path ) ==
"system32" )
return DIRECTORYID_SYSTEM32;
throw InvalidOperationException ( __FILE__,
__LINE__ );
@@ -104,7 +104,7 @@
if ( 0 != InfHostAddLine ( context, NULL ) ||
0 != InfHostAddField ( context, GetDirectoryId ( module ).c_str () ) ||
0 != InfHostAddField ( context, "" ) ||
- 0 != InfHostAddField ( context, module.installName.c_str () ) ||
+ ( module.install && 0 != InfHostAddField ( context,
module.install->name.c_str () ) ) ||
0 != InfHostAddField ( context, GetFlags ( module ).c_str () ) )
{
InfHostFreeContext ( context );
Modified: trunk/reactos/tools/rbuild/testsupportcode.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/testsupportco…
==============================================================================
--- trunk/reactos/tools/rbuild/testsupportcode.cpp (original)
+++ trunk/reactos/tools/rbuild/testsupportcode.cpp Sun Sep 9 11:53:40 2007
@@ -69,13 +69,13 @@
string
TestSupportCode::GetHooksFilename ( Module& module )
{
- return NormalizeFilename ( Environment::GetIntermediatePath () + sSep +
module.GetBasePath () + sSep + "_hooks.c" );
+ return NormalizeFilename ( Environment::GetIntermediatePath () + sSep +
module.output->relative_path + sSep + "_hooks.c" );
}
char*
TestSupportCode::WriteStubbedSymbolToHooksFile ( char* buffer,
const StubbedComponent& component,
- const StubbedSymbol& symbol )
+ const StubbedSymbol& symbol )
{
buffer = buffer + sprintf ( buffer,
" {\"%s\", \"%s\", NULL, NULL,
NULL},\n",
@@ -135,7 +135,7 @@
string
TestSupportCode::GetStubsFilename ( Module& module )
{
- return NormalizeFilename ( Environment::GetIntermediatePath () + sSep +
module.GetBasePath () + sSep + "_stubs.S" );
+ return NormalizeFilename ( Environment::GetIntermediatePath () + sSep +
module.output->relative_path + sSep + "_stubs.S" );
}
string
@@ -249,7 +249,7 @@
string
TestSupportCode::GetStartupFilename ( Module& module )
{
- return NormalizeFilename ( Environment::GetIntermediatePath () + sSep +
module.GetBasePath () + sSep + "_startup.c" );
+ return NormalizeFilename ( Environment::GetIntermediatePath () + sSep +
module.output->relative_path + sSep + "_startup.c" );
}
bool
Modified: trunk/reactos/tools/rbuild/wineresource.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/wineresource.…
==============================================================================
--- trunk/reactos/tools/rbuild/wineresource.cpp (original)
+++ trunk/reactos/tools/rbuild/wineresource.cpp Sun Sep 9 11:53:40 2007
@@ -103,8 +103,8 @@
module.name.c_str () );
}
- string relativeDirectory = module.GetBasePath ();
- string outputDirectory = Environment::GetIntermediatePath() + sSep + module.GetBasePath
();
+ string relativeDirectory = module.output->relative_path;
+ string outputDirectory = Environment::GetIntermediatePath() + sSep +
module.output->relative_path;
string parameters = ssprintf ( "-b %s -O %s -f -x %s",
NormalizeFilename ( relativeDirectory ).c_str (),
NormalizeFilename ( outputDirectory ).c_str (),
@@ -120,6 +120,6 @@
exitcode );
}
module.non_if_data.includes.push_back( new Include ( module.project,
- module.GetBasePath (),
+ module.output->relative_path,
"$(INTERMEDIATE)" ) );
}