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 |
+ |
# Upper case and lower case functions. Each function has a single |
239 |
+ |
# argument which is the text to alter |
240 |
+ |
|
241 |
+ |
uc = $(call tr,$([a-z]),$([A-Z]),$1) |
242 |
+ |
lc = $(call tr,$([A-Z]),$([a-z]),$1) |
243 |
+ |
|
244 |
+ |
# OK, now we can actually use these functions to figure out the names |
245 |
+ |
# of the module files: |
246 |
+ |
|
247 |
+ |
ifneq "$(words $(Modules))" "0" |
248 |
+ |
ifeq "$(ModuleCase)" "UPPER" |
249 |
+ |
MODULES = $(call uc,$(Modules)) |
250 |
+ |
else |
251 |
+ |
ifeq "$(ModuleCase)" "lower" |
252 |
+ |
MODULES = $(call lc,$(Modules)) |
253 |
+ |
else |
254 |
+ |
MODULES = $(Modules) |
255 |
+ |
endif |
256 |
+ |
endif |
257 |
+ |
ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix)) |
258 |
+ |
ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix)) |
259 |
+ |
endif |
260 |
+ |
# |
261 |
+ |
########################################################################### |
262 |
+ |
|
263 |
|
ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries)) |
264 |
|
ThirdPartyJars = $(subst $(Space),$(X),$(ThirdPartyJarsTmp)) |
265 |
|
|
271 |
|
#if Main is defined, do not build library. It may not be true sometimes |
272 |
|
ifneq "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0" |
273 |
|
DependencyFile = $(PackageSourceDir)/Makedepend |
274 |
< |
ifneq "$(Main)" "" |
274 |
> |
ifneq "$(words $(Main))" "0" |
275 |
|
Executable = $(BinDir)/$(Main) |
276 |
< |
ParallelExecutable = $(BinDir)/$(Main)_MPI |
276 |
> |
ifeq "$(BuiltParallelExe)" "1" |
277 |
> |
ParallelExecutable = $(BinDir)/$(Main)_MPI |
278 |
> |
endif |
279 |
|
else |
280 |
|
SharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so |
281 |
|
StaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a |
305 |
|
# |
306 |
|
#--------------------------------------------------------------------------- |
307 |
|
Print = @echo |
308 |
< |
Move = mv |
308 |
> |
Move = mv -f |
309 |
|
Copy = cp |
310 |
|
CCompiler = @CC@ |
311 |
|
CppCompiler = @CXX@ |
313 |
|
MakeDepend = makedepend |
314 |
|
INSTALL = @INSTALL@ |
315 |
|
InstallProgram = @INSTALL_PROGRAM@ |
316 |
+ |
InstallScript = @INSTALL_SCRIPT@ |
317 |
|
InstallData = @INSTALL_DATA@ |
318 |
< |
MkDir = @MKINSTALLDIRS@ |
318 |
> |
MkDir = @MKINSTALLDIRS@ |
319 |
|
Delete = rm -fr |
320 |
|
StaticArchiver = @AR@ |
321 |
|
DynamicArchiver = @CC@ |
344 |
|
JniOptions = |
345 |
|
RmiOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
346 |
|
-sourcepath $(SourceDir) |
347 |
< |
COptions = $(FrcDeclare) |
348 |
< |
CParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
349 |
< |
CppOptions = $(FrcDeclare) |
350 |
< |
CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
347 |
> |
COptions = $(FrcDeclare) @CFLAGS@ |
348 |
> |
CParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@ |
349 |
> |
CppOptions = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@ |
350 |
> |
CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@ |
351 |
|
FortranOptions = |
352 |
|
F90Options = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir) |
353 |
|
F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) |
425 |
|
|
426 |
|
# Create target directory |
427 |
|
$(PackageTargetDir) : |
428 |
< |
$(MakeDir) $@ |
428 |
> |
$(MkDir) $@ |
429 |
|
|
430 |
+ |
$(BinDir) : |
431 |
+ |
$(MkDir) $@ |
432 |
+ |
|
433 |
|
# .c -> .o |
434 |
|
$(PackageTargetDir)/%.o : %.c |
435 |
|
$(Print) $@ |
483 |
|
# .F90 -> .o |
484 |
|
$(PackageTargetDir)/%.o : %.F90 |
485 |
|
$(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@ |
486 |
< |
if test -f *.$(ModSuffix); then \ |
487 |
< |
$(Move) *.$(ModSuffix) $(PackageTargetDir);\ |
486 |
> |
if test -n "`ls *.$(ModSuffix)`"; then \ |
487 |
> |
$(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\ |
488 |
|
fi |
489 |
|
|
490 |
|
$(PackageParallelTargetDir)/%.o : %.F90 |
491 |
|
$(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@ |
492 |
< |
if test -f *.$(ModSuffix); then \ |
493 |
< |
$(Move) *.$(ModSuffix) $(PackageParallelTargetDir);\ |
492 |
> |
if test -n "`ls *.$(ModSuffix)`"; then \ |
493 |
> |
$(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\ |
494 |
|
fi |
495 |
|
|
496 |
|
ifeq "$(UseMPI)" "yes" |
497 |
|
%.o : %.F90 |
498 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
499 |
< |
if test -f *.$(ModSuffix); then \ |
500 |
< |
$(Move) *.$(ModSuffix) $(PackageTargetDir);\ |
501 |
< |
fi |
499 |
> |
if test -n "`ls *.$(ModSuffix)`"; then\ |
500 |
> |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
501 |
> |
fi |
502 |
|
|
503 |
|
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
504 |
< |
if test -f *.$(ModSuffix); then \ |
505 |
< |
$(Move) *.$(ModSuffix) $(PackageParallelTargetDir);\ |
504 |
> |
if test -n "`ls *.$(ModSuffix)`"; then\ |
505 |
> |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
506 |
|
fi |
507 |
|
|
508 |
|
else |
509 |
|
%.o : %.F90 |
510 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
511 |
< |
if test -f *.$(ModSuffix); then \ |
512 |
< |
$(Move) *.$(ModSuffix) $(PackageTargetDir);\ |
513 |
< |
fi |
452 |
< |
|
511 |
> |
if test -n "`ls *.$(ModSuffix)`"; then\ |
512 |
> |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
513 |
> |
fi |
514 |
|
endif |
515 |
|
|
516 |
|
|
630 |
|
$(Ranlib) $(CombinedParallelStaticLib) |
631 |
|
|
632 |
|
# Executable |
633 |
< |
$(Executable) : $(CombinedStaticLib) $(ObjectFiles) |
634 |
< |
$(Linker) $(ObjectFiles) $(LinkOptions) $(LibDirs) $(CombinedStaticLib) $(Libraries) -o $@ |
633 |
> |
$(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir) |
634 |
> |
$(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@ |
635 |
|
|
636 |
< |
$(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) |
637 |
< |
$(Linker) $(ParallelObjectFiles) $(ParallelLinkOptions) $(LibDirs) $(CombinedParallelStaticLib) $(Libraries) -o $@ |
636 |
> |
$(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) $(BinDir) |
637 |
> |
$(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@ |
638 |
|
|
639 |
|
# Anything else is just copied from source to target |
640 |
|
$(PackageTargetDir)/% : $(PackageSourceDir)/% |
677 |
|
$(Executable) |
678 |
|
endif |
679 |
|
|
680 |
+ |
echo : $(PackageListLoop) |
681 |
+ |
$(Print) Done echo. |
682 |
|
|
683 |
+ |
_echoall : |
684 |
+ |
$(Print) $(Modules) |
685 |
+ |
|
686 |
|
# make clean |
687 |
|
clean : $(PackageListLoop) |
688 |
|
$(Print) Done clean. |
689 |
|
|
690 |
|
_cleanall : |
691 |
< |
$(Delete) $(ObjectFiles) $(ParallelObjectFiles) |
691 |
> |
$(Delete) \ |
692 |
> |
$(ObjectFiles) \ |
693 |
> |
$(ModuleFiles) \ |
694 |
> |
$(ParallelObjectFiles) \ |
695 |
> |
$(ParallelModuleFiles) \ |
696 |
> |
$(JarFile) \ |
697 |
> |
$(SharedLibrary) \ |
698 |
> |
$(StaticLibrary) \ |
699 |
> |
$(ParallelSharedLibrary) \ |
700 |
> |
$(ParallelStaticLibrary) \ |
701 |
> |
$(CombinedStaticLib) \ |
702 |
> |
$(CombinedParallelStaticLib) |
703 |
|
|
704 |
|
# make distclean |
705 |
|
distclean : $(PackageListLoop) |
706 |
|
$(Print) Done clean. |
707 |
|
|
708 |
< |
_distcleanall : |
709 |
< |
$(Delete) $(ObjectFiles) \ |
633 |
< |
$(ParallelObjectFiles) \ |
634 |
< |
$(JarFile) \ |
635 |
< |
$(SharedLibrary) \ |
636 |
< |
$(StaticLibrary) \ |
637 |
< |
$(ParallelSharedLibrary) \ |
638 |
< |
$(ParallelStaticLibrary) \ |
639 |
< |
$(Executable) \ |
708 |
> |
_distcleanall : _cleanall |
709 |
> |
$(Delete) $(Executable) \ |
710 |
|
$(ParallelExecutable) \ |
711 |
|
$(DependencyFile) |
712 |
|
|
643 |
– |
|
713 |
|
# make depend |
714 |
|
depend : $(PackageListLoop) |
715 |
|
$(Print) Done dependencies. |
785 |
|
_installdata : $(MyInstallDir) |
786 |
|
$(Print) $(InstallFiles) |
787 |
|
ifneq "$(words $(InstallFiles))" "0" |
788 |
< |
$(InstallData) $(InstallFiles) $(MyInstallDir) |
788 |
> |
$(InstallCommand) $(InstallFiles) $(MyInstallDir) |
789 |
|
endif |
790 |
< |
|
790 |
> |
|
791 |
|
# make statistics |
792 |
|
_statisticsall : |
793 |
|
@$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp |