265ae941eeec4706d8d8f8d7cebd4b2e8549ce4b
[hadrian.git] / src / Settings / TargetDirectory.hs
1 module Settings.TargetDirectory (
2 targetDirectory, targetPath, pkgHaddockFile
3 ) where
4
5 import Base
6 import Stage
7 import Package
8 import Settings.User
9
10 -- User can override the default target directory settings given below
11 targetDirectory :: Stage -> Package -> FilePath
12 targetDirectory = userTargetDirectory
13
14 -- Path to the target directory from GHC source root
15 targetPath :: Stage -> Package -> FilePath
16 targetPath stage pkg = pkgPath pkg -/- targetDirectory stage pkg
17
18 -- Relative path to a package haddock file, e.g.:
19 -- "libraries/array/dist-install/doc/html/array/array.haddock"
20 pkgHaddockFile :: Package -> FilePath
21 pkgHaddockFile pkg @ (Package name _) =
22 targetPath Stage1 pkg -/- "doc/html" -/- name -/- name <.> "haddock"