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