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 2474 by gezelter, Fri Dec 2 20:10:30 2005 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 +        openbabel\
56 +        antlr\
57 +        mdParser
58 + #packages containing applications
59 + Applications = \
60          applications/oopse \
61          applications/dump2Xyz \
62 <        applications/simpleBuilder \
62 >        applications/staticProps \
63 >        applications/dynamicProps \
64 >        applications/simpleBuilder\
65 >        applications/nanoRodBuilder \
66 >        applications/atom2mdin
67  
68 < #packages contain libraries
69 < PackageLibs = \
70 <        utils \
71 <        math \
72 <        types \
73 <        primitives \
74 <        visitors \
75 <        UseTheForce/DarkSide \
76 <        UseTheForce \
77 <        brains \
78 <        io \
79 <        integrators \
80 <        minimizers \
81 <        constraints \
82 <        profiling \
83 <        restraints \
68 > Samples = \
69 >        samples/argon \
70 >        samples/water/dimer \
71 >        samples/water/spce \
72 >        samples/water/ssd \
73 >        samples/water/ssde \
74 >        samples/water/ssdrf \
75 >        samples/water/ssd-ion \
76 >        samples/water/tip3p_ice \
77 >        samples/water/tip4p \
78 >        samples/lipid \
79 >        samples/alkane \
80 >        samples/minimizer \
81 >        samples/metals \
82 >        samples/thermoIntegration/liquid \
83 >        samples/thermoIntegration/solid \
84 >        samples/dipole \
85 >        samples/shape \
86 >        samples/zcons \
87  
88   IncludeDirs = \
89 <        @SPRNG_INC_DIR@ \
90 <        @MPI_INC_DIR@
89 >        @CGAL_INC_DIR@ \
90 >        @MPI_INC_DIR@
91  
92   LibraryDirs = \
93 <        @SPRNG_LIB_DIR@ \
93 >        @CGAL_LIB_DIR@ \
94          @MPI_LIB_DIR@
95  
96   Libraries = \
97 <        @SPRNG_LIB@ \
98 <        @MPI_LIB@
97 >        @LIBS@ \
98 >        @CGAL_LIBS@ \
99 >        @MPI_LIB@ \
100 >        @MPI_F90_LIB@
101  
86 LinkOptions = \
87        @F90LIBS@
88
102   OopseHome       = @OOPSE_HOME@
103 < ForceParamDir   = @OOPSE_HOME@/share/forceFields/
104 < SampleSimDir    = @OOPSE_HOME@/share/samples/
103 > ForceParamDir   = $(OopseHome)/share/forceFields
104 > SampleSimDir    = $(OopseHome)/share/samples
105 > InstallBinDir   = $(OopseHome)/bin
106 > DocDir          = $(OopseHome)/doc
107   FrcDeclare      = -DFRC_PATH="$(ForceParamDir)"
108 + F90Declare      = -D__FORTRAN90
109   ParallelDeclare = -DIS_MPI
110 + UseMPI          = @USE_MPI@
111 + ModuleCase      = @F90_MODULE_NAMES@
112 + ModSuffix       = @MOD@
113 + LinkOptions = \
114 +        @F90LIBS@
115  
116 + ParallelLinkOptions = \
117 +        @F90LIBS@
118  
119 +
120   #---------------------------------------------------------------------------
121   #
122   #  Directories
# Line 104 | Line 128 | BinDir            = $(DEV_ROOT)/bin
128   ParallelTargetDir = $(DEV_ROOT)/MPIobj
129   LibDir            = $(DEV_ROOT)/lib
130   MakeDir           = $(DEV_ROOT)/make
131 + MainMakefile      = $(MakeDir)/Makefile
132   BinDir            = $(DEV_ROOT)/bin
133   DocsDir           = $(DEV_ROOT)/docs
134   CurrentDir        = $(CURDIR)
135 + CombinedStaticLib = $(LibDir)/libOOPSE.a
136 + CombinedParallelStaticLib = $(LibDir)/libOOPSE_MPI.a
137  
138   ifdef Source
139   #get the relative path of current package to source directory
140   # /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside
141   #Package          = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g')
142   #use shell script to get the absolute path and then rip it off from $(CurrentDir)
143 < Package          = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
143 > #Package          = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
144 > # REMINDER: We are now using the Package line in each subdir makefile.
145 > # This avoids the strange path problem and the subshell
146  
147   PackageList              = $(Package)
148   PackageSourceDir         = $(SourceDir)/$(Package)
# Line 121 | Line 150 | PackageList              = $(Packages) $(JavaPackages)
150   PackageParallelTargetDir = $(ParallelTargetDir)
151   JavaMainClass            = $(subst /,.,$(Package)).$(Main)
152   else
153 < PackageList              = $(Packages) $(JavaPackages)
153 > PackageList              = $(PackageLibs) $(JavaPackages) $(Applications)
154   endif
155  
156   PackageListLoop          = $(patsubst %,$(SourceDir)/%/.loop,$(PackageList))
# Line 172 | Line 201 | ObjectFiles            = $(CFiles:%.c=        $(Packag
201   JniHeaders             = $(JniSource:%.java=  $(PackageSourceDir)/%.h)
202   ObjectFiles            = $(CFiles:%.c=        $(PackageTargetDir)/%.o)\
203                           $(CppFiles:%.cpp=    $(PackageTargetDir)/%.o)\
204 <                                     $(FortranFiles:%.f=  $(PackageTargetDir)/%.o)\
205 <                                     $(F90Files:%.F90=    $(PackageTargetDir)/%.o)\
206 <                                     $(LexFiles:%.l=      $(PackageTargetDir)/%.o)\
207 <                                     $(YaccFiles:%.y=     $(PackageTargetDir)/%.o)
204 >                         $(FortranFiles:%.f=  $(PackageTargetDir)/%.o)\
205 >                         $(F90Files:%.F90=    $(PackageTargetDir)/%.o)\
206 >                         $(LexFiles:%.l=      $(PackageTargetDir)/%.o)\
207 >                         $(YaccFiles:%.y=     $(PackageTargetDir)/%.o)
208   ParallelObjectFiles    = $(CFiles:%.c=        $(PackageParallelTargetDir)/%.o)\
209 <                                     $(CppFiles:%.cpp=    $(PackageParallelTargetDir)/%.o)\
210 <                                     $(FortranFiles:%.f=  $(PackageParallelTargetDir)/%.o)\
211 <                                     $(F90Files:%.F90=    $(PackageParallelTargetDir)/%.o)\
212 <                                     $(LexFiles:%.l=      $(PackageParallelTargetDir)/%.o)\
213 <                                     $(YaccFiles:%.y=     $(PackageParallelTargetDir)/%.o)
209 >                         $(CppFiles:%.cpp=    $(PackageParallelTargetDir)/%.o)\
210 >                         $(FortranFiles:%.f=  $(PackageParallelTargetDir)/%.o)\
211 >                         $(F90Files:%.F90=    $(PackageParallelTargetDir)/%.o)\
212 >                         $(LexFiles:%.l=      $(PackageParallelTargetDir)/%.o)\
213 >                         $(YaccFiles:%.y=     $(PackageParallelTargetDir)/%.o)
214  
215   DerivedSource          = $(YaccFiles:%.y=    %.h) \
216 <                               $(YaccFiles:%.y=    %.c) \
217 <                               $(LexFiles:%.l=     %.c)
216 >                         $(YaccFiles:%.y=    %.c) \
217 >                         $(LexFiles:%.l=     %.c)
218  
219   DerivedCFiles          = $(YaccFiles:%.y=    %.c) \
220 <                               $(LexFiles:%.l=     %.c)
220 >                         $(LexFiles:%.l=     %.c)
221  
222   OtherTargetFiles       = $(OtherSourceFiles:%=$(PackageTargetDir)/%)
223  
224 + ###########################################################################
225 + #
226 + # Figure out the names of the module files based on some work done by
227 + # configure.  The tr function below is from John Graham-Cumming
228 + # (http://www.jgc.org).
229 + #
230 + # The tr function.   Has three arguments:
231 + #
232 + # $1   The list of characters to translate from
233 + # $2   The list of characters to translate to
234 + # $3   The text to translate
235 + #
236 + # For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L.
237 +
238 + tr = $(eval __t := $3)                                                    \
239 +     $(foreach c,                                                         \
240 +         $(join $(addsuffix :,$1),$2),                                    \
241 +         $(eval __t :=                                                    \
242 +             $(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \
243 +                 $(__t))))$(__t)
244 +
245 + # Common character classes for use with the tr function.  Each of
246 + # these is actually a variable declaration and must be wrapped with
247 + # $() or ${} to be used.
248 +
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 + [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 #
251 + [0-9] := 0 1 2 3 4 5 6 7 8 9 #
252 + [A-F] := A B C D E F #
253 +
254 + # Figure out whether we have $(eval) or not (GNU Make 3.80 and above)
255 + # if we do not then we need to use the shell version of tr, and not the
256 + # faster tr function above:
257 +
258 + __have_eval := $(false)
259 + __ignore := $(eval __have_eval := $(true))
260 +
261 + ifndef __have_eval
262 +  uc = $(shell echo $1 | tr "a-z" "A-Z")
263 +  lc = $(shell echo $1 | tr "A-Z" "a-z")
264 + else
265 +  uc = $(call tr,$([a-z]),$([A-Z]),$1)
266 +  lc = $(call tr,$([A-Z]),$([a-z]),$1)
267 + endif
268 +
269 + # OK, now we can actually use these functions to figure out the names
270 + # of the module files:
271 +
272 + ifneq "$(words $(Modules))" "0"
273 + ifeq "$(ModuleCase)" "UPPER"
274 +  MODULES = $(call uc,$(Modules))
275 + else
276 +  ifeq "$(ModuleCase)" "lower"
277 +    MODULES = $(call lc,$(Modules))
278 +  else
279 +    MODULES = $(Modules)
280 +  endif
281 + endif
282 +  ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix))
283 +  ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix))
284 + endif
285 + #
286 + ###########################################################################
287 +
288   ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries))
289   ThirdPartyJars    = $(subst $(Space),$(X),$(ThirdPartyJarsTmp))
290  
# Line 203 | Line 296 | ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))
296   #if Main is defined, do not build library. It may not be true sometimes
297   ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0"
298    DependencyFile    = $(PackageSourceDir)/Makedepend
299 <  ifneq "$(Main)" ""
299 >  ifneq "$(words $(Main))" "0"
300      Executable             = $(BinDir)/$(Main)
301 <    ParallelExecutable     = $(BinDir)/$(Main)_MPI
301 >    ifeq "$(BuiltParallelExe)" "1"
302 >      ParallelExecutable     = $(BinDir)/$(Main)_MPI
303 >    endif
304    else
305 <    SharedLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).so
306 <    StaticLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).a
305 >    SharedLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so
306 >    StaticLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a
307      ParallelSharedLibrary  = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.so
308      ParallelStaticLibrary  = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.a
309    endif
310   endif
311 +
312   #
313   # Misc
314   #
# Line 220 | Line 316 | LocalLibs        = $(subst /,,$(patsubst %, oopse_%, $
316   JavaPackageNames = $(subst /,.,$(JavaPackages))
317   IncludePath      = -I$(SourceDir) $(IncludeDirs:%=-I%)
318   LibDirs          = -L$(LibDir)    $(LibraryDirs:%=-L%)
319 < LocalLibs        = $(subst /,,$(patsubst %, oopse_%, $(PackageLibs)))
319 > LocalLibs        = $(subst /,,$(patsubst %, oopse_%_UP, $(PackageLibs)))
320   ParallelLocalLibs= $(subst /,,$(patsubst %, oopse_%_MPI, $(PackageLibs)))
321   LibList          = $(LocalLibs:%=-l%) $(Libraries)
322 < ParallelLibList  = $(LocalLibs:%=-l%) $(Libraries)
322 > LibNames         = $(LocalLibs:%=$(LibDir)/lib%.a)
323 > ParallelLibList  = $(ParallelLocalLibs:%=-l%) $(Libraries)
324 > ParallelLibNames = $(ParallelLocalLibs:%=$(LibDir)/lib%.a)
325  
326  
327   #---------------------------------------------------------------------------
# Line 232 | Line 330 | Move                   = mv
330   #
331   #---------------------------------------------------------------------------
332   Print                  = @echo
333 < Move                   = mv
333 > Move                   = mv -f
334   Copy                   = cp
335   CCompiler              = @CC@
336   CppCompiler            = @CXX@
337   Linker                 = @CXX@
338   MakeDepend             = makedepend
339 < Install                = @INSTALL@
339 > LN_S                   = @LN_S@
340 > INSTALL                = @INSTALL@
341 > EGREP                  = @EGREP@
342   InstallProgram         = @INSTALL_PROGRAM@
343 + InstallScript          = @INSTALL_SCRIPT@
344   InstallData            = @INSTALL_DATA@
345 < MakeDir                = @MKINSTALLDIRS@
346 < Delete                 = rm -fr
345 > MkDir                  = @MKINSTALLDIRS@
346 > Delete                 = rm -f
347   StaticArchiver         = @AR@
348   DynamicArchiver        = @CC@
349   FortranCompiler        = @FC@
# Line 259 | Line 360 | Lex                    = @LEX@
360   List                   = cat
361   Yacc                   = @YACC@
362   Lex                    = @LEX@
363 + Ranlib                 = @RANLIB@
364 + Doxygen                = @DOXYGEN@
365  
263
366   MakeOptions            = -k
367   MakeDependOptions      =
368   StaticArchiverOptions  = rc
# Line 269 | Line 371 | COptions               = $(FrcDeclare)
371   JniOptions             =
372   RmiOptions             = -d $(TargetDir) -classpath $(ClassPath) \
373                           -sourcepath $(SourceDir)
374 < COptions               = $(FrcDeclare)
375 < CParallelOptions       = $(FrcDeclare) $(ParallelDeclare)
376 < CppOptions             = $(FrcDeclare)
377 < CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare)
374 > COptions               = $(FrcDeclare) @CFLAGS@
375 > CParallelOptions       = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@
376 > CppOptions             = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
377 > CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
378   FortranOptions         =
379 < F90Options             =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir)
380 < F90ParallelOptions     =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir)  @PREPDEFFLAG@$(ParallelDeclare)
379 > F90Options             =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir)
380 > F90ParallelOptions     =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir)  @PREPDEFFLAG@$(ParallelDeclare)
381   JavaCompilerOptions    = -d $(TargetDir) -classpath $(ClassPath) \
382                           -sourcepath $(SourceDir) -deprecation
383   JavaRunOptions         = -classpath $(ClassPath)
# Line 301 | Line 403 | Space                  = $(Empty) $(Empty)
403  
404   #---------------------------------------------------------------------------
405   #
406 + #  Install
407 + #
408 + #---------------------------------------------------------------------------
409 +
410 + ifneq "$(words $(SampleFiles))" "0"
411 +  MySample                 = $(subst $(shell cd $(DEV_ROOT)/samples; pwd)/,,$(CurrentDir))
412 +  MyInstallDir             = $(SampleSimDir)/$(MySample)
413 +  InstallFiles             = $(SampleFiles)
414 +  InstallCommand           = $(InstallData)
415 + endif
416 +
417 + ifneq "$(words $(Main))" "0"
418 +  MyInstallDir             = $(InstallBinDir)
419 +  ifeq "$(UseMPI)" "yes"
420 +    InstallFiles             = $(Executable) $(ParallelExecutable)
421 +  else
422 +    InstallFiles             = $(Executable)
423 +  endif
424 +  InstallCommand           = $(InstallProgram)
425 +  ifneq "$(words $(LinkTargets))" "0"
426 +    MyLinkSource = $(patsubst %, $(MyInstallDir)/%,$(Main))
427 +    MyLinkTargets = $(patsubst %, $(MyInstallDir)/%,$(LinkTargets))
428 +  endif
429 + endif
430 +
431 + ifneq "$(words $(ForcefieldFiles))" "0"
432 +  MyInstallDir             = $(ForceParamDir)
433 +  InstallFiles             = $(ForcefieldFiles)
434 +  InstallCommand           = $(InstallData)
435 + endif
436 +
437 + ifneq "$(words $(InstallFiles))" "0"
438 +  InstallList            =
439 + else
440 +  InstallList            = $(patsubst %,$(DEV_ROOT)/%,$(Samples)) $(DEV_ROOT)/forceFields $(patsubst %, $(SourceDir)/%,$(Applications))
441 + endif
442 +
443 + InstallListLoop          = $(patsubst %,$(SourceDir)/%/.install,$(PackageList))  $(patsubst %,%/.install,$(InstallList))
444 +
445 +
446 +
447 + #---------------------------------------------------------------------------
448 + #
449   # Rules
450   #
451   #---------------------------------------------------------------------------
# Line 311 | Line 456 | $(PackageTargetDir) :
456  
457   # Create target directory
458   $(PackageTargetDir) :
459 <        $(MakeDir) $@
459 >        $(MkDir) $@
460 >
461 > $(BinDir) :
462 >        $(MkDir) $@
463  
464   # .c -> .o
465 < $(PackageTargetDir)/%.o : %.c
465 > $(PackageTargetDir)/%.o : %.c $(MainMakefile)
466          $(Print) $@
467          $(CCompiler) $(COptions) -c $(IncludePath) $< -o $@
468  
469 < %.o : %.c
469 > $(PackageParallelTargetDir)/%.o : %.c $(MainMakefile)
470 >        $(Print) $@
471 >        $(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@
472 >
473 > ifeq "$(UseMPI)" "yes"
474 > %.o : %.c $(MainMakefile)
475          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
476 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
477 + else
478 + %.o : %.c $(MainMakefile)
479 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
480 + endif
481  
482   # .cpp -> .o
483 < $(PackageTargetDir)/%.o : %.cpp
483 > $(PackageTargetDir)/%.o : %.cpp $(MainMakefile)
484          $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@
485  
486 < %.o : %.cpp
486 > $(PackageParallelTargetDir)/%.o : %.cpp $(MainMakefile)
487 >        $(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@
488 >
489 > ifeq "$(UseMPI)" "yes"
490 > %.o : %.cpp $(MainMakefile)
491          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
492 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
493 + else
494 + %.o : %.cpp $(MainMakefile)
495 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
496 + endif
497  
498   # .f -> .o
499 < $(PackageTargetDir)/%.o : %.f
499 > $(PackageTargetDir)/%.o : %.f $(MainMakefile)
500          $(FortranCompiler) $(FortranOptions) -c $< -o $@
501  
502 < %.o : %.f
502 > $(PackageParallelTargetDir)/%.o : %.f $(MainMakefile)
503 >        $(FortranCompiler) $(FortranParallelOptions) -c $< -o $@
504 >
505 > ifeq "$(UseMPI)" "yes"
506 > %.o : %.f $(MainMakefile)
507          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
508 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
509 + else
510 + %.o : %.f $(MainMakefile)
511 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
512 + endif
513  
514   # .F90 -> .o
515 < $(PackageTargetDir)/%.o : %.F90
516 <        $(F90Compiler) $(F90Options) -c $< -o $@
515 > $(PackageTargetDir)/%.o : %.F90 $(MainMakefile)
516 >        $(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@
517 >        if test -n "`ls *.$(ModSuffix)`"; then \
518 >          $(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\
519 >        fi
520  
521 < %.o : %.F90
521 > $(PackageParallelTargetDir)/%.o : %.F90 $(MainMakefile)
522 >        $(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@
523 >        if test -n "`ls *.$(ModSuffix)`"; then \
524 >          $(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\
525 >        fi
526 >
527 > ifeq "$(UseMPI)" "yes"
528 > %.o : %.F90 $(MainMakefile)
529          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
530 +        if test -n "`ls *.$(ModSuffix)`"; then\
531 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
532 +        fi
533  
534 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
535 +        if test -n "`ls *.$(ModSuffix)`"; then\
536 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
537 +        fi
538 +
539 + else
540 + %.o : %.F90 $(MainMakefile)
541 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
542 +        if test -n "`ls *.$(ModSuffix)`"; then\
543 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
544 +        fi
545 + endif
546 +
547 +
548   # .java -> .class
549   $(PackageTargetDir)/%.class : $(PackageSourceDir)/%.java
550          $(JavaCompiler) $(JavaCompilerOptions) $<
# Line 375 | Line 578 | $(LibDir)/%.a : $(ObjectFiles)
578          @$(Lex) -o$@ $?
579  
580   # .o -> .a
581 < $(LibDir)/%.a : $(ObjectFiles)
581 >
582 > $(LibDir)/%_UP.a : $(ObjectFiles)
583          $(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles)
584 +        @touch $(LibDir)/.stamp_UP
585  
586 < %.a : $(ObjectFiles)
382 <        $(MAKE) $(MakeOptions) $(LibDir)/$@
383 <
384 < $(LibDir)/%_MPI.a : $(ParallelObjectFiles)
586 > $(LibDir)/%_MPI.a: $(ParallelObjectFiles)
587          $(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles)
588 +        @touch $(LibDir)/.stamp_MPI
589  
590 + %_UP.a : $(ObjectFiles)
591 +        $(MAKE) $(MakeOptions) $(LibDir)/$@
592 +
593   %_MPI.a : $(ParallelObjectFiles)
594          $(MAKE) $(MakeOptions) $(LibDir)/$@
595  
596   # .o -> .so
597 < $(LibDir)/%.so : $(ObjectFiles)
597 > $(LibDir)/%_UP.so : $(ObjectFiles)
598          $(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@
599  
394 %.so : $(ObjectFiles)
395        $(MAKE) $(MakeOptions) $(LibDir)/$@
396
600   $(LibDir)/%_MPI.so : $(ParallelObjectFiles)
601          $(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@
602  
603 + %_UP.so : $(ObjectFiles)
604 +        $(MAKE) $(MakeOptions) $(LibDir)/$@
605 +
606   %_MPI.so : $(ParallelObjectFiles)
607          $(MAKE) $(MakeOptions) $(LibDir)/$@
608  
# Line 432 | Line 638 | $(PackageTargetDir)/%_Skel.class : $(PackageTargetDir)
638   %_Skel.class : %.class
639          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
640  
641 + document :
642 +        $(Print) Generate Documentation for OOPSE-2.0
643 +        @cd $(DEV_ROOT)/src    
644 +        $(Doxygen) $(DEV_ROOT)/make/Doxyfile
645 +
646 + #GUN make funtions to merge the libraries
647 + find_objs = $(shell $(StaticArchiver) -t $(1) | $(EGREP) -v "SYMDEF")
648 + extract_objs = $(shell $(StaticArchiver) -x $(1) $(call find_objs, $(1)))
649 + create_archive = $(shell  $(StaticArchiver) $(StaticArchiverOptions) $(2) $(call find_objs, $(1)))
650 + remove_objs = $(shell $(Delete) $(call find_objs, $(1)))
651 + do_create = $(call extract_objs,$(1))$(call create_archive,$(1),$(2))$(call remove_objs,$(1))  
652 + do_link = $(shell $(LN_S) $(1) $(2))
653 + all_objs = $(foreach thisLib,$(LibNames), $(call find_objs, $(thisLib)))
654 + all_parallel_objs = $(foreach thisLib,$(ParallelLibNames), $(call find_objs, $(thisLib)))
655 + all_lib_objs = $(patsubst %,$(TargetDir)/%,$(call all_objs))
656 + all_lib_parallel_objs = $(patsubst %,$(TargetDir)/%,$(call all_parallel_objs))
657 +
658 + $(CombinedStaticLib) : $(LibDir)/.stamp_UP
659 +        $(Print) creating $@            
660 +        $(StaticArchiver) $(StaticArchiverOptions) $@ $(call all_lib_objs)
661 +        $(Ranlib) $(CombinedStaticLib)
662 +
663 + $(CombinedParallelStaticLib) : $(LibDir)/.stamp_MPI
664 +        $(Print) creating $@
665 +        $(StaticArchiver) $(StaticArchiverOptions) $@ $(call all_lib_parallel_objs)
666 +        $(Ranlib) $(CombinedParallelStaticLib)
667 +
668   # Executable
669 < $(Executable) : $(ObjectFiles)
670 <        $(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ObjectFiles) -o $@
669 > $(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir)
670 >        $(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@
671  
672 < $(ParallelExecutable) : $(ParallelObjectFiles)
673 <        $(Linker) $(LinkOptions) $(LibDirs) $(ParallelLibList) $(ParallelObjectFiles) -o $@
672 > $(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) $(BinDir)
673 >        $(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@
674  
675   # Anything else is just copied from source to target
676   $(PackageTargetDir)/% : $(PackageSourceDir)/%
# Line 450 | Line 683 | _buildall : \
683  
684   _all : _buildall
685  
686 + _buildall :
687 + ifeq "$(UseMPI)" "yes"
688 + _buildall : \
689 +        $(DependencyFile) \
690 +        $(PackageTargetDir) \
691 +        $(ObjectFiles) \
692 +        $(ParallelObjectFiles) \
693 +        $(JavaClassFiles) \
694 +        $(RmiStubFiles) \
695 +        $(RmiSkeletonFiles) \
696 +        $(OtherTargetFiles) \
697 +        $(StaticLibrary) \
698 +        $(ParallelStaticLibrary) \
699 +        $(JarFile) \
700 +        $(Executable) \
701 +        $(ParallelExecutable)
702 + else
703   _buildall : \
704          $(DependencyFile) \
705          $(PackageTargetDir) \
# Line 458 | Line 708 | _buildall : \
708          $(RmiStubFiles) \
709          $(RmiSkeletonFiles) \
710          $(OtherTargetFiles) \
461        $(SharedLibrary) \
711          $(StaticLibrary) \
712          $(JarFile) \
713 <        $(Executable)
714 <        
713 >        $(Executable)
714 > endif
715  
716 + echo : $(PackageListLoop)
717 +        $(Print) Done echo.
718 +
719 + _echoall :
720 +        $(Print) $(Modules)
721 +
722   # make clean
723   clean : $(PackageListLoop)
724          $(Print) Done clean.    
725  
726   _cleanall :
727 <        $(Delete) $(ObjectFiles) $(ParallelObjectFiles)
727 >        $(Delete) \
728 >                $(ObjectFiles) \
729 >                $(ModuleFiles) \
730 >                $(ParallelObjectFiles) \
731 >                $(ParallelModuleFiles) \
732 >                $(JarFile) \
733 >                $(SharedLibrary) \
734 >                $(StaticLibrary) \
735 >                $(ParallelSharedLibrary) \
736 >                $(ParallelStaticLibrary) \
737 >                $(CombinedStaticLib) \
738 >                $(CombinedParallelStaticLib)
739  
740   # make distclean
741   distclean : $(PackageListLoop)
742          $(Print) Done clean.    
743  
744 < _distcleanall :
745 <        $(Delete) $(ObjectFiles) \
480 <                  $(ParallelObjectFiles) \
481 <                        $(JarFile) \
482 <                  $(SharedLibrary) \
483 <                  $(StaticLibrary) \
484 <                  $(ParallelSharedLibrary) \
485 <                  $(ParallelStaticLibrary) \
486 <                  $(Executable) \
744 > _distcleanall : _cleanall
745 >        $(Delete) $(Executable) \
746                    $(ParallelExecutable) \
747                    $(DependencyFile)
748  
490
749   # make depend
750   depend : $(PackageListLoop)
751          $(Print) Done dependencies.
# Line 498 | Line 756 | $(DependencyFile) : $(DerivedSource)
756          $(Print) $@
757          @cd $(PackageSourceDir)
758  
501        @touch Make.ctemp
502        @touch Make.ctemp
503
759   ifneq "$(words $(CppFiles))" "0"
760 <        $(CppCompiler) $(IncludePath) -MM $(CppFiles)  > Make.cpptemp
761 <        cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile)
762 <        cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile)
760 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CppFiles)>> Make.cpptemp
761 >        @cat Make.cpptemp  >> $(DependencyFile)
762 >        $(Delete) Make.cpptemp
763 >
764 >  ifeq "$(UseMPI)" "yes"
765 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CppFiles)>> Make.cpptemp
766 >        @cat Make.cpptemp  >> $(DependencyFile)
767 >        @$(Delete) Make.cpptemp
768 >  endif
769 >
770   endif
771  
772   ifneq "$(words $(CFiles))" "0"
773 <        $(CCompiler)   $(IncludePath) -MM $(CFiles) $(DerivedCFiles)   > Make.ctemp
774 <        cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile)
775 <        cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile)
773 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/'  -MM $(CFiles) $(DerivedCFiles)  >> Make.ctemp
774 >        @cat Make.ctemp  >> $(DependencyFile)
775 >        $(Delete) Make.ctemp
776  
777 +  ifeq "$(UseMPI)" "yes"
778 +        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CFiles) $(DerivedCFiles)  >> Make.ctemp
779 +        @cat Make.ctemp  >> $(DependencyFile)
780 +        @$(Delete) Make.ctemp
781 +  endif
782 +
783   endif
784  
785   ifneq "$(words $(F90Files))" "0"
786 <        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/obj/' -D__FORTRAN90  $(F90Files) > Make.ftemp
787 <        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/MPIobj/' -DIS_MPI -D__FORTRAN90  $(F90Files) >> Make.ftemp
788 <        cat Make.ftemp >> $(DependencyFile)
786 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp
787 >        @cat Make.ftemp >> $(DependencyFile)
788 >        @$(Delete) Make.ftemp
789 >
790 >  ifeq "$(UseMPI)" "yes"
791 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix)  $(F90Files) >> Make.ftemp
792 >        @cat Make.ftemp >> $(DependencyFile)
793 >        @$(Delete) Make.ftemp
794 >  endif
795 >
796   endif
522        $(Delete) Make.cpptemp Make.ctemp Make.ftemp
797  
798   # make lib
799   lib    : $(PackageListLoop)
# Line 532 | Line 806 | jarsign : $(JarFile)
806   jarsign : $(JarFile)
807          $(JarSigner) -keystore GeoSoftKeystore $(JarFile) myself
808  
809 + #make install
810 + %.install :
811 +        @$(MAKE) $(MakeOptions) -C $(subst .install,,$@) _installall    
812 +
813 + install : $(InstallListLoop)
814 +        $(Print) Done Install
815 +
816 + _installall : _buildall _installdata _installlinks
817 +
818 + $(MyInstallDir) :
819 +        $(MkDir) $@
820 +
821 + _installdata :  $(MyInstallDir)
822 +        $(Print) $(InstallFiles)
823 + ifneq "$(words $(InstallFiles))" "0"
824 +        $(InstallCommand) $(InstallFiles) $(MyInstallDir)
825 + endif      
826 +
827 + _installlinks :  $(MyInstallDir)
828 + ifneq "$(words $(MyLinkTargets))" "0"
829 +        @cd $(MyInstallDir)
830 +        $(foreach thisLink,$(MyLinkTargets),$(call do_link,$(MyLinkSource),$(thisLink)))
831 + endif      
832 +
833   # make statistics
834   _statisticsall :
835 <        @$(Print) $(SourceFiles) >> $(DEV_ROOT)/files.tmp
835 >        @$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp
836  
837   statistics : $(PackageListLoop)
838          @$(List) $(DEV_ROOT)/files.tmp | xargs $(WordCount) $(WordCountOptions)
# Line 542 | Line 840 | $(Executable).pure :
840          $(Print) Done statistics.
841  
842   # make pure
843 < $(Executable).pure :
844 <        $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \
845 <        $(LibList) $(ObjectFiles) -o $@
843 > #$(Executable).pure :
844 > #       $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \
845 > #       $(LibList) $(ObjectFiles) -o $@
846 > #
847 > #pure : $(Executable).pure
848  
549 pure : $(Executable).pure
550
849   #make cvslog
850   cvslog:
851 <        $(DEV_ROOT)/scripts/cvs2cl.pl
851 >        $(DEV_ROOT)/scripts/cvs2cl
852  
853   # Execute
854   _runexe :

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines