removing *.o file so that C-xC-s surely works.
This commit is contained in:
parent
1e87b386a1
commit
34534e07ff
14
Check.hs
14
Check.hs
@ -16,11 +16,16 @@ import System.Process
|
|||||||
|
|
||||||
checkSyntax :: Options -> String -> IO String
|
checkSyntax :: Options -> String -> IO String
|
||||||
checkSyntax opt file = do
|
checkSyntax opt file = do
|
||||||
makeDirectory (outDir opt)
|
let outdir = outDir opt
|
||||||
|
outfile = outFile opt
|
||||||
|
objfile = objectFile outdir file
|
||||||
|
makeDirectory outdir
|
||||||
|
exist <- doesFileExist objfile
|
||||||
|
when exist $ removeFile objfile
|
||||||
#if __GLASGOW_HASKELL__ >= 611
|
#if __GLASGOW_HASKELL__ >= 611
|
||||||
(_,_,herr,_) <- runInteractiveProcess (ghc opt) ["--make","-Wall","-fno-warn-unused-do-bind",file,"-outputdir","dist/flymake","-o","dist/flymake/a.out","-i..","-i../..","-i../../..","-i../../../..","-i../../../../.."] Nothing Nothing
|
(_,_,herr,_) <- runInteractiveProcess (ghc opt) ["--make","-Wall","-fno-warn-unused-do-bind",file,"-outputdir",outdir,"-o",outfile,"-i..","-i../..","-i../../..","-i../../../..","-i../../../../.."] Nothing Nothing
|
||||||
#else
|
#else
|
||||||
(_,_,herr,_) <- runInteractiveProcess (ghc opt) ["--make","-Wall",file,"-outputdir","dist/flymake","-o","dist/flymake/a.out","-i..","-i../..","-i../../..","-i../../../..","-i../../../../.."] Nothing Nothing
|
(_,_,herr,_) <- runInteractiveProcess (ghc opt) ["--make","-Wall",file,"-outputdir",outdir,"-o",outfile,"-i..","-i../..","-i../../..","-i../../../..","-i../../../../.."] Nothing Nothing
|
||||||
#endif
|
#endif
|
||||||
hSetBinaryMode herr False
|
hSetBinaryMode herr False
|
||||||
refine <$> hGetContents herr
|
refine <$> hGetContents herr
|
||||||
@ -51,3 +56,6 @@ makeDirectory dir = makeDirectoryRecur $ normalise dir
|
|||||||
unless exist $ do
|
unless exist $ do
|
||||||
makeDirectoryRecur par
|
makeDirectoryRecur par
|
||||||
createDirectory cur
|
createDirectory cur
|
||||||
|
|
||||||
|
objectFile :: FilePath -> FilePath -> FilePath
|
||||||
|
objectFile dir hsfile = dir </> replaceExtension hsfile ".o"
|
||||||
|
@ -28,7 +28,8 @@ defaultOptions = Options { convert = toPlain
|
|||||||
, ghc = "ghc"
|
, ghc = "ghc"
|
||||||
, ghci = "ghci"
|
, ghci = "ghci"
|
||||||
, ghcPkg = "ghc-pkg"
|
, ghcPkg = "ghc-pkg"
|
||||||
, outDir = "dist/flymake"
|
, outDir = outputDir
|
||||||
|
, outFile = outputFile
|
||||||
}
|
}
|
||||||
|
|
||||||
argspec :: [OptDescr (Options -> Options)]
|
argspec :: [OptDescr (Options -> Options)]
|
||||||
|
19
Param.hs
19
Param.hs
@ -1,9 +1,16 @@
|
|||||||
module Param where
|
module Param where
|
||||||
|
|
||||||
data Options = Options { convert :: [String] -> String
|
data Options = Options {
|
||||||
, ghc :: FilePath
|
convert :: [String] -> String
|
||||||
, ghci :: FilePath
|
, ghc :: FilePath
|
||||||
, ghcPkg :: FilePath
|
, ghci :: FilePath
|
||||||
, outDir :: FilePath
|
, ghcPkg :: FilePath
|
||||||
}
|
, outDir :: FilePath
|
||||||
|
, outFile :: FilePath
|
||||||
|
}
|
||||||
|
|
||||||
|
outputDir :: String
|
||||||
|
outputDir = "dist/flymake"
|
||||||
|
|
||||||
|
outputFile :: String
|
||||||
|
outputFile = "dist/flymake/a.out"
|
||||||
|
Loading…
Reference in New Issue
Block a user