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 1508 by gezelter, Wed Sep 29 17:56:08 2004 UTC vs.
Revision 2970 by gezelter, Wed Aug 2 19:40:39 2006 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines