2008-11-04 13:08:01 -06:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# include configuration
|
|
|
|
#
|
|
|
|
$(info )
|
2013-12-10 11:58:26 -02:00
|
|
|
ifeq ($(wildcard make.config),make.config)
|
|
|
|
$(info Using customized file 'make.config'.)
|
2008-11-04 13:08:01 -06:00
|
|
|
$(info )
|
|
|
|
include make.config
|
|
|
|
else
|
2013-12-10 11:58:26 -02:00
|
|
|
$(warning Could not find customized file 'make.config'!)
|
2008-11-04 13:08:01 -06:00
|
|
|
$(info )
|
2013-12-10 11:58:26 -02:00
|
|
|
$(info File 'make.default' is an example with all available compilation time \
|
|
|
|
options. You can modify it, but it is better to copy it to a new file \
|
|
|
|
'make.config' and then customize it. This will also make disappear \
|
|
|
|
the following 15 second pause every time you compile.)
|
2008-11-04 13:08:01 -06:00
|
|
|
$(info )
|
2013-12-10 11:58:26 -02:00
|
|
|
$(shell sleep 15)
|
2008-11-04 13:08:01 -06:00
|
|
|
include make.default
|
|
|
|
endif
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#
|
2013-12-10 11:58:26 -02:00
|
|
|
# host name
|
2008-11-04 13:08:01 -06:00
|
|
|
#
|
2013-12-10 11:58:26 -02:00
|
|
|
HOST := $(shell hostname)
|
2008-11-04 13:08:01 -06:00
|
|
|
|
|
|
|
include hosts/default
|
|
|
|
ifeq ($(wildcard hosts/$(HOST)),hosts/$(HOST))
|
2013-12-10 11:58:26 -02:00
|
|
|
$(info Using customized compiler setup from 'hosts/$(HOST)' file.)
|
2008-11-04 13:08:01 -06:00
|
|
|
$(info )
|
|
|
|
include hosts/$(HOST)
|
2013-12-10 11:58:26 -02:00
|
|
|
else
|
|
|
|
$(info Using default compiler setup from file 'hosts/default'. \
|
|
|
|
Do not modify it!)
|
|
|
|
$(info Instead, copy this file to 'hosts/$(HOST)' and customize compilers and \
|
|
|
|
compilation options there. This will also get rid of the following \
|
|
|
|
15 second pause every time you compile.)
|
|
|
|
$(info )
|
|
|
|
$(shell sleep 15)
|
2008-11-04 13:08:01 -06:00
|
|
|
endif
|
|
|
|
|
2010-02-28 18:35:57 -03:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# check flag conditions
|
|
|
|
#
|
|
|
|
|
2018-03-30 15:29:52 -03:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# directories indicating where the source files are, where the object files
|
|
|
|
# should be created and where to save the resulting executable file
|
|
|
|
|
|
|
|
SRCSDIR := ../src
|
|
|
|
OBJSDIR := ./obj
|
|
|
|
DESTDIR := .
|
|
|
|
|
2008-11-04 13:08:01 -06:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#
|
2008-12-08 15:31:35 -06:00
|
|
|
# pass additional flags to the compiler
|
2008-11-04 13:08:01 -06:00
|
|
|
#
|
2011-06-07 16:51:52 -03:00
|
|
|
# compiler
|
|
|
|
#
|
2014-08-04 09:26:36 -03:00
|
|
|
FFLAGS += ${CPPPREFIX}-D${COMPILER}
|
2011-06-07 16:51:52 -03:00
|
|
|
|
2008-12-08 15:31:35 -06:00
|
|
|
# number of dimensions
|
|
|
|
#
|
2014-08-04 09:26:36 -03:00
|
|
|
FFLAGS += ${CPPPREFIX}-DNDIMS=${NDIMS}
|
2008-11-04 13:08:01 -06:00
|
|
|
|
2008-12-08 15:31:35 -06:00
|
|
|
# output data format
|
|
|
|
#
|
2014-08-04 09:26:36 -03:00
|
|
|
FFLAGS += ${CPPPREFIX}-D${OUTPUT}
|
2008-11-04 13:08:01 -06:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
.SUFFIXES: .F90 .o
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
2011-04-25 13:44:34 -03:00
|
|
|
name = amun
|
2008-11-04 13:08:01 -06:00
|
|
|
|
2018-03-30 15:29:52 -03:00
|
|
|
modules = algebra blocks boundaries constants coordinates domains driver \
|
|
|
|
equations error evolution gravity integrals interpolations io mesh \
|
|
|
|
mpitools operators parameters problems random refinement schemes \
|
|
|
|
shapes sources timers user_problem utils
|
2017-03-08 11:02:59 -03:00
|
|
|
|
2018-03-30 15:29:52 -03:00
|
|
|
sources := $(addprefix $(SRCSDIR)/,$(addsuffix .F90, $(modules)))
|
|
|
|
objects := $(addprefix $(OBJSDIR)/,$(addsuffix .o, $(modules)))
|
2008-11-04 13:08:01 -06:00
|
|
|
|
2018-03-30 15:29:52 -03:00
|
|
|
all: $(name).x
|
2008-11-04 13:08:01 -06:00
|
|
|
|
2018-03-30 15:29:52 -03:00
|
|
|
clean:
|
|
|
|
rm -rf $(OBJSDIR) $(DESTDIR)/$(name).x
|
2008-11-04 13:08:01 -06:00
|
|
|
|
2018-03-30 15:29:52 -03:00
|
|
|
$(OBJSDIR)/%.o : $(SRCSDIR)/%.F90 makefile
|
|
|
|
$(FC) -c $(FFLAGS) -J $(OBJSDIR) $< -o $@
|
2011-02-28 16:08:20 -03:00
|
|
|
|
2018-03-30 15:29:52 -03:00
|
|
|
$(name).x: $(objects) | $(DESTDIR)
|
|
|
|
$(LD) $(LDFLAGS) $(objects) $(LIBS) -o $(DESTDIR)/$(name).x
|
2011-02-28 16:08:20 -03:00
|
|
|
|
2018-03-30 15:29:52 -03:00
|
|
|
$(objects): | $(OBJSDIR)
|
2011-04-28 12:04:22 -03:00
|
|
|
|
2018-03-30 15:29:52 -03:00
|
|
|
$(OBJSDIR):
|
|
|
|
mkdir -p $(OBJSDIR)
|
2011-02-28 16:08:20 -03:00
|
|
|
|
2018-03-30 15:29:52 -03:00
|
|
|
$(DESTDIR):
|
|
|
|
mkdir -p $(DESTDIR)
|
2008-11-04 13:08:01 -06:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
2018-03-30 15:29:52 -03:00
|
|
|
#
|
|
|
|
# object files dependencies
|
|
|
|
#
|
|
|
|
algebra_deps = constants error
|
|
|
|
blocks_deps = error timers
|
|
|
|
boundaries_deps = blocks coordinates equations error gravity \
|
|
|
|
interpolations mpitools timers user_problem
|
|
|
|
constants_deps =
|
|
|
|
coordinates_deps = parameters
|
|
|
|
driver_deps = blocks coordinates equations evolution gravity integrals \
|
|
|
|
interpolations io mesh mpitools operators parameters \
|
|
|
|
problems random refinement schemes shapes sources \
|
|
|
|
user_problem
|
|
|
|
equations_deps = algebra coordinates error parameters timers
|
|
|
|
error_deps =
|
|
|
|
evolution_deps = blocks boundaries coordinates equations mesh mpitools \
|
|
|
|
parameters schemes shapes sources
|
|
|
|
domains_deps = blocks boundaries coordinates parameters
|
|
|
|
gravity_deps = parameters timers user_problem
|
|
|
|
integrals_deps = blocks coordinates equations error evolution mpitools \
|
|
|
|
parameters timers
|
|
|
|
interpolations_deps = algebra blocks coordinates error parameters timers
|
|
|
|
io_deps = blocks coordinates equations error evolution mesh \
|
|
|
|
mpitools random refinement timers
|
|
|
|
mesh_deps = blocks coordinates domains equations error \
|
|
|
|
interpolations mpitools problems refinement timers
|
|
|
|
mpitools_deps = error timers
|
|
|
|
operators_deps = timers
|
|
|
|
parameters_deps = mpitools
|
|
|
|
problems_deps = blocks constants coordinates equations error parameters \
|
|
|
|
random timers user_problem
|
|
|
|
random_deps = mpitools parameters
|
|
|
|
refinement_deps = blocks coordinates equations operators parameters timers
|
|
|
|
schemes_deps = algebra coordinates equations interpolations timers
|
|
|
|
shapes_deps = blocks constants coordinates equations parameters timers \
|
|
|
|
user_problem
|
|
|
|
sources_deps = blocks coordinates equations gravity operators \
|
|
|
|
parameters timers user_problem
|
|
|
|
timers_deps =
|
|
|
|
user_problem_deps = blocks constants coordinates equations error operators \
|
|
|
|
parameters random timers
|
|
|
|
utils_deps = error
|
|
|
|
|
|
|
|
$(OBJSDIR)/algebra.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(algebra_deps)))
|
|
|
|
$(OBJSDIR)/blocks.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(blocks_deps)))
|
|
|
|
$(OBJSDIR)/boundaries.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(boundaries_deps)))
|
|
|
|
$(OBJSDIR)/constants.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(constants_deps)))
|
|
|
|
$(OBJSDIR)/coordinates.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(coordinates_deps)))
|
|
|
|
$(OBJSDIR)/driver.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(driver_deps)))
|
|
|
|
$(OBJSDIR)/equations.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(equations_deps)))
|
|
|
|
$(OBJSDIR)/error.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(error_deps)))
|
|
|
|
$(OBJSDIR)/evolution.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(evolution_deps)))
|
|
|
|
$(OBJSDIR)/domains.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(domains_deps)))
|
|
|
|
$(OBJSDIR)/gravity.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(gravity_deps)))
|
|
|
|
$(OBJSDIR)/integrals.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(integrals_deps)))
|
|
|
|
$(OBJSDIR)/interpolations.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(interpolations_deps)))
|
|
|
|
$(OBJSDIR)/io.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(io_deps)))
|
|
|
|
$(OBJSDIR)/mesh.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(mesh_deps)))
|
|
|
|
$(OBJSDIR)/mpitools.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(mpitools_deps)))
|
|
|
|
$(OBJSDIR)/operators.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(operators_deps)))
|
|
|
|
$(OBJSDIR)/parameters.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(parameters_deps)))
|
|
|
|
$(OBJSDIR)/problems.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(problems_deps)))
|
|
|
|
$(OBJSDIR)/random.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(random_deps)))
|
|
|
|
$(OBJSDIR)/refinement.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(refinement_deps)))
|
|
|
|
$(OBJSDIR)/schemes.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(schemes_deps)))
|
|
|
|
$(OBJSDIR)/shapes.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(shapes_deps)))
|
|
|
|
$(OBJSDIR)/sources.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(sources_deps)))
|
|
|
|
$(OBJSDIR)/timers.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(timers_deps)))
|
|
|
|
$(OBJSDIR)/user_problem.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(user_problem_deps)))
|
|
|
|
$(OBJSDIR)/utils.o : $(addprefix $(OBJSDIR)/,$(addsuffix .o, \
|
|
|
|
$(utils_deps)))
|
2008-11-04 13:08:01 -06:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|