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

Comparing trunk/OOPSE-4/make/Makefile.in (file contents):
Revision 1539 by tim, Wed Oct 6 22:20:47 2004 UTC vs.
Revision 2199 by gezelter, Thu Apr 14 21:41:56 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 = \
80 <        @SPRNG_INC_DIR@ \
81 <        @MPI_INC_DIR@
80 >        @CGAL_INC_DIR@ \
81 >        @MPI_INC_DIR@
82  
83   LibraryDirs = \
84 <        @SPRNG_LIB_DIR@ \
84 >        @CGAL_LIB_DIR@ \
85          @MPI_LIB_DIR@
86  
87   Libraries = \
88 <        @SPRNG_LIB@ \
88 >        @CGAL_LIBS@ \
89          @MPI_LIB@ \
90 <        @MPI_F90_LIB@
90 >        @MPI_F90_LIB@
91  
92   OopseHome       = @OOPSE_HOME@
93 < ForceParamDir   = @OOPSE_HOME@/share/forceFields/
94 < SampleSimDir    = @OOPSE_HOME@/share/samples/
93 > ForceParamDir   = $(OopseHome)/share/forceFields
94 > SampleSimDir    = $(OopseHome)/share/samples
95 > InstallBinDir   = $(OopseHome)/bin
96 > DocDir          = $(OopseHome)/doc
97   FrcDeclare      = -DFRC_PATH="$(ForceParamDir)"
98   F90Declare      = -D__FORTRAN90
99   ParallelDeclare = -DIS_MPI
# Line 123 | Line 129 | Package          = $(subst $(shell cd $(SourceDir); pw
129   # /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside
130   #Package          = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g')
131   #use shell script to get the absolute path and then rip it off from $(CurrentDir)
132 < Package          = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
132 > #Package          = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
133 > # REMINDER: We are now using the Package line in each subdir makefile.
134 > # This avoids the strange path problem and the subshell
135  
136   PackageList              = $(Package)
137   PackageSourceDir         = $(SourceDir)/$(Package)
# Line 201 | Line 209 | OtherTargetFiles       = $(OtherSourceFiles:%=$(Packag
209                           $(LexFiles:%.l=     %.c)
210  
211   OtherTargetFiles       = $(OtherSourceFiles:%=$(PackageTargetDir)/%)
212 +
213 + ###########################################################################
214 + #
215 + # Figure out the names of the module files based on some work done by
216 + # configure.  The tr function below is from John Graham-Cumming
217 + # (http://www.jgc.org).
218 + #
219 + # The tr function.   Has three arguments:
220 + #
221 + # $1   The list of characters to translate from
222 + # $2   The list of characters to translate to
223 + # $3   The text to translate
224 + #
225 + # For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L.
226 +
227 + tr = $(eval __t := $3)                                                    \
228 +     $(foreach c,                                                         \
229 +         $(join $(addsuffix :,$1),$2),                                    \
230 +         $(eval __t :=                                                    \
231 +             $(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \
232 +                 $(__t))))$(__t)
233 +
234 + # Common character classes for use with the tr function.  Each of
235 + # these is actually a variable declaration and must be wrapped with
236 + # $() or ${} to be used.
237 +
238 + [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 #
239 + [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 #
240 + [0-9] := 0 1 2 3 4 5 6 7 8 9 #
241 + [A-F] := A B C D E F #
242 +
243 + # Figure out whether we have $(eval) or not (GNU Make 3.80 and above)
244 + # if we do not then we need to use the shell version of tr, and not the
245 + # faster tr function above:
246 +
247 + __have_eval := $(false)
248 + __ignore := $(eval __have_eval := $(true))
249 +
250 + ifndef __have_eval
251 +  uc = $(shell echo $1 | tr "a-z" "A-Z")
252 +  lc = $(shell echo $1 | tr "A-Z" "a-z")
253 + else
254 +  uc = $(call tr,$([a-z]),$([A-Z]),$1)
255 +  lc = $(call tr,$([A-Z]),$([a-z]),$1)
256 + endif
257  
258 + # OK, now we can actually use these functions to figure out the names
259 + # of the module files:
260 +
261 + ifneq "$(words $(Modules))" "0"
262 + ifeq "$(ModuleCase)" "UPPER"
263 +  MODULES = $(call uc,$(Modules))
264 + else
265 +  ifeq "$(ModuleCase)" "lower"
266 +    MODULES = $(call lc,$(Modules))
267 +  else
268 +    MODULES = $(Modules)
269 +  endif
270 + endif
271 +  ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix))
272 +  ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix))
273 + endif
274 + #
275 + ###########################################################################
276 +
277   ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries))
278   ThirdPartyJars    = $(subst $(Space),$(X),$(ThirdPartyJarsTmp))
279  
# Line 213 | Line 285 | ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))
285   #if Main is defined, do not build library. It may not be true sometimes
286   ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0"
287    DependencyFile    = $(PackageSourceDir)/Makedepend
288 <  ifneq "$(Main)" ""
288 >  ifneq "$(words $(Main))" "0"
289      Executable             = $(BinDir)/$(Main)
290 <    ParallelExecutable     = $(BinDir)/$(Main)_MPI
290 >    ifeq "$(BuiltParallelExe)" "1"
291 >      ParallelExecutable     = $(BinDir)/$(Main)_MPI
292 >    endif
293    else
294      SharedLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so
295      StaticLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a
# Line 223 | Line 297 | endif
297      ParallelStaticLibrary  = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.a
298    endif
299   endif
300 +
301   #
302   # Misc
303   #
# Line 244 | Line 319 | Move                   = mv
319   #
320   #---------------------------------------------------------------------------
321   Print                  = @echo
322 < Move                   = mv
322 > Move                   = mv -f
323   Copy                   = cp
324   CCompiler              = @CC@
325   CppCompiler            = @CXX@
326   Linker                 = @CXX@
327   MakeDepend             = makedepend
328 < Install                = @INSTALL@
328 > INSTALL                = @INSTALL@
329   InstallProgram         = @INSTALL_PROGRAM@
330 + InstallScript          = @INSTALL_SCRIPT@
331   InstallData            = @INSTALL_DATA@
332 < MakeDir                = @MKINSTALLDIRS@
332 > MkDir                  = @MKINSTALLDIRS@
333   Delete                 = rm -fr
334   StaticArchiver         = @AR@
335   DynamicArchiver        = @CC@
# Line 282 | Line 358 | COptions               = $(FrcDeclare)
358   JniOptions             =
359   RmiOptions             = -d $(TargetDir) -classpath $(ClassPath) \
360                           -sourcepath $(SourceDir)
361 < COptions               = $(FrcDeclare)
362 < CParallelOptions       = $(FrcDeclare) $(ParallelDeclare)
363 < CppOptions             = $(FrcDeclare)
364 < CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare)
361 > COptions               = $(FrcDeclare) @CFLAGS@
362 > CParallelOptions       = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@
363 > CppOptions             = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
364 > CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
365   FortranOptions         =
366 < F90Options             =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir)
367 < F90ParallelOptions     =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(ParallelTargetDir)  @PREPDEFFLAG@$(ParallelDeclare)
366 > F90Options             =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir)
367 > F90ParallelOptions     =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir)  @PREPDEFFLAG@$(ParallelDeclare)
368   JavaCompilerOptions    = -d $(TargetDir) -classpath $(ClassPath) \
369                           -sourcepath $(SourceDir) -deprecation
370   JavaRunOptions         = -classpath $(ClassPath)
# Line 310 | Line 386 | Space                  = $(Empty) $(Empty)
386  
387   Empty                  =
388   Space                  = $(Empty) $(Empty)
389 +
390 +
391 + #---------------------------------------------------------------------------
392 + #
393 + #  Install
394 + #
395 + #---------------------------------------------------------------------------
396 +
397 + ifneq "$(words $(SampleFiles))" "0"
398 +  MySample                 = $(subst $(shell cd $(DEV_ROOT)/samples; pwd)/,,$(CurrentDir))
399 +  MyInstallDir             = $(SampleSimDir)/$(MySample)
400 +  InstallFiles             = $(SampleFiles)
401 +  InstallCommand           = $(InstallData)
402 + endif
403 +
404 + ifneq "$(words $(Main))" "0"
405 +  MyInstallDir             = $(InstallBinDir)
406 +  ifeq "$(UseMPI)" "yes"
407 +    InstallFiles             = $(Executable) $(ParallelExecutable)
408 +  else
409 +    InstallFiles             = $(Executable)
410 +  endif
411 +  InstallCommand           = $(InstallProgram)
412 + endif
413  
414 + ifneq "$(words $(ForcefieldFiles))" "0"
415 +  MyInstallDir             = $(ForceParamDir)
416 +  InstallFiles             = $(ForcefieldFiles)
417 +  InstallCommand           = $(InstallData)
418 + endif
419  
420 + ifneq "$(words $(InstallFiles))" "0"
421 +  InstallList            =
422 + else
423 +  InstallList            = $(patsubst %,$(DEV_ROOT)/%,$(Samples)) $(DEV_ROOT)/forceFields $(patsubst %, $(SourceDir)/%,$(Applications))
424 + endif
425 +
426 + InstallListLoop          = $(patsubst %,$(SourceDir)/%/.install,$(PackageList))  $(patsubst %,%/.install,$(InstallList))
427 +
428 +
429 +
430   #---------------------------------------------------------------------------
431   #
432   # Rules
# Line 324 | Line 439 | $(PackageTargetDir) :
439  
440   # Create target directory
441   $(PackageTargetDir) :
442 <        $(MakeDir) $@
442 >        $(MkDir) $@
443  
444 + $(BinDir) :
445 +        $(MkDir) $@
446 +
447   # .c -> .o
448   $(PackageTargetDir)/%.o : %.c
449          $(Print) $@
# Line 379 | Line 497 | $(PackageTargetDir)/%.o : %.F90
497   # .F90 -> .o
498   $(PackageTargetDir)/%.o : %.F90
499          $(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@
500 +        if test -n "`ls *.$(ModSuffix)`"; then \
501 +          $(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\
502 +        fi
503  
504   $(PackageParallelTargetDir)/%.o : %.F90
505          $(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@
506 +        if test -n "`ls *.$(ModSuffix)`"; then \
507 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\
508 +        fi
509  
510   ifeq "$(UseMPI)" "yes"
511   %.o : %.F90
512          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
513 +        if test -n "`ls *.$(ModSuffix)`"; then\
514 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
515 +        fi
516 +
517          $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
518 +        if test -n "`ls *.$(ModSuffix)`"; then\
519 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
520 +        fi
521 +
522   else
523   %.o : %.F90
524          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
525 +        if test -n "`ls *.$(ModSuffix)`"; then\
526 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
527 +        fi
528   endif
529  
530  
# Line 509 | Line 644 | $(Executable) : $(CombinedStaticLib) $(ObjectFiles)
644          $(Ranlib) $(CombinedParallelStaticLib)
645  
646   # Executable
647 < $(Executable) : $(CombinedStaticLib) $(ObjectFiles)
648 <        $(Linker) $(ObjectFiles) $(LinkOptions) $(LibDirs) $(CombinedStaticLib) $(Libraries) -o $@
647 > $(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir)
648 >        $(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@
649  
650 < $(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles)
651 <        $(Linker) $(ParallelObjectFiles) $(ParallelLinkOptions) $(LibDirs) $(CombinedParallelStaticLib) $(Libraries) -o $@
650 > $(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) $(BinDir)
651 >        $(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@
652  
653   # Anything else is just copied from source to target
654   $(PackageTargetDir)/% : $(PackageSourceDir)/%
# Line 526 | Line 661 | ifeq "$(UseMPI)" "yes"
661  
662   _all : _buildall
663  
664 + _buildall :
665   ifeq "$(UseMPI)" "yes"
666   _buildall : \
667          $(DependencyFile) \
# Line 555 | Line 691 | endif
691          $(Executable)
692   endif
693  
694 + echo : $(PackageListLoop)
695 +        $(Print) Done echo.
696  
697 + _echoall :
698 +        $(Print) $(Modules)
699 +
700   # make clean
701   clean : $(PackageListLoop)
702          $(Print) Done clean.    
703  
704   _cleanall :
705 <        $(Delete) $(ObjectFiles) $(ParallelObjectFiles)
705 >        $(Delete) \
706 >                $(ObjectFiles) \
707 >                $(ModuleFiles) \
708 >                $(ParallelObjectFiles) \
709 >                $(ParallelModuleFiles) \
710 >                $(JarFile) \
711 >                $(SharedLibrary) \
712 >                $(StaticLibrary) \
713 >                $(ParallelSharedLibrary) \
714 >                $(ParallelStaticLibrary) \
715 >                $(CombinedStaticLib) \
716 >                $(CombinedParallelStaticLib)
717  
718   # make distclean
719   distclean : $(PackageListLoop)
720          $(Print) Done clean.    
721  
722 < _distcleanall :
723 <        $(Delete) $(ObjectFiles) \
572 <                  $(ParallelObjectFiles) \
573 <                        $(JarFile) \
574 <                  $(SharedLibrary) \
575 <                  $(StaticLibrary) \
576 <                  $(ParallelSharedLibrary) \
577 <                  $(ParallelStaticLibrary) \
578 <                  $(Executable) \
722 > _distcleanall : _cleanall
723 >        $(Delete) $(Executable) \
724                    $(ParallelExecutable) \
725                    $(DependencyFile)
726  
582
727   # make depend
728   depend : $(PackageListLoop)
729          $(Print) Done dependencies.
# Line 591 | Line 735 | ifneq "$(words $(CppFiles))" "0"
735          @cd $(PackageSourceDir)
736  
737   ifneq "$(words $(CppFiles))" "0"
738 <        $(CppCompiler) $(CppOptions) $(IncludePath) -MM $(CppFiles) > Make.cpptemp
739 <        @cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(TargetDir\)\/&/g' >> $(DependencyFile)
738 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CppFiles)>> Make.cpptemp
739 >        @cat Make.cpptemp  >> $(DependencyFile)
740          $(Delete) Make.cpptemp
741 <        $(CppCompiler) $(CppParallelOptions) $(IncludePath) -MM $(CppFiles) > Make.cpptemp
742 <        @cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(ParallelTargetDir\)\/&/g' >> $(DependencyFile)
741 >
742 >  ifeq "$(UseMPI)" "yes"
743 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CppFiles)>> Make.cpptemp
744 >        @cat Make.cpptemp  >> $(DependencyFile)
745          @$(Delete) Make.cpptemp
746 +  endif
747 +
748   endif
749  
750   ifneq "$(words $(CFiles))" "0"
751 <        $(CCompiler) $(COptions) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp
752 <        @cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(TargetDir\)\/&/g' >> $(DependencyFile)
751 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/'  -MM $(CFiles) $(DerivedCFiles)  >> Make.ctemp
752 >        @cat Make.ctemp  >> $(DependencyFile)
753          $(Delete) Make.ctemp
754 <        $(CCompiler) $(CParallelOptions) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp
755 <        @cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(ParallelTargetDir\)\/&/g' >> $(DependencyFile)
754 >
755 >  ifeq "$(UseMPI)" "yes"
756 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CFiles) $(DerivedCFiles)  >> Make.ctemp
757 >        @cat Make.ctemp  >> $(DependencyFile)
758          @$(Delete) Make.ctemp
759 +  endif
760 +
761   endif
762  
763   ifneq "$(words $(F90Files))" "0"
764 <        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp
613 <        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -mc $(ModuleCase) -ms $(ModSuffix)  $(F90Files) >> Make.ftemp
764 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp
765          @cat Make.ftemp >> $(DependencyFile)
766          @$(Delete) Make.ftemp
767 +
768 +  ifeq "$(UseMPI)" "yes"
769 +        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix)  $(F90Files) >> Make.ftemp
770 +        @cat Make.ftemp >> $(DependencyFile)
771 +        @$(Delete) Make.ftemp
772 +  endif
773 +
774   endif
775  
776   # make lib
# Line 626 | Line 784 | jarsign : $(JarFile)
784   jarsign : $(JarFile)
785          $(JarSigner) -keystore GeoSoftKeystore $(JarFile) myself
786  
787 + #make install
788 + %.install :
789 +        @$(MAKE) $(MakeOptions) -C $(subst .install,,$@) _installall    
790 +
791 + install : $(InstallListLoop)
792 +        $(Print) Done Install
793 +
794 + _installall : _buildall _installdata
795 +
796 + $(MyInstallDir) :
797 +        $(MkDir) $@
798 +
799 + _installdata :  $(MyInstallDir)
800 +        $(Print) $(InstallFiles)
801 + ifneq "$(words $(InstallFiles))" "0"
802 +        $(InstallCommand) $(InstallFiles) $(MyInstallDir)
803 + endif      
804 +
805   # make statistics
806   _statisticsall :
807          @$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp
# Line 644 | Line 820 | cvslog:
820  
821   #make cvslog
822   cvslog:
823 <        $(DEV_ROOT)/scripts/cvs2cl.pl
823 >        $(DEV_ROOT)/scripts/cvs2cl
824  
825   # Execute
826   _runexe :

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines