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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines