ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/make/Makefile.in
(Generate patch)

Comparing trunk/OOPSE-3.0/make/Makefile.in (file contents):
Revision 2101 by chrisfen, Thu Mar 10 15:10:24 2005 UTC vs.
Revision 2580 by gezelter, Thu Feb 2 02:57:01 2006 UTC

# Line 51 | Line 51 | PackageLibs = \
51          minimizers \
52          selection \
53          restraints \
54 <
54 >        lattice \
55 >        openbabel\
56 >        antlr\
57 >        mdParser
58   #packages containing applications
59   Applications = \
60          applications/oopse \
61          applications/dump2Xyz \
59        applications/simpleBuilder\
62          applications/staticProps \
63          applications/dynamicProps \
64 +        applications/simpleBuilder\
65 +        applications/nanoRodBuilder \
66 +        applications/atom2mdin
67  
68   Samples = \
69 +        samples/alkane \
70          samples/argon \
71 <        samples/water/dimer \
71 >        samples/cutoff \
72 >        samples/dipole \
73 >        samples/gbljtest \
74 >        samples/lipid \
75 >        samples/metals/EAM \
76 >        samples/metals/EAM/nanoparticle \
77 >        samples/metals/EAM/nanorod \
78 >        samples/metals/Sutton-Chen \
79 >        samples/minimizer \
80 >        samples/shape \
81 >        samples/thermoIntegration/liquid \
82 >        samples/thermoIntegration/solid \
83 >        samples/water/dimer \
84          samples/water/spce \
85          samples/water/ssd \
86          samples/water/ssde \
87 +        samples/water/ssdrf \
88 +        samples/water/ssd-ion \
89          samples/water/tip3p_ice \
90          samples/water/tip4p \
91 <        samples/lipid \
72 <        samples/alkane \
73 <        samples/minimizer \
74 <        samples/metals \
75 <        samples/zcons \
91 >        samples/zcons
92  
93   IncludeDirs = \
94 <        @MPI_INC_DIR@
94 >        @CGAL_INC_DIR@ \
95 >        @MPI_INC_DIR@
96  
97   LibraryDirs = \
98 +        @CGAL_LIB_DIR@ \
99          @MPI_LIB_DIR@
100  
101   Libraries = \
102 +        @LIBS@ \
103 +        @CGAL_LIBS@ \
104          @MPI_LIB@ \
105 <        @MPI_F90_LIB@
105 >        @MPI_F90_LIB@
106  
107   OopseHome       = @OOPSE_HOME@
108   ForceParamDir   = $(OopseHome)/share/forceFields
# Line 96 | Line 116 | LinkOptions = \
116   ModuleCase      = @F90_MODULE_NAMES@
117   ModSuffix       = @MOD@
118   LinkOptions = \
119 <        @F90LIBS@
119 >        @FCLIBS@ \
120 >        @CXXFLAGS@
121  
122   ParallelLinkOptions = \
123 <        @F90LIBS@
123 >        @FCLIBS@ \
124 >        @CXXFLAGS@
125  
126  
127   #---------------------------------------------------------------------------
# Line 113 | Line 135 | BinDir            = $(DEV_ROOT)/bin
135   ParallelTargetDir = $(DEV_ROOT)/MPIobj
136   LibDir            = $(DEV_ROOT)/lib
137   MakeDir           = $(DEV_ROOT)/make
138 + MainMakefile      = $(MakeDir)/Makefile
139   BinDir            = $(DEV_ROOT)/bin
140   DocsDir           = $(DEV_ROOT)/docs
141   CurrentDir        = $(CURDIR)
# Line 205 | Line 228 | ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLib
228  
229   OtherTargetFiles       = $(OtherSourceFiles:%=$(PackageTargetDir)/%)
230  
231 + ###########################################################################
232 + #
233 + # Figure out the names of the module files based on some work done by
234 + # configure.  The tr function below is from John Graham-Cumming
235 + # (http://www.jgc.org).
236 + #
237 + # The tr function.   Has three arguments:
238 + #
239 + # $1   The list of characters to translate from
240 + # $2   The list of characters to translate to
241 + # $3   The text to translate
242 + #
243 + # For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L.
244 +
245 + tr = $(eval __t := $3)                                                    \
246 +     $(foreach c,                                                         \
247 +         $(join $(addsuffix :,$1),$2),                                    \
248 +         $(eval __t :=                                                    \
249 +             $(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \
250 +                 $(__t))))$(__t)
251 +
252 + # Common character classes for use with the tr function.  Each of
253 + # these is actually a variable declaration and must be wrapped with
254 + # $() or ${} to be used.
255 +
256 + [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 #
257 + [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 #
258 + [0-9] := 0 1 2 3 4 5 6 7 8 9 #
259 + [A-F] := A B C D E F #
260 +
261 + # Figure out whether we have $(eval) or not (GNU Make 3.80 and above)
262 + # if we do not then we need to use the shell version of tr, and not the
263 + # faster tr function above:
264 +
265 + __have_eval := $(false)
266 + __ignore := $(eval __have_eval := $(true))
267 +
268 + ifndef __have_eval
269 +  uc = $(shell echo $1 | tr "a-z" "A-Z")
270 +  lc = $(shell echo $1 | tr "A-Z" "a-z")
271 + else
272 +  uc = $(call tr,$([a-z]),$([A-Z]),$1)
273 +  lc = $(call tr,$([A-Z]),$([a-z]),$1)
274 + endif
275 +
276 + # OK, now we can actually use these functions to figure out the names
277 + # of the module files:
278 +
279 + ifneq "$(words $(Modules))" "0"
280 + ifeq "$(ModuleCase)" "UPPER"
281 +  MODULES = $(call uc,$(Modules))
282 + else
283 +  ifeq "$(ModuleCase)" "lower"
284 +    MODULES = $(call lc,$(Modules))
285 +  else
286 +    MODULES = $(Modules)
287 +  endif
288 + endif
289 +  ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix))
290 +  ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix))
291 + endif
292 + #
293 + ###########################################################################
294 +
295   ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries))
296   ThirdPartyJars    = $(subst $(Space),$(X),$(ThirdPartyJarsTmp))
297  
# Line 216 | Line 303 | ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))
303   #if Main is defined, do not build library. It may not be true sometimes
304   ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0"
305    DependencyFile    = $(PackageSourceDir)/Makedepend
306 <  ifneq "$(Main)" ""
306 >  ifneq "$(words $(Main))" "0"
307      Executable             = $(BinDir)/$(Main)
308 <    ParallelExecutable     = $(BinDir)/$(Main)_MPI
308 >    ifeq "$(BuiltParallelExe)" "1"
309 >      ParallelExecutable     = $(BinDir)/$(Main)_MPI
310 >    endif
311    else
312      SharedLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so
313      StaticLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a
# Line 254 | Line 343 | INSTALL                = @INSTALL@
343   CppCompiler            = @CXX@
344   Linker                 = @CXX@
345   MakeDepend             = makedepend
346 + LN_S                   = @LN_S@
347   INSTALL                = @INSTALL@
348 + EGREP                  = @EGREP@
349   InstallProgram         = @INSTALL_PROGRAM@
350 + InstallScript          = @INSTALL_SCRIPT@
351   InstallData            = @INSTALL_DATA@
352   MkDir                  = @MKINSTALLDIRS@
353 < Delete                 = rm -fr
353 > Delete                 = rm -f
354   StaticArchiver         = @AR@
355   DynamicArchiver        = @CC@
356   FortranCompiler        = @FC@
265 F90Compiler            = @F90@
357   JavaCompiler           = $(JAVA_HOME)/bin/javac
358   JavaArchiver           = $(JAVA_HOME)/bin/jar
359   JarSigner              = $(JAVA_HOME)/bin/jarsigner
# Line 288 | Line 379 | CppOptions             = $(FrcDeclare) @CXXFLAGS@ @OOP
379                           -sourcepath $(SourceDir)
380   COptions               = $(FrcDeclare) @CFLAGS@
381   CParallelOptions       = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@
382 < CppOptions             = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
383 < CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
384 < FortranOptions         =
385 < F90Options             =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir)
295 < F90ParallelOptions     =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir)  @PREPDEFFLAG@$(ParallelDeclare)
382 > CppOptions             = $(FrcDeclare) @CXXFLAGS@
383 > CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@
384 > FortranOptions         =  @FCFLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir) @FCFLAGS_SRCEXT@
385 > FortranParallelOptions =  @FCFLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclar) @FCFLAGS_SRCEXT@
386   JavaCompilerOptions    = -d $(TargetDir) -classpath $(ClassPath) \
387                           -sourcepath $(SourceDir) -deprecation
388   JavaRunOptions         = -classpath $(ClassPath)
# Line 337 | Line 427 | endif
427      InstallFiles             = $(Executable)
428    endif
429    InstallCommand           = $(InstallProgram)
430 +  ifneq "$(words $(LinkTargets))" "0"
431 +    MyLinkSource = $(patsubst %, $(MyInstallDir)/%,$(Main))
432 +    MyLinkTargets = $(patsubst %, $(MyInstallDir)/%,$(LinkTargets))
433 +  endif
434   endif
435  
436   ifneq "$(words $(ForcefieldFiles))" "0"
# Line 373 | Line 467 | $(PackageTargetDir)/%.o : %.c
467          $(MkDir) $@
468  
469   # .c -> .o
470 < $(PackageTargetDir)/%.o : %.c
470 > $(PackageTargetDir)/%.o : %.c $(MainMakefile)
471          $(Print) $@
472          $(CCompiler) $(COptions) -c $(IncludePath) $< -o $@
473  
474 < $(PackageParallelTargetDir)/%.o : %.c
474 > $(PackageParallelTargetDir)/%.o : %.c $(MainMakefile)
475          $(Print) $@
476          $(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@
477  
478   ifeq "$(UseMPI)" "yes"
479 < %.o : %.c
479 > %.o : %.c $(MainMakefile)
480          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
481          $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
482   else
483 < %.o : %.c
483 > %.o : %.c $(MainMakefile)
484          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
485   endif
486  
487   # .cpp -> .o
488 < $(PackageTargetDir)/%.o : %.cpp
488 > $(PackageTargetDir)/%.o : %.cpp $(MainMakefile)
489          $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@
490  
491 < $(PackageParallelTargetDir)/%.o : %.cpp
491 > $(PackageParallelTargetDir)/%.o : %.cpp $(MainMakefile)
492          $(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@
493  
494   ifeq "$(UseMPI)" "yes"
495 < %.o : %.cpp
495 > %.o : %.cpp $(MainMakefile)
496          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
497          $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
498   else
499 < %.o : %.cpp
499 > %.o : %.cpp $(MainMakefile)
500          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
501   endif
502  
503   # .f -> .o
504 < $(PackageTargetDir)/%.o : %.f
504 > $(PackageTargetDir)/%.o : %.f $(MainMakefile)
505          $(FortranCompiler) $(FortranOptions) -c $< -o $@
506  
507 < $(PackageParallelTargetDir)/%.o : %.f
507 > $(PackageParallelTargetDir)/%.o : %.f $(MainMakefile)
508          $(FortranCompiler) $(FortranParallelOptions) -c $< -o $@
509  
510   ifeq "$(UseMPI)" "yes"
511 < %.o : %.f
511 > %.o : %.f $(MainMakefile)
512          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
513          $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
514   else
515 < %.o : %.f
515 > %.o : %.f $(MainMakefile)
516          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
517   endif
518  
519   # .F90 -> .o
520 < $(PackageTargetDir)/%.o : %.F90
521 <        $(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@
520 > $(PackageTargetDir)/%.o : %.F90 $(MainMakefile)
521 >        $(FortranCompiler) $(FortranOptions) $(IncludePath) -c $< -o $@
522          if test -n "`ls *.$(ModSuffix)`"; then \
523            $(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\
524          fi
525  
526 < $(PackageParallelTargetDir)/%.o : %.F90
527 <        $(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@
526 > $(PackageParallelTargetDir)/%.o : %.F90 $(MainMakefile)
527 >        $(FortranCompiler) $(FortranParallelOptions) $(IncludePath) -c $< -o $@
528          if test -n "`ls *.$(ModSuffix)`"; then \
529            $(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\
530          fi
531  
532   ifeq "$(UseMPI)" "yes"
533 < %.o : %.F90
533 > %.o : %.F90 $(MainMakefile)
534          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
535          if test -n "`ls *.$(ModSuffix)`"; then\
536            $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
# Line 448 | Line 542 | else
542          fi
543  
544   else
545 < %.o : %.F90
545 > %.o : %.F90 $(MainMakefile)
546          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
547          if test -n "`ls *.$(ModSuffix)`"; then\
548            $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
# Line 555 | Line 649 | find_objs = $(shell $(StaticArchiver) -t $(1))
649          $(Doxygen) $(DEV_ROOT)/make/Doxyfile
650  
651   #GUN make funtions to merge the libraries
652 < find_objs = $(shell $(StaticArchiver) -t $(1))
652 > find_objs = $(shell $(StaticArchiver) -t $(1) | $(EGREP) -v "SYMDEF")
653   extract_objs = $(shell $(StaticArchiver) -x $(1) $(call find_objs, $(1)))
654   create_archive = $(shell  $(StaticArchiver) $(StaticArchiverOptions) $(2) $(call find_objs, $(1)))
655   remove_objs = $(shell $(Delete) $(call find_objs, $(1)))
656   do_create = $(call extract_objs,$(1))$(call create_archive,$(1),$(2))$(call remove_objs,$(1))  
657 + do_link = $(shell $(LN_S) $(1) $(2))
658 + all_objs = $(foreach thisLib,$(LibNames), $(call find_objs, $(thisLib)))
659 + all_parallel_objs = $(foreach thisLib,$(ParallelLibNames), $(call find_objs, $(thisLib)))
660 + all_lib_objs = $(patsubst %,$(TargetDir)/%,$(call all_objs))
661 + all_lib_parallel_objs = $(patsubst %,$(ParallelTargetDir)/%,$(call all_parallel_objs))
662  
663   $(CombinedStaticLib) : $(LibDir)/.stamp_UP
664 <        $(Print) create $@      
665 <        $(foreach thisLib,$(LibNames),$(call do_create,$(thisLib),$@))
664 >        $(Print) creating $@            
665 >        $(StaticArchiver) $(StaticArchiverOptions) $@ $(call all_lib_objs)
666          $(Ranlib) $(CombinedStaticLib)
667  
668   $(CombinedParallelStaticLib) : $(LibDir)/.stamp_MPI
669 <        $(Print) create $@
670 <        $(foreach thisLib,$(ParallelLibNames), $(call do_create, $(thisLib), $@))
669 >        $(Print) creating $@
670 >        $(StaticArchiver) $(StaticArchiverOptions) $@ $(call all_lib_parallel_objs)
671          $(Ranlib) $(CombinedParallelStaticLib)
672  
673   # Executable
674 < $(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir)
674 > $(Executable) : $(CombinedStaticLib) $(ObjectFiles)
675 >        if test ! -d $(BinDir); then \
676 >                $(MkDir) $(BinDir) ;\
677 >        fi
678          $(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@
679  
680 < $(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) $(BinDir)
680 > $(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles)
681 >        if test ! -d $(BinDir); then \
682 >                $(MkDir) $(BinDir) ;\
683 >        fi
684          $(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@
685  
686   # Anything else is just copied from source to target
# Line 618 | Line 723 | endif
723          $(JarFile) \
724          $(Executable)
725   endif
726 +
727 + echo : $(PackageListLoop)
728 +        $(Print) Done echo.
729  
730 + _echoall :
731 +        $(Print) $(Modules)
732  
733   # make clean
734   clean : $(PackageListLoop)
# Line 627 | Line 737 | _cleanall :
737   _cleanall :
738          $(Delete) \
739                  $(ObjectFiles) \
740 +                $(ModuleFiles) \
741                  $(ParallelObjectFiles) \
742 +                $(ParallelModuleFiles) \
743                  $(JarFile) \
744                  $(SharedLibrary) \
745                  $(StaticLibrary) \
# Line 712 | Line 824 | _installall : _buildall _installdata
824   install : $(InstallListLoop)
825          $(Print) Done Install
826  
827 < _installall : _buildall _installdata
827 > _installall : _buildall _installdata _installlinks
828  
829   $(MyInstallDir) :
830          $(MkDir) $@
# Line 720 | Line 832 | ifneq "$(words $(InstallFiles))" "0"
832   _installdata :  $(MyInstallDir)
833          $(Print) $(InstallFiles)
834   ifneq "$(words $(InstallFiles))" "0"
835 <        $(InstallData) $(InstallFiles) $(MyInstallDir)
835 >        $(InstallCommand) $(InstallFiles) $(MyInstallDir)
836   endif      
837  
838 + _installlinks :  $(MyInstallDir)
839 + ifneq "$(words $(MyLinkTargets))" "0"
840 +        @cd $(MyInstallDir)
841 +        $(foreach thisLink,$(MyLinkTargets),$(call do_link,$(MyLinkSource),$(thisLink)))
842 + endif      
843 +
844   # make statistics
845   _statisticsall :
846          @$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp
# Line 733 | Line 851 | $(Executable).pure :
851          $(Print) Done statistics.
852  
853   # make pure
854 < $(Executable).pure :
855 <        $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \
856 <        $(LibList) $(ObjectFiles) -o $@
854 > #$(Executable).pure :
855 > #       $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \
856 > #       $(LibList) $(ObjectFiles) -o $@
857 > #
858 > #pure : $(Executable).pure
859  
740 pure : $(Executable).pure
741
860   #make cvslog
861   cvslog:
862 <        $(DEV_ROOT)/scripts/cvs2cl.pl
862 >        $(DEV_ROOT)/scripts/cvs2cl
863  
864   # Execute
865   _runexe :

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines