-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
117 lines (89 loc) · 2.59 KB
/
Makefile
File metadata and controls
117 lines (89 loc) · 2.59 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
SOURCE = src
BUILD_BASE = build
FFLAGS = -pedantic \
-std=f95 \
-fmax-errors=1 \
-fcheck=all \
-Wall -Wextra -Werror \
-Wno-error=unused-function
CMP = gfortran
# Object files (without path)
OBJS = getkinds.o \
setdata.o \
casechange.o \
typechange.o \
io_utils.o \
readline.o \
readkeys.o \
allocstor.o \
readnucdat.o \
readmats.o \
readsrcs.o \
initmesh.o \
quadsets.o \
fisssource.o \
scatsource.o \
updatesource.o \
sweep.o \
iterate.o \
printflux1.o \
printflux2.o \
deallocstor.o \
snes.o
ifeq ($(origin TEST_PROBLEMS), undefined)
TEST_PROBLEMS = $(sort $(wildcard qa/snestp*.in))
endif
TEST_OUTPUTS = $(TEST_PROBLEMS:.in=.outs)
TEST_OUTPUTL = $(TEST_PROBLEMS:.in=.outl)
.SUFFIXES: .f90 .F90
.PHONY: tests testl clean cleaner veryclean cleantest cleanertest verycleantest docs snes snel
# SNES build
BUILD_SNES = $(BUILD_BASE)/snes
OBJS_SNES = $(addprefix $(BUILD_SNES)/,$(OBJS))
snes: $(BUILD_SNES)/.dir $(OBJS_SNES)
$(CMP) $(FFLAGS) $(OBJS_SNES) -o snes$(VERSION)
$(BUILD_SNES)/.dir:
mkdir -p $(BUILD_SNES)
touch $@
$(BUILD_SNES)/%.o: $(SOURCE)/%.f90 | $(BUILD_SNES)/.dir
$(CMP) $(FFLAGS) -J$(BUILD_SNES) -c -o $@ $<
$(BUILD_SNES)/%.o: $(SOURCE)/%.F90 | $(BUILD_SNES)/.dir
$(CMP) $(FFLAGS) -J$(BUILD_SNES) -c -DSNES -o $@ $<
# SNEL build
BUILD_SNEL = $(BUILD_BASE)/snel
OBJS_SNEL = $(addprefix $(BUILD_SNEL)/,$(OBJS))
snel: $(BUILD_SNEL)/.dir $(OBJS_SNEL)
$(CMP) $(FFLAGS) $(OBJS_SNEL) -o snel$(VERSION)
$(BUILD_SNEL)/.dir:
mkdir -p $(BUILD_SNEL)
touch $@
$(BUILD_SNEL)/%.o: $(SOURCE)/%.f90 | $(BUILD_SNEL)/.dir
$(CMP) $(FFLAGS) -J$(BUILD_SNEL) -c -o $@ $<
$(BUILD_SNEL)/%.o: $(SOURCE)/%.F90 | $(BUILD_SNEL)/.dir
$(CMP) $(FFLAGS) -J$(BUILD_SNEL) -c -DSNEL -o $@ $<
# Test targets
%.outs: %.in snes qa/jcf nucdata/*
./qa/jcf "s" $< 2>&1 > $*.logs
%.outl: %.in snel qa/jcf nucdata/*
./qa/jcf "l" $< 2>&1 > $*.logl
tests: $(TEST_OUTPUTS) references
./check "s"
testl: $(TEST_OUTPUTL) referencel
./check "l"
# Clean targets
clean:
rm -rf $(BUILD_BASE)
cleaner:
rm -f snes snel
veryclean: clean cleaner
clobber: veryclean verycleantest
cleantest:
rm -rf qa/snestp*.log* qa/tpx*
cleanertest:
rm -rf qa/snestp*.out* qa/snestp*.flx*
verycleantest: cleantest cleanertest
# Documentation
docs: images/figures/keff_results.png images/figures/test11_flux_comparison.png
make -C docs html
images/figures/keff_results.png images/figures/test11_flux_comparison.png: verification.py
uv run python verification.py