1 |
##################################################### |
2 |
# Makefile for libmdtools (bundled with OOPSE) # |
3 |
##################################################### |
4 |
# You should not change anything here. # |
5 |
##################################################### |
6 |
|
7 |
# No make rules by default |
8 |
.SUFFIXES : .c .cpp .F90 .hpp .h $(O) |
9 |
|
10 |
# Extension of object files |
11 |
O=@OBJEXT@ |
12 |
|
13 |
# Extension of executables |
14 |
EXE=@EXEEXT@ |
15 |
|
16 |
# Bourn shell |
17 |
SHELL=/bin/sh |
18 |
|
19 |
# Path prefix for installation links |
20 |
PREFIX=@prefix@ |
21 |
|
22 |
# List of subdirectories |
23 |
SUBDIRS=@SUBDIRS@ |
24 |
|
25 |
# Location of the oopse home |
26 |
OOPSE_HOME=@OOPSE_HOME@ |
27 |
|
28 |
FORCE_PARAM_DIR=@OOPSE_HOME@/share/forceFields/ |
29 |
SAMPLE_SIM_DIR=@OOPSE_HOME@/share/samples/ |
30 |
|
31 |
# SPRNG library path |
32 |
SPRNG_LIBDIR=@SPRNG_LIBDIR@ |
33 |
|
34 |
# SPRNG library |
35 |
SPRNG_LIB=@SPRNG_LIB@ |
36 |
|
37 |
# SPRNG include path |
38 |
SPRNG_INC=@SPRNG_INC@ |
39 |
|
40 |
# MPICH library path |
41 |
MPI_LIBDIR=@MPI_LIBDIR@ |
42 |
|
43 |
# MPICH library |
44 |
MPI_LIB=@MPI_LIB@ |
45 |
|
46 |
# MPICH include path |
47 |
MPI_INC=@MPI_INC@ |
48 |
|
49 |
# MPI F90 Module path |
50 |
MPI_F90_MODS=@MPI_F90_MODS@ |
51 |
|
52 |
# Compiler dependent Fortran module |
53 |
FLIBS_EXTRA = @F90LIBS@ |
54 |
|
55 |
# Location of yacc (or its substitution) |
56 |
YACC=@YACC@ |
57 |
|
58 |
#location of lex |
59 |
LEX=@LEX@ |
60 |
|
61 |
# C compiler |
62 |
CC=@CC@ |
63 |
|
64 |
# C++ compiler |
65 |
|
66 |
CXX=@CXX@ |
67 |
|
68 |
# F90 compiler |
69 |
F90=@F90@ |
70 |
|
71 |
# ar |
72 |
AR=@AR@ |
73 |
|
74 |
# ranlib |
75 |
RANLIB=@RANLIB@ |
76 |
|
77 |
# rm |
78 |
RM=rm -f |
79 |
|
80 |
# soft link |
81 |
LN_S=@LN_S@ |
82 |
|
83 |
# BSD install |
84 |
INSTALL=@INSTALL@ |
85 |
INSTALL_PROGRAM=@INSTALL_PROGRAM@ |
86 |
INSTALL_DATA=@INSTALL_DATA@ |
87 |
MKINSTALLDIRS=@MKINSTALLDIRS@ |
88 |
|
89 |
# CPP flags |
90 |
CPPFLAGS=@CPPFLAGS@ |
91 |
|
92 |
# C flags |
93 |
CFLAGS_C=@CFLAGS@ |
94 |
|
95 |
# C++ flags |
96 |
CXXFLAGS_C=@CXXFLAGS@ |
97 |
|
98 |
# Preprocessor flag for fortran |
99 |
PREPFLAG=@PREPFLAG@ |
100 |
|
101 |
# Preprocessor define flag for fortran |
102 |
PREPDEFFLAG=@PREPDEFFLAG@ |
103 |
|
104 |
# Fortran flags |
105 |
FFLAGS_C=@FFLAGS@ |
106 |
|
107 |
# Fortran90 flags |
108 |
F90FLAGS_C=@F90FLAGS@ |
109 |
|
110 |
# LDFLAGS |
111 |
LDFLAGS=@LDFLAGS@ |
112 |
|
113 |
# First do compile-time flags: |
114 |
|
115 |
DECLARE=-DFRC_PATH="$(FORCE_PARAM_DIR)" |
116 |
MPI_DECLARE=-DIS_MPI |
117 |
|
118 |
# include paths starting with "." are all relative to the SUBDIRS!!! |
119 |
|
120 |
INCLUDES= -I.. -I../../libBASS $(SPRNG_INC) |
121 |
MPI_INCLUDES= -I$(MPI_INC) $(MPI_F90_MODS) |
122 |
|
123 |
CFLAGS=$(CFLAGS_C) $(INCLUDES) $(DECLARE) $(MPI_INCLUDES) $(FUNCWRAP) |
124 |
CXXFLAGS=$(CXXFLAGS_C) $(INCLUDES) $(DECLARE) $(FUNCWRAP) |
125 |
FFLAGS=$(PREPFLAG) $(FFLAGS_C) |
126 |
F90FLAGS=$(PREPFLAG) $(F90FLAGS_C) |
127 |
DEPFLAGS=$(CFLAGS_C) -I. -I../libBASS $(SPRNG_INC) $(MPI_INCLUDES) |
128 |
|
129 |
MPI_CFLAGS=$(CFLAGS) $(MPI_INCLUDES) $(MPI_DECLARE) |
130 |
MPI_CXXFLAGS=$(CXXFLAGS) $(MPI_INCLUDES) $(MPI_DECLARE) |
131 |
MPI_F90FLAGS=$(F90FLAGS) $(PREPDEFFLAG)$(MPI_DECLARE) $(MPI_INCLUDES) |
132 |
|
133 |
SRC_DIR := $(PWD) |
134 |
|
135 |
# Then do the compile rules: |
136 |
|
137 |
obj/%.o: %.F90 |
138 |
cd obj; $(F90) $(F90FLAGS) -c $(SRC_DIR)/$< |
139 |
|
140 |
MPIobj/%.o: %.F90 |
141 |
cd MPIobj; $(F90) $(MPI_F90FLAGS) -c $(SRC_DIR)/$< |
142 |
|
143 |
obj/%.o: %.cpp |
144 |
cd obj; $(CXX) $(CXXFLAGS) -c $(SRC_DIR)/$< |
145 |
|
146 |
MPIobj/%.o: %.cpp |
147 |
cd MPIobj; $(CXX) $(MPI_CXXFLAGS) -c $(SRC_DIR)/$< |
148 |
|
149 |
obj/%.o: %.c |
150 |
cd obj; $(CC) $(CFLAGS) -c $(SRC_DIR)/$< |
151 |
|
152 |
MPIobj/%.o: %.c |
153 |
cd MPIobj; $(CC) $(MPI_CFLAGS) -c $(SRC_DIR)/$< |
154 |
|
155 |
# Then list what we have to compile |
156 |
|
157 |
C_FILES = \ |
158 |
$(DIR)/mpiForceField.c \ |
159 |
$(DIR)/fInfo.c |
160 |
|
161 |
CXX_FILES = \ |
162 |
$(DIR)/Atom.cpp \ |
163 |
$(DIR)/Bend.cpp \ |
164 |
$(DIR)/BendExtensions.cpp \ |
165 |
$(DIR)/Bond.cpp \ |
166 |
$(DIR)/BondExtensions.cpp \ |
167 |
$(DIR)/DirectionalAtom.cpp \ |
168 |
$(DIR)/DumpWriter.cpp \ |
169 |
$(DIR)/Exclude.cpp \ |
170 |
$(DIR)/InitializeFromFile.cpp \ |
171 |
$(DIR)/LJFF.cpp \ |
172 |
$(DIR)/EAM_FF.cpp \ |
173 |
$(DIR)/SimInfo.cpp \ |
174 |
$(DIR)/SimSetup.cpp \ |
175 |
$(DIR)/StatWriter.cpp \ |
176 |
$(DIR)/Integrator.cpp \ |
177 |
$(DIR)/Thermo.cpp \ |
178 |
$(DIR)/GhostBend.cpp \ |
179 |
$(DIR)/Torsion.cpp \ |
180 |
$(DIR)/TorsionExtensions.cpp \ |
181 |
$(DIR)/DUFF.cpp \ |
182 |
$(DIR)/randomSPRNG.cpp \ |
183 |
$(DIR)/fortranWrappers.cpp \ |
184 |
$(DIR)/ForceFields.cpp \ |
185 |
$(DIR)/mpiSimulation.cpp \ |
186 |
$(DIR)/Molecule.cpp \ |
187 |
$(DIR)/NPTf.cpp \ |
188 |
$(DIR)/NPTi.cpp \ |
189 |
$(DIR)/NPTxym.cpp \ |
190 |
$(DIR)/NPTzm.cpp \ |
191 |
$(DIR)/NVT.cpp \ |
192 |
$(DIR)/SimState.cpp \ |
193 |
$(DIR)/ZConstraint.cpp \ |
194 |
$(DIR)/ZConsWriter.cpp \ |
195 |
$(DIR)/GenericData.cpp |
196 |
|
197 |
F90_FILES= \ |
198 |
$(DIR)/definitions_module.F90 \ |
199 |
$(DIR)/status_module.F90 \ |
200 |
$(DIR)/atype_module.F90 \ |
201 |
$(DIR)/calc_dipole_dipole.F90 \ |
202 |
$(DIR)/calc_reaction_field.F90 \ |
203 |
$(DIR)/calc_LJ_FF.F90 \ |
204 |
$(DIR)/calc_eam.F90 \ |
205 |
$(DIR)/calc_sticky_pair.F90 \ |
206 |
$(DIR)/do_Forces.F90 \ |
207 |
$(DIR)/vector_class.F90 \ |
208 |
$(DIR)/simulation_module.F90 \ |
209 |
$(DIR)/wrappers.F90 \ |
210 |
$(DIR)/neighborLists.F90 \ |
211 |
$(DIR)/calc_gb.F90 \ |
212 |
$(DIR)/force_globals.F90 \ |
213 |
$(DIR)/mpiSimulation_module.F90 \ |
214 |
$(DIR)/notifyCutoffs.F90 |
215 |
|
216 |
DIR:=. |
217 |
C_SRCS := $(C_FILES) |
218 |
CXX_SRCS := $(CXX_FILES) |
219 |
F90_SRCS := $(F90_FILES) |
220 |
SRCS := $(C_SRCS) $(CXX_SRCS) $(F90_SRCS) |
221 |
|
222 |
DIR:=obj |
223 |
C_OBJS := $(C_FILES:.c=.o) |
224 |
CXX_OBJS := $(CXX_FILES:.cpp=.o) |
225 |
F90_OBJS := $(F90_FILES:.F90=.o) |
226 |
OBJS := $(C_OBJS) $(CXX_OBJS) $(F90_OBJS) |
227 |
|
228 |
DIR:=MPIobj |
229 |
C_MPIOBJS := $(C_FILES:.c=.o) |
230 |
CXX_MPIOBJS := $(CXX_FILES:.cpp=.o) |
231 |
F90_MPIOBJS := $(F90_FILES:.F90=.o) |
232 |
MPIOBJS := $(C_MPIOBJS) $(CXX_MPIOBJS) $(F90_MPIOBJS) |
233 |
|
234 |
LIBSUBDIRS = \ |
235 |
obj \ |
236 |
MPIobj |
237 |
|
238 |
# Possible make targets: |
239 |
|
240 |
all: libmdtools.a libmdtools_MPI.a |
241 |
|
242 |
libmdtools.a: $(OBJS) |
243 |
$(RM) $@ |
244 |
$(AR) cr $@ $(OBJS) |
245 |
$(RANLIB) $@ |
246 |
|
247 |
libmdtools_MPI.a: $(MPIOBJS) |
248 |
$(RM) $@ |
249 |
$(AR) cr $@ $(MPIOBJS) |
250 |
$(RANLIB) $@ |
251 |
|
252 |
.PHONY : clean |
253 |
|
254 |
clean : dummy |
255 |
for i in $(LIBSUBDIRS); do \ |
256 |
(cd $$i; $(RM) *.o *.mod) || exit 1; \ |
257 |
done |
258 |
$(RM) libmdtools.a libmdtools_MPI.a *.o *.mod *~ Make.temp Make.ftemp |
259 |
|
260 |
distclean : dummy |
261 |
for i in $(LIBSUBDIRS); do \ |
262 |
(cd $$i; $(RM) *.o *.mod) || exit 1; \ |
263 |
done |
264 |
$(RM) libmdtools.a libmdtools_MPI.a *.o *.mod *~ Make.temp Make.ftemp |
265 |
|
266 |
depend : Make.dep |
267 |
|
268 |
Make.dep : |
269 |
echo "Only C dependencies are made automagically!" |
270 |
echo "# DO NOT DELETE THIS LINE - used by make depend" > Make.dep |
271 |
$(CC) $(DEPFLAGS) -MM $(C_SRCS) \ |
272 |
| sed 's/\.o:/\$$(O)\ :/g' > Make.temp |
273 |
$(CXX) $(DEPFLAGS) -MM $(CXX_SRCS) \ |
274 |
| sed 's/\.o:/\$$(O)\ :/g' >> Make.temp |
275 |
cat Make.temp | sed 's/^[a-zA-Z0-9]/obj\/&/g' >> Make.dep |
276 |
cat Make.temp | sed 's/^[a-zA-Z0-9]/MPIobj\/&/g' >> Make.dep |
277 |
# ../scripts/sfmakedepend -I $(MPI_F90_MODS) -d obj -f ./Make.ftemp -h *.F90 |
278 |
# ../scripts/sfmakedepend -I $(MPI_F90_MODS) -d MPIobj -f ./Make.ftemp -h *.F90 |
279 |
# cat Make.ftemp | sed 's/\.o:/\$$(O)\ :/g' >> Make.dep |
280 |
$(RM) Make.ftemp Make.temp |
281 |
|
282 |
install : dummy |
283 |
|
284 |
links : dummy |
285 |
|
286 |
tests : dummy |
287 |
|
288 |
dummy : |
289 |
|
290 |
include Make.dep |
291 |
|
292 |
obj/definitions_module$(O): ./definitions_module.F90 |
293 |
|
294 |
obj/vector_class$(O): ./vector_class.F90 |
295 |
|
296 |
obj/status_module$(O): ./status_module.F90 |
297 |
|
298 |
obj/force_globals$(O): ./force_globals.F90 \ |
299 |
obj/definitions_module$(O) |
300 |
|
301 |
obj/neighborLists$(O): ./neighborLists.F90 \ |
302 |
obj/definitions_module$(O) |
303 |
|
304 |
obj/calc_sticky_pair$(O): ./calc_sticky_pair.F90 \ |
305 |
obj/definitions_module$(O) \ |
306 |
obj/simulation_module$(O) \ |
307 |
obj/force_globals$(O) |
308 |
|
309 |
obj/calc_eam$(O): ./calc_eam.F90 \ |
310 |
obj/definitions_module$(O) \ |
311 |
obj/atype_module$(O) \ |
312 |
obj/simulation_module$(O) \ |
313 |
obj/vector_class$(O) \ |
314 |
obj/force_globals$(O) \ |
315 |
obj/status_module$(O) |
316 |
|
317 |
obj/calc_gb$(O): ./calc_gb.F90 \ |
318 |
obj/definitions_module$(O) \ |
319 |
obj/simulation_module$(O) \ |
320 |
obj/force_globals$(O) |
321 |
|
322 |
obj/atype_module$(O): ./atype_module.F90 \ |
323 |
obj/definitions_module$(O) \ |
324 |
obj/vector_class$(O) |
325 |
|
326 |
obj/simulation_module$(O): ./simulation_module.F90 \ |
327 |
obj/definitions_module$(O) \ |
328 |
obj/vector_class$(O) \ |
329 |
obj/force_globals$(O) \ |
330 |
obj/atype_module$(O) \ |
331 |
obj/neighborLists$(O) |
332 |
|
333 |
obj/calc_LJ_FF$(O): ./calc_LJ_FF.F90 \ |
334 |
obj/definitions_module$(O) \ |
335 |
obj/atype_module$(O) \ |
336 |
obj/simulation_module$(O) \ |
337 |
obj/vector_class$(O) \ |
338 |
obj/force_globals$(O) |
339 |
|
340 |
obj/calc_reaction_field$(O): ./calc_reaction_field.F90 \ |
341 |
obj/definitions_module$(O) \ |
342 |
obj/vector_class$(O) \ |
343 |
obj/atype_module$(O) \ |
344 |
obj/simulation_module$(O) \ |
345 |
obj/force_globals$(O) |
346 |
|
347 |
obj/calc_dipole_dipole$(O): ./calc_dipole_dipole.F90 \ |
348 |
obj/definitions_module$(O) \ |
349 |
obj/atype_module$(O) \ |
350 |
obj/simulation_module$(O) \ |
351 |
obj/force_globals$(O) \ |
352 |
obj/vector_class$(O) |
353 |
|
354 |
obj/do_Forces$(O): ./do_Forces.F90 \ |
355 |
obj/definitions_module$(O) \ |
356 |
obj/atype_module$(O) \ |
357 |
obj/simulation_module$(O) \ |
358 |
obj/neighborLists$(O) \ |
359 |
obj/calc_LJ_FF$(O) \ |
360 |
obj/calc_sticky_pair$(O) \ |
361 |
obj/calc_dipole_dipole$(O) \ |
362 |
obj/calc_reaction_field$(O) \ |
363 |
obj/calc_gb$(O) \ |
364 |
obj/force_globals$(O) \ |
365 |
obj/vector_class$(O) |
366 |
|
367 |
obj/notifyCutoffs$(O): ./notifyCutoffs.F90 \ |
368 |
obj/definitions_module$(O) \ |
369 |
obj/atype_module$(O) \ |
370 |
obj/calc_LJ_FF$(O) \ |
371 |
obj/calc_eam$(O) \ |
372 |
obj/calc_dipole_dipole$(O) \ |
373 |
obj/calc_reaction_field$(O) \ |
374 |
obj/do_Forces$(O) |
375 |
|
376 |
obj/wrappers$(O): ./wrappers.F90 \ |
377 |
obj/definitions_module$(O) \ |
378 |
obj/atype_module$(O) \ |
379 |
obj/simulation_module$(O) \ |
380 |
obj/calc_sticky_pair$(O) \ |
381 |
obj/calc_gb$(O) \ |
382 |
obj/do_Forces$(O) \ |
383 |
obj/notifyCutoffs$(O) |
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
#MPI dependencies: |
391 |
|
392 |
MPIobj/definitions_module$(O): ./definitions_module.F90 |
393 |
|
394 |
MPIobj/vector_class$(O): ./vector_class.F90 |
395 |
|
396 |
MPIobj/status_module$(O): ./status_module.F90 |
397 |
|
398 |
MPIobj/mpiSimulation_module$(O): ./mpiSimulation_module.F90 |
399 |
|
400 |
MPIobj/force_globals$(O): ./force_globals.F90 \ |
401 |
MPIobj/mpiSimulation_module$(O) \ |
402 |
MPIobj/definitions_module$(O) |
403 |
|
404 |
MPIobj/neighborLists$(O): ./neighborLists.F90 \ |
405 |
MPIobj/definitions_module$(O) \ |
406 |
MPIobj/mpiSimulation_module$(O) |
407 |
|
408 |
MPIobj/calc_sticky_pair$(O): ./calc_sticky_pair.F90 \ |
409 |
MPIobj/definitions_module$(O) \ |
410 |
MPIobj/simulation_module$(O) \ |
411 |
MPIobj/mpiSimulation_module$(O) \ |
412 |
MPIobj/force_globals$(O) |
413 |
|
414 |
MPIobj/calc_gb$(O): ./calc_gb.F90 \ |
415 |
MPIobj/definitions_module$(O) \ |
416 |
MPIobj/simulation_module$(O) \ |
417 |
MPIobj/mpiSimulation_module$(O) \ |
418 |
MPIobj/force_globals$(O) |
419 |
|
420 |
MPIobj/calc_eam$(O): ./calc_eam.F90 \ |
421 |
MPIobj/definitions_module$(O) \ |
422 |
MPIobj/atype_module$(O) \ |
423 |
MPIobj/simulation_module$(O) \ |
424 |
MPIobj/mpiSimulation_module$(O) \ |
425 |
MPIobj/vector_class$(O) \ |
426 |
MPIobj/force_globals$(O) \ |
427 |
MPIobj/status_module$(O) |
428 |
|
429 |
MPIobj/atype_module$(O): ./atype_module.F90 \ |
430 |
MPIobj/definitions_module$(O) \ |
431 |
MPIobj/vector_class$(O) |
432 |
|
433 |
MPIobj/simulation_module$(O): ./simulation_module.F90 \ |
434 |
MPIobj/definitions_module$(O) \ |
435 |
MPIobj/atype_module$(O) \ |
436 |
MPIobj/vector_class$(O) \ |
437 |
MPIobj/force_globals$(O) \ |
438 |
MPIobj/mpiSimulation_module$(O) \ |
439 |
MPIobj/atype_module$(O) \ |
440 |
MPIobj/neighborLists$(O) |
441 |
|
442 |
MPIobj/calc_LJ_FF$(O): ./calc_LJ_FF.F90 \ |
443 |
MPIobj/definitions_module$(O) \ |
444 |
MPIobj/atype_module$(O) \ |
445 |
MPIobj/simulation_module$(O) \ |
446 |
MPIobj/mpiSimulation_module$(O) \ |
447 |
MPIobj/atype_module$(O) \ |
448 |
MPIobj/vector_class$(O) \ |
449 |
MPIobj/force_globals$(O) |
450 |
|
451 |
MPIobj/calc_reaction_field$(O): ./calc_reaction_field.F90 \ |
452 |
MPIobj/definitions_module$(O) \ |
453 |
MPIobj/atype_module$(O) \ |
454 |
MPIobj/simulation_module$(O) \ |
455 |
MPIobj/mpiSimulation_module$(O) \ |
456 |
MPIobj/vector_class$(O) \ |
457 |
MPIobj/atype_module$(O) \ |
458 |
MPIobj/force_globals$(O) |
459 |
|
460 |
MPIobj/calc_dipole_dipole$(O): ./calc_dipole_dipole.F90 \ |
461 |
MPIobj/definitions_module$(O) \ |
462 |
MPIobj/atype_module$(O) \ |
463 |
MPIobj/simulation_module$(O) \ |
464 |
MPIobj/mpiSimulation_module$(O) \ |
465 |
MPIobj/force_globals$(O) \ |
466 |
MPIobj/vector_class$(O) |
467 |
|
468 |
MPIobj/do_Forces$(O): ./do_Forces.F90 \ |
469 |
MPIobj/definitions_module$(O) \ |
470 |
MPIobj/mpiSimulation_module$(O) \ |
471 |
MPIobj/atype_module$(O) \ |
472 |
MPIobj/simulation_module$(O) \ |
473 |
MPIobj/neighborLists$(O) \ |
474 |
MPIobj/calc_LJ_FF$(O) \ |
475 |
MPIobj/calc_sticky_pair$(O) \ |
476 |
MPIobj/calc_dipole_dipole$(O) \ |
477 |
MPIobj/calc_reaction_field$(O) \ |
478 |
MPIobj/calc_gb$(O) \ |
479 |
MPIobj/force_globals$(O) \ |
480 |
MPIobj/vector_class$(O) |
481 |
|
482 |
MPIobj/notifyCutoffs$(O): ./notifyCutoffs.F90 \ |
483 |
MPIobj/definitions_module$(O) \ |
484 |
MPIobj/atype_module$(O) \ |
485 |
MPIobj/calc_LJ_FF$(O) \ |
486 |
MPIobj/calc_eam$(O) \ |
487 |
MPIobj/calc_dipole_dipole$(O) \ |
488 |
MPIobj/calc_reaction_field$(O) \ |
489 |
MPIobj/do_Forces$(O) |
490 |
|
491 |
MPIobj/wrappers$(O): ./wrappers.F90 \ |
492 |
MPIobj/definitions_module$(O) \ |
493 |
MPIobj/mpiSimulation_module$(O) \ |
494 |
MPIobj/atype_module$(O) \ |
495 |
MPIobj/simulation_module$(O) \ |
496 |
MPIobj/calc_sticky_pair$(O) \ |
497 |
MPIobj/calc_gb$(O) \ |
498 |
MPIobj/do_Forces$(O) \ |
499 |
MPIobj/notifyCutoffs$(O) |
500 |
|