34 |
|
# |
35 |
|
#--------------------------------------------------------------------------- |
36 |
|
IS_UNIX=1 |
37 |
< |
#packages to be made |
38 |
< |
Packages = \ |
37 |
> |
|
38 |
> |
#packages containing libraries |
39 |
> |
PackageLibs = \ |
40 |
|
utils \ |
41 |
+ |
visitors \ |
42 |
|
math \ |
43 |
|
types \ |
44 |
|
primitives \ |
43 |
– |
visitors \ |
45 |
|
UseTheForce/DarkSide \ |
46 |
|
UseTheForce \ |
47 |
|
brains \ |
48 |
|
io \ |
49 |
< |
integrators \ |
49 |
< |
minimizers \ |
49 |
> |
integrators\ |
50 |
|
constraints \ |
51 |
< |
profiling \ |
51 |
> |
minimizers \ |
52 |
> |
selection \ |
53 |
|
restraints \ |
54 |
+ |
lattice \ |
55 |
+ |
openbabel |
56 |
+ |
|
57 |
+ |
#packages containing applications |
58 |
+ |
Applications = \ |
59 |
|
applications/oopse \ |
60 |
|
applications/dump2Xyz \ |
61 |
< |
applications/simpleBuilder \ |
61 |
> |
applications/staticProps \ |
62 |
> |
applications/dynamicProps \ |
63 |
> |
applications/simpleBuilder\ |
64 |
> |
applications/nanoRodBuilder \ |
65 |
> |
applications/atom2mdin |
66 |
|
|
67 |
< |
#packages contain libraries |
68 |
< |
PackageLibs = \ |
69 |
< |
utils \ |
70 |
< |
math \ |
71 |
< |
types \ |
72 |
< |
primitives \ |
73 |
< |
visitors \ |
74 |
< |
UseTheForce/DarkSide \ |
75 |
< |
UseTheForce \ |
76 |
< |
brains \ |
77 |
< |
io \ |
78 |
< |
integrators \ |
79 |
< |
minimizers \ |
80 |
< |
constraints \ |
81 |
< |
profiling \ |
82 |
< |
restraints \ |
67 |
> |
Samples = \ |
68 |
> |
samples/argon \ |
69 |
> |
samples/water/dimer \ |
70 |
> |
samples/water/spce \ |
71 |
> |
samples/water/ssd \ |
72 |
> |
samples/water/ssde \ |
73 |
> |
samples/water/ssdrf \ |
74 |
> |
samples/water/ssd-ion \ |
75 |
> |
samples/water/tip3p_ice \ |
76 |
> |
samples/water/tip4p \ |
77 |
> |
samples/lipid \ |
78 |
> |
samples/alkane \ |
79 |
> |
samples/minimizer \ |
80 |
> |
samples/metals \ |
81 |
> |
samples/thermoIntegration/liquid \ |
82 |
> |
samples/thermoIntegration/solid \ |
83 |
> |
samples/dipole \ |
84 |
> |
samples/shape \ |
85 |
> |
samples/zcons \ |
86 |
|
|
87 |
|
IncludeDirs = \ |
88 |
< |
@SPRNG_INC_DIR@ \ |
89 |
< |
@MPI_INC_DIR@ |
88 |
> |
@CGAL_INC_DIR@ \ |
89 |
> |
@MPI_INC_DIR@ |
90 |
|
|
91 |
|
LibraryDirs = \ |
92 |
< |
@SPRNG_LIB_DIR@ \ |
92 |
> |
@CGAL_LIB_DIR@ \ |
93 |
|
@MPI_LIB_DIR@ |
94 |
|
|
95 |
|
Libraries = \ |
96 |
< |
@SPRNG_LIB@ \ |
96 |
> |
@LIBS@ \ |
97 |
> |
@CGAL_LIBS@ \ |
98 |
|
@MPI_LIB@ \ |
99 |
< |
@MPI_F90_LIB@ |
99 |
> |
@MPI_F90_LIB@ |
100 |
|
|
101 |
|
OopseHome = @OOPSE_HOME@ |
102 |
< |
ForceParamDir = @OOPSE_HOME@/share/forceFields/ |
103 |
< |
SampleSimDir = @OOPSE_HOME@/share/samples/ |
102 |
> |
ForceParamDir = $(OopseHome)/share/forceFields |
103 |
> |
SampleSimDir = $(OopseHome)/share/samples |
104 |
> |
InstallBinDir = $(OopseHome)/bin |
105 |
> |
DocDir = $(OopseHome)/doc |
106 |
|
FrcDeclare = -DFRC_PATH="$(ForceParamDir)" |
107 |
+ |
F90Declare = -D__FORTRAN90 |
108 |
|
ParallelDeclare = -DIS_MPI |
109 |
|
UseMPI = @USE_MPI@ |
110 |
+ |
ModuleCase = @F90_MODULE_NAMES@ |
111 |
+ |
ModSuffix = @MOD@ |
112 |
+ |
LinkOptions = \ |
113 |
+ |
@F90LIBS@ |
114 |
|
|
115 |
+ |
ParallelLinkOptions = \ |
116 |
+ |
@F90LIBS@ |
117 |
+ |
|
118 |
+ |
|
119 |
|
#--------------------------------------------------------------------------- |
120 |
|
# |
121 |
|
# Directories |
126 |
|
TargetDir = $(DEV_ROOT)/obj |
127 |
|
ParallelTargetDir = $(DEV_ROOT)/MPIobj |
128 |
|
LibDir = $(DEV_ROOT)/lib |
104 |
– |
ParallelLibDir = $(DEV_ROOT)/MPIlib |
129 |
|
MakeDir = $(DEV_ROOT)/make |
130 |
+ |
MainMakefile = $(MakeDir)/Makefile |
131 |
|
BinDir = $(DEV_ROOT)/bin |
132 |
|
DocsDir = $(DEV_ROOT)/docs |
133 |
|
CurrentDir = $(CURDIR) |
134 |
< |
RPath = $(shell cd $(DEV_ROOT); pwd)/lib:$(OopseHome)/lib |
135 |
< |
ParallelRPath = $(shell cd $(DEV_ROOT); pwd)/MPIlib:$(OopseHome)/MPIlib |
111 |
< |
LinkOptions = \ |
112 |
< |
@F90LIBS@ \ |
113 |
< |
-Wl,-R$(RPath) |
134 |
> |
CombinedStaticLib = $(LibDir)/libOOPSE.a |
135 |
> |
CombinedParallelStaticLib = $(LibDir)/libOOPSE_MPI.a |
136 |
|
|
115 |
– |
ParallelLinkOptions = \ |
116 |
– |
@F90LIBS@ \ |
117 |
– |
-Wl,-R$(ParallelRPath) |
118 |
– |
|
137 |
|
ifdef Source |
138 |
|
#get the relative path of current package to source directory |
139 |
|
# /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside |
140 |
|
#Package = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g') |
141 |
|
#use shell script to get the absolute path and then rip it off from $(CurrentDir) |
142 |
< |
Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir)) |
142 |
> |
#Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir)) |
143 |
> |
# REMINDER: We are now using the Package line in each subdir makefile. |
144 |
> |
# This avoids the strange path problem and the subshell |
145 |
|
|
146 |
|
PackageList = $(Package) |
147 |
|
PackageSourceDir = $(SourceDir)/$(Package) |
149 |
|
PackageParallelTargetDir = $(ParallelTargetDir) |
150 |
|
JavaMainClass = $(subst /,.,$(Package)).$(Main) |
151 |
|
else |
152 |
< |
PackageList = $(Packages) $(JavaPackages) |
152 |
> |
PackageList = $(PackageLibs) $(JavaPackages) $(Applications) |
153 |
|
endif |
154 |
|
|
155 |
|
PackageListLoop = $(patsubst %,$(SourceDir)/%/.loop,$(PackageList)) |
220 |
|
|
221 |
|
OtherTargetFiles = $(OtherSourceFiles:%=$(PackageTargetDir)/%) |
222 |
|
|
223 |
+ |
########################################################################### |
224 |
+ |
# |
225 |
+ |
# Figure out the names of the module files based on some work done by |
226 |
+ |
# configure. The tr function below is from John Graham-Cumming |
227 |
+ |
# (http://www.jgc.org). |
228 |
+ |
# |
229 |
+ |
# The tr function. Has three arguments: |
230 |
+ |
# |
231 |
+ |
# $1 The list of characters to translate from |
232 |
+ |
# $2 The list of characters to translate to |
233 |
+ |
# $3 The text to translate |
234 |
+ |
# |
235 |
+ |
# For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L. |
236 |
+ |
|
237 |
+ |
tr = $(eval __t := $3) \ |
238 |
+ |
$(foreach c, \ |
239 |
+ |
$(join $(addsuffix :,$1),$2), \ |
240 |
+ |
$(eval __t := \ |
241 |
+ |
$(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \ |
242 |
+ |
$(__t))))$(__t) |
243 |
+ |
|
244 |
+ |
# Common character classes for use with the tr function. Each of |
245 |
+ |
# these is actually a variable declaration and must be wrapped with |
246 |
+ |
# $() or ${} to be used. |
247 |
+ |
|
248 |
+ |
[A-Z] := A B C D E F G H I J K L M N O P Q R S T U V W X Y Z # |
249 |
+ |
[a-z] := a b c d e f g h i j k l m n o p q r s t u v w x y z # |
250 |
+ |
[0-9] := 0 1 2 3 4 5 6 7 8 9 # |
251 |
+ |
[A-F] := A B C D E F # |
252 |
+ |
|
253 |
+ |
# Figure out whether we have $(eval) or not (GNU Make 3.80 and above) |
254 |
+ |
# if we do not then we need to use the shell version of tr, and not the |
255 |
+ |
# faster tr function above: |
256 |
+ |
|
257 |
+ |
__have_eval := $(false) |
258 |
+ |
__ignore := $(eval __have_eval := $(true)) |
259 |
+ |
|
260 |
+ |
ifndef __have_eval |
261 |
+ |
uc = $(shell echo $1 | tr "a-z" "A-Z") |
262 |
+ |
lc = $(shell echo $1 | tr "A-Z" "a-z") |
263 |
+ |
else |
264 |
+ |
uc = $(call tr,$([a-z]),$([A-Z]),$1) |
265 |
+ |
lc = $(call tr,$([A-Z]),$([a-z]),$1) |
266 |
+ |
endif |
267 |
+ |
|
268 |
+ |
# OK, now we can actually use these functions to figure out the names |
269 |
+ |
# of the module files: |
270 |
+ |
|
271 |
+ |
ifneq "$(words $(Modules))" "0" |
272 |
+ |
ifeq "$(ModuleCase)" "UPPER" |
273 |
+ |
MODULES = $(call uc,$(Modules)) |
274 |
+ |
else |
275 |
+ |
ifeq "$(ModuleCase)" "lower" |
276 |
+ |
MODULES = $(call lc,$(Modules)) |
277 |
+ |
else |
278 |
+ |
MODULES = $(Modules) |
279 |
+ |
endif |
280 |
+ |
endif |
281 |
+ |
ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix)) |
282 |
+ |
ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix)) |
283 |
+ |
endif |
284 |
+ |
# |
285 |
+ |
########################################################################### |
286 |
+ |
|
287 |
|
ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries)) |
288 |
|
ThirdPartyJars = $(subst $(Space),$(X),$(ThirdPartyJarsTmp)) |
289 |
|
|
295 |
|
#if Main is defined, do not build library. It may not be true sometimes |
296 |
|
ifneq "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0" |
297 |
|
DependencyFile = $(PackageSourceDir)/Makedepend |
298 |
< |
ifneq "$(Main)" "" |
298 |
> |
ifneq "$(words $(Main))" "0" |
299 |
|
Executable = $(BinDir)/$(Main) |
300 |
< |
ParallelExecutable = $(BinDir)/$(Main)_MPI |
300 |
> |
ifeq "$(BuiltParallelExe)" "1" |
301 |
> |
ParallelExecutable = $(BinDir)/$(Main)_MPI |
302 |
> |
endif |
303 |
|
else |
304 |
< |
SharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).so |
305 |
< |
StaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).a |
306 |
< |
ParallelSharedLibrary = $(ParallelLibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).so |
307 |
< |
ParallelStaticLibrary = $(ParallelLibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).a |
304 |
> |
SharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so |
305 |
> |
StaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a |
306 |
> |
ParallelSharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.so |
307 |
> |
ParallelStaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.a |
308 |
|
endif |
309 |
|
endif |
310 |
+ |
|
311 |
|
# |
312 |
|
# Misc |
313 |
|
# |
315 |
|
JavaPackageNames = $(subst /,.,$(JavaPackages)) |
316 |
|
IncludePath = -I$(SourceDir) $(IncludeDirs:%=-I%) |
317 |
|
LibDirs = -L$(LibDir) $(LibraryDirs:%=-L%) |
318 |
< |
ParallelLibDirs = -L$(ParallelLibDir) $(LibraryDirs:%=-L%) |
319 |
< |
LocalLibs = $(subst /,,$(patsubst %, oopse_%, $(PackageLibs))) |
233 |
< |
ParallelLocalLibs= $(subst /,,$(patsubst %, oopse_%, $(PackageLibs))) |
318 |
> |
LocalLibs = $(subst /,,$(patsubst %, oopse_%_UP, $(PackageLibs))) |
319 |
> |
ParallelLocalLibs= $(subst /,,$(patsubst %, oopse_%_MPI, $(PackageLibs))) |
320 |
|
LibList = $(LocalLibs:%=-l%) $(Libraries) |
321 |
+ |
LibNames = $(LocalLibs:%=$(LibDir)/lib%.a) |
322 |
|
ParallelLibList = $(ParallelLocalLibs:%=-l%) $(Libraries) |
323 |
+ |
ParallelLibNames = $(ParallelLocalLibs:%=$(LibDir)/lib%.a) |
324 |
|
|
325 |
|
|
326 |
|
#--------------------------------------------------------------------------- |
329 |
|
# |
330 |
|
#--------------------------------------------------------------------------- |
331 |
|
Print = @echo |
332 |
< |
Move = mv |
332 |
> |
Move = mv -f |
333 |
|
Copy = cp |
334 |
|
CCompiler = @CC@ |
335 |
|
CppCompiler = @CXX@ |
336 |
|
Linker = @CXX@ |
337 |
|
MakeDepend = makedepend |
338 |
< |
Install = @INSTALL@ |
338 |
> |
INSTALL = @INSTALL@ |
339 |
|
InstallProgram = @INSTALL_PROGRAM@ |
340 |
+ |
InstallScript = @INSTALL_SCRIPT@ |
341 |
|
InstallData = @INSTALL_DATA@ |
342 |
< |
MakeDir = @MKINSTALLDIRS@ |
343 |
< |
Delete = rm -fr |
342 |
> |
MkDir = @MKINSTALLDIRS@ |
343 |
> |
Delete = rm -f |
344 |
|
StaticArchiver = @AR@ |
345 |
|
DynamicArchiver = @CC@ |
346 |
|
FortranCompiler = @FC@ |
357 |
|
List = cat |
358 |
|
Yacc = @YACC@ |
359 |
|
Lex = @LEX@ |
360 |
+ |
Ranlib = @RANLIB@ |
361 |
+ |
Doxygen = @DOXYGEN@ |
362 |
|
|
272 |
– |
|
363 |
|
MakeOptions = -k |
364 |
|
MakeDependOptions = |
365 |
|
StaticArchiverOptions = rc |
368 |
|
JniOptions = |
369 |
|
RmiOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
370 |
|
-sourcepath $(SourceDir) |
371 |
< |
COptions = $(FrcDeclare) |
372 |
< |
CParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
373 |
< |
CppOptions = $(FrcDeclare) |
374 |
< |
CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
371 |
> |
COptions = $(FrcDeclare) @CFLAGS@ |
372 |
> |
CParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@ |
373 |
> |
CppOptions = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@ |
374 |
> |
CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@ |
375 |
|
FortranOptions = |
376 |
< |
F90Options = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir) |
377 |
< |
F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) |
376 |
> |
F90Options = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir) |
377 |
> |
F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) |
378 |
|
JavaCompilerOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
379 |
|
-sourcepath $(SourceDir) -deprecation |
380 |
|
JavaRunOptions = -classpath $(ClassPath) |
400 |
|
|
401 |
|
#--------------------------------------------------------------------------- |
402 |
|
# |
403 |
+ |
# Install |
404 |
+ |
# |
405 |
+ |
#--------------------------------------------------------------------------- |
406 |
+ |
|
407 |
+ |
ifneq "$(words $(SampleFiles))" "0" |
408 |
+ |
MySample = $(subst $(shell cd $(DEV_ROOT)/samples; pwd)/,,$(CurrentDir)) |
409 |
+ |
MyInstallDir = $(SampleSimDir)/$(MySample) |
410 |
+ |
InstallFiles = $(SampleFiles) |
411 |
+ |
InstallCommand = $(InstallData) |
412 |
+ |
endif |
413 |
+ |
|
414 |
+ |
ifneq "$(words $(Main))" "0" |
415 |
+ |
MyInstallDir = $(InstallBinDir) |
416 |
+ |
ifeq "$(UseMPI)" "yes" |
417 |
+ |
InstallFiles = $(Executable) $(ParallelExecutable) |
418 |
+ |
else |
419 |
+ |
InstallFiles = $(Executable) |
420 |
+ |
endif |
421 |
+ |
InstallCommand = $(InstallProgram) |
422 |
+ |
endif |
423 |
+ |
|
424 |
+ |
ifneq "$(words $(ForcefieldFiles))" "0" |
425 |
+ |
MyInstallDir = $(ForceParamDir) |
426 |
+ |
InstallFiles = $(ForcefieldFiles) |
427 |
+ |
InstallCommand = $(InstallData) |
428 |
+ |
endif |
429 |
+ |
|
430 |
+ |
ifneq "$(words $(InstallFiles))" "0" |
431 |
+ |
InstallList = |
432 |
+ |
else |
433 |
+ |
InstallList = $(patsubst %,$(DEV_ROOT)/%,$(Samples)) $(DEV_ROOT)/forceFields $(patsubst %, $(SourceDir)/%,$(Applications)) |
434 |
+ |
endif |
435 |
+ |
|
436 |
+ |
InstallListLoop = $(patsubst %,$(SourceDir)/%/.install,$(PackageList)) $(patsubst %,%/.install,$(InstallList)) |
437 |
+ |
|
438 |
+ |
|
439 |
+ |
|
440 |
+ |
#--------------------------------------------------------------------------- |
441 |
+ |
# |
442 |
|
# Rules |
443 |
|
# |
444 |
|
#--------------------------------------------------------------------------- |
449 |
|
|
450 |
|
# Create target directory |
451 |
|
$(PackageTargetDir) : |
452 |
< |
$(MakeDir) $@ |
452 |
> |
$(MkDir) $@ |
453 |
|
|
454 |
+ |
$(BinDir) : |
455 |
+ |
$(MkDir) $@ |
456 |
+ |
|
457 |
|
# .c -> .o |
458 |
< |
$(PackageTargetDir)/%.o : %.c |
458 |
> |
$(PackageTargetDir)/%.o : %.c $(MainMakefile) |
459 |
|
$(Print) $@ |
460 |
|
$(CCompiler) $(COptions) -c $(IncludePath) $< -o $@ |
461 |
|
|
462 |
< |
$(PackageParallelTargetDir)/%.o : %.c |
462 |
> |
$(PackageParallelTargetDir)/%.o : %.c $(MainMakefile) |
463 |
|
$(Print) $@ |
464 |
|
$(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@ |
465 |
|
|
466 |
|
ifeq "$(UseMPI)" "yes" |
467 |
< |
%.o : %.c |
467 |
> |
%.o : %.c $(MainMakefile) |
468 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
469 |
|
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
470 |
|
else |
471 |
< |
%.o : %.c |
471 |
> |
%.o : %.c $(MainMakefile) |
472 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
473 |
|
endif |
474 |
|
|
475 |
|
# .cpp -> .o |
476 |
< |
$(PackageTargetDir)/%.o : %.cpp |
476 |
> |
$(PackageTargetDir)/%.o : %.cpp $(MainMakefile) |
477 |
|
$(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@ |
478 |
|
|
479 |
< |
$(PackageParallelTargetDir)/%.o : %.cpp |
479 |
> |
$(PackageParallelTargetDir)/%.o : %.cpp $(MainMakefile) |
480 |
|
$(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@ |
481 |
|
|
482 |
|
ifeq "$(UseMPI)" "yes" |
483 |
< |
%.o : %.cpp |
483 |
> |
%.o : %.cpp $(MainMakefile) |
484 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
485 |
|
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
486 |
|
else |
487 |
< |
%.o : %.cpp |
487 |
> |
%.o : %.cpp $(MainMakefile) |
488 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
489 |
|
endif |
490 |
|
|
491 |
|
# .f -> .o |
492 |
< |
$(PackageTargetDir)/%.o : %.f |
492 |
> |
$(PackageTargetDir)/%.o : %.f $(MainMakefile) |
493 |
|
$(FortranCompiler) $(FortranOptions) -c $< -o $@ |
494 |
|
|
495 |
< |
$(PackageParallelTargetDir)/%.o : %.f |
495 |
> |
$(PackageParallelTargetDir)/%.o : %.f $(MainMakefile) |
496 |
|
$(FortranCompiler) $(FortranParallelOptions) -c $< -o $@ |
497 |
|
|
498 |
|
ifeq "$(UseMPI)" "yes" |
499 |
< |
%.o : %.f |
499 |
> |
%.o : %.f $(MainMakefile) |
500 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
501 |
|
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
502 |
|
else |
503 |
< |
%.o : %.f |
503 |
> |
%.o : %.f $(MainMakefile) |
504 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
505 |
|
endif |
506 |
|
|
507 |
|
# .F90 -> .o |
508 |
< |
$(PackageTargetDir)/%.o : %.F90 |
508 |
> |
$(PackageTargetDir)/%.o : %.F90 $(MainMakefile) |
509 |
|
$(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@ |
510 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then \ |
511 |
+ |
$(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\ |
512 |
+ |
fi |
513 |
|
|
514 |
< |
$(PackageParallelTargetDir)/%.o : %.F90 |
514 |
> |
$(PackageParallelTargetDir)/%.o : %.F90 $(MainMakefile) |
515 |
|
$(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@ |
516 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then \ |
517 |
+ |
$(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\ |
518 |
+ |
fi |
519 |
|
|
520 |
|
ifeq "$(UseMPI)" "yes" |
521 |
< |
%.o : %.F90 |
521 |
> |
%.o : %.F90 $(MainMakefile) |
522 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
523 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then\ |
524 |
+ |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
525 |
+ |
fi |
526 |
+ |
|
527 |
|
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
528 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then\ |
529 |
+ |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
530 |
+ |
fi |
531 |
+ |
|
532 |
|
else |
533 |
< |
%.o : %.F90 |
533 |
> |
%.o : %.F90 $(MainMakefile) |
534 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
535 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then\ |
536 |
+ |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
537 |
+ |
fi |
538 |
|
endif |
539 |
|
|
540 |
|
|
572 |
|
|
573 |
|
# .o -> .a |
574 |
|
|
575 |
< |
$(LibDir)/%.a : $(ObjectFiles) |
575 |
> |
$(LibDir)/%_UP.a : $(ObjectFiles) |
576 |
|
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles) |
577 |
+ |
@touch $(LibDir)/.stamp_UP |
578 |
|
|
579 |
< |
$(ParallelLibDir)/%.a: $(ParallelObjectFiles) |
579 |
> |
$(LibDir)/%_MPI.a: $(ParallelObjectFiles) |
580 |
|
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles) |
581 |
+ |
@touch $(LibDir)/.stamp_MPI |
582 |
|
|
583 |
< |
ifeq "$(UseMPI)" "yes" |
433 |
< |
%.a : $(ObjectFiles) $(ParallelObjectFiles) |
583 |
> |
%_UP.a : $(ObjectFiles) |
584 |
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
585 |
< |
$(MAKE) $(MakeOptions) $(ParallelLibDir)/$@ |
586 |
< |
else |
437 |
< |
%.a : $(ObjectFiles) |
585 |
> |
|
586 |
> |
%_MPI.a : $(ParallelObjectFiles) |
587 |
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
439 |
– |
endif |
588 |
|
|
589 |
|
# .o -> .so |
590 |
< |
$(LibDir)/%.so : $(ObjectFiles) |
590 |
> |
$(LibDir)/%_UP.so : $(ObjectFiles) |
591 |
|
$(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@ |
592 |
|
|
593 |
< |
$(ParallelLibDir)/%.so : $(ParallelObjectFiles) |
593 |
> |
$(LibDir)/%_MPI.so : $(ParallelObjectFiles) |
594 |
|
$(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@ |
595 |
|
|
596 |
< |
ifeq "$(UseMPI)" "yes" |
449 |
< |
%.so : $(ObjectFiles) $(ParallelObjectFiles) |
596 |
> |
%_UP.so : $(ObjectFiles) |
597 |
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
598 |
< |
$(MAKE) $(MakeOptions) $(ParallelLibDir)/$@ |
599 |
< |
else |
453 |
< |
%.so : $(ObjectFiles) |
598 |
> |
|
599 |
> |
%_MPI.so : $(ParallelObjectFiles) |
600 |
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
455 |
– |
endif |
601 |
|
|
602 |
|
# .class -> .jar |
603 |
|
$(LibDir)/%.jar : $(JavaClassFiles) $(OtherTargetFiles) |
631 |
|
%_Skel.class : %.class |
632 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
633 |
|
|
634 |
+ |
document : |
635 |
+ |
$(Print) Generate Documentation for OOPSE-2.0 |
636 |
+ |
@cd $(DEV_ROOT)/src |
637 |
+ |
$(Doxygen) $(DEV_ROOT)/make/Doxyfile |
638 |
+ |
|
639 |
+ |
#GUN make funtions to merge the libraries |
640 |
+ |
find_objs = $(shell $(StaticArchiver) -t $(1)) |
641 |
+ |
extract_objs = $(shell $(StaticArchiver) -x $(1) $(call find_objs, $(1))) |
642 |
+ |
create_archive = $(shell $(StaticArchiver) $(StaticArchiverOptions) $(2) $(call find_objs, $(1))) |
643 |
+ |
remove_objs = $(shell $(Delete) $(call find_objs, $(1))) |
644 |
+ |
do_create = $(call extract_objs,$(1))$(call create_archive,$(1),$(2))$(call remove_objs,$(1)) |
645 |
+ |
|
646 |
+ |
$(CombinedStaticLib) : $(LibDir)/.stamp_UP |
647 |
+ |
$(Print) create $@ |
648 |
+ |
$(foreach thisLib,$(LibNames),$(call do_create,$(thisLib),$@)) |
649 |
+ |
$(Ranlib) $(CombinedStaticLib) |
650 |
+ |
|
651 |
+ |
$(CombinedParallelStaticLib) : $(LibDir)/.stamp_MPI |
652 |
+ |
$(Print) create $@ |
653 |
+ |
$(foreach thisLib,$(ParallelLibNames), $(call do_create, $(thisLib), $@)) |
654 |
+ |
$(Ranlib) $(CombinedParallelStaticLib) |
655 |
+ |
|
656 |
|
# Executable |
657 |
< |
$(Executable) : $(ObjectFiles) |
658 |
< |
$(Linker) $(ObjectFiles) $(LinkOptions) $(LibDirs) $(LibList) -o $@ |
657 |
> |
$(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir) |
658 |
> |
$(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@ |
659 |
|
|
660 |
< |
$(ParallelExecutable) : $(ParallelObjectFiles) |
661 |
< |
$(Linker) $(ParallelObjectFiles) $(ParallelLinkOptions) $(ParallelLibDirs) $(LibList) -o $@ |
660 |
> |
$(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) $(BinDir) |
661 |
> |
$(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@ |
662 |
|
|
663 |
|
# Anything else is just copied from source to target |
664 |
|
$(PackageTargetDir)/% : $(PackageSourceDir)/% |
671 |
|
|
672 |
|
_all : _buildall |
673 |
|
|
674 |
+ |
_buildall : |
675 |
|
ifeq "$(UseMPI)" "yes" |
676 |
|
_buildall : \ |
677 |
|
$(DependencyFile) \ |
682 |
|
$(RmiStubFiles) \ |
683 |
|
$(RmiSkeletonFiles) \ |
684 |
|
$(OtherTargetFiles) \ |
517 |
– |
$(SharedLibrary) \ |
685 |
|
$(StaticLibrary) \ |
519 |
– |
$(ParallelSharedLibrary) \ |
686 |
|
$(ParallelStaticLibrary) \ |
687 |
|
$(JarFile) \ |
688 |
|
$(Executable) \ |
696 |
|
$(RmiStubFiles) \ |
697 |
|
$(RmiSkeletonFiles) \ |
698 |
|
$(OtherTargetFiles) \ |
533 |
– |
$(SharedLibrary) \ |
699 |
|
$(StaticLibrary) \ |
700 |
|
$(JarFile) \ |
701 |
|
$(Executable) |
702 |
|
endif |
703 |
|
|
704 |
+ |
echo : $(PackageListLoop) |
705 |
+ |
$(Print) Done echo. |
706 |
|
|
707 |
+ |
_echoall : |
708 |
+ |
$(Print) $(Modules) |
709 |
+ |
|
710 |
|
# make clean |
711 |
|
clean : $(PackageListLoop) |
712 |
|
$(Print) Done clean. |
713 |
|
|
714 |
|
_cleanall : |
715 |
< |
$(Delete) $(ObjectFiles) $(ParallelObjectFiles) |
715 |
> |
$(Delete) \ |
716 |
> |
$(ObjectFiles) \ |
717 |
> |
$(ModuleFiles) \ |
718 |
> |
$(ParallelObjectFiles) \ |
719 |
> |
$(ParallelModuleFiles) \ |
720 |
> |
$(JarFile) \ |
721 |
> |
$(SharedLibrary) \ |
722 |
> |
$(StaticLibrary) \ |
723 |
> |
$(ParallelSharedLibrary) \ |
724 |
> |
$(ParallelStaticLibrary) \ |
725 |
> |
$(CombinedStaticLib) \ |
726 |
> |
$(CombinedParallelStaticLib) |
727 |
|
|
728 |
|
# make distclean |
729 |
|
distclean : $(PackageListLoop) |
730 |
|
$(Print) Done clean. |
731 |
|
|
732 |
< |
_distcleanall : |
733 |
< |
$(Delete) $(ObjectFiles) \ |
553 |
< |
$(ParallelObjectFiles) \ |
554 |
< |
$(JarFile) \ |
555 |
< |
$(SharedLibrary) \ |
556 |
< |
$(StaticLibrary) \ |
557 |
< |
$(ParallelSharedLibrary) \ |
558 |
< |
$(ParallelStaticLibrary) \ |
559 |
< |
$(Executable) \ |
732 |
> |
_distcleanall : _cleanall |
733 |
> |
$(Delete) $(Executable) \ |
734 |
|
$(ParallelExecutable) \ |
735 |
|
$(DependencyFile) |
736 |
|
|
563 |
– |
|
737 |
|
# make depend |
738 |
|
depend : $(PackageListLoop) |
739 |
|
$(Print) Done dependencies. |
744 |
|
$(Print) $@ |
745 |
|
@cd $(PackageSourceDir) |
746 |
|
|
574 |
– |
@touch Make.ctemp |
575 |
– |
@touch Make.ctemp |
576 |
– |
|
747 |
|
ifneq "$(words $(CppFiles))" "0" |
748 |
< |
$(CppCompiler) $(IncludePath) -MM $(CppFiles) > Make.cpptemp |
749 |
< |
cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile) |
750 |
< |
cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile) |
748 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CppFiles)>> Make.cpptemp |
749 |
> |
@cat Make.cpptemp >> $(DependencyFile) |
750 |
> |
$(Delete) Make.cpptemp |
751 |
> |
|
752 |
> |
ifeq "$(UseMPI)" "yes" |
753 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CppFiles)>> Make.cpptemp |
754 |
> |
@cat Make.cpptemp >> $(DependencyFile) |
755 |
> |
@$(Delete) Make.cpptemp |
756 |
> |
endif |
757 |
> |
|
758 |
|
endif |
759 |
|
|
760 |
|
ifneq "$(words $(CFiles))" "0" |
761 |
< |
$(CCompiler) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp |
762 |
< |
cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile) |
763 |
< |
cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile) |
761 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CFiles) $(DerivedCFiles) >> Make.ctemp |
762 |
> |
@cat Make.ctemp >> $(DependencyFile) |
763 |
> |
$(Delete) Make.ctemp |
764 |
|
|
765 |
+ |
ifeq "$(UseMPI)" "yes" |
766 |
+ |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CFiles) $(DerivedCFiles) >> Make.ctemp |
767 |
+ |
@cat Make.ctemp >> $(DependencyFile) |
768 |
+ |
@$(Delete) Make.ctemp |
769 |
+ |
endif |
770 |
+ |
|
771 |
|
endif |
772 |
|
|
773 |
|
ifneq "$(words $(F90Files))" "0" |
774 |
< |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/obj/' -D__FORTRAN90 $(F90Files) > Make.ftemp |
775 |
< |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/MPIobj/' -DIS_MPI -D__FORTRAN90 $(F90Files) >> Make.ftemp |
776 |
< |
cat Make.ftemp >> $(DependencyFile) |
774 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp |
775 |
> |
@cat Make.ftemp >> $(DependencyFile) |
776 |
> |
@$(Delete) Make.ftemp |
777 |
> |
|
778 |
> |
ifeq "$(UseMPI)" "yes" |
779 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) >> Make.ftemp |
780 |
> |
@cat Make.ftemp >> $(DependencyFile) |
781 |
> |
@$(Delete) Make.ftemp |
782 |
> |
endif |
783 |
> |
|
784 |
|
endif |
595 |
– |
$(Delete) Make.cpptemp Make.ctemp Make.ftemp |
785 |
|
|
786 |
|
# make lib |
787 |
|
lib : $(PackageListLoop) |
794 |
|
jarsign : $(JarFile) |
795 |
|
$(JarSigner) -keystore GeoSoftKeystore $(JarFile) myself |
796 |
|
|
797 |
+ |
#make install |
798 |
+ |
%.install : |
799 |
+ |
@$(MAKE) $(MakeOptions) -C $(subst .install,,$@) _installall |
800 |
+ |
|
801 |
+ |
install : $(InstallListLoop) |
802 |
+ |
$(Print) Done Install |
803 |
+ |
|
804 |
+ |
_installall : _buildall _installdata |
805 |
+ |
|
806 |
+ |
$(MyInstallDir) : |
807 |
+ |
$(MkDir) $@ |
808 |
+ |
|
809 |
+ |
_installdata : $(MyInstallDir) |
810 |
+ |
$(Print) $(InstallFiles) |
811 |
+ |
ifneq "$(words $(InstallFiles))" "0" |
812 |
+ |
$(InstallCommand) $(InstallFiles) $(MyInstallDir) |
813 |
+ |
endif |
814 |
+ |
|
815 |
|
# make statistics |
816 |
|
_statisticsall : |
817 |
< |
@$(Print) $(SourceFiles) >> $(DEV_ROOT)/files.tmp |
817 |
> |
@$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp |
818 |
|
|
819 |
|
statistics : $(PackageListLoop) |
820 |
|
@$(List) $(DEV_ROOT)/files.tmp | xargs $(WordCount) $(WordCountOptions) |
822 |
|
$(Print) Done statistics. |
823 |
|
|
824 |
|
# make pure |
825 |
< |
$(Executable).pure : |
826 |
< |
$(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \ |
827 |
< |
$(LibList) $(ObjectFiles) -o $@ |
825 |
> |
#$(Executable).pure : |
826 |
> |
# $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \ |
827 |
> |
# $(LibList) $(ObjectFiles) -o $@ |
828 |
> |
# |
829 |
> |
#pure : $(Executable).pure |
830 |
|
|
622 |
– |
pure : $(Executable).pure |
623 |
– |
|
831 |
|
#make cvslog |
832 |
|
cvslog: |
833 |
< |
$(DEV_ROOT)/scripts/cvs2cl.pl |
833 |
> |
$(DEV_ROOT)/scripts/cvs2cl |
834 |
|
|
835 |
|
# Execute |
836 |
|
_runexe : |