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