diff options
-rw-r--r-- | hadrian/README.md | 3 | ||||
-rw-r--r-- | hadrian/src/Rules/Clean.hs | 13 |
2 files changed, 13 insertions, 3 deletions
diff --git a/hadrian/README.md b/hadrian/README.md index d0ab7a274d..fcbe185a10 100644 --- a/hadrian/README.md +++ b/hadrian/README.md @@ -210,6 +210,9 @@ is close to zero (see [#197][test-issue]). * `build clean` removes all build artefacts. +* `build distclean` additionally remove the mingw tarballs and fs* files created + by configure. + * `build -B` forces Shake to rerun all rules, even if the previous build results are still up-to-date. diff --git a/hadrian/src/Rules/Clean.hs b/hadrian/src/Rules/Clean.hs index d57a7967aa..26a279d178 100644 --- a/hadrian/src/Rules/Clean.hs +++ b/hadrian/src/Rules/Clean.hs @@ -3,6 +3,13 @@ module Rules.Clean (clean, cleanSourceTree, cleanRules) where import qualified System.Directory as IO import Base +distclean :: Action () +distclean = do + putBuild "| Removing mingw tarballs..." + cleanMingwTarballs + cleanFsUtils + clean + clean :: Action () clean = do putBuild "| Removing Hadrian files..." @@ -17,8 +24,6 @@ cleanSourceTree = do path <- buildRoot forM_ [Stage0 ..] $ removeDirectory . (path -/-) . stageString removeDirectory "sdistprep" - cleanFsUtils - cleanMingwTarballs cleanMingwTarballs :: Action () cleanMingwTarballs = do @@ -36,4 +41,6 @@ cleanFsUtils = do liftIO $ forM_ dirs (flip removeFiles ["fs.*"]) cleanRules :: Rules () -cleanRules = "clean" ~> clean +cleanRules = do + "clean" ~> clean + "distclean" ~> distclean |