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 1932 by tim, Wed Jan 12 23:17:02 2005 UTC vs.
Revision 2456 by gezelter, Fri Nov 18 17:50:17 2005 UTC

# Line 49 | Line 49 | PackageLibs = \
49          integrators\
50          constraints \
51          minimizers \
52 +        selection \
53 +        restraints \
54 +        lattice \
55 +        openbabel
56  
57   #packages containing applications
58   Applications = \
59          applications/oopse \
60          applications/dump2Xyz \
61 +        applications/staticProps \
62 +        applications/dynamicProps \
63          applications/simpleBuilder\
64 +        applications/nanoRodBuilder \
65 +        applications/atom2mdin
66  
67   Samples = \
68          samples/argon \
69 <        samples/water/dimer \
69 >        samples/water/dimer \
70          samples/water/spce \
71          samples/water/ssd \
72          samples/water/ssde \
73 +        samples/water/ssdrf \
74 +        samples/water/ssd-ion \
75          samples/water/tip3p_ice \
76          samples/water/tip4p \
77          samples/lipid \
78          samples/alkane \
79          samples/minimizer \
80          samples/metals \
81 +        samples/thermoIntegration/liquid \
82 +        samples/thermoIntegration/solid \
83 +        samples/dipole \
84 +        samples/shape \
85          samples/zcons \
86  
87   IncludeDirs = \
88 <        @SPRNG_INC_DIR@ \
89 <        @MPI_INC_DIR@
88 >        @CGAL_INC_DIR@ \
89 >        @MPI_INC_DIR@
90  
91   LibraryDirs = \
92 <        @SPRNG_LIB_DIR@ \
92 >        @CGAL_LIB_DIR@ \
93          @MPI_LIB_DIR@
94  
95   Libraries = \
96 <        @SPRNG_LIB@ \
96 >        @LIBS@ \
97 >        @CGAL_LIBS@ \
98          @MPI_LIB@ \
99 <        @MPI_F90_LIB@
99 >        @MPI_F90_LIB@
100  
101   OopseHome       = @OOPSE_HOME@
102   ForceParamDir   = $(OopseHome)/share/forceFields
# Line 112 | Line 127 | BinDir            = $(DEV_ROOT)/bin
127   ParallelTargetDir = $(DEV_ROOT)/MPIobj
128   LibDir            = $(DEV_ROOT)/lib
129   MakeDir           = $(DEV_ROOT)/make
130 + MainMakefile      = $(MakeDir)/Makefile
131   BinDir            = $(DEV_ROOT)/bin
132   DocsDir           = $(DEV_ROOT)/docs
133   CurrentDir        = $(CURDIR)
# Line 123 | Line 139 | Package          = $(subst $(shell cd $(SourceDir); pw
139   # /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside
140   #Package          = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g')
141   #use shell script to get the absolute path and then rip it off from $(CurrentDir)
142 < Package          = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
142 > #Package          = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
143 > # REMINDER: We are now using the Package line in each subdir makefile.
144 > # This avoids the strange path problem and the subshell
145  
146   PackageList              = $(Package)
147   PackageSourceDir         = $(SourceDir)/$(Package)
# Line 201 | Line 219 | OtherTargetFiles       = $(OtherSourceFiles:%=$(Packag
219                           $(LexFiles:%.l=     %.c)
220  
221   OtherTargetFiles       = $(OtherSourceFiles:%=$(PackageTargetDir)/%)
222 +
223 + ###########################################################################
224 + #
225 + # Figure out the names of the module files based on some work done by
226 + # configure.  The tr function below is from John Graham-Cumming
227 + # (http://www.jgc.org).
228 + #
229 + # The tr function.   Has three arguments:
230 + #
231 + # $1   The list of characters to translate from
232 + # $2   The list of characters to translate to
233 + # $3   The text to translate
234 + #
235 + # For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L.
236 +
237 + tr = $(eval __t := $3)                                                    \
238 +     $(foreach c,                                                         \
239 +         $(join $(addsuffix :,$1),$2),                                    \
240 +         $(eval __t :=                                                    \
241 +             $(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \
242 +                 $(__t))))$(__t)
243 +
244 + # Common character classes for use with the tr function.  Each of
245 + # these is actually a variable declaration and must be wrapped with
246 + # $() or ${} to be used.
247  
248 + [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 #
249 + [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 #
250 + [0-9] := 0 1 2 3 4 5 6 7 8 9 #
251 + [A-F] := A B C D E F #
252 +
253 + # Figure out whether we have $(eval) or not (GNU Make 3.80 and above)
254 + # if we do not then we need to use the shell version of tr, and not the
255 + # faster tr function above:
256 +
257 + __have_eval := $(false)
258 + __ignore := $(eval __have_eval := $(true))
259 +
260 + ifndef __have_eval
261 +  uc = $(shell echo $1 | tr "a-z" "A-Z")
262 +  lc = $(shell echo $1 | tr "A-Z" "a-z")
263 + else
264 +  uc = $(call tr,$([a-z]),$([A-Z]),$1)
265 +  lc = $(call tr,$([A-Z]),$([a-z]),$1)
266 + endif
267 +
268 + # OK, now we can actually use these functions to figure out the names
269 + # of the module files:
270 +
271 + ifneq "$(words $(Modules))" "0"
272 + ifeq "$(ModuleCase)" "UPPER"
273 +  MODULES = $(call uc,$(Modules))
274 + else
275 +  ifeq "$(ModuleCase)" "lower"
276 +    MODULES = $(call lc,$(Modules))
277 +  else
278 +    MODULES = $(Modules)
279 +  endif
280 + endif
281 +  ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix))
282 +  ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix))
283 + endif
284 + #
285 + ###########################################################################
286 +
287   ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries))
288   ThirdPartyJars    = $(subst $(Space),$(X),$(ThirdPartyJarsTmp))
289  
# Line 213 | Line 295 | ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))
295   #if Main is defined, do not build library. It may not be true sometimes
296   ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0"
297    DependencyFile    = $(PackageSourceDir)/Makedepend
298 <  ifneq "$(Main)" ""
298 >  ifneq "$(words $(Main))" "0"
299      Executable             = $(BinDir)/$(Main)
300 <    ParallelExecutable     = $(BinDir)/$(Main)_MPI
300 >    ifeq "$(BuiltParallelExe)" "1"
301 >      ParallelExecutable     = $(BinDir)/$(Main)_MPI
302 >    endif
303    else
304      SharedLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so
305      StaticLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a
# Line 251 | Line 335 | INSTALL                = @INSTALL@
335   CppCompiler            = @CXX@
336   Linker                 = @CXX@
337   MakeDepend             = makedepend
338 + LN_S                   = @LN_S@
339   INSTALL                = @INSTALL@
340   InstallProgram         = @INSTALL_PROGRAM@
341 + InstallScript          = @INSTALL_SCRIPT@
342   InstallData            = @INSTALL_DATA@
343 < MkDir                = @MKINSTALLDIRS@
344 < Delete                 = rm -fr
343 > MkDir                  = @MKINSTALLDIRS@
344 > Delete                 = rm -f
345   StaticArchiver         = @AR@
346   DynamicArchiver        = @CC@
347   FortranCompiler        = @FC@
# Line 285 | Line 371 | CppOptions             = $(FrcDeclare) @CXXFLAGS@
371                           -sourcepath $(SourceDir)
372   COptions               = $(FrcDeclare) @CFLAGS@
373   CParallelOptions       = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@
374 < CppOptions             = $(FrcDeclare) @CXXFLAGS@
375 < CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@
374 > CppOptions             = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
375 > CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
376   FortranOptions         =
377   F90Options             =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir)
378   F90ParallelOptions     =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir)  @PREPDEFFLAG@$(ParallelDeclare)
# Line 364 | Line 450 | $(PackageTargetDir) :
450  
451   # Create target directory
452   $(PackageTargetDir) :
453 <        $(MakeDir) $@
453 >        $(MkDir) $@
454  
455 + $(BinDir) :
456 +        $(MkDir) $@
457 +
458   # .c -> .o
459 < $(PackageTargetDir)/%.o : %.c
459 > $(PackageTargetDir)/%.o : %.c $(MainMakefile)
460          $(Print) $@
461          $(CCompiler) $(COptions) -c $(IncludePath) $< -o $@
462  
463 < $(PackageParallelTargetDir)/%.o : %.c
463 > $(PackageParallelTargetDir)/%.o : %.c $(MainMakefile)
464          $(Print) $@
465          $(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@
466  
467   ifeq "$(UseMPI)" "yes"
468 < %.o : %.c
468 > %.o : %.c $(MainMakefile)
469          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
470          $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
471   else
472 < %.o : %.c
472 > %.o : %.c $(MainMakefile)
473          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
474   endif
475  
476   # .cpp -> .o
477 < $(PackageTargetDir)/%.o : %.cpp
477 > $(PackageTargetDir)/%.o : %.cpp $(MainMakefile)
478          $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@
479  
480 < $(PackageParallelTargetDir)/%.o : %.cpp
480 > $(PackageParallelTargetDir)/%.o : %.cpp $(MainMakefile)
481          $(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@
482  
483   ifeq "$(UseMPI)" "yes"
484 < %.o : %.cpp
484 > %.o : %.cpp $(MainMakefile)
485          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
486          $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
487   else
488 < %.o : %.cpp
488 > %.o : %.cpp $(MainMakefile)
489          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
490   endif
491  
492   # .f -> .o
493 < $(PackageTargetDir)/%.o : %.f
493 > $(PackageTargetDir)/%.o : %.f $(MainMakefile)
494          $(FortranCompiler) $(FortranOptions) -c $< -o $@
495  
496 < $(PackageParallelTargetDir)/%.o : %.f
496 > $(PackageParallelTargetDir)/%.o : %.f $(MainMakefile)
497          $(FortranCompiler) $(FortranParallelOptions) -c $< -o $@
498  
499   ifeq "$(UseMPI)" "yes"
500 < %.o : %.f
500 > %.o : %.f $(MainMakefile)
501          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
502          $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
503   else
504 < %.o : %.f
504 > %.o : %.f $(MainMakefile)
505          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
506   endif
507  
508   # .F90 -> .o
509 < $(PackageTargetDir)/%.o : %.F90
509 > $(PackageTargetDir)/%.o : %.F90 $(MainMakefile)
510          $(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@
511          if test -n "`ls *.$(ModSuffix)`"; then \
512            $(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\
513          fi
514  
515 < $(PackageParallelTargetDir)/%.o : %.F90
515 > $(PackageParallelTargetDir)/%.o : %.F90 $(MainMakefile)
516          $(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@
517          if test -n "`ls *.$(ModSuffix)`"; then \
518            $(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\
519          fi
520  
521   ifeq "$(UseMPI)" "yes"
522 < %.o : %.F90
522 > %.o : %.F90 $(MainMakefile)
523          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
524          if test -n "`ls *.$(ModSuffix)`"; then\
525            $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
526          fi
527  
528          $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
529 <        if test -n "`ls *.$(ModSuffix)`"; then\
530 <          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
531 <        fi
529 >        if test -n "`ls *.$(ModSuffix)`"; then\
530 >          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
531 >        fi
532  
533   else
534 < %.o : %.F90
534 > %.o : %.F90 $(MainMakefile)
535          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
536          if test -n "`ls *.$(ModSuffix)`"; then\
537            $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
538          fi
450
539   endif
540  
541  
# Line 555 | Line 643 | do_create = $(call extract_objs,$(1))$(call create_arc
643   create_archive = $(shell  $(StaticArchiver) $(StaticArchiverOptions) $(2) $(call find_objs, $(1)))
644   remove_objs = $(shell $(Delete) $(call find_objs, $(1)))
645   do_create = $(call extract_objs,$(1))$(call create_archive,$(1),$(2))$(call remove_objs,$(1))  
646 + do_link = $(shell $(LN_S) $(1) $(2))
647  
648   $(CombinedStaticLib) : $(LibDir)/.stamp_UP
649          $(Print) create $@      
# Line 567 | Line 656 | $(Executable) : $(CombinedStaticLib) $(ObjectFiles)
656          $(Ranlib) $(CombinedParallelStaticLib)
657  
658   # Executable
659 < $(Executable) : $(CombinedStaticLib) $(ObjectFiles)
660 <        $(Linker) $(ObjectFiles) $(LinkOptions) $(LibDirs) $(CombinedStaticLib) $(Libraries) -o $@
659 > $(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir)
660 >        $(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@
661  
662 < $(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles)
663 <        $(Linker) $(ParallelObjectFiles) $(ParallelLinkOptions) $(LibDirs) $(CombinedParallelStaticLib) $(Libraries) -o $@
662 > $(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) $(BinDir)
663 >        $(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@
664  
665   # Anything else is just copied from source to target
666   $(PackageTargetDir)/% : $(PackageSourceDir)/%
# Line 614 | Line 703 | endif
703          $(Executable)
704   endif
705  
706 + echo : $(PackageListLoop)
707 +        $(Print) Done echo.
708  
709 + _echoall :
710 +        $(Print) $(Modules)
711 +
712   # make clean
713   clean : $(PackageListLoop)
714          $(Print) Done clean.    
715  
716   _cleanall :
717 <        $(Delete) $(ObjectFiles) $(ParallelObjectFiles)
717 >        $(Delete) \
718 >                $(ObjectFiles) \
719 >                $(ModuleFiles) \
720 >                $(ParallelObjectFiles) \
721 >                $(ParallelModuleFiles) \
722 >                $(JarFile) \
723 >                $(SharedLibrary) \
724 >                $(StaticLibrary) \
725 >                $(ParallelSharedLibrary) \
726 >                $(ParallelStaticLibrary) \
727 >                $(CombinedStaticLib) \
728 >                $(CombinedParallelStaticLib)
729  
730   # make distclean
731   distclean : $(PackageListLoop)
732          $(Print) Done clean.    
733  
734 < _distcleanall :
735 <        $(Delete) $(ObjectFiles) \
631 <                  $(ParallelObjectFiles) \
632 <                        $(JarFile) \
633 <                  $(SharedLibrary) \
634 <                  $(StaticLibrary) \
635 <                  $(ParallelSharedLibrary) \
636 <                  $(ParallelStaticLibrary) \
637 <                  $(Executable) \
734 > _distcleanall : _cleanall
735 >        $(Delete) $(Executable) \
736                    $(ParallelExecutable) \
737                    $(DependencyFile)
738  
641
739   # make depend
740   depend : $(PackageListLoop)
741          $(Print) Done dependencies.
# Line 706 | Line 803 | _installall : _buildall _installdata
803   install : $(InstallListLoop)
804          $(Print) Done Install
805  
806 < _installall : _buildall _installdata
806 > _installall : _buildall _installdata _installlinks
807  
808   $(MyInstallDir) :
809          $(MkDir) $@
# Line 714 | Line 811 | ifneq "$(words $(InstallFiles))" "0"
811   _installdata :  $(MyInstallDir)
812          $(Print) $(InstallFiles)
813   ifneq "$(words $(InstallFiles))" "0"
814 <        $(InstallData) $(InstallFiles) $(MyInstallDir)
814 >        $(InstallCommand) $(InstallFiles) $(MyInstallDir)
815   endif      
816  
817 + _installlinks :  $(MyInstallDir)
818 +        $(Print) $(LinkTargets)
819 + ifneq "$(words $(LinkTargets))" "0"
820 +        @cd $(MyInstallDir)
821 +        $(foreach thisLink,$(LinkTargets),$(call do_link,$(Executable),$(thisLink)))
822 + endif      
823 +
824   # make statistics
825   _statisticsall :
826          @$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp
# Line 727 | Line 831 | $(Executable).pure :
831          $(Print) Done statistics.
832  
833   # make pure
834 < $(Executable).pure :
835 <        $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \
836 <        $(LibList) $(ObjectFiles) -o $@
834 > #$(Executable).pure :
835 > #       $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \
836 > #       $(LibList) $(ObjectFiles) -o $@
837 > #
838 > #pure : $(Executable).pure
839  
734 pure : $(Executable).pure
735
840   #make cvslog
841   cvslog:
842 <        $(DEV_ROOT)/scripts/cvs2cl.pl
842 >        $(DEV_ROOT)/scripts/cvs2cl
843  
844   # Execute
845   _runexe :

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines