--- trunk/OOPSE-2.0/make/Makefile.in 2005/04/11 16:14:05 2157 +++ trunk/OOPSE-2.0/make/Makefile.in 2005/12/02 20:10:30 2474 @@ -51,38 +51,53 @@ PackageLibs = \ minimizers \ selection \ restraints \ - + lattice \ + openbabel\ + antlr\ + mdParser #packages containing applications Applications = \ applications/oopse \ applications/dump2Xyz \ - applications/simpleBuilder\ applications/staticProps \ applications/dynamicProps \ + applications/simpleBuilder\ + applications/nanoRodBuilder \ + applications/atom2mdin Samples = \ samples/argon \ - samples/water/dimer \ + samples/water/dimer \ samples/water/spce \ samples/water/ssd \ samples/water/ssde \ + samples/water/ssdrf \ + samples/water/ssd-ion \ samples/water/tip3p_ice \ samples/water/tip4p \ samples/lipid \ samples/alkane \ samples/minimizer \ samples/metals \ + samples/thermoIntegration/liquid \ + samples/thermoIntegration/solid \ + samples/dipole \ + samples/shape \ samples/zcons \ IncludeDirs = \ - @MPI_INC_DIR@ + @CGAL_INC_DIR@ \ + @MPI_INC_DIR@ LibraryDirs = \ + @CGAL_LIB_DIR@ \ @MPI_LIB_DIR@ Libraries = \ + @LIBS@ \ + @CGAL_LIBS@ \ @MPI_LIB@ \ - @MPI_F90_LIB@ + @MPI_F90_LIB@ OopseHome = @OOPSE_HOME@ ForceParamDir = $(OopseHome)/share/forceFields @@ -113,6 +128,7 @@ BinDir = $(DEV_ROOT)/bin ParallelTargetDir = $(DEV_ROOT)/MPIobj LibDir = $(DEV_ROOT)/lib MakeDir = $(DEV_ROOT)/make +MainMakefile = $(MakeDir)/Makefile BinDir = $(DEV_ROOT)/bin DocsDir = $(DEV_ROOT)/docs CurrentDir = $(CURDIR) @@ -235,12 +251,21 @@ tr = $(eval __t := $3) [0-9] := 0 1 2 3 4 5 6 7 8 9 # [A-F] := A B C D E F # -# Upper case and lower case functions. Each function has a single -# argument which is the text to alter +# 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: -uc = $(call tr,$([a-z]),$([A-Z]),$1) -lc = $(call tr,$([A-Z]),$([a-z]),$1) +__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: @@ -311,12 +336,14 @@ INSTALL = @INSTALL@ CppCompiler = @CXX@ Linker = @CXX@ MakeDepend = makedepend +LN_S = @LN_S@ INSTALL = @INSTALL@ +EGREP = @EGREP@ InstallProgram = @INSTALL_PROGRAM@ InstallScript = @INSTALL_SCRIPT@ InstallData = @INSTALL_DATA@ MkDir = @MKINSTALLDIRS@ -Delete = rm -fr +Delete = rm -f StaticArchiver = @AR@ DynamicArchiver = @CC@ FortranCompiler = @FC@ @@ -395,6 +422,10 @@ endif InstallFiles = $(Executable) endif InstallCommand = $(InstallProgram) + ifneq "$(words $(LinkTargets))" "0" + MyLinkSource = $(patsubst %, $(MyInstallDir)/%,$(Main)) + MyLinkTargets = $(patsubst %, $(MyInstallDir)/%,$(LinkTargets)) + endif endif ifneq "$(words $(ForcefieldFiles))" "0" @@ -431,70 +462,70 @@ $(PackageTargetDir)/%.o : %.c $(MkDir) $@ # .c -> .o -$(PackageTargetDir)/%.o : %.c +$(PackageTargetDir)/%.o : %.c $(MainMakefile) $(Print) $@ $(CCompiler) $(COptions) -c $(IncludePath) $< -o $@ -$(PackageParallelTargetDir)/%.o : %.c +$(PackageParallelTargetDir)/%.o : %.c $(MainMakefile) $(Print) $@ $(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@ ifeq "$(UseMPI)" "yes" -%.o : %.c +%.o : %.c $(MainMakefile) $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ else -%.o : %.c +%.o : %.c $(MainMakefile) $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ endif # .cpp -> .o -$(PackageTargetDir)/%.o : %.cpp +$(PackageTargetDir)/%.o : %.cpp $(MainMakefile) $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@ -$(PackageParallelTargetDir)/%.o : %.cpp +$(PackageParallelTargetDir)/%.o : %.cpp $(MainMakefile) $(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@ ifeq "$(UseMPI)" "yes" -%.o : %.cpp +%.o : %.cpp $(MainMakefile) $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ else -%.o : %.cpp +%.o : %.cpp $(MainMakefile) $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ endif # .f -> .o -$(PackageTargetDir)/%.o : %.f +$(PackageTargetDir)/%.o : %.f $(MainMakefile) $(FortranCompiler) $(FortranOptions) -c $< -o $@ -$(PackageParallelTargetDir)/%.o : %.f +$(PackageParallelTargetDir)/%.o : %.f $(MainMakefile) $(FortranCompiler) $(FortranParallelOptions) -c $< -o $@ ifeq "$(UseMPI)" "yes" -%.o : %.f +%.o : %.f $(MainMakefile) $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ else -%.o : %.f +%.o : %.f $(MainMakefile) $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ endif # .F90 -> .o -$(PackageTargetDir)/%.o : %.F90 +$(PackageTargetDir)/%.o : %.F90 $(MainMakefile) $(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@ if test -n "`ls *.$(ModSuffix)`"; then \ $(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\ fi -$(PackageParallelTargetDir)/%.o : %.F90 +$(PackageParallelTargetDir)/%.o : %.F90 $(MainMakefile) $(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@ if test -n "`ls *.$(ModSuffix)`"; then \ $(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\ fi ifeq "$(UseMPI)" "yes" -%.o : %.F90 +%.o : %.F90 $(MainMakefile) $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ if test -n "`ls *.$(ModSuffix)`"; then\ $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ @@ -506,7 +537,7 @@ else fi else -%.o : %.F90 +%.o : %.F90 $(MainMakefile) $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ if test -n "`ls *.$(ModSuffix)`"; then\ $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ @@ -613,20 +644,25 @@ find_objs = $(shell $(StaticArchiver) -t $(1)) $(Doxygen) $(DEV_ROOT)/make/Doxyfile #GUN make funtions to merge the libraries -find_objs = $(shell $(StaticArchiver) -t $(1)) +find_objs = $(shell $(StaticArchiver) -t $(1) | $(EGREP) -v "SYMDEF") extract_objs = $(shell $(StaticArchiver) -x $(1) $(call find_objs, $(1))) create_archive = $(shell $(StaticArchiver) $(StaticArchiverOptions) $(2) $(call find_objs, $(1))) remove_objs = $(shell $(Delete) $(call find_objs, $(1))) do_create = $(call extract_objs,$(1))$(call create_archive,$(1),$(2))$(call remove_objs,$(1)) +do_link = $(shell $(LN_S) $(1) $(2)) +all_objs = $(foreach thisLib,$(LibNames), $(call find_objs, $(thisLib))) +all_parallel_objs = $(foreach thisLib,$(ParallelLibNames), $(call find_objs, $(thisLib))) +all_lib_objs = $(patsubst %,$(TargetDir)/%,$(call all_objs)) +all_lib_parallel_objs = $(patsubst %,$(TargetDir)/%,$(call all_parallel_objs)) $(CombinedStaticLib) : $(LibDir)/.stamp_UP - $(Print) create $@ - $(foreach thisLib,$(LibNames),$(call do_create,$(thisLib),$@)) + $(Print) creating $@ + $(StaticArchiver) $(StaticArchiverOptions) $@ $(call all_lib_objs) $(Ranlib) $(CombinedStaticLib) $(CombinedParallelStaticLib) : $(LibDir)/.stamp_MPI - $(Print) create $@ - $(foreach thisLib,$(ParallelLibNames), $(call do_create, $(thisLib), $@)) + $(Print) creating $@ + $(StaticArchiver) $(StaticArchiverOptions) $@ $(call all_lib_parallel_objs) $(Ranlib) $(CombinedParallelStaticLib) # Executable @@ -777,7 +813,7 @@ _installall : _buildall _installdata install : $(InstallListLoop) $(Print) Done Install -_installall : _buildall _installdata +_installall : _buildall _installdata _installlinks $(MyInstallDir) : $(MkDir) $@ @@ -788,6 +824,12 @@ endif $(InstallCommand) $(InstallFiles) $(MyInstallDir) endif +_installlinks : $(MyInstallDir) +ifneq "$(words $(MyLinkTargets))" "0" + @cd $(MyInstallDir) + $(foreach thisLink,$(MyLinkTargets),$(call do_link,$(MyLinkSource),$(thisLink))) +endif + # make statistics _statisticsall : @$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp @@ -798,15 +840,15 @@ $(Executable).pure : $(Print) Done statistics. # make pure -$(Executable).pure : - $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \ - $(LibList) $(ObjectFiles) -o $@ +#$(Executable).pure : +# $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \ +# $(LibList) $(ObjectFiles) -o $@ +# +#pure : $(Executable).pure -pure : $(Executable).pure - #make cvslog cvslog: - $(DEV_ROOT)/scripts/cvs2cl.pl + $(DEV_ROOT)/scripts/cvs2cl # Execute _runexe :