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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines