Commit 7a85ccf5 authored by Zhen Zhang's avatar Zhen Zhang Committed by Andrey Mokhov

Implement install_docs (#442)

parent 4b60862b
......@@ -23,12 +23,16 @@ documentationRules = do
buildPdfDocumentation
buildDocumentationArchives
buildManPage
"//docs//gen_contents_index" %> copyFile "libraries/gen_contents_index"
"//docs//prologue.txt" %> copyFile "libraries/prologue.txt"
"docs" ~> do
root <- buildRoot
let html = htmlRoot -/- "index.html"
archives = map pathArchive docPaths
pdfs = map pathPdf $ docPaths \\ [ "libraries" ]
need $ map (root -/-) $ [html] ++ archives ++ pdfs
need [ root -/- htmlRoot -/- "libraries" -/- "gen_contents_index" ]
need [ root -/- htmlRoot -/- "libraries" -/- "prologue.txt" ]
need [manPagePath]
manPagePath :: FilePath
......
......@@ -45,6 +45,7 @@ installRules = do
installLibExecScripts
installBins
installPackages
installDocs
-- TODO: Get rid of hard-coded list.
-- | Binaries to install.
......@@ -311,3 +312,24 @@ installIncludes = do
(destDir ++ ghcheaderDir ++ "/")
where
installHeader = installData -- they share same arguments
-- ref: ghc.mk
-- | Install documentation to @prefix/share/doc/ghc-<version>@.
installDocs :: Action ()
installDocs = do
destDir <- getDestDir
docDir <- installDocDir
root <- buildRoot
installDirectory (destDir ++ docDir)
let usersGuide = root -/- "docs/pdfs/users_guide.pdf"
whenM (doesFileExist usersGuide) $
installData [usersGuide] (destDir ++ docDir)
let htmlDocDir = destDir ++ docDir -/- "html"
installDirectory htmlDocDir
installData ["docs/index.html"] htmlDocDir
forM_ ["Haddock", "libraries", "users_guide"] $ \dirname -> do
let dir = (root -/- "docs/html" -/- dirname)
whenM (doesDirectoryExist dir) $ copyDirectory dir htmlDocDir
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