From f134dbdffb81cea72a2e4abfb9a13904417b82aa Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Wed, 17 Jan 2024 04:23:16 +0100 Subject: [PATCH 1/3] move section on make variables it should be after the general build instructions, as it goes into more detail. --- doc/manual/src/contributing/hacking.md | 42 +++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/doc/manual/src/contributing/hacking.md b/doc/manual/src/contributing/hacking.md index 0fa59e891..fbdc7b7f7 100644 --- a/doc/manual/src/contributing/hacking.md +++ b/doc/manual/src/contributing/hacking.md @@ -67,27 +67,6 @@ $ nix build You can also build Nix for one of the [supported platforms](#platforms). -## Makefile variables - -You may need `profiledir=$out/etc/profile.d` and `sysconfdir=$out/etc` to run -`make install`. - -You may want to set `MAKEFLAGS="-e -j $NIX_BUILD_CORES"` to allow environment -variables to override `Makefile` variables. - -- `ENABLE_BUILD=yes` to enable building the C++ code. -- `ENABLE_DOC_GEN=yes` to enable building the documentation (manual, man pages, etc.). - - The docs can take a while to build, so you may want to disable this for local development. -- `ENABLE_FUNCTIONAL_TESTS=yes` to enable building the functional tests. -- `ENABLE_UNIT_TESTS=yes` to enable building the unit tests. -- `OPTIMIZE=1` to enable optimizations. -- `libraries=libutil programs=` to only build a specific library (this will - fail in the linking phase if you don't have the other libraries built, but is - useful for checking types). -- `libraries= programs=nix` to only build a specific program (this will not, in - general, work, because the programs need the libraries). - ## Building Nix To build all dependencies and start a shell in which all environment variables are set up so that those dependencies can be found: @@ -132,6 +111,27 @@ $ nix-build You can also build Nix for one of the [supported platforms](#platforms). +## Makefile variables + +You may need `profiledir=$out/etc/profile.d` and `sysconfdir=$out/etc` to run +`make install`. + +You may want to set `MAKEFLAGS="-e -j $NIX_BUILD_CORES"` to allow environment +variables to override `Makefile` variables. + +- `ENABLE_BUILD=yes` to enable building the C++ code. +- `ENABLE_DOC_GEN=yes` to enable building the documentation (manual, man pages, etc.). + + The docs can take a while to build, so you may want to disable this for local development. +- `ENABLE_FUNCTIONAL_TESTS=yes` to enable building the functional tests. +- `ENABLE_UNIT_TESTS=yes` to enable building the unit tests. +- `OPTIMIZE=1` to enable optimizations. +- `libraries=libutil programs=` to only build a specific library (this will + fail in the linking phase if you don't have the other libraries built, but is + useful for checking types). +- `libraries= programs=nix` to only build a specific program (this will not, in + general, work, because the programs need the libraries). + ## Platforms Nix can be built for various platforms, as specified in [`flake.nix`]: From 28eb406834ed176d84e22898ccbcf4ecb963416c Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Wed, 17 Jan 2024 04:39:26 +0100 Subject: [PATCH 2/3] reword section on make variables - use one line per sentence - use imperative for instructions - add link to Make documentation --- doc/manual/src/contributing/hacking.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/doc/manual/src/contributing/hacking.md b/doc/manual/src/contributing/hacking.md index fbdc7b7f7..fe91787a3 100644 --- a/doc/manual/src/contributing/hacking.md +++ b/doc/manual/src/contributing/hacking.md @@ -113,11 +113,9 @@ You can also build Nix for one of the [supported platforms](#platforms). ## Makefile variables -You may need `profiledir=$out/etc/profile.d` and `sysconfdir=$out/etc` to run -`make install`. +You may need `profiledir=$out/etc/profile.d` and `sysconfdir=$out/etc` to run `make install`. -You may want to set `MAKEFLAGS="-e -j $NIX_BUILD_CORES"` to allow environment -variables to override `Makefile` variables. +Run `make` with [`--environment-overrides`](https://www.gnu.org/software/make/manual/make.html#index-_002de) to allow environment variables to override `Makefile` variables: - `ENABLE_BUILD=yes` to enable building the C++ code. - `ENABLE_DOC_GEN=yes` to enable building the documentation (manual, man pages, etc.). @@ -126,11 +124,12 @@ variables to override `Makefile` variables. - `ENABLE_FUNCTIONAL_TESTS=yes` to enable building the functional tests. - `ENABLE_UNIT_TESTS=yes` to enable building the unit tests. - `OPTIMIZE=1` to enable optimizations. -- `libraries=libutil programs=` to only build a specific library (this will - fail in the linking phase if you don't have the other libraries built, but is - useful for checking types). -- `libraries= programs=nix` to only build a specific program (this will not, in - general, work, because the programs need the libraries). +- `libraries=libutil programs=` to only build a specific library. + + This will fail in the linking phase if the other libraries haven't been built, but is useful for checking types. +- `libraries= programs=nix` to only build a specific program. + + This will not work in general, because the programs need the libraries. ## Platforms From 14f470ec4e9d481698b97ea2dae101693fbaca95 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Fri, 19 Jan 2024 00:32:30 +0100 Subject: [PATCH 3/3] doc/hacking.md: Hint short option `make -e` Co-authored-by: Valentin Gagarin --- doc/manual/src/contributing/hacking.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual/src/contributing/hacking.md b/doc/manual/src/contributing/hacking.md index fe91787a3..9a7623dc9 100644 --- a/doc/manual/src/contributing/hacking.md +++ b/doc/manual/src/contributing/hacking.md @@ -115,7 +115,7 @@ You can also build Nix for one of the [supported platforms](#platforms). You may need `profiledir=$out/etc/profile.d` and `sysconfdir=$out/etc` to run `make install`. -Run `make` with [`--environment-overrides`](https://www.gnu.org/software/make/manual/make.html#index-_002de) to allow environment variables to override `Makefile` variables: +Run `make` with [`-e` / `--environment-overrides`](https://www.gnu.org/software/make/manual/make.html#index-_002de) to allow environment variables to override `Makefile` variables: - `ENABLE_BUILD=yes` to enable building the C++ code. - `ENABLE_DOC_GEN=yes` to enable building the documentation (manual, man pages, etc.).