mirror of
https://github.com/reactos/reactos.git
synced 2024-06-28 00:41:36 +00:00
make_msvcX_install_[config] patch by Brezenbak
(i.e. make_msvc71_install_speed) svn path=/trunk/; revision=20785
This commit is contained in:
parent
cf64f6d550
commit
3802b8636c
|
@ -396,22 +396,22 @@ msvc8: $(RBUILD_TARGET)
|
|||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs8.00 msvc
|
||||
|
||||
.PHONY: msvc6
|
||||
.PHONY: msvc6_clean
|
||||
msvc6_clean: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs6.00 msvc
|
||||
|
||||
.PHONY: msvc7
|
||||
.PHONY: msvc7_clean
|
||||
msvc7_clean: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs7.00 msvc
|
||||
|
||||
.PHONY: msvc71
|
||||
.PHONY: msvc71_clean
|
||||
msvc71_clean: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs7.10 msvc
|
||||
|
||||
.PHONY: msvc8
|
||||
.PHONY: msvc8_clean
|
||||
msvc8_clean: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs8.00 msvc
|
||||
|
@ -429,6 +429,52 @@ msvc_clean_all: $(RBUILD_TARGET)
|
|||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs7.10 msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs8.10 msvc
|
||||
|
||||
.PHONY: msvc7_install_debug
|
||||
msvc7_install_debug: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.00 -vcdebug msvc
|
||||
|
||||
.PHONY: msvc7_install_release
|
||||
msvc7_install_release: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.00 -vcrelease msvc
|
||||
|
||||
.PHONY: msvc7_install_speed
|
||||
msvc7_install_speed: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.00 -vcspeed msvc
|
||||
|
||||
.PHONY: msvc71_install_debug
|
||||
msvc71_install_debug: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.10 -vcdebug msvc
|
||||
|
||||
.PHONY: msvc71_install_release
|
||||
msvc71_install_release: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.10 -vcrelease msvc
|
||||
|
||||
|
||||
.PHONY: msvc71_install_speed
|
||||
msvc71_install_speed: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.10 -vcspeed msvc
|
||||
|
||||
.PHONY: msvc8_install_debug
|
||||
msvc8_install_debug: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs8.00 -vcdebug msvc
|
||||
|
||||
.PHONY: msvc8_install_release
|
||||
msvc8_install_release: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs8.00 -vcrelease msvc
|
||||
|
||||
.PHONY: msvc8_install_speed
|
||||
msvc8_install_speed: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs8.00 -vcspeed msvc
|
||||
|
||||
.PHONY: makefile_auto_clean
|
||||
makefile_auto_clean:
|
||||
-@$(rm) $(ROS_AUTOMAKE) $(PREAUTO) 2>$(NUL)
|
||||
|
|
|
@ -60,7 +60,10 @@ void MSVCBackend::Process()
|
|||
_clean_project_files();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( configuration.InstallFiles ) {
|
||||
_install_files( _get_vc_dir(), configuration.VSConfigurationType );
|
||||
return;
|
||||
}
|
||||
string filename_sln ( ProjectNode.name );
|
||||
//string filename_rules = "gccasm.rules";
|
||||
|
||||
|
@ -374,3 +377,42 @@ MSVCBackend::_clean_project_files ( void )
|
|||
remove ( filename_dsw.c_str () );
|
||||
}
|
||||
|
||||
bool
|
||||
MSVCBackend::_copy_file ( const std::string& inputname, const std::string& targetname ) const
|
||||
{
|
||||
FILE * input = fopen ( inputname.c_str (), "rb" );
|
||||
if ( !input )
|
||||
return false;
|
||||
|
||||
FILE * output = fopen ( targetname.c_str (), "wb+" );
|
||||
if ( !output )
|
||||
{
|
||||
fclose ( input );
|
||||
return false;
|
||||
}
|
||||
|
||||
char buffer[256];
|
||||
int num_read;
|
||||
while ( (num_read = fread( buffer, sizeof(char), 256, input) ) || !feof( input ) )
|
||||
fwrite( buffer, sizeof(char), num_read, output );
|
||||
|
||||
fclose ( input );
|
||||
fclose ( output );
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
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 == "" )
|
||||
continue;
|
||||
|
||||
string inputname = Environment::GetOutputPath () + "\\" + module.GetBasePath () + "\\" + vcdir + "\\" + config + "\\" + module.GetTargetName ();
|
||||
string installdir = Environment::GetInstallPath () + "\\" + module.installBase + "\\" + module.installName;
|
||||
if ( _copy_file( inputname, installdir ) )
|
||||
printf ("Installed File :'%s'\n",installdir.c_str () );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,6 +114,8 @@ class MSVCBackend : public Backend
|
|||
std::string vcproj_guid );
|
||||
void _clean_project_files ( void );
|
||||
void _get_object_files ( const Module& module, std::vector<std::string>& out ) const;
|
||||
void _install_files ( const std::string& vcdir, const std::string& config );
|
||||
bool _copy_file ( const std::string& inputname, const std::string& targetname ) const;
|
||||
};
|
||||
|
||||
#endif // __MSVC_H__
|
||||
|
|
|
@ -145,11 +145,10 @@ MSVCBackend::_generate_vcproj ( const Module& module )
|
|||
// this code is deactivated untill the tree builds fine with msvc
|
||||
// --- is appended to each library path which is later
|
||||
// replaced by the configuration
|
||||
// i.e. ../output-i386/lib/rtl/---/rtl.lib becomes
|
||||
// ../output-i386/lib/rtl/Debug/rtl.lib
|
||||
// i.e. ../output-i386/lib/rtl/vcXX/---/rtl.lib becomes
|
||||
// ../output-i386/lib/rtl/vcXX/Debug/rtl.lib
|
||||
// etc
|
||||
libs[i]->importedModule->
|
||||
string libpath = outdir + "\\" + libs[i]->importedModule->GetBasePath() + "\\---\\" + libs[i]->name + ".lib";
|
||||
string libpath = outdir + "\\" + libs[i]->importedModule->GetBasePath() + "\\" + _get_vc_dir() + "\\---\\" + libs[i]->name + ".lib";
|
||||
libraries.push_back ( libpath );
|
||||
#else
|
||||
libraries.push_back ( libs[i]->name + ".lib" );
|
||||
|
|
|
@ -29,6 +29,7 @@ Configuration::Configuration ()
|
|||
CompilationUnitsEnabled = true;
|
||||
MakeHandlesInstallDirectories = false;
|
||||
GenerateProxyMakefilesInSourceTree = false;
|
||||
InstallFiles = false;
|
||||
}
|
||||
|
||||
Configuration::~Configuration ()
|
||||
|
|
|
@ -298,6 +298,12 @@ Project::ProcessXML ( const string& path )
|
|||
(property->value == non_if_data.ifs[i]->value);
|
||||
if ( conditionTrue )
|
||||
non_if_data.ifs[i]->data.ExtractModules( modules );
|
||||
else
|
||||
{
|
||||
If * if_data = non_if_data.ifs[i];
|
||||
non_if_data.ifs.erase ( non_if_data.ifs.begin () + i );
|
||||
delete if_data;
|
||||
}
|
||||
}
|
||||
for ( i = 0; i < linkerFlags.size (); i++ )
|
||||
linkerFlags[i]->ProcessXML ();
|
||||
|
|
|
@ -106,6 +106,10 @@ ParseVCProjectSwitch (
|
|||
if (configuration.VSProjectVersion.length() == 3) //7.1
|
||||
configuration.VSProjectVersion.append("0");
|
||||
|
||||
break;
|
||||
case 'c':
|
||||
configuration.VSConfigurationType = string (&switchStart[3]);
|
||||
configuration.InstallFiles = true;
|
||||
break;
|
||||
default:
|
||||
printf ( "Unknown switch -d%c\n",
|
||||
|
@ -155,7 +159,7 @@ ParseSwitch ( int argc, char** argv, int index )
|
|||
switch ( switchChar )
|
||||
{
|
||||
case 'v':
|
||||
if (switchChar2 == 's')
|
||||
if (switchChar2 == 's' || switchChar2 == 'c' )
|
||||
{
|
||||
return ParseVCProjectSwitch (
|
||||
switchChar2,
|
||||
|
|
|
@ -141,8 +141,10 @@ public:
|
|||
bool CompilationUnitsEnabled;
|
||||
std::string CheckDependenciesForModuleOnlyModule;
|
||||
std::string VSProjectVersion;
|
||||
std::string VSConfigurationType;
|
||||
bool MakeHandlesInstallDirectories;
|
||||
bool GenerateProxyMakefilesInSourceTree;
|
||||
bool InstallFiles;
|
||||
};
|
||||
|
||||
class Environment
|
||||
|
|
Loading…
Reference in a new issue