Skip to content

Commit 58c9b37

Browse files
committed
Enable Makefile.manual to use environmental variables for FC, FFLAGS, FYPP, and document their use in README
1 parent cbc8dd6 commit 58c9b37

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Makefile.manual

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Fortran stdlib Makefile
22

3-
FC = gfortran
4-
FFLAGS = -Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all
5-
FYPPFLAGS=
3+
FC ?= gfortran
4+
FFLAGS ?= -Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all
5+
FYPPFLAGS ?=
66

77
export FC
88
export FFLAGS

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ You can limit the maximum rank by setting ``-DMAXRANK=<num>`` in the ``FYPPFLAGS
182182
make -f Makefile.manual FYPPFLAGS=-DMAXRANK=4
183183
```
184184

185-
You can edit the compiler and its optimization flags by specifying the `FC` and `FFLAGS` variables in Makefile.manual. The default `FFLAGS` does not include any optimization, and you may want to add `-O3 -flto` to its definition.
185+
You can also specify the compiler and compiler-flags by setting the ``FC`` and ``FFLAGS`` environmental variables. Among other things, this facilitates use of compiler optimizations that are not specified in the Makefile.manual defaults.
186+
```sh
187+
make -f Makefile.manual FYPPFLAGS=-DMAXRANK=4 FC=gfortran FFLAGS="-O3 -flto"
188+
```
186189

187190
### Build with [fortran-lang/fpm](https://github.com/fortran-lang/fpm)
188191

0 commit comments

Comments
 (0)