-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
67 lines (44 loc) · 1.57 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
# 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
LDFLAGS = -O2 -Wall
LDLIBS = -llapack
# 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} ${objects} *mod
clobber:
rm -f *mod