X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fhpc%2FHpcMarkup.hs;h=001ec295543a1e96c7fbdb0a3644db5166636a74;hb=a966047ca5c407f336a633d716d3d7b5ed29d231;hp=53eaf323e8e07340c90823d5cbe4affbc88acd93;hpb=11d36d9f0256a3a3ef2934a776924f7c90afb6de;p=ghc-hetmet.git diff --git a/utils/hpc/HpcMarkup.hs b/utils/hpc/HpcMarkup.hs index 53eaf32..001ec29 100644 --- a/utils/hpc/HpcMarkup.hs +++ b/utils/hpc/HpcMarkup.hs @@ -12,17 +12,20 @@ import Trace.Hpc.Util import HpcFlags import System.Environment +import System.Directory import Data.List import Data.Maybe(fromJust) import Data.Array -import qualified Data.Set as Set +import qualified HpcSet as Set ------------------------------------------------------------------------------ markup_options = [ excludeOpt,includeOpt,hpcDirOpt,hsDirOpt,funTotalsOpt , altHighlightOpt +#if __GLASGOW_HASKELL__ >= 604 , destDirOpt +#endif ] markup_plugin = Plugin { name = "markup" @@ -55,6 +58,11 @@ markup_main flags (prog:modNames) = do Nothing -> error $ "unable to find tix file for: " ++ prog Just a -> return a +#if __GLASGOW_HASKELL__ >= 604 + -- create the dest_dir if needed + createDirectoryIfMissing True dest_dir +#endif + mods <- sequence [ genHtmlFromMod dest_dir hpcDirs tix theFunTotals theHsPath invertOutput | tix <- tixs @@ -68,6 +76,9 @@ markup_main flags (prog:modNames) = do let writeSummary name cmp = do let mods' = sortBy cmp mods + + + putStrLn $ "Writing: " ++ (name ++ ".html") writeFile (dest_dir ++ "/" ++ name ++ ".html") $ @@ -75,6 +86,7 @@ markup_main flags (prog:modNames) = do "