Continue rbuild cleanup (Module class)

svn path=/trunk/; revision=28964
This commit is contained in:
Hervé Poussineau 2007-09-09 07:53:40 +00:00
parent 8be848bceb
commit 5d0fb46096
20 changed files with 203 additions and 271 deletions

View file

@ -198,7 +198,7 @@ std::string
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 @@ std::string
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 @@ std::string
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 @@ CBBackend::_clean_project_files ( void )
{
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 @@ CBBackend::_generate_workspace ( FILE* OUT )
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 @@ CBBackend::_generate_cbproj ( const Module& module )
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 @@ CBBackend::_generate_cbproj ( const Module& module )
{
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 @@ CBBackend::_generate_cbproj ( const Module& module )
{
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 @@ CBBackend::_generate_cbproj ( const Module& module )
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 @@ CBBackend::_generate_cbproj ( const Module& module )
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" );

View file

@ -166,10 +166,10 @@ DepMapBackend::_generate_depmap ( FILE* OUT )
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" );

View file

@ -587,7 +587,7 @@ MingwBackend::GetBuildToolDependencies () const
{
if ( dependencies.length () > 0 )
dependencies += " ";
dependencies += module.GetDependencyPath ();
dependencies += strFile ( module.dependency );
}
}
return dependencies;
@ -1165,12 +1165,8 @@ MingwBackend::GetModuleInstallTargetFiles (
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 @@ MingwBackend::OutputModuleInstallTargets ()
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 );
}
}
}

View file

@ -124,21 +124,12 @@ MingwModuleHandler::PassThruCacheDirectory (const FileLocation* file )
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 @@ MingwModuleHandler::GetImportLibraryFilename (
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 @@ MingwModuleHandler::GetModuleArchiveFilename () const
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 @@ MingwModuleHandler::GenerateCleanTarget () const
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",
"%s_install: %s\n",
module.name.c_str (),
cSep,
normalizedTargetFilename.c_str() );
strFile ( module.install ).c_str () );
}
void
@ -1473,8 +1461,8 @@ MingwModuleHandler::GenerateBuildMapCode ( const FileLocation *mapTarget )
"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 @@ MingwModuleHandler::GenerateBuildNonSymbolStrippedCode ()
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 @@ MingwModuleHandler::GenerateLinkerCommand (
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 @@ MingwModuleHandler::GenerateLinkerCommand (
* 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 @@ MingwModuleHandler::GenerateOtherMacros ()
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 @@ MingwModuleHandler::GenerateRules ()
if ( module.name != "zlib" ) /* Avoid make warning */
{
FileLocation proxyMakefile ( OutputDirectory,
module.GetBasePath (),
module.output->relative_path,
"makefile" );
CLEAN_FILE ( &proxyMakefile );
}
@ -2172,11 +2157,11 @@ MingwModuleHandler::GenerateInvocations () const
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 @@ MingwModuleHandler::GenerateImportLibraryTargetIfNeeded ()
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 @@ MingwKernelModuleHandler::GenerateKernelModuleTarget ()
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 @@ MingwBootLoaderModuleHandler::Process ()
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 @@ MingwBootProgramModuleHandler::Process ()
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 @@ MingwBootProgramModuleHandler::GenerateBootProgramModuleTarget ()
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 @@ MingwBootProgramModuleHandler::GenerateBootProgramModuleTarget ()
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 @@ MingwIsoModuleHandler::OutputBootstrapfileCopyCommands (
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 @@ MingwIsoModuleHandler::GetBootstrapCdFiles (
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 @@ MingwLiveIsoModuleHandler::OutputModuleCopyCommands ( string& livecdDirectory,
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 @@ MingwTestModuleHandler::Process ()
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 @@ MingwElfExecutableModuleHandler::MingwElfExecutableModuleHandler (
void
MingwElfExecutableModuleHandler::Process ()
{
string targetName ( module.GetTargetName () );
string targetName ( module.output->name );
string targetMacro ( GetTargetMacro (module) );
string workingDirectory = GetWorkingDirectory ();
string objectsMacro = GetObjectsMacro ( module );

View file

@ -43,9 +43,6 @@ public:
static const FileLocation* PassThruCacheDirectory (const FileLocation* fileLocation );
static DirectoryLocation GetTargetDirectoryTree (
const Module& module );
static const FileLocation* GetTargetFilename (
const Module& module,
string_list* pclean_files );

View file

@ -35,7 +35,7 @@ ProxyMakefile::~ProxyMakefile ()
bool
ProxyMakefile::GenerateProxyMakefile ( Module& module )
{
return module.GenerateInOutputTree ();
return module.output->directory == OutputDirectory;
}
void
@ -72,7 +72,7 @@ string
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 @@ ProxyMakefile::GenerateProxyMakefileForModule ( Module& module,
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" );

View file

@ -72,7 +72,7 @@ void MsBuildBackend::Process()
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 @@ MsBuildBackend::_generate_sources ( const Module& module )
{
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 @@ MsBuildBackend::_generate_sources ( const Module& module )
{
string path = Path::RelativeFromDirectory (
incs[i]->directory,
module.GetBasePath() );
module.output->relative_path );
includes.push_back ( path );
}
@ -220,14 +220,14 @@ MsBuildBackend::_clean_project_files ( void )
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 makefile = module.output->relative_path + "\\makefile";
string sourcesfile = module.output->relative_path + "\\sources";
string basepath = module.GetBasePath ();
remove ( makefile.c_str() );
remove ( sourcesfile.c_str() );
string basepath = module.output->relative_path;
remove ( makefile.c_str() );
remove ( sourcesfile.c_str() );
}
}

View file

@ -225,7 +225,7 @@ std::string
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 @@ std::string
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 @@ std::string
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 @@ std::string
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 @@ std::string
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 @@ std::string
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 @@ std::string
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 @@ std::string MSVCBackend::_get_vc_dir ( void ) const
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 @@ MSVCBackend::_get_object_files ( const Module& module, vector<string>& out) cons
//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 @@ MSVCBackend::_clean_project_files ( void )
{
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 @@ MSVCBackend::_install_files (const std::string& vcdir, const::string& config)
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 () );
}

View file

@ -56,7 +56,7 @@ MSVCBackend::_generate_dsp ( const Module& module )
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 @@ MSVCBackend::_generate_dsp ( const Module& module )
//$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 @@ MSVCBackend::_generate_dsp ( const Module& module )
string path = Path::RelativeFromDirectory (
incs[i]->directory,
module.GetBasePath() );
module.output->relative_path );
includes.push_back ( path );
}
const vector<Library*>& libs = data.libraries;

View file

@ -98,7 +98,7 @@ MSVCBackend::_generate_vcproj ( const Module& module )
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 @@ MSVCBackend::_generate_vcproj ( const Module& module )
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 @@ MSVCBackend::_generate_vcproj ( const Module& module )
{
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 @@ MSVCBackend::_generate_vcproj ( const Module& module )
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 @@ MSVCBackend::_generate_vcproj ( const Module& module )
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 @@ MSVCBackend::_generate_vcproj ( const Module& module )
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);

View file

@ -108,7 +108,7 @@ VReportBackend::GenerateReport ( FILE* OUT )
{
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 () );

View file

@ -107,7 +107,7 @@ Bootstrap::Initialize ()
if ( att != NULL )
nameoncd = att->value;
else
nameoncd = module->GetTargetName ();
nameoncd = module->output->name;
}
void

View file

@ -34,8 +34,8 @@ CompilationUnit::CompilationUnit ( File* file )
}
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 @@ CompilationUnit::CompilationUnit ( const Project* project,
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 @@ CompilationUnit::GetFilename () const
if ( files.size () == 0 || files.size () > 1 )
{
return new FileLocation ( IntermediateDirectory,
module ? module->GetBasePath () : "",
module ? module->output->relative_path : "",
local_name );
}

View file

@ -87,7 +87,7 @@ Include::ProcessXML()
if ( base != NULL )
{
baseModule = base;
basePath = base->GetBasePath ();
basePath = base->output->relative_path;
referenceResolved = true;
}
}

View file

@ -57,7 +57,7 @@ LinkerScript::ProcessXML()
if ( base != NULL )
{
baseModule = base;
basePath = base->GetBasePath ();
basePath = base->output->relative_path;
referenceResolved = true;
}
}

View file

@ -265,8 +265,6 @@ Module::Module ( const Project& project,
xmlbuildFile = Path::RelativeFromWorkingDirectory ( moduleNode.xmlFile->filename () );
path = FixSeparator ( modulePath );
enabled = true;
const XMLAttribute* att = moduleNode.GetAttribute ( "if", false );
@ -430,17 +428,16 @@ Module::Module ( const Project& project,
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;
{
const XMLAttribute* installbase = moduleNode.GetAttribute ( "installbase", false );
install = new FileLocation ( InstallDirectory,
installbase ? installbase->value : "",
att->value );
}
else
installName = "";
install = NULL;
att = moduleNode.GetAttribute ( "usewrc", false );
if ( att != NULL )
@ -487,6 +484,11 @@ Module::Module ( const Project& project,
buildtype = "BOOTPROG";
}
}
output = new FileLocation ( GetTargetDirectoryTree (),
modulePath,
name + extension );
SetImportLibrary ( NULL );
}
Module::~Module ()
@ -535,7 +537,7 @@ Module::ProcessXML()
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 @@ Module::ProcessXMLSubElement ( const XMLElement& e,
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 @@ Module::GetModuleType ( const string& location, const XMLAttribute& attribute )
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 @@ Module::IsDLL () const
__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,7 +1210,7 @@ Module::InvokeModule () const
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 )
@ -1257,6 +1220,16 @@ Module::InvokeModule () const
}
void
Module::SetImportLibrary ( ImportLibrary* importLibrary )
{
this->importLibrary = importLibrary;
dependency = new FileLocation ( IntermediateDirectory,
output->relative_path,
HasImportLibrary () ? "lib" + name + ".a" : output->name );
}
File::File ( const string& _name,
bool _first,
std::string _switches,
@ -1406,7 +1379,7 @@ Invoke::ProcessXMLSubElementInput ( const XMLElement& e )
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 @@ Invoke::ProcessXMLSubElementOutput ( const XMLElement& e )
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 @@ ImportLibrary::ImportLibrary ( const Project& project,
if ( index == string::npos )
{
source = new FileLocation ( directory,
module.GetBasePath (),
module.output->relative_path,
definition->value );
}
else
@ -1611,7 +1584,7 @@ ImportLibrary::ImportLibrary ( const Project& project,
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 );
}
}

View file

@ -302,6 +302,15 @@ enum HostType
HostTrue
};
enum DirectoryLocation
{
SourceDirectory,
IntermediateDirectory,
OutputDirectory,
InstallDirectory,
TemporaryDirectory,
};
class Module
{
public:
@ -314,7 +323,6 @@ public:
std::string baseaddress;
std::string payload;
std::string buildtype;
std::string path;
ModuleType type;
ImportLibrary* importLibrary;
Metadata* metadata;
@ -335,14 +343,15 @@ public:
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 @@ public:
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 @@ public:
bool HasFileWithExtension ( const IfableData&, const std::string& extension ) const;
void InvokeModule () const;
void ProcessXML ();
void GetSourceFilenames ( string_list& list,
bool includeGeneratedFiles ) const;
private:
void SetImportLibrary ( ImportLibrary* importLibrary );
DirectoryLocation GetTargetDirectoryTree () const;
std::string GetDefaultModuleExtension () const;
std::string GetDefaultModuleEntrypoint () const;
std::string GetDefaultModuleBaseaddress () const;
@ -828,16 +831,6 @@ private:
};
enum DirectoryLocation
{
SourceDirectory,
IntermediateDirectory,
OutputDirectory,
InstallDirectory,
TemporaryDirectory,
};
class FileLocation
{
public:

View file

@ -65,7 +65,7 @@ SysSetupGenerator::Generate ()
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 @@ SysSetupGenerator::Generate ( HINF inf,
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 );

View file

@ -69,13 +69,13 @@ TestSupportCode::GenerateTestSupportCodeForModule ( Module& module,
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 @@ TestSupportCode::WriteHooksFile ( Module& module )
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 @@ TestSupportCode::WriteStubsFile ( Module& module )
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

View file

@ -103,8 +103,8 @@ WineResource::UnpackResourcesInModule ( Module& module,
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 @@ WineResource::UnpackResourcesInModule ( Module& module,
exitcode );
}
module.non_if_data.includes.push_back( new Include ( module.project,
module.GetBasePath (),
module.output->relative_path,
"$(INTERMEDIATE)" ) );
}