38 |
|
#packages containing libraries |
39 |
|
PackageLibs = \ |
40 |
|
utils \ |
41 |
+ |
visitors \ |
42 |
|
math \ |
43 |
|
types \ |
44 |
|
primitives \ |
44 |
– |
visitors \ |
45 |
|
UseTheForce/DarkSide \ |
46 |
|
UseTheForce \ |
47 |
|
brains \ |
48 |
|
io \ |
49 |
< |
integrators \ |
50 |
< |
minimizers \ |
49 |
> |
integrators\ |
50 |
|
constraints \ |
51 |
< |
profiling \ |
51 |
> |
minimizers \ |
52 |
> |
selection \ |
53 |
|
restraints \ |
54 |
|
|
55 |
|
#packages containing applications |
56 |
|
Applications = \ |
57 |
|
applications/oopse \ |
58 |
|
applications/dump2Xyz \ |
59 |
< |
applications/simpleBuilder |
59 |
> |
applications/simpleBuilder\ |
60 |
> |
applications/staticProps \ |
61 |
> |
applications/dynamicProps \ |
62 |
|
|
63 |
|
Samples = \ |
64 |
|
samples/argon \ |
75 |
|
samples/zcons \ |
76 |
|
|
77 |
|
IncludeDirs = \ |
76 |
– |
@SPRNG_INC_DIR@ \ |
78 |
|
@MPI_INC_DIR@ |
79 |
|
|
80 |
|
LibraryDirs = \ |
80 |
– |
@SPRNG_LIB_DIR@ \ |
81 |
|
@MPI_LIB_DIR@ |
82 |
|
|
83 |
|
Libraries = \ |
84 |
– |
@SPRNG_LIB@ \ |
84 |
|
@MPI_LIB@ \ |
85 |
|
@MPI_F90_LIB@ |
86 |
|
|
124 |
|
# /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside |
125 |
|
#Package = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g') |
126 |
|
#use shell script to get the absolute path and then rip it off from $(CurrentDir) |
127 |
< |
Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir)) |
127 |
> |
#Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir)) |
128 |
> |
# REMINDER: We are now using the Package line in each subdir makefile. |
129 |
> |
# This avoids the strange path problem and the subshell |
130 |
|
|
131 |
|
PackageList = $(Package) |
132 |
|
PackageSourceDir = $(SourceDir)/$(Package) |
205 |
|
|
206 |
|
OtherTargetFiles = $(OtherSourceFiles:%=$(PackageTargetDir)/%) |
207 |
|
|
208 |
+ |
########################################################################### |
209 |
+ |
# |
210 |
+ |
# Figure out the names of the module files based on some work done by |
211 |
+ |
# configure. The tr function below is from John Graham-Cumming |
212 |
+ |
# (http://www.jgc.org). |
213 |
+ |
# |
214 |
+ |
# The tr function. Has three arguments: |
215 |
+ |
# |
216 |
+ |
# $1 The list of characters to translate from |
217 |
+ |
# $2 The list of characters to translate to |
218 |
+ |
# $3 The text to translate |
219 |
+ |
# |
220 |
+ |
# For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L. |
221 |
+ |
|
222 |
+ |
tr = $(eval __t := $3) \ |
223 |
+ |
$(foreach c, \ |
224 |
+ |
$(join $(addsuffix :,$1),$2), \ |
225 |
+ |
$(eval __t := \ |
226 |
+ |
$(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \ |
227 |
+ |
$(__t))))$(__t) |
228 |
+ |
|
229 |
+ |
# Common character classes for use with the tr function. Each of |
230 |
+ |
# these is actually a variable declaration and must be wrapped with |
231 |
+ |
# $() or ${} to be used. |
232 |
+ |
|
233 |
+ |
[A-Z] := A B C D E F G H I J K L M N O P Q R S T U V W X Y Z # |
234 |
+ |
[a-z] := a b c d e f g h i j k l m n o p q r s t u v w x y z # |
235 |
+ |
[0-9] := 0 1 2 3 4 5 6 7 8 9 # |
236 |
+ |
[A-F] := A B C D E F # |
237 |
+ |
|
238 |
+ |
# Figure out whether we have $(eval) or not (GNU Make 3.80 and above) |
239 |
+ |
# if we do not then we need to use the shell version of tr, and not the |
240 |
+ |
# faster tr function above: |
241 |
+ |
|
242 |
+ |
__have_eval := $(false) |
243 |
+ |
__ignore := $(eval __have_eval := $(true)) |
244 |
+ |
|
245 |
+ |
ifndef __have_eval |
246 |
+ |
uc = $(shell echo $1 | tr "A-Z" "a-z") |
247 |
+ |
lc = $(shell echo $1 | tr "A-Z" "a-z") |
248 |
+ |
else |
249 |
+ |
uc = $(call tr,$([a-z]),$([A-Z]),$1) |
250 |
+ |
lc = $(call tr,$([A-Z]),$([a-z]),$1) |
251 |
+ |
endif |
252 |
+ |
|
253 |
+ |
# OK, now we can actually use these functions to figure out the names |
254 |
+ |
# of the module files: |
255 |
+ |
|
256 |
+ |
ifneq "$(words $(Modules))" "0" |
257 |
+ |
ifeq "$(ModuleCase)" "UPPER" |
258 |
+ |
MODULES = $(call uc,$(Modules)) |
259 |
+ |
else |
260 |
+ |
ifeq "$(ModuleCase)" "lower" |
261 |
+ |
MODULES = $(call lc,$(Modules)) |
262 |
+ |
else |
263 |
+ |
MODULES = $(Modules) |
264 |
+ |
endif |
265 |
+ |
endif |
266 |
+ |
ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix)) |
267 |
+ |
ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix)) |
268 |
+ |
endif |
269 |
+ |
# |
270 |
+ |
########################################################################### |
271 |
+ |
|
272 |
|
ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries)) |
273 |
|
ThirdPartyJars = $(subst $(Space),$(X),$(ThirdPartyJarsTmp)) |
274 |
|
|
280 |
|
#if Main is defined, do not build library. It may not be true sometimes |
281 |
|
ifneq "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0" |
282 |
|
DependencyFile = $(PackageSourceDir)/Makedepend |
283 |
< |
ifneq "$(Main)" "" |
283 |
> |
ifneq "$(words $(Main))" "0" |
284 |
|
Executable = $(BinDir)/$(Main) |
285 |
< |
ParallelExecutable = $(BinDir)/$(Main)_MPI |
285 |
> |
ifeq "$(BuiltParallelExe)" "1" |
286 |
> |
ParallelExecutable = $(BinDir)/$(Main)_MPI |
287 |
> |
endif |
288 |
|
else |
289 |
|
SharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so |
290 |
|
StaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a |
314 |
|
# |
315 |
|
#--------------------------------------------------------------------------- |
316 |
|
Print = @echo |
317 |
< |
Move = mv |
317 |
> |
Move = mv -f |
318 |
|
Copy = cp |
319 |
|
CCompiler = @CC@ |
320 |
|
CppCompiler = @CXX@ |
322 |
|
MakeDepend = makedepend |
323 |
|
INSTALL = @INSTALL@ |
324 |
|
InstallProgram = @INSTALL_PROGRAM@ |
325 |
+ |
InstallScript = @INSTALL_SCRIPT@ |
326 |
|
InstallData = @INSTALL_DATA@ |
327 |
< |
MkDir = @MKINSTALLDIRS@ |
327 |
> |
MkDir = @MKINSTALLDIRS@ |
328 |
|
Delete = rm -fr |
329 |
|
StaticArchiver = @AR@ |
330 |
|
DynamicArchiver = @CC@ |
353 |
|
JniOptions = |
354 |
|
RmiOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
355 |
|
-sourcepath $(SourceDir) |
356 |
< |
COptions = $(FrcDeclare) |
357 |
< |
CParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
358 |
< |
CppOptions = $(FrcDeclare) |
359 |
< |
CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
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 = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir) |
362 |
|
F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) |
434 |
|
|
435 |
|
# Create target directory |
436 |
|
$(PackageTargetDir) : |
437 |
< |
$(MakeDir) $@ |
437 |
> |
$(MkDir) $@ |
438 |
|
|
439 |
+ |
$(BinDir) : |
440 |
+ |
$(MkDir) $@ |
441 |
+ |
|
442 |
|
# .c -> .o |
443 |
|
$(PackageTargetDir)/%.o : %.c |
444 |
|
$(Print) $@ |
492 |
|
# .F90 -> .o |
493 |
|
$(PackageTargetDir)/%.o : %.F90 |
494 |
|
$(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@ |
495 |
< |
if test -f *.$(ModSuffix); then \ |
496 |
< |
$(Move) *.$(ModSuffix) $(PackageTargetDir);\ |
495 |
> |
if test -n "`ls *.$(ModSuffix)`"; then \ |
496 |
> |
$(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\ |
497 |
|
fi |
498 |
|
|
499 |
|
$(PackageParallelTargetDir)/%.o : %.F90 |
500 |
|
$(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@ |
501 |
< |
if test -f *.$(ModSuffix); then \ |
502 |
< |
$(Move) *.$(ModSuffix) $(PackageParallelTargetDir);\ |
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 -f *.$(ModSuffix); then \ |
509 |
< |
$(Move) *.$(ModSuffix) $(PackageTargetDir);\ |
510 |
< |
fi |
508 |
> |
if test -n "`ls *.$(ModSuffix)`"; then\ |
509 |
> |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
510 |
> |
fi |
511 |
|
|
512 |
|
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
513 |
< |
if test -f *.$(ModSuffix); then \ |
514 |
< |
$(Move) *.$(ModSuffix) $(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 -f *.$(ModSuffix); then \ |
521 |
< |
$(Move) *.$(ModSuffix) $(PackageTargetDir);\ |
522 |
< |
fi |
452 |
< |
|
520 |
> |
if test -n "`ls *.$(ModSuffix)`"; then\ |
521 |
> |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
522 |
> |
fi |
523 |
|
endif |
524 |
|
|
525 |
|
|
639 |
|
$(Ranlib) $(CombinedParallelStaticLib) |
640 |
|
|
641 |
|
# Executable |
642 |
< |
$(Executable) : $(CombinedStaticLib) $(ObjectFiles) |
643 |
< |
$(Linker) $(ObjectFiles) $(LinkOptions) $(LibDirs) $(CombinedStaticLib) $(Libraries) -o $@ |
642 |
> |
$(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir) |
643 |
> |
$(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@ |
644 |
|
|
645 |
< |
$(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) |
646 |
< |
$(Linker) $(ParallelObjectFiles) $(ParallelLinkOptions) $(LibDirs) $(CombinedParallelStaticLib) $(Libraries) -o $@ |
645 |
> |
$(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) $(BinDir) |
646 |
> |
$(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@ |
647 |
|
|
648 |
|
# Anything else is just copied from source to target |
649 |
|
$(PackageTargetDir)/% : $(PackageSourceDir)/% |
686 |
|
$(Executable) |
687 |
|
endif |
688 |
|
|
689 |
+ |
echo : $(PackageListLoop) |
690 |
+ |
$(Print) Done echo. |
691 |
|
|
692 |
+ |
_echoall : |
693 |
+ |
$(Print) $(Modules) |
694 |
+ |
|
695 |
|
# make clean |
696 |
|
clean : $(PackageListLoop) |
697 |
|
$(Print) Done clean. |
698 |
|
|
699 |
|
_cleanall : |
700 |
< |
$(Delete) $(ObjectFiles) $(ParallelObjectFiles) |
700 |
> |
$(Delete) \ |
701 |
> |
$(ObjectFiles) \ |
702 |
> |
$(ModuleFiles) \ |
703 |
> |
$(ParallelObjectFiles) \ |
704 |
> |
$(ParallelModuleFiles) \ |
705 |
> |
$(JarFile) \ |
706 |
> |
$(SharedLibrary) \ |
707 |
> |
$(StaticLibrary) \ |
708 |
> |
$(ParallelSharedLibrary) \ |
709 |
> |
$(ParallelStaticLibrary) \ |
710 |
> |
$(CombinedStaticLib) \ |
711 |
> |
$(CombinedParallelStaticLib) |
712 |
|
|
713 |
|
# make distclean |
714 |
|
distclean : $(PackageListLoop) |
715 |
|
$(Print) Done clean. |
716 |
|
|
717 |
< |
_distcleanall : |
718 |
< |
$(Delete) $(ObjectFiles) \ |
633 |
< |
$(ParallelObjectFiles) \ |
634 |
< |
$(JarFile) \ |
635 |
< |
$(SharedLibrary) \ |
636 |
< |
$(StaticLibrary) \ |
637 |
< |
$(ParallelSharedLibrary) \ |
638 |
< |
$(ParallelStaticLibrary) \ |
639 |
< |
$(Executable) \ |
717 |
> |
_distcleanall : _cleanall |
718 |
> |
$(Delete) $(Executable) \ |
719 |
|
$(ParallelExecutable) \ |
720 |
|
$(DependencyFile) |
721 |
|
|
643 |
– |
|
722 |
|
# make depend |
723 |
|
depend : $(PackageListLoop) |
724 |
|
$(Print) Done dependencies. |
794 |
|
_installdata : $(MyInstallDir) |
795 |
|
$(Print) $(InstallFiles) |
796 |
|
ifneq "$(words $(InstallFiles))" "0" |
797 |
< |
$(InstallData) $(InstallFiles) $(MyInstallDir) |
797 |
> |
$(InstallCommand) $(InstallFiles) $(MyInstallDir) |
798 |
|
endif |
799 |
< |
|
799 |
> |
|
800 |
|
# make statistics |
801 |
|
_statisticsall : |
802 |
|
@$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp |