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 |
+ |
|
55 |
+ |
#packages containing applications |
56 |
+ |
Applications = \ |
57 |
|
applications/oopse \ |
58 |
|
applications/dump2Xyz \ |
59 |
< |
applications/simpleBuilder \ |
59 |
> |
applications/simpleBuilder\ |
60 |
> |
applications/staticProps \ |
61 |
> |
applications/dynamicProps \ |
62 |
|
|
63 |
< |
#packages contain libraries |
64 |
< |
PackageLibs = \ |
65 |
< |
utils \ |
66 |
< |
math \ |
67 |
< |
types \ |
68 |
< |
primitives \ |
69 |
< |
visitors \ |
70 |
< |
UseTheForce/DarkSide \ |
71 |
< |
UseTheForce \ |
72 |
< |
brains \ |
73 |
< |
io \ |
74 |
< |
integrators \ |
75 |
< |
minimizers \ |
70 |
< |
constraints \ |
71 |
< |
profiling \ |
72 |
< |
restraints \ |
63 |
> |
Samples = \ |
64 |
> |
samples/argon \ |
65 |
> |
samples/water/dimer \ |
66 |
> |
samples/water/spce \ |
67 |
> |
samples/water/ssd \ |
68 |
> |
samples/water/ssde \ |
69 |
> |
samples/water/tip3p_ice \ |
70 |
> |
samples/water/tip4p \ |
71 |
> |
samples/lipid \ |
72 |
> |
samples/alkane \ |
73 |
> |
samples/minimizer \ |
74 |
> |
samples/metals \ |
75 |
> |
samples/zcons \ |
76 |
|
|
77 |
|
IncludeDirs = \ |
78 |
< |
/usr/include \ |
76 |
< |
/usr/local/include |
78 |
> |
@MPI_INC_DIR@ |
79 |
|
|
80 |
|
LibraryDirs = \ |
81 |
< |
/usr/lib \ |
80 |
< |
/usr/local/mpich/lib \ |
81 |
< |
/usr/local/lib \ |
82 |
< |
/usr/local/intel/compiler81/lib \ |
81 |
> |
@MPI_LIB_DIR@ |
82 |
|
|
83 |
|
Libraries = \ |
84 |
< |
mpich \ |
85 |
< |
sprng \ |
87 |
< |
ifcore \ |
84 |
> |
@MPI_LIB@ \ |
85 |
> |
@MPI_F90_LIB@ |
86 |
|
|
87 |
+ |
OopseHome = @OOPSE_HOME@ |
88 |
+ |
ForceParamDir = $(OopseHome)/share/forceFields |
89 |
+ |
SampleSimDir = $(OopseHome)/share/samples |
90 |
+ |
InstallBinDir = $(OopseHome)/bin |
91 |
+ |
DocDir = $(OopseHome)/doc |
92 |
+ |
FrcDeclare = -DFRC_PATH="$(ForceParamDir)" |
93 |
+ |
F90Declare = -D__FORTRAN90 |
94 |
+ |
ParallelDeclare = -DIS_MPI |
95 |
+ |
UseMPI = @USE_MPI@ |
96 |
+ |
ModuleCase = @F90_MODULE_NAMES@ |
97 |
+ |
ModSuffix = @MOD@ |
98 |
+ |
LinkOptions = \ |
99 |
+ |
@F90LIBS@ |
100 |
+ |
|
101 |
+ |
ParallelLinkOptions = \ |
102 |
+ |
@F90LIBS@ |
103 |
+ |
|
104 |
+ |
|
105 |
|
#--------------------------------------------------------------------------- |
106 |
|
# |
107 |
|
# Directories |
116 |
|
BinDir = $(DEV_ROOT)/bin |
117 |
|
DocsDir = $(DEV_ROOT)/docs |
118 |
|
CurrentDir = $(CURDIR) |
119 |
+ |
CombinedStaticLib = $(LibDir)/libOOPSE.a |
120 |
+ |
CombinedParallelStaticLib = $(LibDir)/libOOPSE_MPI.a |
121 |
|
|
122 |
|
ifdef Source |
123 |
|
#get the relative path of current package to source directory |
124 |
|
# /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside |
125 |
|
#Package = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g') |
126 |
|
#use shell script to get the absolute path and then rip it off from $(CurrentDir) |
127 |
< |
Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir)) |
127 |
> |
#Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir)) |
128 |
> |
# REMINDER: We are now using the Package line in each subdir makefile. |
129 |
> |
# This avoids the strange path problem and the subshell |
130 |
|
|
131 |
|
PackageList = $(Package) |
132 |
|
PackageSourceDir = $(SourceDir)/$(Package) |
134 |
|
PackageParallelTargetDir = $(ParallelTargetDir) |
135 |
|
JavaMainClass = $(subst /,.,$(Package)).$(Main) |
136 |
|
else |
137 |
< |
PackageList = $(Packages) $(JavaPackages) |
137 |
> |
PackageList = $(PackageLibs) $(JavaPackages) $(Applications) |
138 |
|
endif |
139 |
|
|
140 |
|
PackageListLoop = $(patsubst %,$(SourceDir)/%/.loop,$(PackageList)) |
185 |
|
JniHeaders = $(JniSource:%.java= $(PackageSourceDir)/%.h) |
186 |
|
ObjectFiles = $(CFiles:%.c= $(PackageTargetDir)/%.o)\ |
187 |
|
$(CppFiles:%.cpp= $(PackageTargetDir)/%.o)\ |
188 |
< |
$(FortranFiles:%.f= $(PackageTargetDir)/%.o)\ |
189 |
< |
$(F90Files:%.F90= $(PackageTargetDir)/%.o)\ |
190 |
< |
$(LexFiles:%.l= $(PackageTargetDir)/%.o)\ |
191 |
< |
$(YaccFiles:%.y= $(PackageTargetDir)/%.o) |
188 |
> |
$(FortranFiles:%.f= $(PackageTargetDir)/%.o)\ |
189 |
> |
$(F90Files:%.F90= $(PackageTargetDir)/%.o)\ |
190 |
> |
$(LexFiles:%.l= $(PackageTargetDir)/%.o)\ |
191 |
> |
$(YaccFiles:%.y= $(PackageTargetDir)/%.o) |
192 |
|
ParallelObjectFiles = $(CFiles:%.c= $(PackageParallelTargetDir)/%.o)\ |
193 |
< |
$(CppFiles:%.cpp= $(PackageParallelTargetDir)/%.o)\ |
194 |
< |
$(FortranFiles:%.f= $(PackageParallelTargetDir)/%.o)\ |
195 |
< |
$(F90Files:%.F90= $(PackageParallelTargetDir)/%.o)\ |
196 |
< |
$(LexFiles:%.l= $(PackageParallelTargetDir)/%.o)\ |
197 |
< |
$(YaccFiles:%.y= $(PackageParallelTargetDir)/%.o) |
193 |
> |
$(CppFiles:%.cpp= $(PackageParallelTargetDir)/%.o)\ |
194 |
> |
$(FortranFiles:%.f= $(PackageParallelTargetDir)/%.o)\ |
195 |
> |
$(F90Files:%.F90= $(PackageParallelTargetDir)/%.o)\ |
196 |
> |
$(LexFiles:%.l= $(PackageParallelTargetDir)/%.o)\ |
197 |
> |
$(YaccFiles:%.y= $(PackageParallelTargetDir)/%.o) |
198 |
|
|
199 |
|
DerivedSource = $(YaccFiles:%.y= %.h) \ |
200 |
< |
$(YaccFiles:%.y= %.c) \ |
201 |
< |
$(LexFiles:%.l= %.c) |
200 |
> |
$(YaccFiles:%.y= %.c) \ |
201 |
> |
$(LexFiles:%.l= %.c) |
202 |
|
|
203 |
|
DerivedCFiles = $(YaccFiles:%.y= %.c) \ |
204 |
< |
$(LexFiles:%.l= %.c) |
204 |
> |
$(LexFiles:%.l= %.c) |
205 |
|
|
206 |
|
OtherTargetFiles = $(OtherSourceFiles:%=$(PackageTargetDir)/%) |
207 |
+ |
|
208 |
+ |
########################################################################### |
209 |
+ |
# |
210 |
+ |
# Figure out the names of the module files based on some work done by |
211 |
+ |
# configure. The tr function below is from John Graham-Cumming |
212 |
+ |
# (http://www.jgc.org). |
213 |
+ |
# |
214 |
+ |
# The tr function. Has three arguments: |
215 |
+ |
# |
216 |
+ |
# $1 The list of characters to translate from |
217 |
+ |
# $2 The list of characters to translate to |
218 |
+ |
# $3 The text to translate |
219 |
+ |
# |
220 |
+ |
# For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L. |
221 |
+ |
|
222 |
+ |
tr = $(eval __t := $3) \ |
223 |
+ |
$(foreach c, \ |
224 |
+ |
$(join $(addsuffix :,$1),$2), \ |
225 |
+ |
$(eval __t := \ |
226 |
+ |
$(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \ |
227 |
+ |
$(__t))))$(__t) |
228 |
|
|
229 |
+ |
# Common character classes for use with the tr function. Each of |
230 |
+ |
# these is actually a variable declaration and must be wrapped with |
231 |
+ |
# $() or ${} to be used. |
232 |
+ |
|
233 |
+ |
[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 # |
234 |
+ |
[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 # |
235 |
+ |
[0-9] := 0 1 2 3 4 5 6 7 8 9 # |
236 |
+ |
[A-F] := A B C D E F # |
237 |
+ |
|
238 |
+ |
# Figure out whether we have $(eval) or not (GNU Make 3.80 and above) |
239 |
+ |
# if we do not then we need to use the shell version of tr, and not the |
240 |
+ |
# faster tr function above: |
241 |
+ |
|
242 |
+ |
__have_eval := $(false) |
243 |
+ |
__ignore := $(eval __have_eval := $(true)) |
244 |
+ |
|
245 |
+ |
ifndef __have_eval |
246 |
+ |
uc = $(shell echo $1 | tr "a-z" "A-Z") |
247 |
+ |
lc = $(shell echo $1 | tr "A-Z" "a-z") |
248 |
+ |
else |
249 |
+ |
uc = $(call tr,$([a-z]),$([A-Z]),$1) |
250 |
+ |
lc = $(call tr,$([A-Z]),$([a-z]),$1) |
251 |
+ |
endif |
252 |
+ |
|
253 |
+ |
# OK, now we can actually use these functions to figure out the names |
254 |
+ |
# of the module files: |
255 |
+ |
|
256 |
+ |
ifneq "$(words $(Modules))" "0" |
257 |
+ |
ifeq "$(ModuleCase)" "UPPER" |
258 |
+ |
MODULES = $(call uc,$(Modules)) |
259 |
+ |
else |
260 |
+ |
ifeq "$(ModuleCase)" "lower" |
261 |
+ |
MODULES = $(call lc,$(Modules)) |
262 |
+ |
else |
263 |
+ |
MODULES = $(Modules) |
264 |
+ |
endif |
265 |
+ |
endif |
266 |
+ |
ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix)) |
267 |
+ |
ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix)) |
268 |
+ |
endif |
269 |
+ |
# |
270 |
+ |
########################################################################### |
271 |
+ |
|
272 |
|
ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries)) |
273 |
|
ThirdPartyJars = $(subst $(Space),$(X),$(ThirdPartyJarsTmp)) |
274 |
|
|
280 |
|
#if Main is defined, do not build library. It may not be true sometimes |
281 |
|
ifneq "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0" |
282 |
|
DependencyFile = $(PackageSourceDir)/Makedepend |
283 |
< |
ifneq "$(Main)" "" |
283 |
> |
ifneq "$(words $(Main))" "0" |
284 |
|
Executable = $(BinDir)/$(Main) |
285 |
< |
ParallelExecutable = $(BinDir)/$(Main)_MPI |
285 |
> |
ifeq "$(BuiltParallelExe)" "1" |
286 |
> |
ParallelExecutable = $(BinDir)/$(Main)_MPI |
287 |
> |
endif |
288 |
|
else |
289 |
< |
SharedLibrary = $(LibDir)/lib$(subst /,,$(Package)).so |
290 |
< |
StaticLibrary = $(LibDir)/lib$(subst /,,$(Package)).a |
291 |
< |
ParallelSharedLibrary = $(LibDir)/lib$(subst /,,$(Package))_MPI.so |
292 |
< |
ParallelStaticLibrary = $(LibDir)/lib$(subst /,,$(Package))_MPI.a |
289 |
> |
SharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so |
290 |
> |
StaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a |
291 |
> |
ParallelSharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.so |
292 |
> |
ParallelStaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.a |
293 |
|
endif |
294 |
|
endif |
295 |
+ |
|
296 |
|
# |
297 |
|
# Misc |
298 |
|
# |
300 |
|
JavaPackageNames = $(subst /,.,$(JavaPackages)) |
301 |
|
IncludePath = -I$(SourceDir) $(IncludeDirs:%=-I%) |
302 |
|
LibDirs = -L$(LibDir) $(LibraryDirs:%=-L%) |
303 |
< |
LocalLibs = $(subst /,,$(PackageLibs)) |
304 |
< |
LibList = $(LocalLibs:%=-l%) $(Libraries:%=-l%) |
303 |
> |
LocalLibs = $(subst /,,$(patsubst %, oopse_%_UP, $(PackageLibs))) |
304 |
> |
ParallelLocalLibs= $(subst /,,$(patsubst %, oopse_%_MPI, $(PackageLibs))) |
305 |
> |
LibList = $(LocalLibs:%=-l%) $(Libraries) |
306 |
> |
LibNames = $(LocalLibs:%=$(LibDir)/lib%.a) |
307 |
> |
ParallelLibList = $(ParallelLocalLibs:%=-l%) $(Libraries) |
308 |
> |
ParallelLibNames = $(ParallelLocalLibs:%=$(LibDir)/lib%.a) |
309 |
|
|
310 |
|
|
311 |
|
#--------------------------------------------------------------------------- |
314 |
|
# |
315 |
|
#--------------------------------------------------------------------------- |
316 |
|
Print = @echo |
317 |
< |
Move = mv |
317 |
> |
Move = mv -f |
318 |
|
Copy = cp |
319 |
|
CCompiler = @CC@ |
320 |
|
CppCompiler = @CXX@ |
321 |
|
Linker = @CXX@ |
322 |
|
MakeDepend = makedepend |
323 |
< |
Install = @INSTALL@ |
323 |
> |
INSTALL = @INSTALL@ |
324 |
|
InstallProgram = @INSTALL_PROGRAM@ |
325 |
+ |
InstallScript = @INSTALL_SCRIPT@ |
326 |
|
InstallData = @INSTALL_DATA@ |
327 |
< |
MakeDir = @MKINSTALLDIRS@ |
327 |
> |
MkDir = @MKINSTALLDIRS@ |
328 |
|
Delete = rm -fr |
329 |
|
StaticArchiver = @AR@ |
330 |
|
DynamicArchiver = @CC@ |
342 |
|
List = cat |
343 |
|
Yacc = @YACC@ |
344 |
|
Lex = @LEX@ |
345 |
+ |
Ranlib = @RANLIB@ |
346 |
+ |
Doxygen = @DOXYGEN@ |
347 |
|
|
254 |
– |
|
348 |
|
MakeOptions = -k |
349 |
|
MakeDependOptions = |
350 |
|
StaticArchiverOptions = rc |
353 |
|
JniOptions = |
354 |
|
RmiOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
355 |
|
-sourcepath $(SourceDir) |
356 |
+ |
COptions = $(FrcDeclare) @CFLAGS@ |
357 |
+ |
CParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@ |
358 |
+ |
CppOptions = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@ |
359 |
+ |
CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@ |
360 |
|
FortranOptions = |
361 |
< |
F90Options = -I$(SourceDir) -module $(TargetDir) |
361 |
> |
F90Options = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir) |
362 |
> |
F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) |
363 |
|
JavaCompilerOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
364 |
|
-sourcepath $(SourceDir) -deprecation |
365 |
|
JavaRunOptions = -classpath $(ClassPath) |
385 |
|
|
386 |
|
#--------------------------------------------------------------------------- |
387 |
|
# |
388 |
+ |
# Install |
389 |
+ |
# |
390 |
+ |
#--------------------------------------------------------------------------- |
391 |
+ |
|
392 |
+ |
ifneq "$(words $(SampleFiles))" "0" |
393 |
+ |
MySample = $(subst $(shell cd $(DEV_ROOT)/samples; pwd)/,,$(CurrentDir)) |
394 |
+ |
MyInstallDir = $(SampleSimDir)/$(MySample) |
395 |
+ |
InstallFiles = $(SampleFiles) |
396 |
+ |
InstallCommand = $(InstallData) |
397 |
+ |
endif |
398 |
+ |
|
399 |
+ |
ifneq "$(words $(Main))" "0" |
400 |
+ |
MyInstallDir = $(InstallBinDir) |
401 |
+ |
ifeq "$(UseMPI)" "yes" |
402 |
+ |
InstallFiles = $(Executable) $(ParallelExecutable) |
403 |
+ |
else |
404 |
+ |
InstallFiles = $(Executable) |
405 |
+ |
endif |
406 |
+ |
InstallCommand = $(InstallProgram) |
407 |
+ |
endif |
408 |
+ |
|
409 |
+ |
ifneq "$(words $(ForcefieldFiles))" "0" |
410 |
+ |
MyInstallDir = $(ForceParamDir) |
411 |
+ |
InstallFiles = $(ForcefieldFiles) |
412 |
+ |
InstallCommand = $(InstallData) |
413 |
+ |
endif |
414 |
+ |
|
415 |
+ |
ifneq "$(words $(InstallFiles))" "0" |
416 |
+ |
InstallList = |
417 |
+ |
else |
418 |
+ |
InstallList = $(patsubst %,$(DEV_ROOT)/%,$(Samples)) $(DEV_ROOT)/forceFields $(patsubst %, $(SourceDir)/%,$(Applications)) |
419 |
+ |
endif |
420 |
+ |
|
421 |
+ |
InstallListLoop = $(patsubst %,$(SourceDir)/%/.install,$(PackageList)) $(patsubst %,%/.install,$(InstallList)) |
422 |
+ |
|
423 |
+ |
|
424 |
+ |
|
425 |
+ |
#--------------------------------------------------------------------------- |
426 |
+ |
# |
427 |
|
# Rules |
428 |
|
# |
429 |
|
#--------------------------------------------------------------------------- |
434 |
|
|
435 |
|
# Create target directory |
436 |
|
$(PackageTargetDir) : |
437 |
< |
$(MakeDir) $@ |
437 |
> |
$(MkDir) $@ |
438 |
|
|
439 |
+ |
$(BinDir) : |
440 |
+ |
$(MkDir) $@ |
441 |
+ |
|
442 |
|
# .c -> .o |
443 |
|
$(PackageTargetDir)/%.o : %.c |
444 |
|
$(Print) $@ |
445 |
|
$(CCompiler) $(COptions) -c $(IncludePath) $< -o $@ |
446 |
|
|
447 |
+ |
$(PackageParallelTargetDir)/%.o : %.c |
448 |
+ |
$(Print) $@ |
449 |
+ |
$(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@ |
450 |
+ |
|
451 |
+ |
ifeq "$(UseMPI)" "yes" |
452 |
|
%.o : %.c |
453 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
454 |
+ |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
455 |
+ |
else |
456 |
+ |
%.o : %.c |
457 |
+ |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
458 |
+ |
endif |
459 |
|
|
460 |
|
# .cpp -> .o |
461 |
|
$(PackageTargetDir)/%.o : %.cpp |
462 |
|
$(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@ |
463 |
|
|
464 |
+ |
$(PackageParallelTargetDir)/%.o : %.cpp |
465 |
+ |
$(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@ |
466 |
+ |
|
467 |
+ |
ifeq "$(UseMPI)" "yes" |
468 |
|
%.o : %.cpp |
469 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
470 |
+ |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
471 |
+ |
else |
472 |
+ |
%.o : %.cpp |
473 |
+ |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
474 |
+ |
endif |
475 |
|
|
476 |
|
# .f -> .o |
477 |
|
$(PackageTargetDir)/%.o : %.f |
478 |
|
$(FortranCompiler) $(FortranOptions) -c $< -o $@ |
479 |
|
|
480 |
+ |
$(PackageParallelTargetDir)/%.o : %.f |
481 |
+ |
$(FortranCompiler) $(FortranParallelOptions) -c $< -o $@ |
482 |
+ |
|
483 |
+ |
ifeq "$(UseMPI)" "yes" |
484 |
|
%.o : %.f |
485 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
486 |
+ |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
487 |
+ |
else |
488 |
+ |
%.o : %.f |
489 |
+ |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
490 |
+ |
endif |
491 |
|
|
492 |
|
# .F90 -> .o |
493 |
|
$(PackageTargetDir)/%.o : %.F90 |
494 |
< |
$(F90Compiler) $(F90Options) -c $< -o $@ |
494 |
> |
$(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@ |
495 |
> |
if test -n "`ls *.$(ModSuffix)`"; then \ |
496 |
> |
$(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\ |
497 |
> |
fi |
498 |
|
|
499 |
+ |
$(PackageParallelTargetDir)/%.o : %.F90 |
500 |
+ |
$(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@ |
501 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then \ |
502 |
+ |
$(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\ |
503 |
+ |
fi |
504 |
+ |
|
505 |
+ |
ifeq "$(UseMPI)" "yes" |
506 |
|
%.o : %.F90 |
507 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
508 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then\ |
509 |
+ |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
510 |
+ |
fi |
511 |
|
|
512 |
+ |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
513 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then\ |
514 |
+ |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
515 |
+ |
fi |
516 |
+ |
|
517 |
+ |
else |
518 |
+ |
%.o : %.F90 |
519 |
+ |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
520 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then\ |
521 |
+ |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
522 |
+ |
fi |
523 |
+ |
endif |
524 |
+ |
|
525 |
+ |
|
526 |
|
# .java -> .class |
527 |
|
$(PackageTargetDir)/%.class : $(PackageSourceDir)/%.java |
528 |
|
$(JavaCompiler) $(JavaCompilerOptions) $< |
556 |
|
@$(Lex) -o$@ $? |
557 |
|
|
558 |
|
# .o -> .a |
559 |
< |
$(LibDir)/%.a : $(ObjectFiles) |
559 |
> |
|
560 |
> |
$(LibDir)/%_UP.a : $(ObjectFiles) |
561 |
|
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles) |
562 |
+ |
@touch $(LibDir)/.stamp_UP |
563 |
|
|
564 |
< |
%.a : $(ObjectFiles) |
368 |
< |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
369 |
< |
|
370 |
< |
$(LibDir)/%_MPI.a : $(ParallelObjectFiles) |
564 |
> |
$(LibDir)/%_MPI.a: $(ParallelObjectFiles) |
565 |
|
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles) |
566 |
+ |
@touch $(LibDir)/.stamp_MPI |
567 |
|
|
568 |
+ |
%_UP.a : $(ObjectFiles) |
569 |
+ |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
570 |
+ |
|
571 |
|
%_MPI.a : $(ParallelObjectFiles) |
572 |
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
573 |
|
|
574 |
|
# .o -> .so |
575 |
< |
$(LibDir)/%.so : $(ObjectFiles) |
575 |
> |
$(LibDir)/%_UP.so : $(ObjectFiles) |
576 |
|
$(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@ |
577 |
|
|
380 |
– |
%.so : $(ObjectFiles) |
381 |
– |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
382 |
– |
|
578 |
|
$(LibDir)/%_MPI.so : $(ParallelObjectFiles) |
579 |
|
$(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@ |
580 |
|
|
581 |
+ |
%_UP.so : $(ObjectFiles) |
582 |
+ |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
583 |
+ |
|
584 |
|
%_MPI.so : $(ParallelObjectFiles) |
585 |
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
586 |
|
|
616 |
|
%_Skel.class : %.class |
617 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
618 |
|
|
619 |
+ |
document : |
620 |
+ |
$(Print) Generate Documentation for OOPSE-2.0 |
621 |
+ |
@cd $(DEV_ROOT)/src |
622 |
+ |
$(Doxygen) $(DEV_ROOT)/make/Doxyfile |
623 |
+ |
|
624 |
+ |
#GUN make funtions to merge the libraries |
625 |
+ |
find_objs = $(shell $(StaticArchiver) -t $(1)) |
626 |
+ |
extract_objs = $(shell $(StaticArchiver) -x $(1) $(call find_objs, $(1))) |
627 |
+ |
create_archive = $(shell $(StaticArchiver) $(StaticArchiverOptions) $(2) $(call find_objs, $(1))) |
628 |
+ |
remove_objs = $(shell $(Delete) $(call find_objs, $(1))) |
629 |
+ |
do_create = $(call extract_objs,$(1))$(call create_archive,$(1),$(2))$(call remove_objs,$(1)) |
630 |
+ |
|
631 |
+ |
$(CombinedStaticLib) : $(LibDir)/.stamp_UP |
632 |
+ |
$(Print) create $@ |
633 |
+ |
$(foreach thisLib,$(LibNames),$(call do_create,$(thisLib),$@)) |
634 |
+ |
$(Ranlib) $(CombinedStaticLib) |
635 |
+ |
|
636 |
+ |
$(CombinedParallelStaticLib) : $(LibDir)/.stamp_MPI |
637 |
+ |
$(Print) create $@ |
638 |
+ |
$(foreach thisLib,$(ParallelLibNames), $(call do_create, $(thisLib), $@)) |
639 |
+ |
$(Ranlib) $(CombinedParallelStaticLib) |
640 |
+ |
|
641 |
|
# Executable |
642 |
< |
$(Executable) : $(ObjectFiles) |
643 |
< |
$(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ObjectFiles) -o $@ |
642 |
> |
$(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir) |
643 |
> |
$(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@ |
644 |
|
|
645 |
< |
$(ParallelExecutable) : $(ParallelObjectFiles) |
646 |
< |
$(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ParallelObjectFiles) -o $@ |
645 |
> |
$(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) $(BinDir) |
646 |
> |
$(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@ |
647 |
|
|
648 |
|
# Anything else is just copied from source to target |
649 |
|
$(PackageTargetDir)/% : $(PackageSourceDir)/% |
656 |
|
|
657 |
|
_all : _buildall |
658 |
|
|
659 |
+ |
_buildall : |
660 |
+ |
ifeq "$(UseMPI)" "yes" |
661 |
+ |
_buildall : \ |
662 |
+ |
$(DependencyFile) \ |
663 |
+ |
$(PackageTargetDir) \ |
664 |
+ |
$(ObjectFiles) \ |
665 |
+ |
$(ParallelObjectFiles) \ |
666 |
+ |
$(JavaClassFiles) \ |
667 |
+ |
$(RmiStubFiles) \ |
668 |
+ |
$(RmiSkeletonFiles) \ |
669 |
+ |
$(OtherTargetFiles) \ |
670 |
+ |
$(StaticLibrary) \ |
671 |
+ |
$(ParallelStaticLibrary) \ |
672 |
+ |
$(JarFile) \ |
673 |
+ |
$(Executable) \ |
674 |
+ |
$(ParallelExecutable) |
675 |
+ |
else |
676 |
|
_buildall : \ |
677 |
|
$(DependencyFile) \ |
678 |
|
$(PackageTargetDir) \ |
681 |
|
$(RmiStubFiles) \ |
682 |
|
$(RmiSkeletonFiles) \ |
683 |
|
$(OtherTargetFiles) \ |
447 |
– |
$(SharedLibrary) \ |
684 |
|
$(StaticLibrary) \ |
685 |
|
$(JarFile) \ |
686 |
< |
$(Executable) |
687 |
< |
|
686 |
> |
$(Executable) |
687 |
> |
endif |
688 |
|
|
689 |
+ |
echo : $(PackageListLoop) |
690 |
+ |
$(Print) Done echo. |
691 |
+ |
|
692 |
+ |
_echoall : |
693 |
+ |
$(Print) $(Modules) |
694 |
+ |
|
695 |
|
# make clean |
696 |
|
clean : $(PackageListLoop) |
697 |
|
$(Print) Done clean. |
698 |
|
|
699 |
|
_cleanall : |
700 |
< |
$(Delete) $(ObjectFiles) $(ParallelObjectFiles) |
700 |
> |
$(Delete) \ |
701 |
> |
$(ObjectFiles) \ |
702 |
> |
$(ModuleFiles) \ |
703 |
> |
$(ParallelObjectFiles) \ |
704 |
> |
$(ParallelModuleFiles) \ |
705 |
> |
$(JarFile) \ |
706 |
> |
$(SharedLibrary) \ |
707 |
> |
$(StaticLibrary) \ |
708 |
> |
$(ParallelSharedLibrary) \ |
709 |
> |
$(ParallelStaticLibrary) \ |
710 |
> |
$(CombinedStaticLib) \ |
711 |
> |
$(CombinedParallelStaticLib) |
712 |
|
|
713 |
|
# make distclean |
714 |
|
distclean : $(PackageListLoop) |
715 |
|
$(Print) Done clean. |
716 |
|
|
717 |
< |
_distcleanall : |
718 |
< |
$(Delete) $(ObjectFiles) \ |
466 |
< |
$(ParallelObjectFiles) \ |
467 |
< |
$(JarFile) \ |
468 |
< |
$(SharedLibrary) \ |
469 |
< |
$(StaticLibrary) \ |
470 |
< |
$(ParallelSharedLibrary) \ |
471 |
< |
$(ParallelStaticLibrary) \ |
472 |
< |
$(Executable) \ |
717 |
> |
_distcleanall : _cleanall |
718 |
> |
$(Delete) $(Executable) \ |
719 |
|
$(ParallelExecutable) \ |
720 |
< |
$(DependencyFile) |
720 |
> |
$(DependencyFile) |
721 |
|
|
476 |
– |
|
722 |
|
# make depend |
723 |
|
depend : $(PackageListLoop) |
724 |
|
$(Print) Done dependencies. |
729 |
|
$(Print) $@ |
730 |
|
@cd $(PackageSourceDir) |
731 |
|
|
487 |
– |
touch Make.ctemp |
488 |
– |
touch Make.ctemp |
489 |
– |
|
732 |
|
ifneq "$(words $(CppFiles))" "0" |
733 |
< |
$(CppCompiler) $(IncludePath) -MM $(CppFiles) > Make.cpptemp |
734 |
< |
cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile) |
735 |
< |
cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile) |
733 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CppFiles)>> Make.cpptemp |
734 |
> |
@cat Make.cpptemp >> $(DependencyFile) |
735 |
> |
$(Delete) Make.cpptemp |
736 |
> |
|
737 |
> |
ifeq "$(UseMPI)" "yes" |
738 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CppFiles)>> Make.cpptemp |
739 |
> |
@cat Make.cpptemp >> $(DependencyFile) |
740 |
> |
@$(Delete) Make.cpptemp |
741 |
> |
endif |
742 |
> |
|
743 |
|
endif |
744 |
|
|
745 |
|
ifneq "$(words $(CFiles))" "0" |
746 |
< |
$(CCompiler) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp |
747 |
< |
cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile) |
748 |
< |
cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile) |
746 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CFiles) $(DerivedCFiles) >> Make.ctemp |
747 |
> |
@cat Make.ctemp >> $(DependencyFile) |
748 |
> |
$(Delete) Make.ctemp |
749 |
|
|
750 |
+ |
ifeq "$(UseMPI)" "yes" |
751 |
+ |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CFiles) $(DerivedCFiles) >> Make.ctemp |
752 |
+ |
@cat Make.ctemp >> $(DependencyFile) |
753 |
+ |
@$(Delete) Make.ctemp |
754 |
+ |
endif |
755 |
+ |
|
756 |
|
endif |
757 |
|
|
758 |
|
ifneq "$(words $(F90Files))" "0" |
759 |
< |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/obj/' -D__F90 *.F90 > Make.ftemp |
760 |
< |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/MPIobj/' -DIS_MPI -D__F90 *.F90 >> Make.ftemp |
761 |
< |
cat Make.ftemp >> $(DependencyFile) |
759 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp |
760 |
> |
@cat Make.ftemp >> $(DependencyFile) |
761 |
> |
@$(Delete) Make.ftemp |
762 |
> |
|
763 |
> |
ifeq "$(UseMPI)" "yes" |
764 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) >> Make.ftemp |
765 |
> |
@cat Make.ftemp >> $(DependencyFile) |
766 |
> |
@$(Delete) Make.ftemp |
767 |
> |
endif |
768 |
> |
|
769 |
|
endif |
508 |
– |
$(Delete) Make.cpptemp Make.ctemp Make.ftemp |
770 |
|
|
771 |
|
# make lib |
772 |
|
lib : $(PackageListLoop) |
779 |
|
jarsign : $(JarFile) |
780 |
|
$(JarSigner) -keystore GeoSoftKeystore $(JarFile) myself |
781 |
|
|
782 |
+ |
#make install |
783 |
+ |
%.install : |
784 |
+ |
@$(MAKE) $(MakeOptions) -C $(subst .install,,$@) _installall |
785 |
+ |
|
786 |
+ |
install : $(InstallListLoop) |
787 |
+ |
$(Print) Done Install |
788 |
+ |
|
789 |
+ |
_installall : _buildall _installdata |
790 |
+ |
|
791 |
+ |
$(MyInstallDir) : |
792 |
+ |
$(MkDir) $@ |
793 |
+ |
|
794 |
+ |
_installdata : $(MyInstallDir) |
795 |
+ |
$(Print) $(InstallFiles) |
796 |
+ |
ifneq "$(words $(InstallFiles))" "0" |
797 |
+ |
$(InstallCommand) $(InstallFiles) $(MyInstallDir) |
798 |
+ |
endif |
799 |
+ |
|
800 |
|
# make statistics |
801 |
|
_statisticsall : |
802 |
< |
@$(Print) $(SourceFiles) >> $(DEV_ROOT)/files.tmp |
802 |
> |
@$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp |
803 |
|
|
804 |
|
statistics : $(PackageListLoop) |
805 |
|
@$(List) $(DEV_ROOT)/files.tmp | xargs $(WordCount) $(WordCountOptions) |
813 |
|
|
814 |
|
pure : $(Executable).pure |
815 |
|
|
816 |
+ |
#make cvslog |
817 |
+ |
cvslog: |
818 |
+ |
$(DEV_ROOT)/scripts/cvs2cl.pl |
819 |
+ |
|
820 |
|
# Execute |
821 |
|
_runexe : |
822 |
|
$(Executable) $(RunParameters) |