From 5919bd0799b176e194ad7c0f28f65aa34a6a6237 Mon Sep 17 00:00:00 2001 From: Loris Ercole <30901257+lorisercole@users.noreply.github.com> Date: Tue, 9 Jan 2024 16:44:21 +0100 Subject: Improve "makefile" build system documentation (#41781) Shows how to modify environment variables using "setup_build_environment" instead of overriding "edit" --- lib/spack/docs/build_systems/makefilepackage.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/spack/docs/build_systems/makefilepackage.rst b/lib/spack/docs/build_systems/makefilepackage.rst index 2555ac163a..c6d6300ccc 100644 --- a/lib/spack/docs/build_systems/makefilepackage.rst +++ b/lib/spack/docs/build_systems/makefilepackage.rst @@ -88,13 +88,13 @@ command-line. However, Makefiles that use ``?=`` for assignment honor environment variables. Since Spack already sets ``CC``, ``CXX``, ``F77``, and ``FC``, you won't need to worry about setting these variables. If there are any other variables you need to set, you can do this in the -``edit`` method: +``setup_build_environment`` method: .. code-block:: python - def edit(self, spec, prefix): - env["PREFIX"] = prefix - env["BLASLIB"] = spec["blas"].libs.ld_flags + def setup_build_environment(self, env): + env.set("PREFIX", prefix) + env.set("BLASLIB", spec["blas"].libs.ld_flags) `cbench `_ @@ -140,7 +140,7 @@ Edit Makefile Some Makefiles are just plain stubborn and will ignore command-line variables. The only way to ensure that these packages build correctly is to directly edit the Makefile. Spack provides a ``FileFilter`` class -and a ``filter_file`` method to help with this. For example: +and a ``filter`` method to help with this. For example: .. code-block:: python -- cgit v1.2.3-70-g09d2