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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines