summaryrefslogtreecommitdiff
path: root/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Main.hs b/Main.hs
index b696241..463a33b 100644
--- a/Main.hs
+++ b/Main.hs
@@ -88,6 +88,14 @@ doBuild (BuildOptions mtarget) = do
old <- targetCheckOld rootdir tg
when old $ targetBuild rootdir tg
+doRebuild :: BuildOptions -> IO ()
+doRebuild (BuildOptions mtarget) = do
+ (rootdir, targets, targetsForName) <- readCachedTargets (const True)
+ toBuild <- maybe (return targets) (targetsToBuild targetsForName) mtarget
+ forM_ toBuild $ useAnyTarget $ \tg -> do
+ targetRemoveBuildArtifacts rootdir tg
+ targetBuild rootdir tg
+
doRun :: RunOptions -> IO ()
doRun (RunOptions mtarget args) = do
(rootdir, targets, targetsForName) <- readCachedTargets (isJust . useAnyTarget targetExecute)
@@ -110,4 +118,5 @@ main = do
Configure -> doConfigure
Clean -> doClean
Build opts -> doBuild opts
+ Rebuild opts -> doRebuild opts
Run opts -> doRun opts