use ROS_TEMPORARY and ROS_INTERMEDIATE to allow builder to override locations for...
authorRoyce Mitchell III <royce3@ev1.net>
Sat, 8 Jan 2005 06:36:03 +0000 (06:36 +0000)
committerRoyce Mitchell III <royce3@ev1.net>
Sat, 8 Jan 2005 06:36:03 +0000 (06:36 +0000)
svn path=/branches/xmlbuildsystem/; revision=12882

reactos/tools/rbuild/backend/mingw/mingw.cpp
reactos/tools/rbuild/backend/mingw/mingw.h
reactos/tools/rbuild/backend/mingw/modulehandler.cpp
reactos/tools/rbuild/backend/mingw/modulehandler.h

index f206013..6ab999d 100644 (file)
@@ -78,7 +78,7 @@ MingwBackend::GenerateAllTarget ()
                Module& module = *ProjectNode.modules[i];\r
                fprintf ( fMakefile,\r
                          " %s",\r
-                         module.GetPath ().c_str () );\r
+                         FixupTargetFilename(module.GetPath ()).c_str () );\r
        }\r
        fprintf ( fMakefile, "\n\t\n\n" );\r
 }\r
@@ -105,3 +105,9 @@ MingwBackend::GetModuleHandlers ( MingwModuleHandlerList& moduleHandlers ) const
        moduleHandlers.push_back ( new MingwKernelModuleHandler ( fMakefile ) );\r
        moduleHandlers.push_back ( new MingwStaticLibraryModuleHandler ( fMakefile ) );\r
 }\r
+\r
+string\r
+FixupTargetFilename ( const string& targetFilename )\r
+{\r
+       return string("$(ROS_INTERMEDIATE)") + targetFilename;\r
+}\r
index 6483933..28a3acf 100644 (file)
@@ -40,4 +40,6 @@ private:
        FILE* fMakefile;\r
 };\r
 \r
+std::string FixupTargetFilename ( const std::string& targetFilename );\r
+\r
 #endif /* MINGW_H */\r
index d0832dd..87d0f3f 100644 (file)
@@ -33,7 +33,7 @@ MingwModuleHandler::ReplaceExtension ( const string& filename,
 string\r
 MingwModuleHandler::GetModuleArchiveFilename ( const Module& module ) const\r
 {\r
-       return ReplaceExtension ( module.GetPath ().c_str (),\r
+       return ReplaceExtension ( FixupTargetFilename(module.GetPath ()).c_str (),\r
                                  ".a" );\r
 }\r
 \r
@@ -50,7 +50,7 @@ MingwModuleHandler::GetImportLibraryDependencies ( const Module& module ) const
                        dependencies += " ";\r
                const Module* importedModule = module.project.LocateModule ( module.libraries[i]->name );\r
                assert ( importedModule != NULL );\r
-               dependencies += importedModule->GetPath ().c_str ();\r
+               dependencies += FixupTargetFilename(importedModule->GetPath ()).c_str ();\r
        }\r
        return dependencies;\r
 }\r
@@ -74,8 +74,9 @@ MingwModuleHandler::GetSourceFilenames ( const Module& module ) const
 string\r
 MingwModuleHandler::GetObjectFilename ( const string& sourceFilename ) const\r
 {\r
-       return ReplaceExtension ( sourceFilename,\r
-                                     ".o" );\r
+       return\r
+               FixupTargetFilename ( ReplaceExtension ( sourceFilename,\r
+                                                        ".o" ) );\r
 }\r
 \r
 string\r
@@ -242,39 +243,45 @@ MingwKernelModuleHandler::Process ( const Module& module )
 void\r
 MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module )\r
 {\r
+       static string ros_junk ( "$(ROS_TEMPORARY)" );\r
+       //static string ros_output ( "$(ROS_INTERMEDIATE)" );\r
+       string target ( FixupTargetFilename(module.GetPath()) );\r
        string workingDirectory = GetWorkingDirectory ( );\r
        string archiveFilename = GetModuleArchiveFilename ( module );\r
        string importLibraryDependencies = GetImportLibraryDependencies ( module );\r
+       string base_tmp = ros_junk + module.name + ".base.tmp";\r
+       string junk_tmp = ros_junk + module.name + ".junk.tmp";\r
+       string temp_exp = ros_junk + module.name + ".temp.exp";\r
        fprintf ( fMakefile, "%s: %s %s\n",\r
-                 module.GetPath ().c_str (),\r
+                 target.c_str (),\r
                  archiveFilename.c_str (),\r
                  importLibraryDependencies.c_str () );\r
        fprintf ( fMakefile,\r
-                 "\t${gcc} -Wl,--base-file,%s" SSEP "base.tmp -o %s" SSEP "junk.tmp %s %s\n",\r
-                 workingDirectory.c_str (),\r
-                 workingDirectory.c_str (),\r
+                 "\t${gcc} -Wl,--base-file,%s -o %s %s %s\n",\r
+                 base_tmp.c_str (),\r
+                 junk_tmp.c_str (),\r
                  archiveFilename.c_str (),\r
                  importLibraryDependencies.c_str () );\r
        fprintf ( fMakefile,\r
-                 "\t${rm} %s" SSEP "junk.tmp\n",\r
-                 workingDirectory.c_str () );\r
+                 "\t${rm} %s\n",\r
+                 junk_tmp.c_str () );\r
        fprintf ( fMakefile,\r
-                 "\t${dlltool} --dllname %s --base-file %s" SSEP "base.tmp --output-exp %s" SSEP "temp.exp --kill-at\n",\r
-                 module.GetPath ().c_str (),\r
-                 workingDirectory.c_str (),\r
-                 workingDirectory.c_str ());\r
+                 "\t${dlltool} --dllname %s --base-file %s --output-exp %s --kill-at\n",\r
+                 target.c_str (),\r
+                 base_tmp.c_str (),\r
+                 temp_exp.c_str ());\r
        fprintf ( fMakefile,\r
-                 "\t${rm} %s" SSEP "base.tmp\n",\r
-                 workingDirectory.c_str () );\r
+                 "\t${rm} %s\n",\r
+                 base_tmp.c_str () );\r
        fprintf ( fMakefile,\r
-                 "\t${ld} -Wl,%s" SSEP "temp.exp -o %s %s %s\n",\r
-                 workingDirectory.c_str (),\r
-                 module.GetPath ().c_str (),\r
+                 "\t${ld} -Wl,%s -o %s %s %s\n",\r
+                 temp_exp.c_str (),\r
+                 target.c_str (),\r
                  archiveFilename.c_str (),\r
                  importLibraryDependencies.c_str () );\r
        fprintf ( fMakefile,\r
-                 "\t${rm} %s" SSEP "temp.exp\n",\r
-                 workingDirectory.c_str () );\r
+                 "\t${rm} %s\n",\r
+                 temp_exp.c_str () );\r
        \r
        GenerateArchiveTarget ( module );\r
        GenerateObjectFileTargets ( module );\r
index a1a7096..9e1dccc 100644 (file)
@@ -16,6 +16,7 @@ protected:
        std::string GetModuleArchiveFilename ( const Module& module ) const;\r
        std::string GetImportLibraryDependencies ( const Module& module ) const;\r
        std::string GetSourceFilenames ( const Module& module ) const;\r
+\r
        std::string GetObjectFilename ( const std::string& sourceFilename ) const;\r
        std::string GetObjectFilenames ( const Module& module ) const;\r
        void GenerateObjectFileTargets ( const Module& module ) const;\r