summaryrefslogtreecommitdiff
path: root/hadrian/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'hadrian/README.md')
-rw-r--r--hadrian/README.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/hadrian/README.md b/hadrian/README.md
index b88d08dd47..7bd5fa8a34 100644
--- a/hadrian/README.md
+++ b/hadrian/README.md
@@ -110,6 +110,36 @@ by Shake oracles.
The Make-based build system uses `mk/build.mk` to specify user build settings. We
use `hadrian/UserSettings.hs` for the same purpose, see [documentation](doc/user-settings.md).
+#### Building libraries and executables
+
+You can build a specific library or executable for a given stage by doing
+`build stage<N>:<lib|exe>:<package name>`. Examples:
+
+``` sh
+# build the stage 1 GHC compiler (the executable), the binary will be placed
+# under _build/stage0/bin/ghc (because it is built by the stage0 compiler).
+build stage1:exe:ghc-bin
+
+# build the stage 2 GHC compiler, the binary will be placed under
+# _build/stage1/bin/ghc (because it is built by the stage1 compiler).
+build stage2:exe:ghc-bin
+
+# build the ghc library with the boot compiler, and register it
+# in the package database under _build/stage0/lib.
+build stage0:lib:ghc
+
+# build the Cabal library with the stage 1 compiler and register it
+# in the package database under _build/stage1/lib.
+
+# build the text library with the stage 2 compiler and register it
+# in the package database under _build/stage2/lib.
+build stage2:lib:text
+
+# build the stage 2 haddock executable and place the program under
+# _build/stage1/haddock.
+build stage2:exe:haddock
+```
+
#### Clean and full rebuild
* `build clean` removes all build artefacts.