Skip to content

Commit 7edcdbc

Browse files
committed
Update makefile
Added defaults for FC and FFLAGS.
1 parent 80096cf commit 7edcdbc

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
PREFIX ?= /usr/local
22

3+
FC ?= gfortran
4+
FFLAGS ?= -O3 -g -fbacktrace -fPIC
5+
36
.PHONY: all clean cleanall install test
47

58
all: strings.mod libfstrings.a libfstrings.so
69

710
strings.mod: strings.f90
8-
$(FC) -g -fbacktrace -fPIC -c $^
11+
$(FC) $(FFLAGS) -c $^
912

1013
libfstrings.a: strings.o
1114
$(AR) -ruv $@ $^
1215

1316
libfstrings.so: strings.o
14-
$(FC) -I. -fPIC -shared -o $@ $^
17+
$(FC) -I. $(FFLAGS) -shared -o $@ $^
1518

1619
test:
17-
@$(FC) -I./ -o test/test_shared.x test/test.f90 -L./ -lfstrings
18-
@$(FC) -I./ -o test/test_static.x test/test.f90 ./libfstrings.a
20+
@$(FC) -I./ $(FFLAGS) -o test/test_shared.x test/test.f90 -L./ -lfstrings
21+
@$(FC) -I./ $(FFLAGS) -o test/test_static.x test/test.f90 ./libfstrings.a
1922
@test/test.sh shared
2023
@test/test.sh static
2124

0 commit comments

Comments
 (0)