ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/make/Makefile.in
(Generate patch)

Comparing trunk/OOPSE-2.0/make/Makefile.in (file contents):
Revision 1510 by tim, Wed Sep 29 18:37:08 2004 UTC vs.
Revision 2474 by gezelter, Fri Dec 2 20:10:30 2005 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines