generate output rules for files under <if>

svn path=/branches/xmlbuildsystem/; revision=13017
This commit is contained in:
Royce Mitchell III 2005-01-13 04:13:20 +00:00
parent 84c57ede37
commit babc7c7c8a
2 changed files with 22 additions and 18 deletions

View file

@ -328,7 +328,7 @@ MingwModuleHandler::GenerateMacros (
{ {
fprintf ( fprintf (
fMakefile, fMakefile,
"ifeq ($(%s),\"%s\")\n", "ifeq (\"$(%s)\",\"%s\")\n",
rIf.property.c_str(), rIf.property.c_str(),
rIf.value.c_str() ); rIf.value.c_str() );
GenerateMacros ( GenerateMacros (
@ -445,14 +445,14 @@ MingwModuleHandler::GenerateCommand ( const Module& module,
void void
MingwModuleHandler::GenerateObjectFileTargets ( const Module& module, MingwModuleHandler::GenerateObjectFileTargets ( const Module& module,
const vector<File*>& files, const vector<File*>& files,
const vector<If*>& ifs,
const string& cc, const string& cc,
const string& cflagsMacro, const string& cflagsMacro,
const string& nasmflagsMacro ) const const string& nasmflagsMacro ) const
{ {
if ( files.size () == 0 ) size_t i;
return;
for ( size_t i = 0; i < files.size (); i++ ) for ( i = 0; i < files.size (); i++ )
{ {
string sourceFilename = files[i]->name; string sourceFilename = files[i]->name;
string objectFilename = GetObjectFilename ( sourceFilename ); string objectFilename = GetObjectFilename ( sourceFilename );
@ -468,8 +468,9 @@ MingwModuleHandler::GenerateObjectFileTargets ( const Module& module,
cflagsMacro, cflagsMacro,
nasmflagsMacro ).c_str () ); nasmflagsMacro ).c_str () );
} }
fprintf ( fMakefile, "\n" ); for ( i = 0; i < ifs.size(); i++ )
GenerateObjectFileTargets ( module, ifs[i]->files, ifs[i]->ifs, cc, cflagsMacro, nasmflagsMacro );
} }
void void
@ -478,9 +479,8 @@ MingwModuleHandler::GenerateObjectFileTargets ( const Module& module,
const string& cflagsMacro, const string& cflagsMacro,
const string& nasmflagsMacro ) const const string& nasmflagsMacro ) const
{ {
GenerateObjectFileTargets ( module, module.files, cc, cflagsMacro, nasmflagsMacro ); GenerateObjectFileTargets ( module, module.files, module.ifs, cc, cflagsMacro, nasmflagsMacro );
for ( size_t i = 0; i < module.ifs.size(); i++ ) fprintf ( fMakefile, "\n" );
GenerateObjectFileTargets ( module, module.ifs[i]->files, cc, cflagsMacro, nasmflagsMacro );
} }
void void
@ -695,6 +695,9 @@ MingwBuildToolModuleHandler::GenerateBuildToolModuleTarget ( const Module& modul
{ {
string target ( FixupTargetFilename ( module.GetPath () ) ); string target ( FixupTargetFilename ( module.GetPath () ) );
string archiveFilename = GetModuleArchiveFilename ( module ); string archiveFilename = GetModuleArchiveFilename ( module );
GenerateMacrosAndTargetsHost ( module );
fprintf ( fMakefile, "%s: %s\n", fprintf ( fMakefile, "%s: %s\n",
target.c_str (), target.c_str (),
archiveFilename.c_str () ); archiveFilename.c_str () );
@ -702,7 +705,6 @@ MingwBuildToolModuleHandler::GenerateBuildToolModuleTarget ( const Module& modul
"\t${host_gcc} -o %s %s\n\n", "\t${host_gcc} -o %s %s\n\n",
target.c_str (), target.c_str (),
archiveFilename.c_str () ); archiveFilename.c_str () );
GenerateMacrosAndTargetsHost ( module );
} }
static MingwKernelModuleHandler kernelmodule_handler; static MingwKernelModuleHandler kernelmodule_handler;
@ -734,6 +736,9 @@ MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module )
string temp_exp = ros_junk + module.name + ".temp.exp"; string temp_exp = ros_junk + module.name + ".temp.exp";
string gccOptions = ssprintf ("-Wl,-T,%s" SSEP "ntoskrnl.lnk -Wl,--subsystem,native -Wl,--entry,_NtProcessStartup -Wl,--image-base,0xC0000000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll", string gccOptions = ssprintf ("-Wl,-T,%s" SSEP "ntoskrnl.lnk -Wl,--subsystem,native -Wl,--entry,_NtProcessStartup -Wl,--image-base,0xC0000000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll",
module.GetBasePath ().c_str () ); module.GetBasePath ().c_str () );
GenerateMacrosAndTargetsTarget ( module );
fprintf ( fMakefile, "%s: %s %s\n", fprintf ( fMakefile, "%s: %s %s\n",
target.c_str (), target.c_str (),
archiveFilename.c_str (), archiveFilename.c_str (),
@ -766,8 +771,6 @@ MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module )
fprintf ( fMakefile, fprintf ( fMakefile,
"\t${rm} %s\n\n", "\t${rm} %s\n\n",
temp_exp.c_str () ); temp_exp.c_str () );
GenerateMacrosAndTargetsTarget ( module );
} }
@ -831,6 +834,8 @@ MingwKernelModeDLLModuleHandler::GenerateKernelModeDLLModuleTarget ( const Modul
if (module.files.size () > 0) if (module.files.size () > 0)
{ {
GenerateMacrosAndTargetsTarget ( module );
fprintf ( fMakefile, "%s: %s %s\n", fprintf ( fMakefile, "%s: %s %s\n",
target.c_str (), target.c_str (),
archiveFilename.c_str (), archiveFilename.c_str (),
@ -841,8 +846,6 @@ MingwKernelModeDLLModuleHandler::GenerateKernelModeDLLModuleTarget ( const Modul
target.c_str (), target.c_str (),
archiveFilename.c_str (), archiveFilename.c_str (),
importLibraryDependencies.c_str () ); importLibraryDependencies.c_str () );
GenerateMacrosAndTargetsTarget ( module );
} }
else else
{ {
@ -892,6 +895,8 @@ MingwNativeDLLModuleHandler::GenerateNativeDLLModuleTarget ( const Module& modul
if (module.files.size () > 0) if (module.files.size () > 0)
{ {
GenerateMacrosAndTargetsTarget ( module );
fprintf ( fMakefile, "%s: %s %s\n", fprintf ( fMakefile, "%s: %s %s\n",
target.c_str (), target.c_str (),
archiveFilename.c_str (), archiveFilename.c_str (),
@ -902,8 +907,6 @@ MingwNativeDLLModuleHandler::GenerateNativeDLLModuleTarget ( const Module& modul
target.c_str (), target.c_str (),
archiveFilename.c_str (), archiveFilename.c_str (),
importLibraryDependencies.c_str () ); importLibraryDependencies.c_str () );
GenerateMacrosAndTargetsTarget ( module );
} }
else else
{ {
@ -953,6 +956,8 @@ MingwWin32DLLModuleHandler::GenerateWin32DLLModuleTarget ( const Module& module
if (module.files.size () > 0) if (module.files.size () > 0)
{ {
GenerateMacrosAndTargetsTarget ( module );
fprintf ( fMakefile, "%s: %s %s\n", fprintf ( fMakefile, "%s: %s %s\n",
target.c_str (), target.c_str (),
archiveFilename.c_str (), archiveFilename.c_str (),
@ -963,8 +968,6 @@ MingwWin32DLLModuleHandler::GenerateWin32DLLModuleTarget ( const Module& module
target.c_str (), target.c_str (),
archiveFilename.c_str (), archiveFilename.c_str (),
importLibraryDependencies.c_str () ); importLibraryDependencies.c_str () );
GenerateMacrosAndTargetsTarget ( module );
} }
else else
{ {

View file

@ -80,6 +80,7 @@ private:
const std::string& nasmflagsMacro ) const; const std::string& nasmflagsMacro ) const;
void GenerateObjectFileTargets ( const Module& module, void GenerateObjectFileTargets ( const Module& module,
const std::vector<File*>& files, const std::vector<File*>& files,
const std::vector<If*>& ifs,
const std::string& cc, const std::string& cc,
const std::string& cflagsMacro, const std::string& cflagsMacro,
const std::string& nasmflagsMacro ) const; const std::string& nasmflagsMacro ) const;