--- trunk/OOPSE-3.0/make/Makefile.in 2004/10/06 21:22:43 1535 +++ trunk/OOPSE-3.0/make/Makefile.in 2004/10/11 21:13:46 1557 @@ -86,8 +86,10 @@ ForceParamDir = @OOPSE_HOME@/share/forceFields/ @MPI_F90_LIB@ OopseHome = @OOPSE_HOME@ -ForceParamDir = @OOPSE_HOME@/share/forceFields/ -SampleSimDir = @OOPSE_HOME@/share/samples/ +ForceParamDir = $(OopseHome)/share/forceFields +SampleSimDir = $(OopseHome)/share/samples +InstallBinDir = $(OopseHome)/bin +DocDir = $(OopseHome)/doc FrcDeclare = -DFRC_PATH="$(ForceParamDir)" F90Declare = -D__FORTRAN90 ParallelDeclare = -DIS_MPI @@ -223,6 +225,7 @@ endif ParallelStaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.a endif endif + # # Misc # @@ -250,10 +253,10 @@ Install = @INSTALL@ CppCompiler = @CXX@ Linker = @CXX@ MakeDepend = makedepend -Install = @INSTALL@ +INSTALL = @INSTALL@ InstallProgram = @INSTALL_PROGRAM@ InstallData = @INSTALL_DATA@ -MakeDir = @MKINSTALLDIRS@ +MkDir = @MKINSTALLDIRS@ Delete = rm -fr StaticArchiver = @AR@ DynamicArchiver = @CC@ @@ -272,8 +275,8 @@ Ranlib = @RANLIB@ Yacc = @YACC@ Lex = @LEX@ Ranlib = @RANLIB@ +Doxygen = @DOXYGEN@ - MakeOptions = -k MakeDependOptions = StaticArchiverOptions = rc @@ -287,8 +290,8 @@ F90Options = @PREPFLAG@ @F90FLAGS@ @MODDI CppOptions = $(FrcDeclare) CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) 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) @@ -310,8 +313,47 @@ Space = $(Empty) $(Empty) Empty = Space = $(Empty) $(Empty) + + +#--------------------------------------------------------------------------- +# +# Install +# +#--------------------------------------------------------------------------- + +ifneq "$(words $(SampleFiles))" "0" + MySample = $(subst $(shell cd $(DEV_ROOT)/samples; pwd)/,,$(CurrentDir)) + MyInstallDir = $(SampleSimDir)/$(MySample) + InstallFiles = $(SampleFiles) + InstallCommand = $(InstallData) +endif + +ifneq "$(words $(Main))" "0" + MyInstallDir = $(InstallBinDir) + ifeq "$(UseMPI)" "yes" + InstallFiles = $(Executable) $(ParallelExecutable) + else + InstallFiles = $(Executable) + endif + InstallCommand = $(InstallProgram) +endif +ifneq "$(words $(ForcefieldFiles))" "0" + MyInstallDir = $(ForceParamDir) + InstallFiles = $(ForcefieldFiles) + InstallCommand = $(InstallData) +endif +ifneq "$(words $(InstallFiles))" "0" + InstallList = +else + InstallList = $(patsubst %,$(DEV_ROOT)/%,$(Samples)) $(DEV_ROOT)/forceFields $(patsubst %, $(SourceDir)/%,$(Applications)) +endif + +InstallListLoop = $(patsubst %,$(SourceDir)/%/.install,$(PackageList)) $(patsubst %,%/.install,$(InstallList)) + + + #--------------------------------------------------------------------------- # # Rules @@ -379,17 +421,35 @@ $(PackageTargetDir)/%.o : %.F90 # .F90 -> .o $(PackageTargetDir)/%.o : %.F90 $(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@ + if test -f *.$(ModSuffix); then \ + $(Move) *.$(ModSuffix) $(PackageTargetDir);\ + fi $(PackageParallelTargetDir)/%.o : %.F90 $(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@ + if test -f *.$(ModSuffix); then \ + $(Move) *.$(ModSuffix) $(PackageParallelTargetDir);\ + fi ifeq "$(UseMPI)" "yes" %.o : %.F90 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ + if test -f *.$(ModSuffix); then \ + $(Move) *.$(ModSuffix) $(PackageTargetDir);\ + fi + $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ + if test -f *.$(ModSuffix); then \ + $(Move) *.$(ModSuffix) $(PackageParallelTargetDir);\ + fi + else %.o : %.F90 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ + if test -f *.$(ModSuffix); then \ + $(Move) *.$(ModSuffix) $(PackageTargetDir);\ + fi + endif @@ -486,6 +546,11 @@ $(PackageTargetDir)/%_Skel.class : $(PackageTargetDir) %_Skel.class : %.class $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ +document : + $(Print) Generate Documentation for OOPSE-2.0 + @cd $(DEV_ROOT)/src + $(Doxygen) $(DEV_ROOT)/make/Doxyfile + #GUN make funtions to merge the libraries find_objs = $(shell $(StaticArchiver) -t $(1)) extract_objs = $(shell $(StaticArchiver) -x $(1) $(call find_objs, $(1))) @@ -521,6 +586,7 @@ ifeq "$(UseMPI)" "yes" _all : _buildall +_buildall : ifeq "$(UseMPI)" "yes" _buildall : \ $(DependencyFile) \ @@ -586,28 +652,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) - $(Delete) Make.cpptemp + + 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) - $(Delete) Make.ctemp + + 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) $(F90Files) > Make.ftemp - $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) $(F90Files) >> Make.ftemp - cat Make.ftemp >> $(DependencyFile) - $(Delete) 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 @@ -621,6 +701,24 @@ jarsign : $(JarFile) jarsign : $(JarFile) $(JarSigner) -keystore GeoSoftKeystore $(JarFile) myself +#make install +%.install : + @$(MAKE) $(MakeOptions) -C $(subst .install,,$@) _installall + +install : $(InstallListLoop) + $(Print) Done Install + +_installall : _buildall _installdata + +$(MyInstallDir) : + $(MkDir) $@ + +_installdata : $(MyInstallDir) + $(Print) $(InstallFiles) +ifneq "$(words $(InstallFiles))" "0" + $(InstallData) $(InstallFiles) $(MyInstallDir) +endif + # make statistics _statisticsall : @$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp