Add <module>_install target

svn path=/branches/xmlbuildsystem/; revision=15047
This commit is contained in:
Casper Hornstrup 2005-05-06 16:05:37 +00:00
parent 7dec8061f1
commit e5c1f57b80
3 changed files with 23 additions and 0 deletions

View file

@ -283,6 +283,7 @@ MingwBackend::ProcessModules ()
h.Process ();
h.GenerateInvocations ();
h.GenerateCleanTarget ();
h.GenerateInstallTarget ();
delete v[i];
}

View file

@ -440,6 +440,27 @@ MingwModuleHandler::GenerateCleanTarget () const
fprintf ( fMakefile, "clean: %s_clean\n\n", module.name.c_str() );
}
void
MingwModuleHandler::GenerateInstallTarget () const
{
if ( module.installName.length () == 0 )
return;
fprintf ( fMakefile, ".PHONY: %s_install\n", module.name.c_str() );
fprintf ( fMakefile, "%s_install:\n", module.name.c_str() );
string sourceFilename = MingwModuleHandler::PassThruCacheDirectory (
NormalizeFilename ( module.GetPath () ),
backend->outputDirectory );
string normalizedTargetFilename = MingwModuleHandler::PassThruCacheDirectory (
NormalizeFilename ( module.installBase + SSEP + module.installName ),
backend->installDirectory );
fprintf ( fMakefile,
"\t$(ECHO_CP)\n" );
fprintf ( fMakefile,
"\t${cp} %s %s 1>$(NUL)\n",
sourceFilename.c_str (),
normalizedTargetFilename.c_str () );
}
string
MingwModuleHandler::GetObjectFilenames ()
{

View file

@ -54,6 +54,7 @@ public:
virtual std::string TypeSpecificLinkerFlags() { return ""; }
void GenerateInvocations () const;
void GenerateCleanTarget () const;
void GenerateInstallTarget () const;
static bool ReferenceObjects ( const Module& module );
protected:
std::string GetWorkingDirectory () const;