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

Comparing trunk/OOPSE-2.0/make/Makefile.in (file contents):
Revision 1535 by gezelter, Wed Oct 6 21:22:43 2004 UTC vs.
Revision 2176 by gezelter, Tue Apr 12 21:26:42 2005 UTC

# Line 38 | Line 38 | PackageLibs = \
38   #packages containing libraries
39   PackageLibs = \
40          utils \
41 +        visitors \
42          math \
43          types \
44          primitives \
44        visitors \
45          UseTheForce/DarkSide \
46          UseTheForce \
47          brains \
48          io \
49 <        integrators \
50 <        minimizers \
49 >        integrators\
50          constraints \
51 <        profiling \
51 >        minimizers \
52 >        selection \
53          restraints \
54 +        lattice \
55  
56   #packages containing applications
57   Applications = \
58          applications/oopse \
59          applications/dump2Xyz \
60 <        applications/simpleBuilder
60 >        applications/staticProps \
61 >        applications/dynamicProps \
62 >        applications/simpleBuilder\
63 >        applications/nanoRodBuilder \
64  
65   Samples = \
66          samples/argon \
# Line 73 | Line 77 | IncludeDirs = \
77          samples/zcons \
78  
79   IncludeDirs = \
76        @SPRNG_INC_DIR@ \
80          @MPI_INC_DIR@
81  
82   LibraryDirs = \
80        @SPRNG_LIB_DIR@ \
83          @MPI_LIB_DIR@
84  
85   Libraries = \
84        @SPRNG_LIB@ \
86          @MPI_LIB@ \
87          @MPI_F90_LIB@
88  
89   OopseHome       = @OOPSE_HOME@
90 < ForceParamDir   = @OOPSE_HOME@/share/forceFields/
91 < SampleSimDir    = @OOPSE_HOME@/share/samples/
90 > ForceParamDir   = $(OopseHome)/share/forceFields
91 > SampleSimDir    = $(OopseHome)/share/samples
92 > InstallBinDir   = $(OopseHome)/bin
93 > DocDir          = $(OopseHome)/doc
94   FrcDeclare      = -DFRC_PATH="$(ForceParamDir)"
95   F90Declare      = -D__FORTRAN90
96   ParallelDeclare = -DIS_MPI
# Line 123 | Line 126 | Package          = $(subst $(shell cd $(SourceDir); pw
126   # /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside
127   #Package          = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g')
128   #use shell script to get the absolute path and then rip it off from $(CurrentDir)
129 < Package          = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
129 > #Package          = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
130 > # REMINDER: We are now using the Package line in each subdir makefile.
131 > # This avoids the strange path problem and the subshell
132  
133   PackageList              = $(Package)
134   PackageSourceDir         = $(SourceDir)/$(Package)
# Line 202 | Line 207 | ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLib
207  
208   OtherTargetFiles       = $(OtherSourceFiles:%=$(PackageTargetDir)/%)
209  
210 + ###########################################################################
211 + #
212 + # Figure out the names of the module files based on some work done by
213 + # configure.  The tr function below is from John Graham-Cumming
214 + # (http://www.jgc.org).
215 + #
216 + # The tr function.   Has three arguments:
217 + #
218 + # $1   The list of characters to translate from
219 + # $2   The list of characters to translate to
220 + # $3   The text to translate
221 + #
222 + # For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L.
223 +
224 + tr = $(eval __t := $3)                                                    \
225 +     $(foreach c,                                                         \
226 +         $(join $(addsuffix :,$1),$2),                                    \
227 +         $(eval __t :=                                                    \
228 +             $(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \
229 +                 $(__t))))$(__t)
230 +
231 + # Common character classes for use with the tr function.  Each of
232 + # these is actually a variable declaration and must be wrapped with
233 + # $() or ${} to be used.
234 +
235 + [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 #
236 + [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 #
237 + [0-9] := 0 1 2 3 4 5 6 7 8 9 #
238 + [A-F] := A B C D E F #
239 +
240 + # Figure out whether we have $(eval) or not (GNU Make 3.80 and above)
241 + # if we do not then we need to use the shell version of tr, and not the
242 + # faster tr function above:
243 +
244 + __have_eval := $(false)
245 + __ignore := $(eval __have_eval := $(true))
246 +
247 + ifndef __have_eval
248 +  uc = $(shell echo $1 | tr "a-z" "A-Z")
249 +  lc = $(shell echo $1 | tr "A-Z" "a-z")
250 + else
251 +  uc = $(call tr,$([a-z]),$([A-Z]),$1)
252 +  lc = $(call tr,$([A-Z]),$([a-z]),$1)
253 + endif
254 +
255 + # OK, now we can actually use these functions to figure out the names
256 + # of the module files:
257 +
258 + ifneq "$(words $(Modules))" "0"
259 + ifeq "$(ModuleCase)" "UPPER"
260 +  MODULES = $(call uc,$(Modules))
261 + else
262 +  ifeq "$(ModuleCase)" "lower"
263 +    MODULES = $(call lc,$(Modules))
264 +  else
265 +    MODULES = $(Modules)
266 +  endif
267 + endif
268 +  ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix))
269 +  ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix))
270 + endif
271 + #
272 + ###########################################################################
273 +
274   ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries))
275   ThirdPartyJars    = $(subst $(Space),$(X),$(ThirdPartyJarsTmp))
276  
# Line 213 | Line 282 | ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))
282   #if Main is defined, do not build library. It may not be true sometimes
283   ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0"
284    DependencyFile    = $(PackageSourceDir)/Makedepend
285 <  ifneq "$(Main)" ""
285 >  ifneq "$(words $(Main))" "0"
286      Executable             = $(BinDir)/$(Main)
287 <    ParallelExecutable     = $(BinDir)/$(Main)_MPI
287 >    ifeq "$(BuiltParallelExe)" "1"
288 >      ParallelExecutable     = $(BinDir)/$(Main)_MPI
289 >    endif
290    else
291      SharedLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so
292      StaticLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a
# Line 223 | Line 294 | endif
294      ParallelStaticLibrary  = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.a
295    endif
296   endif
297 +
298   #
299   # Misc
300   #
# Line 244 | Line 316 | Move                   = mv
316   #
317   #---------------------------------------------------------------------------
318   Print                  = @echo
319 < Move                   = mv
319 > Move                   = mv -f
320   Copy                   = cp
321   CCompiler              = @CC@
322   CppCompiler            = @CXX@
323   Linker                 = @CXX@
324   MakeDepend             = makedepend
325 < Install                = @INSTALL@
325 > INSTALL                = @INSTALL@
326   InstallProgram         = @INSTALL_PROGRAM@
327 + InstallScript          = @INSTALL_SCRIPT@
328   InstallData            = @INSTALL_DATA@
329 < MakeDir                = @MKINSTALLDIRS@
329 > MkDir                  = @MKINSTALLDIRS@
330   Delete                 = rm -fr
331   StaticArchiver         = @AR@
332   DynamicArchiver        = @CC@
# Line 272 | Line 345 | Ranlib                 = @RANLIB@
345   Yacc                   = @YACC@
346   Lex                    = @LEX@
347   Ranlib                 = @RANLIB@
348 + Doxygen                = @DOXYGEN@
349  
276
350   MakeOptions            = -k
351   MakeDependOptions      =
352   StaticArchiverOptions  = rc
# Line 282 | Line 355 | COptions               = $(FrcDeclare)
355   JniOptions             =
356   RmiOptions             = -d $(TargetDir) -classpath $(ClassPath) \
357                           -sourcepath $(SourceDir)
358 < COptions               = $(FrcDeclare)
359 < CParallelOptions       = $(FrcDeclare) $(ParallelDeclare)
360 < CppOptions             = $(FrcDeclare)
361 < CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare)
358 > COptions               = $(FrcDeclare) @CFLAGS@
359 > CParallelOptions       = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@
360 > CppOptions             = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
361 > CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
362   FortranOptions         =
363 < F90Options             =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir)
364 < F90ParallelOptions     =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(ParallelTargetDir)  @PREPDEFFLAG@$(ParallelDeclare)
363 > F90Options             =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir)
364 > F90ParallelOptions     =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir)  @PREPDEFFLAG@$(ParallelDeclare)
365   JavaCompilerOptions    = -d $(TargetDir) -classpath $(ClassPath) \
366                           -sourcepath $(SourceDir) -deprecation
367   JavaRunOptions         = -classpath $(ClassPath)
# Line 310 | Line 383 | Space                  = $(Empty) $(Empty)
383  
384   Empty                  =
385   Space                  = $(Empty) $(Empty)
386 +
387 +
388 + #---------------------------------------------------------------------------
389 + #
390 + #  Install
391 + #
392 + #---------------------------------------------------------------------------
393 +
394 + ifneq "$(words $(SampleFiles))" "0"
395 +  MySample                 = $(subst $(shell cd $(DEV_ROOT)/samples; pwd)/,,$(CurrentDir))
396 +  MyInstallDir             = $(SampleSimDir)/$(MySample)
397 +  InstallFiles             = $(SampleFiles)
398 +  InstallCommand           = $(InstallData)
399 + endif
400 +
401 + ifneq "$(words $(Main))" "0"
402 +  MyInstallDir             = $(InstallBinDir)
403 +  ifeq "$(UseMPI)" "yes"
404 +    InstallFiles             = $(Executable) $(ParallelExecutable)
405 +  else
406 +    InstallFiles             = $(Executable)
407 +  endif
408 +  InstallCommand           = $(InstallProgram)
409 + endif
410 +
411 + ifneq "$(words $(ForcefieldFiles))" "0"
412 +  MyInstallDir             = $(ForceParamDir)
413 +  InstallFiles             = $(ForcefieldFiles)
414 +  InstallCommand           = $(InstallData)
415 + endif
416  
417 + ifneq "$(words $(InstallFiles))" "0"
418 +  InstallList            =
419 + else
420 +  InstallList            = $(patsubst %,$(DEV_ROOT)/%,$(Samples)) $(DEV_ROOT)/forceFields $(patsubst %, $(SourceDir)/%,$(Applications))
421 + endif
422  
423 + InstallListLoop          = $(patsubst %,$(SourceDir)/%/.install,$(PackageList))  $(patsubst %,%/.install,$(InstallList))
424 +
425 +
426 +
427   #---------------------------------------------------------------------------
428   #
429   # Rules
# Line 324 | Line 436 | $(PackageTargetDir) :
436  
437   # Create target directory
438   $(PackageTargetDir) :
439 <        $(MakeDir) $@
439 >        $(MkDir) $@
440  
441 + $(BinDir) :
442 +        $(MkDir) $@
443 +
444   # .c -> .o
445   $(PackageTargetDir)/%.o : %.c
446          $(Print) $@
# Line 379 | Line 494 | $(PackageTargetDir)/%.o : %.F90
494   # .F90 -> .o
495   $(PackageTargetDir)/%.o : %.F90
496          $(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@
497 +        if test -n "`ls *.$(ModSuffix)`"; then \
498 +          $(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\
499 +        fi
500  
501   $(PackageParallelTargetDir)/%.o : %.F90
502          $(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@
503 +        if test -n "`ls *.$(ModSuffix)`"; then \
504 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\
505 +        fi
506  
507   ifeq "$(UseMPI)" "yes"
508   %.o : %.F90
509          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
510 +        if test -n "`ls *.$(ModSuffix)`"; then\
511 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
512 +        fi
513 +
514          $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
515 +        if test -n "`ls *.$(ModSuffix)`"; then\
516 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
517 +        fi
518 +
519   else
520   %.o : %.F90
521          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
522 +        if test -n "`ls *.$(ModSuffix)`"; then\
523 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
524 +        fi
525   endif
526  
527  
# Line 486 | Line 618 | $(PackageTargetDir)/%_Skel.class : $(PackageTargetDir)
618   %_Skel.class : %.class
619          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
620  
621 + document :
622 +        $(Print) Generate Documentation for OOPSE-2.0
623 +        @cd $(DEV_ROOT)/src    
624 +        $(Doxygen) $(DEV_ROOT)/make/Doxyfile
625 +
626   #GUN make funtions to merge the libraries
627   find_objs = $(shell $(StaticArchiver) -t $(1))
628   extract_objs = $(shell $(StaticArchiver) -x $(1) $(call find_objs, $(1)))
# Line 504 | Line 641 | $(Executable) : $(CombinedStaticLib) $(ObjectFiles)
641          $(Ranlib) $(CombinedParallelStaticLib)
642  
643   # Executable
644 < $(Executable) : $(CombinedStaticLib) $(ObjectFiles)
645 <        $(Linker) $(ObjectFiles) $(LinkOptions) $(LibDirs) $(CombinedStaticLib) $(Libraries) -o $@
644 > $(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir)
645 >        $(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@
646  
647 < $(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles)
648 <        $(Linker) $(ParallelObjectFiles) $(ParallelLinkOptions) $(LibDirs) $(CombinedParallelStaticLib) $(Libraries) -o $@
647 > $(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) $(BinDir)
648 >        $(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@
649  
650   # Anything else is just copied from source to target
651   $(PackageTargetDir)/% : $(PackageSourceDir)/%
# Line 521 | Line 658 | ifeq "$(UseMPI)" "yes"
658  
659   _all : _buildall
660  
661 + _buildall :
662   ifeq "$(UseMPI)" "yes"
663   _buildall : \
664          $(DependencyFile) \
# Line 550 | Line 688 | endif
688          $(Executable)
689   endif
690  
691 + echo : $(PackageListLoop)
692 +        $(Print) Done echo.
693  
694 + _echoall :
695 +        $(Print) $(Modules)
696 +
697   # make clean
698   clean : $(PackageListLoop)
699          $(Print) Done clean.    
700  
701   _cleanall :
702 <        $(Delete) $(ObjectFiles) $(ParallelObjectFiles)
702 >        $(Delete) \
703 >                $(ObjectFiles) \
704 >                $(ModuleFiles) \
705 >                $(ParallelObjectFiles) \
706 >                $(ParallelModuleFiles) \
707 >                $(JarFile) \
708 >                $(SharedLibrary) \
709 >                $(StaticLibrary) \
710 >                $(ParallelSharedLibrary) \
711 >                $(ParallelStaticLibrary) \
712 >                $(CombinedStaticLib) \
713 >                $(CombinedParallelStaticLib)
714  
715   # make distclean
716   distclean : $(PackageListLoop)
717          $(Print) Done clean.    
718  
719 < _distcleanall :
720 <        $(Delete) $(ObjectFiles) \
567 <                  $(ParallelObjectFiles) \
568 <                        $(JarFile) \
569 <                  $(SharedLibrary) \
570 <                  $(StaticLibrary) \
571 <                  $(ParallelSharedLibrary) \
572 <                  $(ParallelStaticLibrary) \
573 <                  $(Executable) \
719 > _distcleanall : _cleanall
720 >        $(Delete) $(Executable) \
721                    $(ParallelExecutable) \
722                    $(DependencyFile)
723  
577
724   # make depend
725   depend : $(PackageListLoop)
726          $(Print) Done dependencies.
# Line 586 | Line 732 | ifneq "$(words $(CppFiles))" "0"
732          @cd $(PackageSourceDir)
733  
734   ifneq "$(words $(CppFiles))" "0"
735 <        $(CppCompiler) $(CppOptions) $(IncludePath) -MM $(CppFiles) > Make.cpptemp
736 <        cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(TargetDir\)\/&/g' >> $(DependencyFile)
735 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CppFiles)>> Make.cpptemp
736 >        @cat Make.cpptemp  >> $(DependencyFile)
737          $(Delete) Make.cpptemp
738 <        $(CppCompiler) $(CppParallelOptions) $(IncludePath) -MM $(CppFiles) > Make.cpptemp
739 <        cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(ParallelTargetDir\)\/&/g' >> $(DependencyFile)
740 <        $(Delete) Make.cpptemp
738 >
739 >  ifeq "$(UseMPI)" "yes"
740 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CppFiles)>> Make.cpptemp
741 >        @cat Make.cpptemp  >> $(DependencyFile)
742 >        @$(Delete) Make.cpptemp
743 >  endif
744 >
745   endif
746  
747   ifneq "$(words $(CFiles))" "0"
748 <        $(CCompiler) $(COptions) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp
749 <        cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(TargetDir\)\/&/g' >> $(DependencyFile)
748 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/'  -MM $(CFiles) $(DerivedCFiles)  >> Make.ctemp
749 >        @cat Make.ctemp  >> $(DependencyFile)
750          $(Delete) Make.ctemp
751 <        $(CCompiler) $(CParallelOptions) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp
752 <        cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(ParallelTargetDir\)\/&/g' >> $(DependencyFile)
753 <        $(Delete) Make.ctemp
751 >
752 >  ifeq "$(UseMPI)" "yes"
753 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CFiles) $(DerivedCFiles)  >> Make.ctemp
754 >        @cat Make.ctemp  >> $(DependencyFile)
755 >        @$(Delete) Make.ctemp
756 >  endif
757 >
758   endif
759  
760   ifneq "$(words $(F90Files))" "0"
761 <        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare)  $(F90Files) > Make.ftemp
762 <        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare)  $(F90Files) >> Make.ftemp
763 <        cat Make.ftemp >> $(DependencyFile)
764 <        $(Delete) Make.ftemp
761 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp
762 >        @cat Make.ftemp >> $(DependencyFile)
763 >        @$(Delete) Make.ftemp
764 >
765 >  ifeq "$(UseMPI)" "yes"
766 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix)  $(F90Files) >> Make.ftemp
767 >        @cat Make.ftemp >> $(DependencyFile)
768 >        @$(Delete) Make.ftemp
769 >  endif
770 >
771   endif
772  
773   # make lib
# Line 621 | Line 781 | jarsign : $(JarFile)
781   jarsign : $(JarFile)
782          $(JarSigner) -keystore GeoSoftKeystore $(JarFile) myself
783  
784 + #make install
785 + %.install :
786 +        @$(MAKE) $(MakeOptions) -C $(subst .install,,$@) _installall    
787 +
788 + install : $(InstallListLoop)
789 +        $(Print) Done Install
790 +
791 + _installall : _buildall _installdata
792 +
793 + $(MyInstallDir) :
794 +        $(MkDir) $@
795 +
796 + _installdata :  $(MyInstallDir)
797 +        $(Print) $(InstallFiles)
798 + ifneq "$(words $(InstallFiles))" "0"
799 +        $(InstallCommand) $(InstallFiles) $(MyInstallDir)
800 + endif      
801 +
802   # make statistics
803   _statisticsall :
804          @$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines