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 1524 by tim, Tue Oct 5 14:14:46 2004 UTC vs.
Revision 2754 by gezelter, Wed May 17 03:03:03 2006 UTC

# Line 34 | Line 34 | IS_UNIX=1
34   #
35   #---------------------------------------------------------------------------
36   IS_UNIX=1
37 < #packages to be made
38 < Packages = \
37 >
38 > #packages containing libraries
39 > PackageLibs = \
40          utils \
41 +        visitors \
42          math \
43          types \
44          primitives \
43        visitors \
45          UseTheForce/DarkSide \
46          UseTheForce \
47          brains \
48          io \
49 <        integrators \
49 <        minimizers \
49 >        integrators\
50          constraints \
51 <        profiling \
51 >        minimizers \
52 >        selection \
53          restraints \
54 +        lattice \
55 +        hydrodynamics \
56 +        openbabel\
57 +        antlr\
58 +        mdParser
59 + #packages containing applications
60 + Applications = \
61          applications/oopse \
62          applications/dump2Xyz \
63 +        applications/staticProps \
64 +        applications/dynamicProps \
65          applications/simpleBuilder \
66 +        applications/randomBuilder \
67 +        applications/nanoRodBuilder \
68 +        applications/nanoparticleBuilder \
69 +        applications/atom2mdin \
70 +        applications/hydrodynamics
71  
57 #packages contain libraries
58 PackageLibs = \
59        utils \
60        math \
61        types \
62        primitives \
63        visitors \
64        UseTheForce/DarkSide \
65        UseTheForce \
66        brains \
67        io \
68        integrators \
69        minimizers \
70        constraints \
71        profiling \
72        restraints \
72  
73 + Samples = \
74 +        samples/alkane \
75 +        samples/argon \
76 +        samples/cutoff \
77 +        samples/dipole \
78 +        samples/gbljtest \
79 +        samples/lipid \
80 +        samples/metals/EAM \
81 +        samples/metals/EAM/nanoparticle \
82 +        samples/metals/EAM/nanorod \
83 +        samples/metals/Sutton-Chen \
84 +        samples/minimizer \
85 +        samples/shape \
86 +        samples/thermoIntegration/liquid \
87 +        samples/thermoIntegration/solid \
88 +        samples/water/dimer \
89 +        samples/water/spce \
90 +        samples/water/ssd \
91 +        samples/water/ssde \
92 +        samples/water/ssdrf \
93 +        samples/water/ssd-ion \
94 +        samples/water/tip3p_ice \
95 +        samples/water/tip4p \
96 +        samples/zcons
97 +
98   IncludeDirs = \
99 <        @SPRNG_INC_DIR@ \
100 <        @MPI_INC_DIR@
99 >        @ZLIB_INC_DIR@ \
100 >        @FFTW_INC_DIR@ \
101 >        @CGAL_INC_DIR@ \
102 >        @MPI_INC_DIR@
103  
104   LibraryDirs = \
105 <        @SPRNG_LIB_DIR@ \
105 >        @ZLIB_LIB_DIR@ \
106 >        @FFTW_LIB_DIR@ \
107 >        @CGAL_LIB_DIR@ \
108          @MPI_LIB_DIR@
109  
110   Libraries = \
111 <        @SPRNG_LIB@ \
112 <        @MPI_LIB@
111 >        @LIBS@ \
112 >        @ZLIB@ \
113 >        @FFTW_LIBS@ \
114 >        @CGAL_LIBS@ \
115 >        @MPI_LIB@ \
116 >        @MPI_F90_LIB@
117  
86 LinkOptions = \
87        @F90LIBS@
88
118   OopseHome       = @OOPSE_HOME@
119 < ForceParamDir   = @OOPSE_HOME@/share/forceFields/
120 < SampleSimDir    = @OOPSE_HOME@/share/samples/
119 > ForceParamDir   = $(OopseHome)/share/forceFields
120 > SampleSimDir    = $(OopseHome)/share/samples
121 > InstallBinDir   = $(OopseHome)/bin
122 > DocDir          = $(OopseHome)/doc
123   FrcDeclare      = -DFRC_PATH="$(ForceParamDir)"
124 + F90Declare      = -D__FORTRAN90
125   ParallelDeclare = -DIS_MPI
126 + UseMPI          = @USE_MPI@
127 + ModuleCase      = @F90_MODULE_NAMES@
128 + ModSuffix       = @MOD@
129 + LinkOptions = \
130 +        @LDFLAGS@ \
131 +        @FCLIBS@ \
132 +        @CXXFLAGS@
133 +        
134  
135 + ParallelLinkOptions = \
136 +        @LDFLAGS@ \
137 +        @FCLIBS@ \
138 +        @CXXFLAGS@
139  
140 +
141   #---------------------------------------------------------------------------
142   #
143   #  Directories
# Line 104 | Line 149 | BinDir            = $(DEV_ROOT)/bin
149   ParallelTargetDir = $(DEV_ROOT)/MPIobj
150   LibDir            = $(DEV_ROOT)/lib
151   MakeDir           = $(DEV_ROOT)/make
152 + MainMakefile      = $(MakeDir)/Makefile
153   BinDir            = $(DEV_ROOT)/bin
154   DocsDir           = $(DEV_ROOT)/docs
155   CurrentDir        = $(CURDIR)
156 + CombinedStaticLib = $(LibDir)/libOOPSE.a
157 + CombinedParallelStaticLib = $(LibDir)/libOOPSE_MPI.a
158  
159   ifdef Source
160   #get the relative path of current package to source directory
161   # /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside
162   #Package          = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g')
163   #use shell script to get the absolute path and then rip it off from $(CurrentDir)
164 < Package          = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
164 > #Package          = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
165 > # REMINDER: We are now using the Package line in each subdir makefile.
166 > # This avoids the strange path problem and the subshell
167  
168   PackageList              = $(Package)
169   PackageSourceDir         = $(SourceDir)/$(Package)
# Line 121 | Line 171 | PackageList              = $(Packages) $(JavaPackages)
171   PackageParallelTargetDir = $(ParallelTargetDir)
172   JavaMainClass            = $(subst /,.,$(Package)).$(Main)
173   else
174 < PackageList              = $(Packages) $(JavaPackages)
174 > PackageList              = $(PackageLibs) $(JavaPackages) $(Applications)
175   endif
176  
177   PackageListLoop          = $(patsubst %,$(SourceDir)/%/.loop,$(PackageList))
# Line 172 | Line 222 | ObjectFiles            = $(CFiles:%.c=        $(Packag
222   JniHeaders             = $(JniSource:%.java=  $(PackageSourceDir)/%.h)
223   ObjectFiles            = $(CFiles:%.c=        $(PackageTargetDir)/%.o)\
224                           $(CppFiles:%.cpp=    $(PackageTargetDir)/%.o)\
225 <                                     $(FortranFiles:%.f=  $(PackageTargetDir)/%.o)\
226 <                                     $(F90Files:%.F90=    $(PackageTargetDir)/%.o)\
227 <                                     $(LexFiles:%.l=      $(PackageTargetDir)/%.o)\
228 <                                     $(YaccFiles:%.y=     $(PackageTargetDir)/%.o)
225 >                         $(FortranFiles:%.f=  $(PackageTargetDir)/%.o)\
226 >                         $(F90Files:%.F90=    $(PackageTargetDir)/%.o)\
227 >                         $(LexFiles:%.l=      $(PackageTargetDir)/%.o)\
228 >                         $(YaccFiles:%.y=     $(PackageTargetDir)/%.o)
229   ParallelObjectFiles    = $(CFiles:%.c=        $(PackageParallelTargetDir)/%.o)\
230 <                                     $(CppFiles:%.cpp=    $(PackageParallelTargetDir)/%.o)\
231 <                                     $(FortranFiles:%.f=  $(PackageParallelTargetDir)/%.o)\
232 <                                     $(F90Files:%.F90=    $(PackageParallelTargetDir)/%.o)\
233 <                                     $(LexFiles:%.l=      $(PackageParallelTargetDir)/%.o)\
234 <                                     $(YaccFiles:%.y=     $(PackageParallelTargetDir)/%.o)
230 >                         $(CppFiles:%.cpp=    $(PackageParallelTargetDir)/%.o)\
231 >                         $(FortranFiles:%.f=  $(PackageParallelTargetDir)/%.o)\
232 >                         $(F90Files:%.F90=    $(PackageParallelTargetDir)/%.o)\
233 >                         $(LexFiles:%.l=      $(PackageParallelTargetDir)/%.o)\
234 >                         $(YaccFiles:%.y=     $(PackageParallelTargetDir)/%.o)
235  
236   DerivedSource          = $(YaccFiles:%.y=    %.h) \
237 <                               $(YaccFiles:%.y=    %.c) \
238 <                               $(LexFiles:%.l=     %.c)
237 >                         $(YaccFiles:%.y=    %.c) \
238 >                         $(LexFiles:%.l=     %.c)
239  
240   DerivedCFiles          = $(YaccFiles:%.y=    %.c) \
241 <                               $(LexFiles:%.l=     %.c)
241 >                         $(LexFiles:%.l=     %.c)
242  
243   OtherTargetFiles       = $(OtherSourceFiles:%=$(PackageTargetDir)/%)
244 +
245 + ###########################################################################
246 + #
247 + # Figure out the names of the module files based on some work done by
248 + # configure.  The tr function below is from John Graham-Cumming
249 + # (http://www.jgc.org).
250 + #
251 + # The tr function.   Has three arguments:
252 + #
253 + # $1   The list of characters to translate from
254 + # $2   The list of characters to translate to
255 + # $3   The text to translate
256 + #
257 + # For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L.
258  
259 + tr = $(eval __t := $3)                                                    \
260 +     $(foreach c,                                                         \
261 +         $(join $(addsuffix :,$1),$2),                                    \
262 +         $(eval __t :=                                                    \
263 +             $(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \
264 +                 $(__t))))$(__t)
265 +
266 + # Common character classes for use with the tr function.  Each of
267 + # these is actually a variable declaration and must be wrapped with
268 + # $() or ${} to be used.
269 +
270 + [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 #
271 + [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 #
272 + [0-9] := 0 1 2 3 4 5 6 7 8 9 #
273 + [A-F] := A B C D E F #
274 +
275 + # Figure out whether we have $(eval) or not (GNU Make 3.80 and above)
276 + # if we do not then we need to use the shell version of tr, and not the
277 + # faster tr function above:
278 +
279 + __have_eval := $(false)
280 + __ignore := $(eval __have_eval := $(true))
281 +
282 + ifndef __have_eval
283 +  uc = $(shell echo $1 | tr "a-z" "A-Z")
284 +  lc = $(shell echo $1 | tr "A-Z" "a-z")
285 + else
286 +  uc = $(call tr,$([a-z]),$([A-Z]),$1)
287 +  lc = $(call tr,$([A-Z]),$([a-z]),$1)
288 + endif
289 +
290 + # OK, now we can actually use these functions to figure out the names
291 + # of the module files:
292 +
293 + ifneq "$(words $(Modules))" "0"
294 + ifeq "$(ModuleCase)" "UPPER"
295 +  MODULES = $(call uc,$(Modules))
296 + else
297 +  ifeq "$(ModuleCase)" "lower"
298 +    MODULES = $(call lc,$(Modules))
299 +  else
300 +    MODULES = $(Modules)
301 +  endif
302 + endif
303 +  ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix))
304 +  ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix))
305 + endif
306 + #
307 + ###########################################################################
308 +
309   ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries))
310   ThirdPartyJars    = $(subst $(Space),$(X),$(ThirdPartyJarsTmp))
311  
# Line 203 | Line 317 | ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))
317   #if Main is defined, do not build library. It may not be true sometimes
318   ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0"
319    DependencyFile    = $(PackageSourceDir)/Makedepend
320 <  ifneq "$(Main)" ""
320 >  ifneq "$(words $(Main))" "0"
321      Executable             = $(BinDir)/$(Main)
322 <    ParallelExecutable     = $(BinDir)/$(Main)_MPI
322 >    ifeq "$(BuiltParallelExe)" "1"
323 >      ParallelExecutable     = $(BinDir)/$(Main)_MPI
324 >    endif
325    else
326 <    SharedLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).so
327 <    StaticLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).a
326 >    SharedLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so
327 >    StaticLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a
328      ParallelSharedLibrary  = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.so
329      ParallelStaticLibrary  = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.a
330    endif
331   endif
332 +
333   #
334   # Misc
335   #
# Line 220 | Line 337 | LocalLibs        = $(subst /,,$(patsubst %, oopse_%, $
337   JavaPackageNames = $(subst /,.,$(JavaPackages))
338   IncludePath      = -I$(SourceDir) $(IncludeDirs:%=-I%)
339   LibDirs          = -L$(LibDir)    $(LibraryDirs:%=-L%)
340 < LocalLibs        = $(subst /,,$(patsubst %, oopse_%, $(PackageLibs)))
340 > LocalLibs        = $(subst /,,$(patsubst %, oopse_%_UP, $(PackageLibs)))
341   ParallelLocalLibs= $(subst /,,$(patsubst %, oopse_%_MPI, $(PackageLibs)))
342   LibList          = $(LocalLibs:%=-l%) $(Libraries)
343 < ParallelLibList  = $(LocalLibs:%=-l%) $(Libraries)
343 > LibNames         = $(LocalLibs:%=$(LibDir)/lib%.a)
344 > ParallelLibList  = $(ParallelLocalLibs:%=-l%) $(Libraries)
345 > ParallelLibNames = $(ParallelLocalLibs:%=$(LibDir)/lib%.a)
346  
347  
348   #---------------------------------------------------------------------------
# Line 232 | Line 351 | Move                   = mv
351   #
352   #---------------------------------------------------------------------------
353   Print                  = @echo
354 < Move                   = mv
354 > Move                   = mv -f
355   Copy                   = cp
356   CCompiler              = @CC@
357   CppCompiler            = @CXX@
358   Linker                 = @CXX@
359   MakeDepend             = makedepend
360 < Install                = @INSTALL@
360 > LN_S                   = @LN_S@
361 > INSTALL                = @INSTALL@
362 > EGREP                  = @EGREP@
363   InstallProgram         = @INSTALL_PROGRAM@
364 + InstallScript          = @INSTALL_SCRIPT@
365   InstallData            = @INSTALL_DATA@
366 < MakeDir                = @MKINSTALLDIRS@
367 < Delete                 = rm -fr
366 > MkDir                  = @MKINSTALLDIRS@
367 > Delete                 = rm -f
368   StaticArchiver         = @AR@
369   DynamicArchiver        = @CC@
370   FortranCompiler        = @FC@
249 F90Compiler            = @F90@
371   JavaCompiler           = $(JAVA_HOME)/bin/javac
372   JavaArchiver           = $(JAVA_HOME)/bin/jar
373   JarSigner              = $(JAVA_HOME)/bin/jarsigner
# Line 259 | Line 380 | Lex                    = @LEX@
380   List                   = cat
381   Yacc                   = @YACC@
382   Lex                    = @LEX@
383 + Ranlib                 = @RANLIB@
384 + Doxygen                = @DOXYGEN@
385  
263
386   MakeOptions            = -k
387   MakeDependOptions      =
388   StaticArchiverOptions  = rc
# Line 269 | Line 391 | COptions               = $(FrcDeclare)
391   JniOptions             =
392   RmiOptions             = -d $(TargetDir) -classpath $(ClassPath) \
393                           -sourcepath $(SourceDir)
394 < COptions               = $(FrcDeclare)
395 < CParallelOptions       = $(FrcDeclare) $(ParallelDeclare)
396 < CppOptions             = $(FrcDeclare)
397 < CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare)
398 < FortranOptions         =
399 < F90Options             =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir)
278 < F90ParallelOptions     =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir)  @PREPDEFFLAG@$(ParallelDeclare)
394 > COptions               = $(FrcDeclare) @CPPFLAGS@ @CFLAGS@
395 > CParallelOptions       = $(FrcDeclare) $(ParallelDeclare) @CPPFLAGS@ @CFLAGS@
396 > CppOptions             = $(FrcDeclare) @CPPFLAGS@ @CXXFLAGS@
397 > CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare) @CPPFLAGS@ @CXXFLAGS@
398 > FortranOptions         =  @FCFLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir) @FCFLAGS_SRCEXT@
399 > FortranParallelOptions =  @FCFLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) @FCFLAGS_SRCEXT@
400   JavaCompilerOptions    = -d $(TargetDir) -classpath $(ClassPath) \
401                           -sourcepath $(SourceDir) -deprecation
402   JavaRunOptions         = -classpath $(ClassPath)
# Line 301 | Line 422 | Space                  = $(Empty) $(Empty)
422  
423   #---------------------------------------------------------------------------
424   #
425 + #  Install
426 + #
427 + #---------------------------------------------------------------------------
428 +
429 + ifneq "$(words $(SampleFiles))" "0"
430 +  MySample                 = $(subst $(shell cd $(DEV_ROOT)/samples; pwd)/,,$(CurrentDir))
431 +  MyInstallDir             = $(SampleSimDir)/$(MySample)
432 +  InstallFiles             = $(SampleFiles)
433 +  InstallCommand           = $(InstallData)
434 + endif
435 +
436 + ifneq "$(words $(Main))" "0"
437 +  MyInstallDir             = $(InstallBinDir)
438 +  ifeq "$(UseMPI)" "yes"
439 +    InstallFiles             = $(Executable) $(ParallelExecutable)
440 +  else
441 +    InstallFiles             = $(Executable)
442 +  endif
443 +  InstallCommand           = $(InstallProgram)
444 +  ifneq "$(words $(LinkTargets))" "0"
445 +    MyLinkSource = $(patsubst %, $(MyInstallDir)/%,$(Main))
446 +    MyLinkTargets = $(patsubst %, $(MyInstallDir)/%,$(LinkTargets))
447 +  endif
448 + endif
449 +
450 + ifneq "$(words $(ForcefieldFiles))" "0"
451 +  MyInstallDir             = $(ForceParamDir)
452 +  InstallFiles             = $(ForcefieldFiles)
453 +  InstallCommand           = $(InstallData)
454 + endif
455 +
456 + ifneq "$(words $(InstallFiles))" "0"
457 +  InstallList            =
458 + else
459 +  InstallList            = $(patsubst %,$(DEV_ROOT)/%,$(Samples)) $(DEV_ROOT)/forceFields $(patsubst %, $(SourceDir)/%,$(Applications))
460 + endif
461 +
462 + InstallListLoop          = $(patsubst %,$(SourceDir)/%/.install,$(PackageList))  $(patsubst %,%/.install,$(InstallList))
463 +
464 +
465 +
466 + #---------------------------------------------------------------------------
467 + #
468   # Rules
469   #
470   #---------------------------------------------------------------------------
# Line 311 | Line 475 | $(PackageTargetDir) :
475  
476   # Create target directory
477   $(PackageTargetDir) :
478 <        $(MakeDir) $@
478 >        $(MkDir) $@
479  
480 + $(BinDir) :
481 +        $(MkDir) $@
482 +
483   # .c -> .o
484 < $(PackageTargetDir)/%.o : %.c
484 > $(PackageTargetDir)/%.o : %.c $(MainMakefile)
485          $(Print) $@
486          $(CCompiler) $(COptions) -c $(IncludePath) $< -o $@
487  
488 < %.o : %.c
488 > $(PackageParallelTargetDir)/%.o : %.c $(MainMakefile)
489 >        $(Print) $@
490 >        $(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@
491 >
492 > ifeq "$(UseMPI)" "yes"
493 > %.o : %.c $(MainMakefile)
494          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
495 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
496 + else
497 + %.o : %.c $(MainMakefile)
498 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
499 + endif
500  
501   # .cpp -> .o
502 < $(PackageTargetDir)/%.o : %.cpp
502 > $(PackageTargetDir)/%.o : %.cpp $(MainMakefile)
503          $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@
504  
505 < %.o : %.cpp
505 > $(PackageParallelTargetDir)/%.o : %.cpp $(MainMakefile)
506 >        $(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@
507 >
508 > ifeq "$(UseMPI)" "yes"
509 > %.o : %.cpp $(MainMakefile)
510          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
511 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
512 + else
513 + %.o : %.cpp $(MainMakefile)
514 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
515 + endif
516  
517   # .f -> .o
518 < $(PackageTargetDir)/%.o : %.f
518 > $(PackageTargetDir)/%.o : %.f $(MainMakefile)
519          $(FortranCompiler) $(FortranOptions) -c $< -o $@
520  
521 < %.o : %.f
521 > $(PackageParallelTargetDir)/%.o : %.f $(MainMakefile)
522 >        $(FortranCompiler) $(FortranParallelOptions) -c $< -o $@
523 >
524 > ifeq "$(UseMPI)" "yes"
525 > %.o : %.f $(MainMakefile)
526          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
527 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
528 + else
529 + %.o : %.f $(MainMakefile)
530 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
531 + endif
532  
533   # .F90 -> .o
534 < $(PackageTargetDir)/%.o : %.F90
535 <        $(F90Compiler) $(F90Options) -c $< -o $@
534 > $(PackageTargetDir)/%.o : %.F90 $(MainMakefile)
535 >        $(FortranCompiler) $(FortranOptions) $(IncludePath) -c $< -o $@
536 >        if test -n "`ls *.$(ModSuffix)`"; then \
537 >          $(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\
538 >        fi
539  
540 < %.o : %.F90
540 > $(PackageParallelTargetDir)/%.o : %.F90 $(MainMakefile)
541 >        $(FortranCompiler) $(FortranParallelOptions) $(IncludePath) -c $< -o $@
542 >        if test -n "`ls *.$(ModSuffix)`"; then \
543 >          $(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\
544 >        fi
545 >
546 > ifeq "$(UseMPI)" "yes"
547 > %.o : %.F90 $(MainMakefile)
548          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
549 +        if test -n "`ls *.$(ModSuffix)`"; then\
550 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
551 +        fi
552  
553 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
554 +        if test -n "`ls *.$(ModSuffix)`"; then\
555 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
556 +        fi
557 +
558 + else
559 + %.o : %.F90 $(MainMakefile)
560 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
561 +        if test -n "`ls *.$(ModSuffix)`"; then\
562 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
563 +        fi
564 + endif
565 +
566 +
567   # .java -> .class
568   $(PackageTargetDir)/%.class : $(PackageSourceDir)/%.java
569          $(JavaCompiler) $(JavaCompilerOptions) $<
# Line 375 | Line 597 | $(LibDir)/%.a : $(ObjectFiles)
597          @$(Lex) -o$@ $?
598  
599   # .o -> .a
600 < $(LibDir)/%.a : $(ObjectFiles)
600 >
601 > $(LibDir)/%_UP.a : $(ObjectFiles)
602          $(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles)
603 +        @touch $(LibDir)/.stamp_UP
604  
605 < %.a : $(ObjectFiles)
382 <        $(MAKE) $(MakeOptions) $(LibDir)/$@
383 <
384 < $(LibDir)/%_MPI.a : $(ParallelObjectFiles)
605 > $(LibDir)/%_MPI.a: $(ParallelObjectFiles)
606          $(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles)
607 +        @touch $(LibDir)/.stamp_MPI
608  
609 + %_UP.a : $(ObjectFiles)
610 +        $(MAKE) $(MakeOptions) $(LibDir)/$@
611 +
612   %_MPI.a : $(ParallelObjectFiles)
613          $(MAKE) $(MakeOptions) $(LibDir)/$@
614  
615   # .o -> .so
616 < $(LibDir)/%.so : $(ObjectFiles)
616 > $(LibDir)/%_UP.so : $(ObjectFiles)
617          $(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@
618  
394 %.so : $(ObjectFiles)
395        $(MAKE) $(MakeOptions) $(LibDir)/$@
396
619   $(LibDir)/%_MPI.so : $(ParallelObjectFiles)
620          $(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@
621  
622 + %_UP.so : $(ObjectFiles)
623 +        $(MAKE) $(MakeOptions) $(LibDir)/$@
624 +
625   %_MPI.so : $(ParallelObjectFiles)
626          $(MAKE) $(MakeOptions) $(LibDir)/$@
627  
# Line 432 | Line 657 | $(PackageTargetDir)/%_Skel.class : $(PackageTargetDir)
657   %_Skel.class : %.class
658          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
659  
660 + document :
661 +        $(Print) Generate Documentation for OOPSE-2.0
662 +        @cd $(DEV_ROOT)/src    
663 +        $(Doxygen) $(DEV_ROOT)/make/Doxyfile
664 +
665 + #GUN make funtions to merge the libraries
666 + find_objs = $(shell $(StaticArchiver) -t $(1) | $(EGREP) -v "SYMDEF")
667 + extract_objs = $(shell $(StaticArchiver) -x $(1) $(call find_objs, $(1)))
668 + create_archive = $(shell  $(StaticArchiver) $(StaticArchiverOptions) $(2) $(call find_objs, $(1)))
669 + remove_objs = $(shell $(Delete) $(call find_objs, $(1)))
670 + do_create = $(call extract_objs,$(1))$(call create_archive,$(1),$(2))$(call remove_objs,$(1))  
671 + do_link = $(shell $(LN_S) $(1) $(2))
672 + all_objs = $(foreach thisLib,$(LibNames), $(call find_objs, $(thisLib)))
673 + all_parallel_objs = $(foreach thisLib,$(ParallelLibNames), $(call find_objs, $(thisLib)))
674 + all_lib_objs = $(patsubst %,$(TargetDir)/%,$(call all_objs))
675 + all_lib_parallel_objs = $(patsubst %,$(ParallelTargetDir)/%,$(call all_parallel_objs))
676 +
677 + $(CombinedStaticLib) : $(LibDir)/.stamp_UP
678 +        $(Print) creating $@            
679 +        $(StaticArchiver) $(StaticArchiverOptions) $@ $(call all_lib_objs)
680 +        $(Ranlib) $(CombinedStaticLib)
681 +
682 + $(CombinedParallelStaticLib) : $(LibDir)/.stamp_MPI
683 +        $(Print) creating $@
684 +        $(StaticArchiver) $(StaticArchiverOptions) $@ $(call all_lib_parallel_objs)
685 +        $(Ranlib) $(CombinedParallelStaticLib)
686 +
687   # Executable
688 < $(Executable) : $(ObjectFiles)
689 <        $(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ObjectFiles) -o $@
688 > $(Executable) : $(CombinedStaticLib) $(ObjectFiles)
689 >        if test ! -d $(BinDir); then \
690 >                $(MkDir) $(BinDir) ;\
691 >        fi
692 >        $(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@
693  
694 < $(ParallelExecutable) : $(ParallelObjectFiles)
695 <        $(Linker) $(LinkOptions) $(LibDirs) $(ParallelLibList) $(ParallelObjectFiles) -o $@
694 > $(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles)
695 >        if test ! -d $(BinDir); then \
696 >                $(MkDir) $(BinDir) ;\
697 >        fi
698 >        $(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@
699  
700   # Anything else is just copied from source to target
701   $(PackageTargetDir)/% : $(PackageSourceDir)/%
# Line 450 | Line 708 | _buildall : \
708  
709   _all : _buildall
710  
711 + _buildall :
712 + ifeq "$(UseMPI)" "yes"
713   _buildall : \
714          $(DependencyFile) \
715          $(PackageTargetDir) \
716          $(ObjectFiles) \
717 +        $(ParallelObjectFiles) \
718          $(JavaClassFiles) \
719          $(RmiStubFiles) \
720          $(RmiSkeletonFiles) \
721          $(OtherTargetFiles) \
461        $(SharedLibrary) \
722          $(StaticLibrary) \
723 +        $(ParallelStaticLibrary) \
724          $(JarFile) \
725 <        $(Executable)
726 <        
725 >        $(Executable) \
726 >        $(ParallelExecutable)
727 > else
728 > _buildall : \
729 >        $(DependencyFile) \
730 >        $(PackageTargetDir) \
731 >        $(ObjectFiles) \
732 >        $(JavaClassFiles) \
733 >        $(RmiStubFiles) \
734 >        $(RmiSkeletonFiles) \
735 >        $(OtherTargetFiles) \
736 >        $(StaticLibrary) \
737 >        $(JarFile) \
738 >        $(Executable)
739 > endif
740  
741 + echo : $(PackageListLoop)
742 +        $(Print) Done echo.
743 +
744 + _echoall :
745 +        $(Print) $(Modules)
746 +
747   # make clean
748   clean : $(PackageListLoop)
749          $(Print) Done clean.    
750  
751   _cleanall :
752 <        $(Delete) $(ObjectFiles) $(ParallelObjectFiles)
752 >        $(Delete) \
753 >                $(ObjectFiles) \
754 >                $(ModuleFiles) \
755 >                $(ParallelObjectFiles) \
756 >                $(ParallelModuleFiles) \
757 >                $(JarFile) \
758 >                $(SharedLibrary) \
759 >                $(StaticLibrary) \
760 >                $(ParallelSharedLibrary) \
761 >                $(ParallelStaticLibrary) \
762 >                $(CombinedStaticLib) \
763 >                $(CombinedParallelStaticLib)
764  
765   # make distclean
766   distclean : $(PackageListLoop)
767          $(Print) Done clean.    
768  
769 < _distcleanall :
770 <        $(Delete) $(ObjectFiles) \
480 <                  $(ParallelObjectFiles) \
481 <                        $(JarFile) \
482 <                  $(SharedLibrary) \
483 <                  $(StaticLibrary) \
484 <                  $(ParallelSharedLibrary) \
485 <                  $(ParallelStaticLibrary) \
486 <                  $(Executable) \
769 > _distcleanall : _cleanall
770 >        $(Delete) $(Executable) \
771                    $(ParallelExecutable) \
772                    $(DependencyFile)
773  
490
774   # make depend
775   depend : $(PackageListLoop)
776          $(Print) Done dependencies.
# Line 498 | Line 781 | $(DependencyFile) : $(DerivedSource)
781          $(Print) $@
782          @cd $(PackageSourceDir)
783  
501        @touch Make.ctemp
502        @touch Make.ctemp
503
784   ifneq "$(words $(CppFiles))" "0"
785 <        $(CppCompiler) $(IncludePath) -MM $(CppFiles)  > Make.cpptemp
786 <        cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile)
787 <        cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile)
785 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CppFiles)>> Make.cpptemp
786 >        @cat Make.cpptemp  >> $(DependencyFile)
787 >        $(Delete) Make.cpptemp
788 >
789 >  ifeq "$(UseMPI)" "yes"
790 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CppFiles)>> Make.cpptemp
791 >        @cat Make.cpptemp  >> $(DependencyFile)
792 >        @$(Delete) Make.cpptemp
793 >  endif
794 >
795   endif
796  
797   ifneq "$(words $(CFiles))" "0"
798 <        $(CCompiler)   $(IncludePath) -MM $(CFiles) $(DerivedCFiles)   > Make.ctemp
799 <        cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile)
800 <        cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile)
798 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/'  -MM $(CFiles) $(DerivedCFiles)  >> Make.ctemp
799 >        @cat Make.ctemp  >> $(DependencyFile)
800 >        $(Delete) Make.ctemp
801  
802 +  ifeq "$(UseMPI)" "yes"
803 +        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CFiles) $(DerivedCFiles)  >> Make.ctemp
804 +        @cat Make.ctemp  >> $(DependencyFile)
805 +        @$(Delete) Make.ctemp
806 +  endif
807 +
808   endif
809  
810   ifneq "$(words $(F90Files))" "0"
811 <        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/obj/' -D__FORTRAN90  $(F90Files) > Make.ftemp
812 <        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/MPIobj/' -DIS_MPI -D__FORTRAN90  $(F90Files) >> Make.ftemp
813 <        cat Make.ftemp >> $(DependencyFile)
811 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp
812 >        @cat Make.ftemp >> $(DependencyFile)
813 >        @$(Delete) Make.ftemp
814 >
815 >  ifeq "$(UseMPI)" "yes"
816 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix)  $(F90Files) >> Make.ftemp
817 >        @cat Make.ftemp >> $(DependencyFile)
818 >        @$(Delete) Make.ftemp
819 >  endif
820 >
821   endif
522        $(Delete) Make.cpptemp Make.ctemp Make.ftemp
822  
823   # make lib
824   lib    : $(PackageListLoop)
# Line 532 | Line 831 | jarsign : $(JarFile)
831   jarsign : $(JarFile)
832          $(JarSigner) -keystore GeoSoftKeystore $(JarFile) myself
833  
834 + #make install
835 + %.install :
836 +        @$(MAKE) $(MakeOptions) -C $(subst .install,,$@) _installall    
837 +
838 + install : $(InstallListLoop)
839 +        $(Print) Done Install
840 +
841 + _installall : _buildall _installdata _installlinks
842 +
843 + $(MyInstallDir) :
844 +        $(MkDir) $@
845 +
846 + _installdata :  $(MyInstallDir)
847 +        $(Print) $(InstallFiles)
848 + ifneq "$(words $(InstallFiles))" "0"
849 +        $(InstallCommand) $(InstallFiles) $(MyInstallDir)
850 + endif      
851 +
852 + _installlinks :  $(MyInstallDir)
853 + ifneq "$(words $(MyLinkTargets))" "0"
854 +        @cd $(MyInstallDir)
855 +        $(foreach thisLink,$(MyLinkTargets),$(call do_link,$(MyLinkSource),$(thisLink)))
856 + endif      
857 +
858   # make statistics
859   _statisticsall :
860 <        @$(Print) $(SourceFiles) >> $(DEV_ROOT)/files.tmp
860 >        @$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp
861  
862   statistics : $(PackageListLoop)
863          @$(List) $(DEV_ROOT)/files.tmp | xargs $(WordCount) $(WordCountOptions)
# Line 542 | Line 865 | $(Executable).pure :
865          $(Print) Done statistics.
866  
867   # make pure
868 < $(Executable).pure :
869 <        $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \
870 <        $(LibList) $(ObjectFiles) -o $@
868 > #$(Executable).pure :
869 > #       $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \
870 > #       $(LibList) $(ObjectFiles) -o $@
871 > #
872 > #pure : $(Executable).pure
873  
549 pure : $(Executable).pure
550
874   #make cvslog
875   cvslog:
876 <        $(DEV_ROOT)/scripts/cvs2cl.pl
876 >        $(DEV_ROOT)/scripts/cvs2cl
877  
878   # Execute
879   _runexe :

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines