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 |
+ |
hydrodynamics \ |
56 |
+ |
openbabel\ |
57 |
+ |
antlr\ |
58 |
+ |
mdParser |
59 |
+ |
#packages containing applications |
60 |
+ |
Applications = \ |
61 |
|
applications/oopse \ |
62 |
|
applications/dump2Xyz \ |
63 |
+ |
applications/staticProps \ |
64 |
+ |
applications/dynamicProps \ |
65 |
|
applications/simpleBuilder \ |
66 |
+ |
applications/randomBuilder \ |
67 |
+ |
applications/nanoRodBuilder \ |
68 |
+ |
applications/nanoparticleBuilder \ |
69 |
+ |
applications/atom2mdin \ |
70 |
+ |
applications/hydrodynamics |
71 |
|
|
57 |
– |
#packages contain libraries |
58 |
– |
PackageLibs = \ |
59 |
– |
utils \ |
60 |
– |
math \ |
61 |
– |
types \ |
62 |
– |
primitives \ |
63 |
– |
visitors \ |
64 |
– |
UseTheForce/DarkSide \ |
65 |
– |
UseTheForce \ |
66 |
– |
brains \ |
67 |
– |
io \ |
68 |
– |
integrators \ |
69 |
– |
minimizers \ |
70 |
– |
constraints \ |
71 |
– |
profiling \ |
72 |
– |
restraints \ |
72 |
|
|
73 |
+ |
Samples = \ |
74 |
+ |
samples/alkane \ |
75 |
+ |
samples/argon \ |
76 |
+ |
samples/cutoff \ |
77 |
+ |
samples/dipole \ |
78 |
+ |
samples/gbljtest \ |
79 |
+ |
samples/lipid \ |
80 |
+ |
samples/metals/EAM \ |
81 |
+ |
samples/metals/EAM/nanoparticle \ |
82 |
+ |
samples/metals/EAM/nanorod \ |
83 |
+ |
samples/metals/Sutton-Chen \ |
84 |
+ |
samples/minimizer \ |
85 |
+ |
samples/shape \ |
86 |
+ |
samples/thermoIntegration/liquid \ |
87 |
+ |
samples/thermoIntegration/solid \ |
88 |
+ |
samples/water/dimer \ |
89 |
+ |
samples/water/spce \ |
90 |
+ |
samples/water/ssd \ |
91 |
+ |
samples/water/ssde \ |
92 |
+ |
samples/water/ssdrf \ |
93 |
+ |
samples/water/ssd-ion \ |
94 |
+ |
samples/water/tip3p_ice \ |
95 |
+ |
samples/water/tip4p \ |
96 |
+ |
samples/zcons |
97 |
+ |
|
98 |
|
IncludeDirs = \ |
99 |
< |
@SPRNG_INC_DIR@ \ |
100 |
< |
@MPI_INC_DIR@ |
99 |
> |
@FFTW_INC_DIR@ \ |
100 |
> |
@CGAL_INC_DIR@ \ |
101 |
> |
@MPI_INC_DIR@ |
102 |
|
|
103 |
|
LibraryDirs = \ |
104 |
< |
@SPRNG_LIB_DIR@ \ |
104 |
> |
@FFTW_LIB_DIR@ \ |
105 |
> |
@CGAL_LIB_DIR@ \ |
106 |
|
@MPI_LIB_DIR@ |
107 |
|
|
108 |
|
Libraries = \ |
109 |
< |
@SPRNG_LIB@ \ |
110 |
< |
@MPI_LIB@ |
109 |
> |
@LIBS@ \ |
110 |
> |
@FFTW_LIBS@ \ |
111 |
> |
@CGAL_LIBS@ \ |
112 |
> |
@MPI_LIB@ \ |
113 |
> |
@MPI_F90_LIB@ |
114 |
|
|
86 |
– |
LinkOptions = \ |
87 |
– |
@F90LIBS@ |
88 |
– |
|
115 |
|
OopseHome = @OOPSE_HOME@ |
116 |
< |
ForceParamDir = @OOPSE_HOME@/share/forceFields/ |
117 |
< |
SampleSimDir = @OOPSE_HOME@/share/samples/ |
116 |
> |
ForceParamDir = $(OopseHome)/share/forceFields |
117 |
> |
SampleSimDir = $(OopseHome)/share/samples |
118 |
> |
InstallBinDir = $(OopseHome)/bin |
119 |
> |
DocDir = $(OopseHome)/doc |
120 |
|
FrcDeclare = -DFRC_PATH="$(ForceParamDir)" |
121 |
+ |
F90Declare = -D__FORTRAN90 |
122 |
|
ParallelDeclare = -DIS_MPI |
123 |
+ |
UseMPI = @USE_MPI@ |
124 |
+ |
ModuleCase = @F90_MODULE_NAMES@ |
125 |
+ |
ModSuffix = @MOD@ |
126 |
+ |
LinkOptions = \ |
127 |
+ |
@LDFLAGS@ \ |
128 |
+ |
@FCLIBS@ \ |
129 |
+ |
@CXXFLAGS@ |
130 |
+ |
|
131 |
|
|
132 |
+ |
ParallelLinkOptions = \ |
133 |
+ |
@LDFLAGS@ \ |
134 |
+ |
@FCLIBS@ \ |
135 |
+ |
@CXXFLAGS@ |
136 |
|
|
137 |
+ |
|
138 |
|
#--------------------------------------------------------------------------- |
139 |
|
# |
140 |
|
# Directories |
146 |
|
ParallelTargetDir = $(DEV_ROOT)/MPIobj |
147 |
|
LibDir = $(DEV_ROOT)/lib |
148 |
|
MakeDir = $(DEV_ROOT)/make |
149 |
+ |
MainMakefile = $(MakeDir)/Makefile |
150 |
|
BinDir = $(DEV_ROOT)/bin |
151 |
|
DocsDir = $(DEV_ROOT)/docs |
152 |
|
CurrentDir = $(CURDIR) |
153 |
+ |
CombinedStaticLib = $(LibDir)/libOOPSE.a |
154 |
+ |
CombinedParallelStaticLib = $(LibDir)/libOOPSE_MPI.a |
155 |
|
|
156 |
|
ifdef Source |
157 |
|
#get the relative path of current package to source directory |
158 |
|
# /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside |
159 |
|
#Package = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g') |
160 |
|
#use shell script to get the absolute path and then rip it off from $(CurrentDir) |
161 |
< |
Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir)) |
161 |
> |
#Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir)) |
162 |
> |
# REMINDER: We are now using the Package line in each subdir makefile. |
163 |
> |
# This avoids the strange path problem and the subshell |
164 |
|
|
165 |
|
PackageList = $(Package) |
166 |
|
PackageSourceDir = $(SourceDir)/$(Package) |
168 |
|
PackageParallelTargetDir = $(ParallelTargetDir) |
169 |
|
JavaMainClass = $(subst /,.,$(Package)).$(Main) |
170 |
|
else |
171 |
< |
PackageList = $(Packages) $(JavaPackages) |
171 |
> |
PackageList = $(PackageLibs) $(JavaPackages) $(Applications) |
172 |
|
endif |
173 |
|
|
174 |
|
PackageListLoop = $(patsubst %,$(SourceDir)/%/.loop,$(PackageList)) |
219 |
|
JniHeaders = $(JniSource:%.java= $(PackageSourceDir)/%.h) |
220 |
|
ObjectFiles = $(CFiles:%.c= $(PackageTargetDir)/%.o)\ |
221 |
|
$(CppFiles:%.cpp= $(PackageTargetDir)/%.o)\ |
222 |
< |
$(FortranFiles:%.f= $(PackageTargetDir)/%.o)\ |
223 |
< |
$(F90Files:%.F90= $(PackageTargetDir)/%.o)\ |
224 |
< |
$(LexFiles:%.l= $(PackageTargetDir)/%.o)\ |
225 |
< |
$(YaccFiles:%.y= $(PackageTargetDir)/%.o) |
222 |
> |
$(FortranFiles:%.f= $(PackageTargetDir)/%.o)\ |
223 |
> |
$(F90Files:%.F90= $(PackageTargetDir)/%.o)\ |
224 |
> |
$(LexFiles:%.l= $(PackageTargetDir)/%.o)\ |
225 |
> |
$(YaccFiles:%.y= $(PackageTargetDir)/%.o) |
226 |
|
ParallelObjectFiles = $(CFiles:%.c= $(PackageParallelTargetDir)/%.o)\ |
227 |
< |
$(CppFiles:%.cpp= $(PackageParallelTargetDir)/%.o)\ |
228 |
< |
$(FortranFiles:%.f= $(PackageParallelTargetDir)/%.o)\ |
229 |
< |
$(F90Files:%.F90= $(PackageParallelTargetDir)/%.o)\ |
230 |
< |
$(LexFiles:%.l= $(PackageParallelTargetDir)/%.o)\ |
231 |
< |
$(YaccFiles:%.y= $(PackageParallelTargetDir)/%.o) |
227 |
> |
$(CppFiles:%.cpp= $(PackageParallelTargetDir)/%.o)\ |
228 |
> |
$(FortranFiles:%.f= $(PackageParallelTargetDir)/%.o)\ |
229 |
> |
$(F90Files:%.F90= $(PackageParallelTargetDir)/%.o)\ |
230 |
> |
$(LexFiles:%.l= $(PackageParallelTargetDir)/%.o)\ |
231 |
> |
$(YaccFiles:%.y= $(PackageParallelTargetDir)/%.o) |
232 |
|
|
233 |
|
DerivedSource = $(YaccFiles:%.y= %.h) \ |
234 |
< |
$(YaccFiles:%.y= %.c) \ |
235 |
< |
$(LexFiles:%.l= %.c) |
234 |
> |
$(YaccFiles:%.y= %.c) \ |
235 |
> |
$(LexFiles:%.l= %.c) |
236 |
|
|
237 |
|
DerivedCFiles = $(YaccFiles:%.y= %.c) \ |
238 |
< |
$(LexFiles:%.l= %.c) |
238 |
> |
$(LexFiles:%.l= %.c) |
239 |
|
|
240 |
|
OtherTargetFiles = $(OtherSourceFiles:%=$(PackageTargetDir)/%) |
241 |
|
|
242 |
+ |
########################################################################### |
243 |
+ |
# |
244 |
+ |
# Figure out the names of the module files based on some work done by |
245 |
+ |
# configure. The tr function below is from John Graham-Cumming |
246 |
+ |
# (http://www.jgc.org). |
247 |
+ |
# |
248 |
+ |
# The tr function. Has three arguments: |
249 |
+ |
# |
250 |
+ |
# $1 The list of characters to translate from |
251 |
+ |
# $2 The list of characters to translate to |
252 |
+ |
# $3 The text to translate |
253 |
+ |
# |
254 |
+ |
# For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L. |
255 |
+ |
|
256 |
+ |
tr = $(eval __t := $3) \ |
257 |
+ |
$(foreach c, \ |
258 |
+ |
$(join $(addsuffix :,$1),$2), \ |
259 |
+ |
$(eval __t := \ |
260 |
+ |
$(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \ |
261 |
+ |
$(__t))))$(__t) |
262 |
+ |
|
263 |
+ |
# Common character classes for use with the tr function. Each of |
264 |
+ |
# these is actually a variable declaration and must be wrapped with |
265 |
+ |
# $() or ${} to be used. |
266 |
+ |
|
267 |
+ |
[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 # |
268 |
+ |
[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 # |
269 |
+ |
[0-9] := 0 1 2 3 4 5 6 7 8 9 # |
270 |
+ |
[A-F] := A B C D E F # |
271 |
+ |
|
272 |
+ |
# Figure out whether we have $(eval) or not (GNU Make 3.80 and above) |
273 |
+ |
# if we do not then we need to use the shell version of tr, and not the |
274 |
+ |
# faster tr function above: |
275 |
+ |
|
276 |
+ |
__have_eval := $(false) |
277 |
+ |
__ignore := $(eval __have_eval := $(true)) |
278 |
+ |
|
279 |
+ |
ifndef __have_eval |
280 |
+ |
uc = $(shell echo $1 | tr "a-z" "A-Z") |
281 |
+ |
lc = $(shell echo $1 | tr "A-Z" "a-z") |
282 |
+ |
else |
283 |
+ |
uc = $(call tr,$([a-z]),$([A-Z]),$1) |
284 |
+ |
lc = $(call tr,$([A-Z]),$([a-z]),$1) |
285 |
+ |
endif |
286 |
+ |
|
287 |
+ |
# OK, now we can actually use these functions to figure out the names |
288 |
+ |
# of the module files: |
289 |
+ |
|
290 |
+ |
ifneq "$(words $(Modules))" "0" |
291 |
+ |
ifeq "$(ModuleCase)" "UPPER" |
292 |
+ |
MODULES = $(call uc,$(Modules)) |
293 |
+ |
else |
294 |
+ |
ifeq "$(ModuleCase)" "lower" |
295 |
+ |
MODULES = $(call lc,$(Modules)) |
296 |
+ |
else |
297 |
+ |
MODULES = $(Modules) |
298 |
+ |
endif |
299 |
+ |
endif |
300 |
+ |
ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix)) |
301 |
+ |
ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix)) |
302 |
+ |
endif |
303 |
+ |
# |
304 |
+ |
########################################################################### |
305 |
+ |
|
306 |
|
ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries)) |
307 |
|
ThirdPartyJars = $(subst $(Space),$(X),$(ThirdPartyJarsTmp)) |
308 |
|
|
314 |
|
#if Main is defined, do not build library. It may not be true sometimes |
315 |
|
ifneq "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0" |
316 |
|
DependencyFile = $(PackageSourceDir)/Makedepend |
317 |
< |
ifneq "$(Main)" "" |
317 |
> |
ifneq "$(words $(Main))" "0" |
318 |
|
Executable = $(BinDir)/$(Main) |
319 |
< |
ParallelExecutable = $(BinDir)/$(Main)_MPI |
319 |
> |
ifeq "$(BuiltParallelExe)" "1" |
320 |
> |
ParallelExecutable = $(BinDir)/$(Main)_MPI |
321 |
> |
endif |
322 |
|
else |
323 |
< |
SharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).so |
324 |
< |
StaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).a |
323 |
> |
SharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so |
324 |
> |
StaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a |
325 |
|
ParallelSharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.so |
326 |
|
ParallelStaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.a |
327 |
|
endif |
328 |
|
endif |
329 |
+ |
|
330 |
|
# |
331 |
|
# Misc |
332 |
|
# |
334 |
|
JavaPackageNames = $(subst /,.,$(JavaPackages)) |
335 |
|
IncludePath = -I$(SourceDir) $(IncludeDirs:%=-I%) |
336 |
|
LibDirs = -L$(LibDir) $(LibraryDirs:%=-L%) |
337 |
< |
LocalLibs = $(subst /,,$(patsubst %, oopse_%, $(PackageLibs))) |
337 |
> |
LocalLibs = $(subst /,,$(patsubst %, oopse_%_UP, $(PackageLibs))) |
338 |
|
ParallelLocalLibs= $(subst /,,$(patsubst %, oopse_%_MPI, $(PackageLibs))) |
339 |
|
LibList = $(LocalLibs:%=-l%) $(Libraries) |
340 |
< |
ParallelLibList = $(LocalLibs:%=-l%) $(Libraries) |
340 |
> |
LibNames = $(LocalLibs:%=$(LibDir)/lib%.a) |
341 |
> |
ParallelLibList = $(ParallelLocalLibs:%=-l%) $(Libraries) |
342 |
> |
ParallelLibNames = $(ParallelLocalLibs:%=$(LibDir)/lib%.a) |
343 |
|
|
344 |
|
|
345 |
|
#--------------------------------------------------------------------------- |
348 |
|
# |
349 |
|
#--------------------------------------------------------------------------- |
350 |
|
Print = @echo |
351 |
< |
Move = mv |
351 |
> |
Move = mv -f |
352 |
|
Copy = cp |
353 |
|
CCompiler = @CC@ |
354 |
|
CppCompiler = @CXX@ |
355 |
|
Linker = @CXX@ |
356 |
|
MakeDepend = makedepend |
357 |
< |
Install = @INSTALL@ |
357 |
> |
LN_S = @LN_S@ |
358 |
> |
INSTALL = @INSTALL@ |
359 |
> |
EGREP = @EGREP@ |
360 |
|
InstallProgram = @INSTALL_PROGRAM@ |
361 |
+ |
InstallScript = @INSTALL_SCRIPT@ |
362 |
|
InstallData = @INSTALL_DATA@ |
363 |
< |
MakeDir = @MKINSTALLDIRS@ |
364 |
< |
Delete = rm -fr |
363 |
> |
MkDir = @MKINSTALLDIRS@ |
364 |
> |
Delete = rm -f |
365 |
|
StaticArchiver = @AR@ |
366 |
|
DynamicArchiver = @CC@ |
367 |
|
FortranCompiler = @FC@ |
249 |
– |
F90Compiler = @F90@ |
368 |
|
JavaCompiler = $(JAVA_HOME)/bin/javac |
369 |
|
JavaArchiver = $(JAVA_HOME)/bin/jar |
370 |
|
JarSigner = $(JAVA_HOME)/bin/jarsigner |
377 |
|
List = cat |
378 |
|
Yacc = @YACC@ |
379 |
|
Lex = @LEX@ |
380 |
+ |
Ranlib = @RANLIB@ |
381 |
+ |
Doxygen = @DOXYGEN@ |
382 |
|
|
263 |
– |
|
383 |
|
MakeOptions = -k |
384 |
|
MakeDependOptions = |
385 |
|
StaticArchiverOptions = rc |
388 |
|
JniOptions = |
389 |
|
RmiOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
390 |
|
-sourcepath $(SourceDir) |
391 |
< |
COptions = $(FrcDeclare) |
392 |
< |
CParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
393 |
< |
CppOptions = $(FrcDeclare) |
394 |
< |
CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
395 |
< |
FortranOptions = |
396 |
< |
F90Options = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir) |
278 |
< |
F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir) @PREPDEFFLAG@$(ParallelDeclare) |
391 |
> |
COptions = $(FrcDeclare) @CPPFLAGS@ @CFLAGS@ |
392 |
> |
CParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CPPFLAGS@ @CFLAGS@ |
393 |
> |
CppOptions = $(FrcDeclare) @CPPFLAGS@ @CXXFLAGS@ |
394 |
> |
CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CPPFLAGS@ @CXXFLAGS@ |
395 |
> |
FortranOptions = @FCFLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir) @FCFLAGS_SRCEXT@ |
396 |
> |
FortranParallelOptions = @FCFLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) @FCFLAGS_SRCEXT@ |
397 |
|
JavaCompilerOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
398 |
|
-sourcepath $(SourceDir) -deprecation |
399 |
|
JavaRunOptions = -classpath $(ClassPath) |
415 |
|
|
416 |
|
Empty = |
417 |
|
Space = $(Empty) $(Empty) |
418 |
+ |
|
419 |
+ |
|
420 |
+ |
#--------------------------------------------------------------------------- |
421 |
+ |
# |
422 |
+ |
# Install |
423 |
+ |
# |
424 |
+ |
#--------------------------------------------------------------------------- |
425 |
+ |
|
426 |
+ |
ifneq "$(words $(SampleFiles))" "0" |
427 |
+ |
MySample = $(subst $(shell cd $(DEV_ROOT)/samples; pwd)/,,$(CurrentDir)) |
428 |
+ |
MyInstallDir = $(SampleSimDir)/$(MySample) |
429 |
+ |
InstallFiles = $(SampleFiles) |
430 |
+ |
InstallCommand = $(InstallData) |
431 |
+ |
endif |
432 |
+ |
|
433 |
+ |
ifneq "$(words $(Main))" "0" |
434 |
+ |
MyInstallDir = $(InstallBinDir) |
435 |
+ |
ifeq "$(UseMPI)" "yes" |
436 |
+ |
InstallFiles = $(Executable) $(ParallelExecutable) |
437 |
+ |
else |
438 |
+ |
InstallFiles = $(Executable) |
439 |
+ |
endif |
440 |
+ |
InstallCommand = $(InstallProgram) |
441 |
+ |
ifneq "$(words $(LinkTargets))" "0" |
442 |
+ |
MyLinkSource = $(patsubst %, $(MyInstallDir)/%,$(Main)) |
443 |
+ |
MyLinkTargets = $(patsubst %, $(MyInstallDir)/%,$(LinkTargets)) |
444 |
+ |
endif |
445 |
+ |
endif |
446 |
+ |
|
447 |
+ |
ifneq "$(words $(ForcefieldFiles))" "0" |
448 |
+ |
MyInstallDir = $(ForceParamDir) |
449 |
+ |
InstallFiles = $(ForcefieldFiles) |
450 |
+ |
InstallCommand = $(InstallData) |
451 |
+ |
endif |
452 |
+ |
|
453 |
+ |
ifneq "$(words $(InstallFiles))" "0" |
454 |
+ |
InstallList = |
455 |
+ |
else |
456 |
+ |
InstallList = $(patsubst %,$(DEV_ROOT)/%,$(Samples)) $(DEV_ROOT)/forceFields $(patsubst %, $(SourceDir)/%,$(Applications)) |
457 |
+ |
endif |
458 |
+ |
|
459 |
+ |
InstallListLoop = $(patsubst %,$(SourceDir)/%/.install,$(PackageList)) $(patsubst %,%/.install,$(InstallList)) |
460 |
|
|
461 |
|
|
462 |
+ |
|
463 |
|
#--------------------------------------------------------------------------- |
464 |
|
# |
465 |
|
# Rules |
472 |
|
|
473 |
|
# Create target directory |
474 |
|
$(PackageTargetDir) : |
475 |
< |
$(MakeDir) $@ |
475 |
> |
$(MkDir) $@ |
476 |
|
|
477 |
+ |
$(BinDir) : |
478 |
+ |
$(MkDir) $@ |
479 |
+ |
|
480 |
|
# .c -> .o |
481 |
< |
$(PackageTargetDir)/%.o : %.c |
481 |
> |
$(PackageTargetDir)/%.o : %.c $(MainMakefile) |
482 |
|
$(Print) $@ |
483 |
|
$(CCompiler) $(COptions) -c $(IncludePath) $< -o $@ |
484 |
|
|
485 |
< |
%.o : %.c |
485 |
> |
$(PackageParallelTargetDir)/%.o : %.c $(MainMakefile) |
486 |
> |
$(Print) $@ |
487 |
> |
$(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@ |
488 |
> |
|
489 |
> |
ifeq "$(UseMPI)" "yes" |
490 |
> |
%.o : %.c $(MainMakefile) |
491 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
492 |
+ |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
493 |
+ |
else |
494 |
+ |
%.o : %.c $(MainMakefile) |
495 |
+ |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
496 |
+ |
endif |
497 |
|
|
498 |
|
# .cpp -> .o |
499 |
< |
$(PackageTargetDir)/%.o : %.cpp |
499 |
> |
$(PackageTargetDir)/%.o : %.cpp $(MainMakefile) |
500 |
|
$(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@ |
501 |
|
|
502 |
< |
%.o : %.cpp |
502 |
> |
$(PackageParallelTargetDir)/%.o : %.cpp $(MainMakefile) |
503 |
> |
$(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@ |
504 |
> |
|
505 |
> |
ifeq "$(UseMPI)" "yes" |
506 |
> |
%.o : %.cpp $(MainMakefile) |
507 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
508 |
+ |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
509 |
+ |
else |
510 |
+ |
%.o : %.cpp $(MainMakefile) |
511 |
+ |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
512 |
+ |
endif |
513 |
|
|
514 |
|
# .f -> .o |
515 |
< |
$(PackageTargetDir)/%.o : %.f |
515 |
> |
$(PackageTargetDir)/%.o : %.f $(MainMakefile) |
516 |
|
$(FortranCompiler) $(FortranOptions) -c $< -o $@ |
517 |
|
|
518 |
< |
%.o : %.f |
518 |
> |
$(PackageParallelTargetDir)/%.o : %.f $(MainMakefile) |
519 |
> |
$(FortranCompiler) $(FortranParallelOptions) -c $< -o $@ |
520 |
> |
|
521 |
> |
ifeq "$(UseMPI)" "yes" |
522 |
> |
%.o : %.f $(MainMakefile) |
523 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
524 |
+ |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
525 |
+ |
else |
526 |
+ |
%.o : %.f $(MainMakefile) |
527 |
+ |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
528 |
+ |
endif |
529 |
|
|
530 |
|
# .F90 -> .o |
531 |
< |
$(PackageTargetDir)/%.o : %.F90 |
532 |
< |
$(F90Compiler) $(F90Options) -c $< -o $@ |
531 |
> |
$(PackageTargetDir)/%.o : %.F90 $(MainMakefile) |
532 |
> |
$(FortranCompiler) $(FortranOptions) $(IncludePath) -c $< -o $@ |
533 |
> |
if test -n "`ls *.$(ModSuffix)`"; then \ |
534 |
> |
$(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\ |
535 |
> |
fi |
536 |
|
|
537 |
< |
%.o : %.F90 |
537 |
> |
$(PackageParallelTargetDir)/%.o : %.F90 $(MainMakefile) |
538 |
> |
$(FortranCompiler) $(FortranParallelOptions) $(IncludePath) -c $< -o $@ |
539 |
> |
if test -n "`ls *.$(ModSuffix)`"; then \ |
540 |
> |
$(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\ |
541 |
> |
fi |
542 |
> |
|
543 |
> |
ifeq "$(UseMPI)" "yes" |
544 |
> |
%.o : %.F90 $(MainMakefile) |
545 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
546 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then\ |
547 |
+ |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
548 |
+ |
fi |
549 |
|
|
550 |
+ |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
551 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then\ |
552 |
+ |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
553 |
+ |
fi |
554 |
+ |
|
555 |
+ |
else |
556 |
+ |
%.o : %.F90 $(MainMakefile) |
557 |
+ |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
558 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then\ |
559 |
+ |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
560 |
+ |
fi |
561 |
+ |
endif |
562 |
+ |
|
563 |
+ |
|
564 |
|
# .java -> .class |
565 |
|
$(PackageTargetDir)/%.class : $(PackageSourceDir)/%.java |
566 |
|
$(JavaCompiler) $(JavaCompilerOptions) $< |
594 |
|
@$(Lex) -o$@ $? |
595 |
|
|
596 |
|
# .o -> .a |
597 |
< |
$(LibDir)/%.a : $(ObjectFiles) |
597 |
> |
|
598 |
> |
$(LibDir)/%_UP.a : $(ObjectFiles) |
599 |
|
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles) |
600 |
+ |
@touch $(LibDir)/.stamp_UP |
601 |
|
|
602 |
< |
%.a : $(ObjectFiles) |
382 |
< |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
383 |
< |
|
384 |
< |
$(LibDir)/%_MPI.a : $(ParallelObjectFiles) |
602 |
> |
$(LibDir)/%_MPI.a: $(ParallelObjectFiles) |
603 |
|
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles) |
604 |
+ |
@touch $(LibDir)/.stamp_MPI |
605 |
|
|
606 |
+ |
%_UP.a : $(ObjectFiles) |
607 |
+ |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
608 |
+ |
|
609 |
|
%_MPI.a : $(ParallelObjectFiles) |
610 |
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
611 |
|
|
612 |
|
# .o -> .so |
613 |
< |
$(LibDir)/%.so : $(ObjectFiles) |
613 |
> |
$(LibDir)/%_UP.so : $(ObjectFiles) |
614 |
|
$(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@ |
615 |
|
|
394 |
– |
%.so : $(ObjectFiles) |
395 |
– |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
396 |
– |
|
616 |
|
$(LibDir)/%_MPI.so : $(ParallelObjectFiles) |
617 |
|
$(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@ |
618 |
|
|
619 |
+ |
%_UP.so : $(ObjectFiles) |
620 |
+ |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
621 |
+ |
|
622 |
|
%_MPI.so : $(ParallelObjectFiles) |
623 |
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
624 |
|
|
654 |
|
%_Skel.class : %.class |
655 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
656 |
|
|
657 |
+ |
document : |
658 |
+ |
$(Print) Generate Documentation for OOPSE-2.0 |
659 |
+ |
@cd $(DEV_ROOT)/src |
660 |
+ |
$(Doxygen) $(DEV_ROOT)/make/Doxyfile |
661 |
+ |
|
662 |
+ |
#GUN make funtions to merge the libraries |
663 |
+ |
find_objs = $(shell $(StaticArchiver) -t $(1) | $(EGREP) -v "SYMDEF") |
664 |
+ |
extract_objs = $(shell $(StaticArchiver) -x $(1) $(call find_objs, $(1))) |
665 |
+ |
create_archive = $(shell $(StaticArchiver) $(StaticArchiverOptions) $(2) $(call find_objs, $(1))) |
666 |
+ |
remove_objs = $(shell $(Delete) $(call find_objs, $(1))) |
667 |
+ |
do_create = $(call extract_objs,$(1))$(call create_archive,$(1),$(2))$(call remove_objs,$(1)) |
668 |
+ |
do_link = $(shell $(LN_S) $(1) $(2)) |
669 |
+ |
all_objs = $(foreach thisLib,$(LibNames), $(call find_objs, $(thisLib))) |
670 |
+ |
all_parallel_objs = $(foreach thisLib,$(ParallelLibNames), $(call find_objs, $(thisLib))) |
671 |
+ |
all_lib_objs = $(patsubst %,$(TargetDir)/%,$(call all_objs)) |
672 |
+ |
all_lib_parallel_objs = $(patsubst %,$(ParallelTargetDir)/%,$(call all_parallel_objs)) |
673 |
+ |
|
674 |
+ |
$(CombinedStaticLib) : $(LibDir)/.stamp_UP |
675 |
+ |
$(Print) creating $@ |
676 |
+ |
$(StaticArchiver) $(StaticArchiverOptions) $@ $(call all_lib_objs) |
677 |
+ |
$(Ranlib) $(CombinedStaticLib) |
678 |
+ |
|
679 |
+ |
$(CombinedParallelStaticLib) : $(LibDir)/.stamp_MPI |
680 |
+ |
$(Print) creating $@ |
681 |
+ |
$(StaticArchiver) $(StaticArchiverOptions) $@ $(call all_lib_parallel_objs) |
682 |
+ |
$(Ranlib) $(CombinedParallelStaticLib) |
683 |
+ |
|
684 |
|
# Executable |
685 |
< |
$(Executable) : $(ObjectFiles) |
686 |
< |
$(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ObjectFiles) -o $@ |
685 |
> |
$(Executable) : $(CombinedStaticLib) $(ObjectFiles) |
686 |
> |
if test ! -d $(BinDir); then \ |
687 |
> |
$(MkDir) $(BinDir) ;\ |
688 |
> |
fi |
689 |
> |
$(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@ |
690 |
|
|
691 |
< |
$(ParallelExecutable) : $(ParallelObjectFiles) |
692 |
< |
$(Linker) $(LinkOptions) $(LibDirs) $(ParallelLibList) $(ParallelObjectFiles) -o $@ |
691 |
> |
$(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) |
692 |
> |
if test ! -d $(BinDir); then \ |
693 |
> |
$(MkDir) $(BinDir) ;\ |
694 |
> |
fi |
695 |
> |
$(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@ |
696 |
|
|
697 |
|
# Anything else is just copied from source to target |
698 |
|
$(PackageTargetDir)/% : $(PackageSourceDir)/% |
705 |
|
|
706 |
|
_all : _buildall |
707 |
|
|
708 |
+ |
_buildall : |
709 |
+ |
ifeq "$(UseMPI)" "yes" |
710 |
|
_buildall : \ |
711 |
|
$(DependencyFile) \ |
712 |
|
$(PackageTargetDir) \ |
713 |
|
$(ObjectFiles) \ |
714 |
+ |
$(ParallelObjectFiles) \ |
715 |
|
$(JavaClassFiles) \ |
716 |
|
$(RmiStubFiles) \ |
717 |
|
$(RmiSkeletonFiles) \ |
718 |
|
$(OtherTargetFiles) \ |
461 |
– |
$(SharedLibrary) \ |
719 |
|
$(StaticLibrary) \ |
720 |
+ |
$(ParallelStaticLibrary) \ |
721 |
|
$(JarFile) \ |
722 |
< |
$(Executable) |
723 |
< |
|
722 |
> |
$(Executable) \ |
723 |
> |
$(ParallelExecutable) |
724 |
> |
else |
725 |
> |
_buildall : \ |
726 |
> |
$(DependencyFile) \ |
727 |
> |
$(PackageTargetDir) \ |
728 |
> |
$(ObjectFiles) \ |
729 |
> |
$(JavaClassFiles) \ |
730 |
> |
$(RmiStubFiles) \ |
731 |
> |
$(RmiSkeletonFiles) \ |
732 |
> |
$(OtherTargetFiles) \ |
733 |
> |
$(StaticLibrary) \ |
734 |
> |
$(JarFile) \ |
735 |
> |
$(Executable) |
736 |
> |
endif |
737 |
|
|
738 |
+ |
echo : $(PackageListLoop) |
739 |
+ |
$(Print) Done echo. |
740 |
+ |
|
741 |
+ |
_echoall : |
742 |
+ |
$(Print) $(Modules) |
743 |
+ |
|
744 |
|
# make clean |
745 |
|
clean : $(PackageListLoop) |
746 |
|
$(Print) Done clean. |
747 |
|
|
748 |
|
_cleanall : |
749 |
< |
$(Delete) $(ObjectFiles) $(ParallelObjectFiles) |
749 |
> |
$(Delete) \ |
750 |
> |
$(ObjectFiles) \ |
751 |
> |
$(ModuleFiles) \ |
752 |
> |
$(ParallelObjectFiles) \ |
753 |
> |
$(ParallelModuleFiles) \ |
754 |
> |
$(JarFile) \ |
755 |
> |
$(SharedLibrary) \ |
756 |
> |
$(StaticLibrary) \ |
757 |
> |
$(ParallelSharedLibrary) \ |
758 |
> |
$(ParallelStaticLibrary) \ |
759 |
> |
$(CombinedStaticLib) \ |
760 |
> |
$(CombinedParallelStaticLib) |
761 |
|
|
762 |
|
# make distclean |
763 |
|
distclean : $(PackageListLoop) |
764 |
|
$(Print) Done clean. |
765 |
|
|
766 |
< |
_distcleanall : |
767 |
< |
$(Delete) $(ObjectFiles) \ |
480 |
< |
$(ParallelObjectFiles) \ |
481 |
< |
$(JarFile) \ |
482 |
< |
$(SharedLibrary) \ |
483 |
< |
$(StaticLibrary) \ |
484 |
< |
$(ParallelSharedLibrary) \ |
485 |
< |
$(ParallelStaticLibrary) \ |
486 |
< |
$(Executable) \ |
766 |
> |
_distcleanall : _cleanall |
767 |
> |
$(Delete) $(Executable) \ |
768 |
|
$(ParallelExecutable) \ |
769 |
|
$(DependencyFile) |
770 |
|
|
490 |
– |
|
771 |
|
# make depend |
772 |
|
depend : $(PackageListLoop) |
773 |
|
$(Print) Done dependencies. |
778 |
|
$(Print) $@ |
779 |
|
@cd $(PackageSourceDir) |
780 |
|
|
501 |
– |
@touch Make.ctemp |
502 |
– |
@touch Make.ctemp |
503 |
– |
|
781 |
|
ifneq "$(words $(CppFiles))" "0" |
782 |
< |
$(CppCompiler) $(IncludePath) -MM $(CppFiles) > Make.cpptemp |
783 |
< |
cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile) |
784 |
< |
cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile) |
782 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CppFiles)>> Make.cpptemp |
783 |
> |
@cat Make.cpptemp >> $(DependencyFile) |
784 |
> |
$(Delete) Make.cpptemp |
785 |
> |
|
786 |
> |
ifeq "$(UseMPI)" "yes" |
787 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CppFiles)>> Make.cpptemp |
788 |
> |
@cat Make.cpptemp >> $(DependencyFile) |
789 |
> |
@$(Delete) Make.cpptemp |
790 |
> |
endif |
791 |
> |
|
792 |
|
endif |
793 |
|
|
794 |
|
ifneq "$(words $(CFiles))" "0" |
795 |
< |
$(CCompiler) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp |
796 |
< |
cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile) |
797 |
< |
cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile) |
795 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CFiles) $(DerivedCFiles) >> Make.ctemp |
796 |
> |
@cat Make.ctemp >> $(DependencyFile) |
797 |
> |
$(Delete) Make.ctemp |
798 |
|
|
799 |
+ |
ifeq "$(UseMPI)" "yes" |
800 |
+ |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CFiles) $(DerivedCFiles) >> Make.ctemp |
801 |
+ |
@cat Make.ctemp >> $(DependencyFile) |
802 |
+ |
@$(Delete) Make.ctemp |
803 |
+ |
endif |
804 |
+ |
|
805 |
|
endif |
806 |
|
|
807 |
|
ifneq "$(words $(F90Files))" "0" |
808 |
< |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/obj/' -D__FORTRAN90 $(F90Files) > Make.ftemp |
809 |
< |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/MPIobj/' -DIS_MPI -D__FORTRAN90 $(F90Files) >> Make.ftemp |
810 |
< |
cat Make.ftemp >> $(DependencyFile) |
808 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp |
809 |
> |
@cat Make.ftemp >> $(DependencyFile) |
810 |
> |
@$(Delete) Make.ftemp |
811 |
> |
|
812 |
> |
ifeq "$(UseMPI)" "yes" |
813 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) >> Make.ftemp |
814 |
> |
@cat Make.ftemp >> $(DependencyFile) |
815 |
> |
@$(Delete) Make.ftemp |
816 |
> |
endif |
817 |
> |
|
818 |
|
endif |
522 |
– |
$(Delete) Make.cpptemp Make.ctemp Make.ftemp |
819 |
|
|
820 |
|
# make lib |
821 |
|
lib : $(PackageListLoop) |
828 |
|
jarsign : $(JarFile) |
829 |
|
$(JarSigner) -keystore GeoSoftKeystore $(JarFile) myself |
830 |
|
|
831 |
+ |
#make install |
832 |
+ |
%.install : |
833 |
+ |
@$(MAKE) $(MakeOptions) -C $(subst .install,,$@) _installall |
834 |
+ |
|
835 |
+ |
install : $(InstallListLoop) |
836 |
+ |
$(Print) Done Install |
837 |
+ |
|
838 |
+ |
_installall : _buildall _installdata _installlinks |
839 |
+ |
|
840 |
+ |
$(MyInstallDir) : |
841 |
+ |
$(MkDir) $@ |
842 |
+ |
|
843 |
+ |
_installdata : $(MyInstallDir) |
844 |
+ |
$(Print) $(InstallFiles) |
845 |
+ |
ifneq "$(words $(InstallFiles))" "0" |
846 |
+ |
$(InstallCommand) $(InstallFiles) $(MyInstallDir) |
847 |
+ |
endif |
848 |
+ |
|
849 |
+ |
_installlinks : $(MyInstallDir) |
850 |
+ |
ifneq "$(words $(MyLinkTargets))" "0" |
851 |
+ |
@cd $(MyInstallDir) |
852 |
+ |
$(foreach thisLink,$(MyLinkTargets),$(call do_link,$(MyLinkSource),$(thisLink))) |
853 |
+ |
endif |
854 |
+ |
|
855 |
|
# make statistics |
856 |
|
_statisticsall : |
857 |
< |
@$(Print) $(SourceFiles) >> $(DEV_ROOT)/files.tmp |
857 |
> |
@$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp |
858 |
|
|
859 |
|
statistics : $(PackageListLoop) |
860 |
|
@$(List) $(DEV_ROOT)/files.tmp | xargs $(WordCount) $(WordCountOptions) |
862 |
|
$(Print) Done statistics. |
863 |
|
|
864 |
|
# make pure |
865 |
< |
$(Executable).pure : |
866 |
< |
$(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \ |
867 |
< |
$(LibList) $(ObjectFiles) -o $@ |
865 |
> |
#$(Executable).pure : |
866 |
> |
# $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \ |
867 |
> |
# $(LibList) $(ObjectFiles) -o $@ |
868 |
> |
# |
869 |
> |
#pure : $(Executable).pure |
870 |
|
|
549 |
– |
pure : $(Executable).pure |
550 |
– |
|
871 |
|
#make cvslog |
872 |
|
cvslog: |
873 |
< |
$(DEV_ROOT)/scripts/cvs2cl.pl |
873 |
> |
$(DEV_ROOT)/scripts/cvs2cl |
874 |
|
|
875 |
|
# Execute |
876 |
|
_runexe : |