diff options
author | Seth R. Johnson <johnsonsr@ornl.gov> | 2021-05-22 14:47:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-22 18:47:43 +0000 |
commit | d8cbd37aaadf6c375ac071017d8af46221e421e0 (patch) | |
tree | 398ffc5f966141f0ac0ffc17af2418c1d0806953 /lib | |
parent | 4e6a6e4f2758bd616f0c2c2703160cbb9c539b63 (diff) | |
download | spack-d8cbd37aaadf6c375ac071017d8af46221e421e0.tar.gz spack-d8cbd37aaadf6c375ac071017d8af46221e421e0.tar.bz2 spack-d8cbd37aaadf6c375ac071017d8af46221e421e0.tar.xz spack-d8cbd37aaadf6c375ac071017d8af46221e421e0.zip |
Fix makefile filter suggestions (#23856)
Bash has a builtin `fc` that will override the compiler if you use "fc",
so it's better to use the full spack-supplied compiler path.
Additionally, the filter regex in the docs was wrong: it replaced the
entire assignment operation with the RHS.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/docs/build_systems/makefilepackage.rst | 6 | ||||
-rw-r--r-- | lib/spack/docs/packaging_guide.rst | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/spack/docs/build_systems/makefilepackage.rst b/lib/spack/docs/build_systems/makefilepackage.rst index f425855b69..e78c558a5a 100644 --- a/lib/spack/docs/build_systems/makefilepackage.rst +++ b/lib/spack/docs/build_systems/makefilepackage.rst @@ -147,8 +147,10 @@ and a ``filter_file`` method to help with this. For example: def edit(self, spec, prefix): makefile = FileFilter('Makefile') - makefile.filter('CC = gcc', 'CC = cc') - makefile.filter('CXX = g++', 'CC = c++') + makefile.filter(r'^\s*CC\s*=.*', 'CC = ' + spack_cc) + makefile.filter(r'^\s*CXX\s*=.*', 'CXX = ' + spack_cxx) + makefile.filter(r'^\s*F77\s*=.*', 'F77 = ' + spack_f77) + makefile.filter(r'^\s*FC\s*=.*', 'FC = ' + spack_fc) `stream <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/stream/package.py>`_ diff --git a/lib/spack/docs/packaging_guide.rst b/lib/spack/docs/packaging_guide.rst index 24666fc44a..5d00a64fac 100644 --- a/lib/spack/docs/packaging_guide.rst +++ b/lib/spack/docs/packaging_guide.rst @@ -4800,10 +4800,10 @@ Filtering functions .. code-block:: python - filter_file(r'^CC\s*=.*', spack_cc, 'Makefile') - filter_file(r'^CXX\s*=.*', spack_cxx, 'Makefile') - filter_file(r'^F77\s*=.*', spack_f77, 'Makefile') - filter_file(r'^FC\s*=.*', spack_fc, 'Makefile') + filter_file(r'^\s*CC\s*=.*', 'CC = ' + spack_cc, 'Makefile') + filter_file(r'^\s*CXX\s*=.*', 'CXX = ' + spack_cxx, 'Makefile') + filter_file(r'^\s*F77\s*=.*', 'F77 = ' + spack_f77, 'Makefile') + filter_file(r'^\s*FC\s*=.*', 'FC = ' + spack_fc, 'Makefile') #. Replacing ``#!/usr/bin/perl`` with ``#!/usr/bin/env perl`` in ``bib2xhtml``: |