X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=libraries%2Fcabal-bin.hs;h=ed72a1e6e78cbcf3428a0643effd0c24480c45fa;hb=bbc583766a08678d03740354bed216e268306356;hp=1ecba50a3d768061d103e98316cb98043d6bac50;hpb=79b4f894215ae098c26cfe8fb7bc7f89008e8420;p=ghc-hetmet.git diff --git a/libraries/cabal-bin.hs b/libraries/cabal-bin.hs index 1ecba50..ed72a1e 100644 --- a/libraries/cabal-bin.hs +++ b/libraries/cabal-bin.hs @@ -1,6 +1,7 @@ module Main (main) where +import Control.Monad import Data.Maybe import Distribution.PackageDescription import Distribution.PackageDescription.Parse @@ -45,7 +46,14 @@ doit verbosity ghc packageConf args = do runSetup :: Verbosity -> FilePath -> FilePath -> [String] -> IO () runSetup verbosity ghc packageConf args = do - rawSystemExit verbosity ghc ["-package-conf", packageConf, - "--make", "Setup", "-o", "Setup"] + -- Don't bother building Setup if we are cleaning. If we need to + -- build Setup in order to build, and Setup isn't built already, + -- then there shouldn't be anything to clean anyway. + unless cleaning $ + rawSystemExit verbosity ghc ["-package-conf", packageConf, + "--make", "Setup", "-o", "Setup"] rawSystemExit verbosity "./Setup" args + where cleaning = case args of + "clean" : _ -> True + _ -> False