Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
178 lines (129 loc) · 4.07 KB
/
Copy pathMakefile
File metadata and controls
178 lines (129 loc) · 4.07 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),distclean)
ifneq ($(MAKECMDGOALS),fullclean)
-include Makefile.conf
endif
endif
endif
ifneq ($(EXTENSION_BASE),)
include extensions/Makefile
else
SRCDIRS := src test
SUBDIRS := $(SRCDIRS) new-manual developer-doc regtest macports vim json astyle python
SUBDIRSCLEAN:=$(addsuffix .clean,$(SUBDIRS))
.PHONY: all lib vim python json clean $(SRCDIRS) doc docclean check check_failed installcheck cppcheck distclean all_plus_docs macports codecheck plumedcheck astyle nmcheck
# if machine dependent configuration has been found:
ifdef GCCDEP
# Everything is expressed as prerequisites so that, with make -j, independent
# parts are built concurrently. In particular, the python interface only needs
# the path of the kernel library (not the library itself), so it can be built
# while the C++ code is being compiled.
# The syntax files for vim and json are generated by running plumed,
# so they have to wait for lib.
all: lib vim python json
vim: lib
$(MAKE) -C vim
python:
$(MAKE) -C python
json: lib
LD_LIBRARY_PATH="$(realpath .)/src/lib":${LD_LIBRARY_PATH} PLUMED_PREPEND_PATH="$(realpath .)/src/lib" $(MAKE) -C json
# target useful for macports
# it builds the code then the documentation
all_plus_docs:
$(MAKE) all
$(MAKE) docs
lib:
$(MAKE) -C src
# the python interface that is installed is built (against the installed kernel)
# during make install in src/lib, so the in-place one is not needed here
install: lib vim json
$(MAKE) -C src install
uninstall:
$(MAKE) -C src uninstall
# standard target (according to GNU doc)
html:
$(MAKE) doc
# standard target (according to GNU doc)
install-html: doc
$(MAKE) -C src install-html
$(SRCDIRS):
$(MAKE) -C $@
# compile plumed before tests:
test: src
# doxygen
doc:
$(MAKE) -C new-manual
$(MAKE) -C developer-doc
docs:
$(MAKE) doc
# regtests
# perform tests using non-installed plumed
# python regtests (regtest/python) use the in-place python interface ($PLUMED_ROOT/python),
# which is therefore built (or checked to be up to date) here.
# This is needed since make install does not build it anymore.
check: python
LD_LIBRARY_PATH="$(realpath .)/src/lib":${LD_LIBRARY_PATH} PLUMED_PREPEND_PATH="$(realpath .)/src/lib" $(MAKE) -C regtest
$(MAKE) -C regtest checkfail
check_failed: python
LD_LIBRARY_PATH="$(realpath .)/src/lib":${LD_LIBRARY_PATH} PLUMED_PREPEND_PATH="$(realpath .)/src/lib" $(MAKE) -C regtest
$(MAKE) -C regtest checkfail_onlyfailed
# perform tests using the installed version of plumed
installcheck:
PLUMED_PREPEND_PATH="$(bindir)" PLUMED_PROGRAM_NAME="$(program_name)" $(MAKE) -C regtest
$(MAKE) -C regtest checkfail
else
all:
@echo No configuration available
@echo First run ./configure
endif
# these targets are available also without configuration
clean: $(SUBDIRSCLEAN)
rm -f *~ */*~ */*/*~
$(SUBDIRSCLEAN): %.clean:
[ ! -e $* ] || $(MAKE) -C $* clean
distclean: fullclean
fullclean:
make clean
rm -f Makefile.conf
rm -f sourceme.sh
rm -f config.log
rm -f stamp-h
rm -f */*.on */*.off
docclean:
cd new-manual && make clean
cd developer-doc && make clean
cppcheck:
$(MAKE) -C src cppcheck
codecheck:
$(MAKE) -C src codecheck
plumedcheck:
$(MAKE) -C src plumedcheck
cppcheck-local:
$(MAKE) -C src cppcheck-local
codecheck-local:
$(MAKE) -C src codecheck-local
plumedcheck-local:
$(MAKE) -C src plumedcheck-local
macports:
$(MAKE) -C macports
# stamp-h file keeps track of when ./configure was last applied
# the procedure below is taken from:
# https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Automatic-Remaking.html#Automatic-Remaking
Makefile.conf: stamp-h
stamp-h: sourceme.sh.in Makefile.conf.in config.status
./config.status
config.status: configure
./config.status --recheck
astyle:
$(MAKE) -C astyle
$(MAKE) -C src astyle
$(MAKE) -C plugins astyle
@which ruff &> /dev/null && ./pythonformatter.sh || echo "ruff not found, cannot format python files"
ifeq ($(use_debug_glibcxx),yes)
nmcheck:
@echo SKIPPING nmcheck due to debug flags
else
nmcheck:
$(MAKE) -C src nmcheck
endif
endif # extension-only build