Move need of inplaceLibCopyTargets to top-level (#388)
authorZhen Zhang <izgzhen@gmail.com>
Tue, 15 Aug 2017 12:34:32 +0000 (20:34 +0800)
committerAndrey Mokhov <andrey.mokhov@gmail.com>
Tue, 15 Aug 2017 12:34:32 +0000 (13:34 +0100)
src/Rules.hs
src/Rules/Program.hs

index d55a578..4077dc6 100644 (file)
@@ -24,7 +24,8 @@ import qualified Rules.Perl
 import qualified Rules.Program
 import qualified Rules.Register
 import Settings
-import Settings.Path
+import Settings.Path (inplaceLibCopyTargets, pkgLibraryFile,
+                      pkgSetupConfigFile, pkgHaddockFile)
 import Target
 import Utilities
 
@@ -41,10 +42,11 @@ topLevelTargets = action $ do
                  libs <- concatForM [Stage0, Stage1] $ \stage ->
                      concatForM libraryPackages $ packageTargets stage
                  prgs <- concatForM programsStage1Only $ packageTargets Stage0
-                 return $ libs ++ prgs
-             else
-                 concatForM allStages $ \stage ->
-                     concatForM (knownPackages \\ [rts, libffi]) $ packageTargets stage
+                 return $ libs ++ prgs ++ inplaceLibCopyTargets
+             else do
+                 targets <- concatForM allStages $ \stage ->
+                                concatForM (knownPackages \\ [rts, libffi]) $ packageTargets stage
+                 return $ targets ++ inplaceLibCopyTargets
 
 -- | Return the list of targets associated with a given 'Stage' and 'Package'.
 packageTargets :: Stage -> Package -> Action [FilePath]
index 6ca514f..edef17f 100644 (file)
@@ -11,7 +11,8 @@ import Oracles.PackageData
 import Oracles.Setting
 import Rules.Wrappers
 import Settings
-import Settings.Path
+import Settings.Path (buildPath, inplaceLibBinPath, rtsContext, objectPath,
+                      inplaceLibPath, inplaceBinPath)
 import Target
 import Utilities
 
@@ -26,8 +27,6 @@ buildProgram rs context@Context {..} = when (isProgram package) $ do
         context' <- programContext stage package
         buildBinaryAndWrapper rs context' bin
 
-    when (package == ghc) $ want inplaceLibCopyTargets
-
     -- Rules for programs built in install directories
     when (stage == Stage0 || package == ghc) $ do
         -- Some binaries in inplace/bin are wrapped