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 |
+ |
lattice \ |
55 |
|
|
56 |
|
#packages containing applications |
57 |
|
Applications = \ |
58 |
|
applications/oopse \ |
59 |
|
applications/dump2Xyz \ |
60 |
< |
applications/simpleBuilder |
60 |
> |
applications/staticProps \ |
61 |
> |
applications/dynamicProps \ |
62 |
> |
applications/simpleBuilder\ |
63 |
> |
applications/nanoRodBuilder \ |
64 |
|
|
65 |
|
Samples = \ |
66 |
|
samples/argon \ |
77 |
|
samples/zcons \ |
78 |
|
|
79 |
|
IncludeDirs = \ |
76 |
– |
@SPRNG_INC_DIR@ \ |
80 |
|
@MPI_INC_DIR@ |
81 |
|
|
82 |
|
LibraryDirs = \ |
80 |
– |
@SPRNG_LIB_DIR@ \ |
83 |
|
@MPI_LIB_DIR@ |
84 |
|
|
85 |
|
Libraries = \ |
84 |
– |
@SPRNG_LIB@ \ |
86 |
|
@MPI_LIB@ \ |
87 |
|
@MPI_F90_LIB@ |
88 |
|
|
126 |
|
# /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside |
127 |
|
#Package = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g') |
128 |
|
#use shell script to get the absolute path and then rip it off from $(CurrentDir) |
129 |
< |
Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir)) |
129 |
> |
#Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir)) |
130 |
> |
# REMINDER: We are now using the Package line in each subdir makefile. |
131 |
> |
# This avoids the strange path problem and the subshell |
132 |
|
|
133 |
|
PackageList = $(Package) |
134 |
|
PackageSourceDir = $(SourceDir)/$(Package) |
207 |
|
|
208 |
|
OtherTargetFiles = $(OtherSourceFiles:%=$(PackageTargetDir)/%) |
209 |
|
|
210 |
+ |
########################################################################### |
211 |
+ |
# |
212 |
+ |
# Figure out the names of the module files based on some work done by |
213 |
+ |
# configure. The tr function below is from John Graham-Cumming |
214 |
+ |
# (http://www.jgc.org). |
215 |
+ |
# |
216 |
+ |
# The tr function. Has three arguments: |
217 |
+ |
# |
218 |
+ |
# $1 The list of characters to translate from |
219 |
+ |
# $2 The list of characters to translate to |
220 |
+ |
# $3 The text to translate |
221 |
+ |
# |
222 |
+ |
# For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L. |
223 |
+ |
|
224 |
+ |
tr = $(eval __t := $3) \ |
225 |
+ |
$(foreach c, \ |
226 |
+ |
$(join $(addsuffix :,$1),$2), \ |
227 |
+ |
$(eval __t := \ |
228 |
+ |
$(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \ |
229 |
+ |
$(__t))))$(__t) |
230 |
+ |
|
231 |
+ |
# Common character classes for use with the tr function. Each of |
232 |
+ |
# these is actually a variable declaration and must be wrapped with |
233 |
+ |
# $() or ${} to be used. |
234 |
+ |
|
235 |
+ |
[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 # |
236 |
+ |
[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 # |
237 |
+ |
[0-9] := 0 1 2 3 4 5 6 7 8 9 # |
238 |
+ |
[A-F] := A B C D E F # |
239 |
+ |
|
240 |
+ |
# Figure out whether we have $(eval) or not (GNU Make 3.80 and above) |
241 |
+ |
# if we do not then we need to use the shell version of tr, and not the |
242 |
+ |
# faster tr function above: |
243 |
+ |
|
244 |
+ |
__have_eval := $(false) |
245 |
+ |
__ignore := $(eval __have_eval := $(true)) |
246 |
+ |
|
247 |
+ |
ifndef __have_eval |
248 |
+ |
uc = $(shell echo $1 | tr "a-z" "A-Z") |
249 |
+ |
lc = $(shell echo $1 | tr "A-Z" "a-z") |
250 |
+ |
else |
251 |
+ |
uc = $(call tr,$([a-z]),$([A-Z]),$1) |
252 |
+ |
lc = $(call tr,$([A-Z]),$([a-z]),$1) |
253 |
+ |
endif |
254 |
+ |
|
255 |
+ |
# OK, now we can actually use these functions to figure out the names |
256 |
+ |
# of the module files: |
257 |
+ |
|
258 |
+ |
ifneq "$(words $(Modules))" "0" |
259 |
+ |
ifeq "$(ModuleCase)" "UPPER" |
260 |
+ |
MODULES = $(call uc,$(Modules)) |
261 |
+ |
else |
262 |
+ |
ifeq "$(ModuleCase)" "lower" |
263 |
+ |
MODULES = $(call lc,$(Modules)) |
264 |
+ |
else |
265 |
+ |
MODULES = $(Modules) |
266 |
+ |
endif |
267 |
+ |
endif |
268 |
+ |
ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix)) |
269 |
+ |
ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix)) |
270 |
+ |
endif |
271 |
+ |
# |
272 |
+ |
########################################################################### |
273 |
+ |
|
274 |
|
ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries)) |
275 |
|
ThirdPartyJars = $(subst $(Space),$(X),$(ThirdPartyJarsTmp)) |
276 |
|
|
282 |
|
#if Main is defined, do not build library. It may not be true sometimes |
283 |
|
ifneq "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0" |
284 |
|
DependencyFile = $(PackageSourceDir)/Makedepend |
285 |
< |
ifneq "$(Main)" "" |
285 |
> |
ifneq "$(words $(Main))" "0" |
286 |
|
Executable = $(BinDir)/$(Main) |
287 |
< |
ParallelExecutable = $(BinDir)/$(Main)_MPI |
287 |
> |
ifeq "$(BuiltParallelExe)" "1" |
288 |
> |
ParallelExecutable = $(BinDir)/$(Main)_MPI |
289 |
> |
endif |
290 |
|
else |
291 |
|
SharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so |
292 |
|
StaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a |
316 |
|
# |
317 |
|
#--------------------------------------------------------------------------- |
318 |
|
Print = @echo |
319 |
< |
Move = mv |
319 |
> |
Move = mv -f |
320 |
|
Copy = cp |
321 |
|
CCompiler = @CC@ |
322 |
|
CppCompiler = @CXX@ |
324 |
|
MakeDepend = makedepend |
325 |
|
INSTALL = @INSTALL@ |
326 |
|
InstallProgram = @INSTALL_PROGRAM@ |
327 |
+ |
InstallScript = @INSTALL_SCRIPT@ |
328 |
|
InstallData = @INSTALL_DATA@ |
329 |
< |
MkDir = @MKINSTALLDIRS@ |
329 |
> |
MkDir = @MKINSTALLDIRS@ |
330 |
|
Delete = rm -fr |
331 |
|
StaticArchiver = @AR@ |
332 |
|
DynamicArchiver = @CC@ |
355 |
|
JniOptions = |
356 |
|
RmiOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
357 |
|
-sourcepath $(SourceDir) |
358 |
< |
COptions = $(FrcDeclare) |
359 |
< |
CParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
360 |
< |
CppOptions = $(FrcDeclare) |
361 |
< |
CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
358 |
> |
COptions = $(FrcDeclare) @CFLAGS@ |
359 |
> |
CParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@ |
360 |
> |
CppOptions = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@ |
361 |
> |
CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@ |
362 |
|
FortranOptions = |
363 |
< |
F90Options = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir) |
364 |
< |
F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) |
363 |
> |
F90Options = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir) |
364 |
> |
F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) |
365 |
|
JavaCompilerOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
366 |
|
-sourcepath $(SourceDir) -deprecation |
367 |
|
JavaRunOptions = -classpath $(ClassPath) |
436 |
|
|
437 |
|
# Create target directory |
438 |
|
$(PackageTargetDir) : |
439 |
< |
$(MakeDir) $@ |
439 |
> |
$(MkDir) $@ |
440 |
|
|
441 |
+ |
$(BinDir) : |
442 |
+ |
$(MkDir) $@ |
443 |
+ |
|
444 |
|
# .c -> .o |
445 |
|
$(PackageTargetDir)/%.o : %.c |
446 |
|
$(Print) $@ |
494 |
|
# .F90 -> .o |
495 |
|
$(PackageTargetDir)/%.o : %.F90 |
496 |
|
$(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@ |
497 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then \ |
498 |
+ |
$(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\ |
499 |
+ |
fi |
500 |
|
|
501 |
|
$(PackageParallelTargetDir)/%.o : %.F90 |
502 |
|
$(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@ |
503 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then \ |
504 |
+ |
$(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\ |
505 |
+ |
fi |
506 |
|
|
507 |
|
ifeq "$(UseMPI)" "yes" |
508 |
|
%.o : %.F90 |
509 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
510 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then\ |
511 |
+ |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
512 |
+ |
fi |
513 |
+ |
|
514 |
|
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
515 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then\ |
516 |
+ |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
517 |
+ |
fi |
518 |
+ |
|
519 |
|
else |
520 |
|
%.o : %.F90 |
521 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
522 |
+ |
if test -n "`ls *.$(ModSuffix)`"; then\ |
523 |
+ |
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
524 |
+ |
fi |
525 |
|
endif |
526 |
|
|
527 |
|
|
641 |
|
$(Ranlib) $(CombinedParallelStaticLib) |
642 |
|
|
643 |
|
# Executable |
644 |
< |
$(Executable) : $(CombinedStaticLib) $(ObjectFiles) |
645 |
< |
$(Linker) $(ObjectFiles) $(LinkOptions) $(LibDirs) $(CombinedStaticLib) $(Libraries) -o $@ |
644 |
> |
$(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir) |
645 |
> |
$(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@ |
646 |
|
|
647 |
< |
$(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) |
648 |
< |
$(Linker) $(ParallelObjectFiles) $(ParallelLinkOptions) $(LibDirs) $(CombinedParallelStaticLib) $(Libraries) -o $@ |
647 |
> |
$(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) $(BinDir) |
648 |
> |
$(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@ |
649 |
|
|
650 |
|
# Anything else is just copied from source to target |
651 |
|
$(PackageTargetDir)/% : $(PackageSourceDir)/% |
688 |
|
$(Executable) |
689 |
|
endif |
690 |
|
|
691 |
+ |
echo : $(PackageListLoop) |
692 |
+ |
$(Print) Done echo. |
693 |
|
|
694 |
+ |
_echoall : |
695 |
+ |
$(Print) $(Modules) |
696 |
+ |
|
697 |
|
# make clean |
698 |
|
clean : $(PackageListLoop) |
699 |
|
$(Print) Done clean. |
700 |
|
|
701 |
|
_cleanall : |
702 |
< |
$(Delete) $(ObjectFiles) $(ParallelObjectFiles) |
702 |
> |
$(Delete) \ |
703 |
> |
$(ObjectFiles) \ |
704 |
> |
$(ModuleFiles) \ |
705 |
> |
$(ParallelObjectFiles) \ |
706 |
> |
$(ParallelModuleFiles) \ |
707 |
> |
$(JarFile) \ |
708 |
> |
$(SharedLibrary) \ |
709 |
> |
$(StaticLibrary) \ |
710 |
> |
$(ParallelSharedLibrary) \ |
711 |
> |
$(ParallelStaticLibrary) \ |
712 |
> |
$(CombinedStaticLib) \ |
713 |
> |
$(CombinedParallelStaticLib) |
714 |
|
|
715 |
|
# make distclean |
716 |
|
distclean : $(PackageListLoop) |
717 |
|
$(Print) Done clean. |
718 |
|
|
719 |
< |
_distcleanall : |
720 |
< |
$(Delete) $(ObjectFiles) \ |
615 |
< |
$(ParallelObjectFiles) \ |
616 |
< |
$(JarFile) \ |
617 |
< |
$(SharedLibrary) \ |
618 |
< |
$(StaticLibrary) \ |
619 |
< |
$(ParallelSharedLibrary) \ |
620 |
< |
$(ParallelStaticLibrary) \ |
621 |
< |
$(Executable) \ |
719 |
> |
_distcleanall : _cleanall |
720 |
> |
$(Delete) $(Executable) \ |
721 |
|
$(ParallelExecutable) \ |
722 |
|
$(DependencyFile) |
723 |
|
|
625 |
– |
|
724 |
|
# make depend |
725 |
|
depend : $(PackageListLoop) |
726 |
|
$(Print) Done dependencies. |
732 |
|
@cd $(PackageSourceDir) |
733 |
|
|
734 |
|
ifneq "$(words $(CppFiles))" "0" |
735 |
< |
$(CppCompiler) $(CppOptions) $(IncludePath) -MM $(CppFiles) > Make.cpptemp |
736 |
< |
@cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(TargetDir\)\/&/g' >> $(DependencyFile) |
735 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CppFiles)>> Make.cpptemp |
736 |
> |
@cat Make.cpptemp >> $(DependencyFile) |
737 |
|
$(Delete) Make.cpptemp |
738 |
< |
$(CppCompiler) $(CppParallelOptions) $(IncludePath) -MM $(CppFiles) > Make.cpptemp |
739 |
< |
@cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(ParallelTargetDir\)\/&/g' >> $(DependencyFile) |
738 |
> |
|
739 |
> |
ifeq "$(UseMPI)" "yes" |
740 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CppFiles)>> Make.cpptemp |
741 |
> |
@cat Make.cpptemp >> $(DependencyFile) |
742 |
|
@$(Delete) Make.cpptemp |
743 |
+ |
endif |
744 |
+ |
|
745 |
|
endif |
746 |
|
|
747 |
|
ifneq "$(words $(CFiles))" "0" |
748 |
< |
$(CCompiler) $(COptions) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp |
749 |
< |
@cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(TargetDir\)\/&/g' >> $(DependencyFile) |
748 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CFiles) $(DerivedCFiles) >> Make.ctemp |
749 |
> |
@cat Make.ctemp >> $(DependencyFile) |
750 |
|
$(Delete) Make.ctemp |
751 |
< |
$(CCompiler) $(CParallelOptions) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp |
752 |
< |
@cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(ParallelTargetDir\)\/&/g' >> $(DependencyFile) |
751 |
> |
|
752 |
> |
ifeq "$(UseMPI)" "yes" |
753 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CFiles) $(DerivedCFiles) >> Make.ctemp |
754 |
> |
@cat Make.ctemp >> $(DependencyFile) |
755 |
|
@$(Delete) Make.ctemp |
756 |
+ |
endif |
757 |
+ |
|
758 |
|
endif |
759 |
|
|
760 |
|
ifneq "$(words $(F90Files))" "0" |
761 |
< |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp |
656 |
< |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) >> Make.ftemp |
761 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp |
762 |
|
@cat Make.ftemp >> $(DependencyFile) |
763 |
|
@$(Delete) Make.ftemp |
764 |
+ |
|
765 |
+ |
ifeq "$(UseMPI)" "yes" |
766 |
+ |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) >> Make.ftemp |
767 |
+ |
@cat Make.ftemp >> $(DependencyFile) |
768 |
+ |
@$(Delete) Make.ftemp |
769 |
+ |
endif |
770 |
+ |
|
771 |
|
endif |
772 |
|
|
773 |
|
# make lib |
796 |
|
_installdata : $(MyInstallDir) |
797 |
|
$(Print) $(InstallFiles) |
798 |
|
ifneq "$(words $(InstallFiles))" "0" |
799 |
< |
$(InstallData) $(InstallFiles) $(MyInstallDir) |
799 |
> |
$(InstallCommand) $(InstallFiles) $(MyInstallDir) |
800 |
|
endif |
801 |
< |
|
801 |
> |
|
802 |
|
# make statistics |
803 |
|
_statisticsall : |
804 |
|
@$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp |