Let dependencies control 'make install'
[reactos.git] / reactos / tools / rbuild / backend / mingw / mingw.cpp
index 59f0da1..b8d43ce 100644 (file)
@@ -656,7 +656,9 @@ MingwBackend::GetInstallFiles (
 }\r
 \r
 void\r
-MingwBackend::OutputInstallfileCopyCommands ( const string& installDirectory )\r
+MingwBackend::GetNonModuleInstallTargetFiles (\r
+       string installDirectory,\r
+       vector<string>& out ) const\r
 {\r
        for ( size_t i = 0; i < ProjectNode.installfiles.size (); i++ )\r
        {\r
@@ -665,6 +667,37 @@ MingwBackend::OutputInstallfileCopyCommands ( const string& installDirectory )
                string targetFilename = MingwModuleHandler::PassThruCacheDirectory (\r
                        FixupTargetFilename ( targetFilenameNoFixup ),\r
                        true );\r
+               out.push_back ( targetFilename );\r
+       }\r
+}\r
+\r
+void\r
+MingwBackend::GetInstallTargetFiles (\r
+       string installDirectory,\r
+       vector<string>& out ) const\r
+{\r
+       GetNonModuleInstallTargetFiles ( installDirectory,\r
+                                        out );\r
+}\r
+\r
+void\r
+MingwBackend::OutputInstallfileTargets ( const string& installDirectory )\r
+{\r
+       for ( size_t i = 0; i < ProjectNode.installfiles.size (); i++ )\r
+       {\r
+               const InstallFile& installfile = *ProjectNode.installfiles[i];\r
+               string targetFilenameNoFixup = installDirectory + SSEP + installfile.base + SSEP + installfile.newname;\r
+               string targetFilename = MingwModuleHandler::PassThruCacheDirectory (\r
+                       FixupTargetFilename ( targetFilenameNoFixup ),\r
+                       true );\r
+               string targetDirectory = MingwModuleHandler::PassThruCacheDirectory (\r
+                       FixupTargetFilename ( installDirectory + SSEP + installfile.base ),\r
+                       true );\r
+               fprintf ( fMakefile,\r
+                         "%s: %s %s\n",\r
+                         targetFilename.c_str (),\r
+                         installfile.GetPath ().c_str (),\r
+                         targetDirectory.c_str () );\r
                fprintf ( fMakefile,\r
                          "\t$(ECHO_CP)\n" );\r
                fprintf ( fMakefile,\r
@@ -679,19 +712,18 @@ MingwBackend::GenerateInstallTarget ()
 {\r
        string installDirectoryNoFixup = "reactos";\r
        string installDirectory = MingwModuleHandler::PassThruCacheDirectory (\r
-               FixupTargetFilename ( installDirectoryNoFixup ),\r
+               NormalizeFilename ( installDirectoryNoFixup ),\r
                true );\r
-       string installDirectories = GetInstallDirectories ( installDirectoryNoFixup );\r
-       vector<string> vInstallFiles;\r
-       GetInstallFiles ( vInstallFiles );\r
-       string installFiles = v2s ( vInstallFiles, 5 );\r
+       vector<string> vInstallTargetFiles;\r
+       GetInstallTargetFiles ( installDirectoryNoFixup,\r
+                               vInstallTargetFiles );\r
+       string installTargetFiles = v2s ( vInstallTargetFiles, 5 );\r
 \r
        fprintf ( fMakefile,\r
-                 "install: all %s %s %s\n",\r
+                 "install: %s %s\n",\r
                  installDirectory.c_str (),\r
-                 installDirectories.c_str (),\r
-                 installFiles.c_str () );\r
-       OutputInstallfileCopyCommands ( installDirectoryNoFixup );\r
+                 installTargetFiles.c_str () );\r
+       OutputInstallfileTargets ( installDirectoryNoFixup );\r
        fprintf ( fMakefile,\r
                  "\n" );\r
 }\r