-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (24 loc) · 844 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Build directory path
build = ../build
# Fortran Compiler
fc = gfortran
# Fortran Compiler flags
# -J specifies where to put .mod files for compiled modules
io_flags = -J$(build) -std=f2008 -pedantic -Wall -Wextra -Wimplicit-interface -fPIC -fmax-errors=1 -g -fcheck=all -fbacktrace
# If not exist, create build directory
$(shell mkdir -p $(build))
# json-fortran variable from file
include json-fortran/dependencies.make
# tatu_io variable from file
include ./dependencies.make
# Object files relative to each source file in $(tatu_io)
tatu_io.o = $(patsubst %, $(build)/%.o, $(tatu_io))
default: jsonfortran $(tatu_io.o)
# Runs the first target of Makefile in ./json-fortran directory
jsonfortran:
$(MAKE) -C json-fortran
# Compile tatu_io files
$(build)/%.o: source/%.f08
$(fc) $(io_flags) -c $(<) -o $(@)
clean:
rm -rf $(build)