--- trunk/OOPSE-2.0/make/Makefile.in 2005/01/12 23:17:02 1932 +++ trunk/OOPSE-2.0/make/Makefile.in 2005/04/12 21:26:42 2176 @@ -49,12 +49,18 @@ PackageLibs = \ integrators\ constraints \ minimizers \ + selection \ + restraints \ + lattice \ #packages containing applications Applications = \ applications/oopse \ applications/dump2Xyz \ + applications/staticProps \ + applications/dynamicProps \ applications/simpleBuilder\ + applications/nanoRodBuilder \ Samples = \ samples/argon \ @@ -71,15 +77,12 @@ IncludeDirs = \ samples/zcons \ IncludeDirs = \ - @SPRNG_INC_DIR@ \ @MPI_INC_DIR@ LibraryDirs = \ - @SPRNG_LIB_DIR@ \ @MPI_LIB_DIR@ Libraries = \ - @SPRNG_LIB@ \ @MPI_LIB@ \ @MPI_F90_LIB@ @@ -123,7 +126,9 @@ Package = $(subst $(shell cd $(SourceDir); pw # /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside #Package = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g') #use shell script to get the absolute path and then rip it off from $(CurrentDir) -Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir)) +#Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir)) +# REMINDER: We are now using the Package line in each subdir makefile. +# This avoids the strange path problem and the subshell PackageList = $(Package) PackageSourceDir = $(SourceDir)/$(Package) @@ -201,6 +206,70 @@ OtherTargetFiles = $(OtherSourceFiles:%=$(Packag $(LexFiles:%.l= %.c) OtherTargetFiles = $(OtherSourceFiles:%=$(PackageTargetDir)/%) + +########################################################################### +# +# Figure out the names of the module files based on some work done by +# configure. The tr function below is from John Graham-Cumming +# (http://www.jgc.org). +# +# The tr function. Has three arguments: +# +# $1 The list of characters to translate from +# $2 The list of characters to translate to +# $3 The text to translate +# +# For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L. + +tr = $(eval __t := $3) \ + $(foreach c, \ + $(join $(addsuffix :,$1),$2), \ + $(eval __t := \ + $(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \ + $(__t))))$(__t) + +# Common character classes for use with the tr function. Each of +# these is actually a variable declaration and must be wrapped with +# $() or ${} to be used. + +[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 # +[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 # +[0-9] := 0 1 2 3 4 5 6 7 8 9 # +[A-F] := A B C D E F # + +# Figure out whether we have $(eval) or not (GNU Make 3.80 and above) +# if we do not then we need to use the shell version of tr, and not the +# faster tr function above: + +__have_eval := $(false) +__ignore := $(eval __have_eval := $(true)) + +ifndef __have_eval + uc = $(shell echo $1 | tr "a-z" "A-Z") + lc = $(shell echo $1 | tr "A-Z" "a-z") +else + uc = $(call tr,$([a-z]),$([A-Z]),$1) + lc = $(call tr,$([A-Z]),$([a-z]),$1) +endif + +# OK, now we can actually use these functions to figure out the names +# of the module files: + +ifneq "$(words $(Modules))" "0" +ifeq "$(ModuleCase)" "UPPER" + MODULES = $(call uc,$(Modules)) +else + ifeq "$(ModuleCase)" "lower" + MODULES = $(call lc,$(Modules)) + else + MODULES = $(Modules) + endif +endif + ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix)) + ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix)) +endif +# +########################################################################### ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries)) ThirdPartyJars = $(subst $(Space),$(X),$(ThirdPartyJarsTmp)) @@ -213,9 +282,11 @@ ifneq "$(words $(ObjectFiles) $(ParallelObjectFiles)) #if Main is defined, do not build library. It may not be true sometimes ifneq "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0" DependencyFile = $(PackageSourceDir)/Makedepend - ifneq "$(Main)" "" + ifneq "$(words $(Main))" "0" Executable = $(BinDir)/$(Main) - ParallelExecutable = $(BinDir)/$(Main)_MPI + ifeq "$(BuiltParallelExe)" "1" + ParallelExecutable = $(BinDir)/$(Main)_MPI + endif else SharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so StaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a @@ -253,8 +324,9 @@ InstallData = @INSTALL_DATA@ MakeDepend = makedepend INSTALL = @INSTALL@ InstallProgram = @INSTALL_PROGRAM@ +InstallScript = @INSTALL_SCRIPT@ InstallData = @INSTALL_DATA@ -MkDir = @MKINSTALLDIRS@ +MkDir = @MKINSTALLDIRS@ Delete = rm -fr StaticArchiver = @AR@ DynamicArchiver = @CC@ @@ -285,8 +357,8 @@ CppOptions = $(FrcDeclare) @CXXFLAGS@ -sourcepath $(SourceDir) COptions = $(FrcDeclare) @CFLAGS@ CParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@ -CppOptions = $(FrcDeclare) @CXXFLAGS@ -CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ +CppOptions = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@ +CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@ FortranOptions = F90Options = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir) F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) @@ -364,8 +436,11 @@ $(PackageTargetDir) : # Create target directory $(PackageTargetDir) : - $(MakeDir) $@ + $(MkDir) $@ +$(BinDir) : + $(MkDir) $@ + # .c -> .o $(PackageTargetDir)/%.o : %.c $(Print) $@ @@ -437,9 +512,9 @@ ifeq "$(UseMPI)" "yes" fi $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ - if test -n "`ls *.$(ModSuffix)`"; then\ - $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ - fi + if test -n "`ls *.$(ModSuffix)`"; then\ + $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ + fi else %.o : %.F90 @@ -447,7 +522,6 @@ else if test -n "`ls *.$(ModSuffix)`"; then\ $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ fi - endif @@ -567,11 +641,11 @@ $(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(Ranlib) $(CombinedParallelStaticLib) # Executable -$(Executable) : $(CombinedStaticLib) $(ObjectFiles) - $(Linker) $(ObjectFiles) $(LinkOptions) $(LibDirs) $(CombinedStaticLib) $(Libraries) -o $@ +$(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir) + $(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@ -$(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) - $(Linker) $(ParallelObjectFiles) $(ParallelLinkOptions) $(LibDirs) $(CombinedParallelStaticLib) $(Libraries) -o $@ +$(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) $(BinDir) + $(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@ # Anything else is just copied from source to target $(PackageTargetDir)/% : $(PackageSourceDir)/% @@ -614,31 +688,39 @@ endif $(Executable) endif +echo : $(PackageListLoop) + $(Print) Done echo. +_echoall : + $(Print) $(Modules) + # make clean clean : $(PackageListLoop) $(Print) Done clean. _cleanall : - $(Delete) $(ObjectFiles) $(ParallelObjectFiles) + $(Delete) \ + $(ObjectFiles) \ + $(ModuleFiles) \ + $(ParallelObjectFiles) \ + $(ParallelModuleFiles) \ + $(JarFile) \ + $(SharedLibrary) \ + $(StaticLibrary) \ + $(ParallelSharedLibrary) \ + $(ParallelStaticLibrary) \ + $(CombinedStaticLib) \ + $(CombinedParallelStaticLib) # make distclean distclean : $(PackageListLoop) $(Print) Done clean. -_distcleanall : - $(Delete) $(ObjectFiles) \ - $(ParallelObjectFiles) \ - $(JarFile) \ - $(SharedLibrary) \ - $(StaticLibrary) \ - $(ParallelSharedLibrary) \ - $(ParallelStaticLibrary) \ - $(Executable) \ +_distcleanall : _cleanall + $(Delete) $(Executable) \ $(ParallelExecutable) \ $(DependencyFile) - # make depend depend : $(PackageListLoop) $(Print) Done dependencies. @@ -714,7 +796,7 @@ ifneq "$(words $(InstallFiles))" "0" _installdata : $(MyInstallDir) $(Print) $(InstallFiles) ifneq "$(words $(InstallFiles))" "0" - $(InstallData) $(InstallFiles) $(MyInstallDir) + $(InstallCommand) $(InstallFiles) $(MyInstallDir) endif # make statistics