diff options
author | eldritch horrors <pennae@lix.systems> | 2024-03-04 06:12:19 +0100 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-03-04 07:11:25 +0100 |
commit | a089d8f5f6f96ea3f35790c36b6456e71f477879 (patch) | |
tree | ba290e853e076393ec9eaf1b075d294093c04cb0 /doc | |
parent | c208e918e55c423203692343b56d893dc7435095 (diff) |
Merge pull request #9465 from obsidiansystems/build-dir
Use `buildprefix` in a few more places
(cherry picked from commit b6a3fde6b7a416929553e6be36fc991680ddf9ef)
Change-Id: I2790663fa9f8242ac2db6582b7e421d2fdf42942
Diffstat (limited to 'doc')
-rw-r--r-- | doc/manual/src/contributing/hacking.md | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/manual/src/contributing/hacking.md b/doc/manual/src/contributing/hacking.md index dbe0c82cf..6bea6f727 100644 --- a/doc/manual/src/contributing/hacking.md +++ b/doc/manual/src/contributing/hacking.md @@ -146,6 +146,31 @@ $ nix build .#packages.aarch64-linux.default Cross-compiled builds are available for ARMv6 (`armv6l-linux`) and ARMv7 (`armv7l-linux`). Add more [system types](#system-type) to `crossSystems` in `flake.nix` to bootstrap Nix on unsupported platforms. +### Building for multiple platforms at once + +It is useful to perform multiple cross and native builds on the same source tree, +for example to ensure that better support for one platform doesn't break the build for another. +In order to facilitate this, Nix has some support for being built out of tree – that is, placing build artefacts in a different directory than the source code: + +1. Create a directory for the build, e.g. + + ```bash + mkdir build + ``` + +2. Run the configure script from that directory, e.g. + + ```bash + cd build + ../configure <configure flags> + ``` + +3. Run make from the source directory, but with the build directory specified, e.g. + + ```bash + make builddir=build <make flags> + ``` + ## System type Nix uses a string with he following format to identify the *system type* or *platform* it runs on: |