IBM Fortran does not support preprocessor directives -D directly. They have to be passed using -WF, compilation flag. Therefore we add a variable CPPPREFIX to provide this kind of prefix. Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
57 lines
1.1 KiB
Plaintext
57 lines
1.1 KiB
Plaintext
#-------------------------------------------------------------------------------
|
|
#
|
|
# depending on the compilation flags choose the right compilers and options
|
|
#
|
|
#-------------------------------------------------------------------------------
|
|
#
|
|
#
|
|
#-------------------------------------------------------------------------------
|
|
#
|
|
# compiler and linker setup
|
|
#
|
|
ifeq ($(MPI),Y)
|
|
FC = mpif90
|
|
else
|
|
FC = gfortran
|
|
endif
|
|
LD = $(FC)
|
|
|
|
# preprocessor prefix (used by IBM Fortran, e.g.)
|
|
#
|
|
CPPPREFIX =
|
|
|
|
# compiler and linker flags
|
|
#
|
|
ifeq ($(DEBUG),Y)
|
|
FFLAGS = -g -O2 $(CPPPREFIX)-DDEBUG
|
|
else
|
|
FFLAGS = -O2
|
|
endif
|
|
|
|
LDFLAGS = $(FFLAGS)
|
|
|
|
# libraries
|
|
#
|
|
LIBS =
|
|
|
|
#-------------------------------------------------------------------------------
|
|
#
|
|
ifeq ($(STATIC),Y)
|
|
LDFLAGS += -static
|
|
endif
|
|
|
|
ifeq ($(SIGNALS),Y)
|
|
FFLAGS += $(CPPPREFIX)-DSIGNALS
|
|
endif
|
|
|
|
ifeq ($(MPI),Y)
|
|
FFLAGS += $(CPPPREFIX)-DMPI
|
|
endif
|
|
|
|
ifeq ($(OUTPUT),HDF5)
|
|
FFLAGS += -I/usr/include
|
|
LIBS += -lhdf5_fortran -lhdf5 -lz
|
|
endif
|
|
#
|
|
#-------------------------------------------------------------------------------
|