diff --git a/reactos/tools/rbuild/backend/mingw/mingw.cpp b/reactos/tools/rbuild/backend/mingw/mingw.cpp index d5aefb831f3..55fca0dbb60 100644 --- a/reactos/tools/rbuild/backend/mingw/mingw.cpp +++ b/reactos/tools/rbuild/backend/mingw/mingw.cpp @@ -267,7 +267,8 @@ MingwBackend::CloseMakefile () const void MingwBackend::GenerateHeader () const { - fprintf ( fMakefile, "# THIS FILE IS AUTOMATICALLY GENERATED, EDIT 'ReactOS.rbuild' INSTEAD\n\n" ); + fprintf ( fMakefile, "# THIS FILE IS AUTOMATICALLY GENERATED, EDIT '%s' INSTEAD\n\n", + ProjectNode.GetProjectFilename ().c_str () ); } string diff --git a/reactos/tools/rbuild/project.cpp b/reactos/tools/rbuild/project.cpp index 79aca79fca5..a2b3c9daafe 100644 --- a/reactos/tools/rbuild/project.cpp +++ b/reactos/tools/rbuild/project.cpp @@ -80,6 +80,13 @@ Environment::GetCdOutputPath () "reactos" ); } +/* static */ string +Environment::GetAutomakeFile ( const std::string& defaultFile ) +{ + return GetEnvironmentVariablePathOrDefault ( "ROS_AUTOMAKE", + defaultFile ); +} + ParseContext::ParseContext () : ifData (NULL), compilationUnit (NULL) @@ -284,7 +291,7 @@ Project::ProcessXML ( const string& path ) att = node->GetAttribute ( "makefile", true ); assert(att); - makefile = att->value; + makefile = Environment::GetAutomakeFile ( att->value ); size_t i; for ( i = 0; i < node->subElements.size (); i++ ) @@ -465,7 +472,7 @@ Project::LocateModule ( const string& name ) const return NULL; } -std::string +const std::string& Project::GetProjectFilename () const { return xmlfile; diff --git a/reactos/tools/rbuild/rbuild.h b/reactos/tools/rbuild/rbuild.h index 8d68bedadee..932749f387a 100644 --- a/reactos/tools/rbuild/rbuild.h +++ b/reactos/tools/rbuild/rbuild.h @@ -157,6 +157,7 @@ public: static std::string GetOutputPath (); static std::string GetCdOutputPath (); static std::string GetInstallPath (); + static std::string GetAutomakeFile ( const std::string& defaultFile ); static std::string GetEnvironmentVariablePathOrDefault ( const std::string& name, const std::string& defaultValue ); }; @@ -224,7 +225,7 @@ public: void ProcessXML ( const std::string& path ); Module* LocateModule ( const std::string& name ); const Module* LocateModule ( const std::string& name ) const; - std::string GetProjectFilename () const; + const std::string& GetProjectFilename () const; std::string ResolveProperties ( const std::string& s ) const; private: std::string ResolveNextProperty ( std::string& s ) const;