-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
executable file
·76 lines (53 loc) · 2.03 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# This is a makefile for GNU make.
# This makefile builds "Cappuccino".
# 1. Source files
# Directory containing the main makefile, used by "VPATH":
makefile_dir = src/cappuccino
# Write paths relative to makefile_dir, separated by blanks (do not
# include ${makefile_dir} in the list):
# VPATH := ${makefile_dir} $(addprefix ${makefile_dir}/, dir)
# Write paths relative to makefile_dir in 'directories' file, if there are many source directories:
VPATH := ${makefile_dir} $(shell cat ${makefile_dir}/directories)
# Write source file names, without path, separated by blanks, not
# commas. Only .f* files, not included files. Also the file
# containinig the main program unit.
# sources :=
# Write source file names, without path, in a separate file,
# one file name per line:
sources := $(shell cat ${makefile_dir}/files)
# NOTE: In that file the file names are sorted so the file containing a module
# is listed before the file where the module has been used.
# 2. Objects and executable file
#objects := $(addsuffix .o, $(basename ${sources}))
# Or, if all the source files have the same suffix, more simply:
objects := $(sources:.f=.o)
execut = bin/cappuccino
# 3. Compiler-dependent part
# 4. Rules
FC = gfortran
# add -DLIS to define LIS library flag;
# add -DLAPACK to define Lapack library flag;
# The -cpp flag is here because of C style preprocessor directives.
#LDFLAGS = -O3 -cpp -DLAPACK -DLIS -Wall
LDFLAGS = -O3 -cpp -Wall
# Lapack is used for LSTSQ_QR gradients, LIS may be used for linear systems.
# If you don't use either LAPACK or LIS don't link these libraries below.
# OpenMP is used within LIS, only in a case you've compiled LIS with OpenMP support.
#LDLIBS = -llapack -llis -fopenmp
#LDLIBS = -llapack
LDLIBS =
# Extend known suffixes:
# (if the suffixes are not ".f" or ".F")
%.o: %.f90
$(COMPILE.f) $(OUTPUT_OPTION) $<
%.o: %.F90
$(COMPILE.F) $(OUTPUT_OPTION) $<
.DELETE_ON_ERROR:
.PHONY: all clean
all: ${execut}
${execut}: ${objects}
$(FC) $(LDFLAGS) $^ $(LDLIBS) -o $@
clean:
rm -f ${execut} *mod
clobber:
rm -f *mod