Skip to content

Commit 100f760

Browse files
authored
Merge pull request #591 from fiolj/correct-makefile
Fix compilation errors with makefiles due to command-line variable assignments
2 parents 26b6f58 + 8fcebc8 commit 100f760

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
make -f Makefile.manual test
100100
make -f Makefile.manual clean
101101
env:
102-
FYPPFLAGS: "-DMAXRANK=4"
102+
ADD_FYPPFLAGS: "-DMAXRANK=4"
103103

104104
intel-build:
105105
runs-on: ${{ matrix.os }}

Makefile.manual

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
FC ?= gfortran
44
FFLAGS ?= -Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all
5-
FYPPFLAGS ?=
5+
ADD_FYPPFLAGS ?=
66

77
VERSION := $(subst ., ,$(file < VERSION))
8-
FYPPFLAGS += \
8+
VERSION_FYPPFLAGS += \
99
-DPROJECT_VERSION_MAJOR=$(word 1,$(VERSION)) \
1010
-DPROJECT_VERSION_MINOR=$(word 2,$(VERSION)) \
1111
-DPROJECT_VERSION_PATCH=$(word 3,$(VERSION))
1212

13+
FYPPFLAGS := $(ADD_FYPPFLAGS) $(VERSION_FYPPFLAGS)
14+
1315
export FC
1416
export FFLAGS
1517
export FYPPFLAGS

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,15 @@ Alternatively, you can build using provided Makefiles:
176176
make -f Makefile.manual
177177
```
178178

179-
You can limit the maximum rank by setting ``-DMAXRANK=<num>`` in the ``FYPPFLAGS`` environment variable (which can reduce the compilation time):
179+
You can limit the maximum rank by setting ``-DMAXRANK=<num>`` in the ``ADD_FYPPFLAGS`` environment variable (which can reduce the compilation time):
180180

181181
```sh
182-
make -f Makefile.manual FYPPFLAGS=-DMAXRANK=4
182+
make -f Makefile.manual ADD_FYPPFLAGS=-DMAXRANK=4
183183
```
184184

185185
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.
186186
```sh
187-
make -f Makefile.manual FYPPFLAGS=-DMAXRANK=4 FC=gfortran FFLAGS="-O3 -flto"
187+
make -f Makefile.manual ADD_FYPPFLAGS=-DMAXRANK=4 FC=gfortran FFLAGS="-O3 -flto"
188188
```
189189

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

0 commit comments

Comments
 (0)