--- trunk/OOPSE-2.0/make/Makefile.in 2004/10/11 15:43:16 1552 +++ trunk/OOPSE-2.0/make/Makefile.in 2005/03/21 19:22:55 2126 @@ -38,25 +38,27 @@ PackageLibs = \ #packages containing libraries PackageLibs = \ utils \ + visitors \ math \ types \ primitives \ - visitors \ UseTheForce/DarkSide \ UseTheForce \ brains \ io \ - integrators \ - minimizers \ + integrators\ constraints \ - profiling \ + minimizers \ + selection \ restraints \ #packages containing applications Applications = \ applications/oopse \ applications/dump2Xyz \ - applications/simpleBuilder + applications/simpleBuilder\ + applications/staticProps \ + applications/dynamicProps \ Samples = \ samples/argon \ @@ -73,15 +75,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@ @@ -125,7 +124,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) @@ -215,7 +216,7 @@ 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 else @@ -247,7 +248,7 @@ Move = mv # #--------------------------------------------------------------------------- Print = @echo -Move = mv +Move = mv -f Copy = cp CCompiler = @CC@ CppCompiler = @CXX@ @@ -255,8 +256,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,13 +287,13 @@ COptions = $(FrcDeclare) JniOptions = RmiOptions = -d $(TargetDir) -classpath $(ClassPath) \ -sourcepath $(SourceDir) -COptions = $(FrcDeclare) -CParallelOptions = $(FrcDeclare) $(ParallelDeclare) -CppOptions = $(FrcDeclare) -CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) +COptions = $(FrcDeclare) @CFLAGS@ +CParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@ +CppOptions = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@ +CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@ FortranOptions = -F90Options = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir) -F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) +F90Options = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir) +F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) JavaCompilerOptions = -d $(TargetDir) -classpath $(ClassPath) \ -sourcepath $(SourceDir) -deprecation JavaRunOptions = -classpath $(ClassPath) @@ -366,8 +368,11 @@ $(PackageTargetDir) : # Create target directory $(PackageTargetDir) : - $(MakeDir) $@ + $(MkDir) $@ +$(BinDir) : + $(MkDir) $@ + # .c -> .o $(PackageTargetDir)/%.o : %.c $(Print) $@ @@ -421,17 +426,34 @@ $(PackageTargetDir)/%.o : %.F90 # .F90 -> .o $(PackageTargetDir)/%.o : %.F90 $(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@ + if test -n "`ls *.$(ModSuffix)`"; then \ + $(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\ + fi $(PackageParallelTargetDir)/%.o : %.F90 $(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@ + if test -n "`ls *.$(ModSuffix)`"; then \ + $(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\ + fi ifeq "$(UseMPI)" "yes" %.o : %.F90 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ + if test -n "`ls *.$(ModSuffix)`"; then\ + $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ + fi + $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ + if test -n "`ls *.$(ModSuffix)`"; then\ + $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ + fi + else %.o : %.F90 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ + if test -n "`ls *.$(ModSuffix)`"; then\ + $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ + fi endif @@ -551,11 +573,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)/% @@ -604,25 +626,26 @@ _cleanall : $(Print) Done clean. _cleanall : - $(Delete) $(ObjectFiles) $(ParallelObjectFiles) + $(Delete) \ + $(ObjectFiles) \ + $(ParallelObjectFiles) \ + $(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. @@ -634,28 +657,42 @@ ifneq "$(words $(CppFiles))" "0" @cd $(PackageSourceDir) ifneq "$(words $(CppFiles))" "0" - $(CppCompiler) $(CppOptions) $(IncludePath) -MM $(CppFiles) > Make.cpptemp - @cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(TargetDir\)\/&/g' >> $(DependencyFile) + $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CppFiles)>> Make.cpptemp + @cat Make.cpptemp >> $(DependencyFile) $(Delete) Make.cpptemp - $(CppCompiler) $(CppParallelOptions) $(IncludePath) -MM $(CppFiles) > Make.cpptemp - @cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(ParallelTargetDir\)\/&/g' >> $(DependencyFile) + + ifeq "$(UseMPI)" "yes" + $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CppFiles)>> Make.cpptemp + @cat Make.cpptemp >> $(DependencyFile) @$(Delete) Make.cpptemp + endif + endif ifneq "$(words $(CFiles))" "0" - $(CCompiler) $(COptions) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp - @cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(TargetDir\)\/&/g' >> $(DependencyFile) + $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CFiles) $(DerivedCFiles) >> Make.ctemp + @cat Make.ctemp >> $(DependencyFile) $(Delete) Make.ctemp - $(CCompiler) $(CParallelOptions) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp - @cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(ParallelTargetDir\)\/&/g' >> $(DependencyFile) + + ifeq "$(UseMPI)" "yes" + $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CFiles) $(DerivedCFiles) >> Make.ctemp + @cat Make.ctemp >> $(DependencyFile) @$(Delete) Make.ctemp + endif + endif ifneq "$(words $(F90Files))" "0" - $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp - $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) >> Make.ftemp + $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp @cat Make.ftemp >> $(DependencyFile) @$(Delete) Make.ftemp + + ifeq "$(UseMPI)" "yes" + $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) >> Make.ftemp + @cat Make.ftemp >> $(DependencyFile) + @$(Delete) Make.ftemp + endif + endif # make lib @@ -684,9 +721,9 @@ ifneq "$(words $(InstallFiles))" "0" _installdata : $(MyInstallDir) $(Print) $(InstallFiles) ifneq "$(words $(InstallFiles))" "0" - $(InstallData) $(InstallFiles) $(MyInstallDir) + $(InstallCommand) $(InstallFiles) $(MyInstallDir) endif - + # make statistics _statisticsall : @$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp