aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-06-02 12:51:14 +0200
committerWojtek Kosior <kwojtus@protonmail.com>2019-06-02 12:51:14 +0200
commitec0bf480229353c6de8c1836bd16fb31f4d26f58 (patch)
tree4dce80b5086c1a9f798e961e2a5916c85ba48e0d /Makefile
parent5d1fddc10b0eff740f186f38777314ed46ae2dd4 (diff)
downloadfortran-assignment2-ec0bf480229353c6de8c1836bd16fb31f4d26f58.tar.gz
fortran-assignment2-ec0bf480229353c6de8c1836bd16fb31f4d26f58.zip
support 2 compilers
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 26 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 2d9a5ea..a0d7d51 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,31 @@
+ifneq ($(FC), ifort)
+ifneq ($(FC), gfortran)
+
+ifneq ($(shell which ifort 2>/dev/null),)
+FC = ifort
+endif
+
+ifneq ($(shell which gfortran 2>/dev/null),)
FC = gfortran
+endif
+
+endif
+endif
+
+
+ifndef FFLAGS
+
+ifeq ($(FC), gfortran)
FFLAGS = -std=f2008 -Wall -pedantic -fbounds-check -fimplicit-none \
- -I/usr/include -lfftw3 -lm
+ -ffree-form -O2 -I/usr/include -lfftw3 -lm
+endif
+
+ifeq ($(FC), ifort)
+FFLAGS = -std08 -module . -implicitnone -pedantic -check bounds \
+ -O2 -I/usr/include -lfftw3 -lm
+endif
+
+endif
all : fourier