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