Add support for non-library packages.
[hadrian.git] / src / Settings / TargetDirectory.hs
1 module Settings.TargetDirectory (
2 targetDirectory, targetPath, pkgHaddockFile
3 ) where
4
5 import Expression
6 import Settings.User
7
8 -- TODO: move to Settings.hs?
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"