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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines