Commit de4f7bcc authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Move gmp library instead of copying it. Add moveFile.

See #163.
parent 0b6c0aa0
module Rules.Actions (
build, buildWithResources, buildWithCmdOptions, copyFile, createDirectory,
removeDirectory, copyDirectory, moveDirectory, applyPatch, fixFile, runMake,
runMakeVerbose, renderLibrary, renderProgram, runBuilder, makeExecutable
build, buildWithResources, buildWithCmdOptions, copyFile, moveFile,
createDirectory, removeDirectory, copyDirectory, moveDirectory,
applyPatch, fixFile, runMake, runMakeVerbose, renderLibrary, renderProgram,
runBuilder, makeExecutable
) where
import qualified System.Directory as IO
......@@ -87,6 +88,12 @@ copyFile source target = do
putProgressInfo $ renderAction "Copy file" source target
copyFileChanged source target
-- Note, moveFile cannot track the source, because it is moved.
moveFile :: FilePath -> FilePath -> Action ()
moveFile source target = do
putProgressInfo $ renderAction "Move file" source target
liftIO $ IO.renameFile source target
createDirectory :: FilePath -> Action ()
createDirectory dir = do
putBuild $ "| Create directory " ++ dir
......
......@@ -103,8 +103,7 @@ gmpRules = do
copyFile (libPath -/- "gmp.h") gmpLibraryInTreeH
copyFile (libPath -/- "gmp.h") gmpLibraryH
-- TODO: why copy library, can we move it instead?
copyFile (libPath -/- ".libs/libgmp.a") gmpLibrary
moveFile (libPath -/- ".libs/libgmp.a") gmpLibrary
createDirectory gmpObjects
build $ Target gmpContext Ar [gmpLibrary] [gmpObjects]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment