mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-17 04:43:47 -07:00
only check xmonad.hs against the xmonad binary, not the .o file (meaning you can remove it if you like)
This commit is contained in:
@@ -297,16 +297,18 @@ restart mprog resume = do
|
|||||||
-- The -i flag is used to restrict recompilation to the xmonad.hs file.
|
-- The -i flag is used to restrict recompilation to the xmonad.hs file.
|
||||||
-- Raises an exception if GHC can't be found, or if anything else goes wrong.
|
-- Raises an exception if GHC can't be found, or if anything else goes wrong.
|
||||||
--
|
--
|
||||||
|
-- The file is only recompiled if it is newer than its binary.
|
||||||
|
--
|
||||||
recompile :: IO ()
|
recompile :: IO ()
|
||||||
recompile = do
|
recompile = do
|
||||||
dir <- liftM (++ "/.xmonad") getHomeDirectory
|
dir <- liftM (++ "/.xmonad") getHomeDirectory
|
||||||
let src = dir ++ "/" ++ "xmonad.hs"
|
let bin = dir ++ "/" ++ "xmonad"
|
||||||
obj = dir ++ "/" ++ "xmonad.o"
|
src = bin ++ ".hs"
|
||||||
yes <- doesFileExist src
|
yes <- doesFileExist src
|
||||||
when yes $ do
|
when yes $ do
|
||||||
srcT <- getModificationTime src
|
srcT <- getModificationTime src
|
||||||
objT <- getModificationTime obj
|
binT <- getModificationTime bin
|
||||||
when (srcT > objT) $ do
|
when (srcT > binT) $ do
|
||||||
waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i"] (Just dir)
|
waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i"] (Just dir)
|
||||||
Nothing Nothing Nothing Nothing
|
Nothing Nothing Nothing Nothing
|
||||||
return ()
|
return ()
|
||||||
|
Reference in New Issue
Block a user