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 1514 by tim, Thu Sep 30 15:41:35 2004 UTC vs.
Revision 2530 by chuckv, Fri Dec 30 00:18:28 2005 UTC

# Line 34 | Line 34 | IS_UNIX=1
34   #
35   #---------------------------------------------------------------------------
36   IS_UNIX=1
37 < #packages to be made
38 < Packages = \
37 >
38 > #packages containing libraries
39 > PackageLibs = \
40          utils \
41 +        visitors \
42          math \
43          types \
44          primitives \
43        visitors \
45          UseTheForce/DarkSide \
46          UseTheForce \
47          brains \
48          io \
49 <        integrators \
49 <        minimizers \
49 >        integrators\
50          constraints \
51 <        profiling \
51 >        minimizers \
52 >        selection \
53          restraints \
54 +        lattice \
55 +        openbabel\
56 +        antlr\
57 +        mdParser
58 + #packages containing applications
59 + Applications = \
60          applications/oopse \
61          applications/dump2Xyz \
62 <        applications/simpleBuilder \
62 >        applications/staticProps \
63 >        applications/dynamicProps \
64 >        applications/simpleBuilder\
65 >        applications/nanoRodBuilder \
66 >        applications/atom2mdin
67  
68 < #packages contain libraries
69 < PackageLibs = \
70 <        utils \
71 <        math \
72 <        types \
73 <        primitives \
74 <        visitors \
75 <        UseTheForce/DarkSide \
76 <        UseTheForce \
77 <        brains \
78 <        io \
79 <        integrators \
80 <        minimizers \
81 <        constraints \
82 <        profiling \
83 <        restraints \
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/metals/EAM \
83 >        samples/metals/EAM/nanoparticle \
84 >        samples/metals/EAM/nanorod \
85 >        samples/metals/Sutton-Chen \
86 >        samples/thermoIntegration/liquid \
87 >        samples/thermoIntegration/solid \
88 >        samples/dipole \
89 >        samples/shape \
90 >        samples/zcons \
91  
92   IncludeDirs = \
93 <        /usr/include \
94 <        /usr/local/include
93 >        @CGAL_INC_DIR@ \
94 >        @MPI_INC_DIR@
95  
96   LibraryDirs = \
97 <        /usr/lib \
98 <        /usr/local/mpich/lib \
81 <        /usr/local/lib \
82 <        /usr/local/intel/compiler80/lib \
97 >        @CGAL_LIB_DIR@ \
98 >        @MPI_LIB_DIR@
99  
100   Libraries = \
101 <        mpich \
102 <        sprng \
103 <        ifcore \
101 >        @LIBS@ \
102 >        @CGAL_LIBS@ \
103 >        @MPI_LIB@ \
104 >        @MPI_F90_LIB@
105  
106 + OopseHome       = @OOPSE_HOME@
107 + ForceParamDir   = $(OopseHome)/share/forceFields
108 + SampleSimDir    = $(OopseHome)/share/samples
109 + InstallBinDir   = $(OopseHome)/bin
110 + DocDir          = $(OopseHome)/doc
111 + FrcDeclare      = -DFRC_PATH="$(ForceParamDir)"
112 + F90Declare      = -D__FORTRAN90
113 + ParallelDeclare = -DIS_MPI
114 + UseMPI          = @USE_MPI@
115 + ModuleCase      = @F90_MODULE_NAMES@
116 + ModSuffix       = @MOD@
117 + LinkOptions = \
118 +        @F90LIBS@
119 +
120 + ParallelLinkOptions = \
121 +        @F90LIBS@
122 +
123 +
124   #---------------------------------------------------------------------------
125   #
126   #  Directories
# Line 97 | Line 132 | BinDir            = $(DEV_ROOT)/bin
132   ParallelTargetDir = $(DEV_ROOT)/MPIobj
133   LibDir            = $(DEV_ROOT)/lib
134   MakeDir           = $(DEV_ROOT)/make
135 + MainMakefile      = $(MakeDir)/Makefile
136   BinDir            = $(DEV_ROOT)/bin
137   DocsDir           = $(DEV_ROOT)/docs
138   CurrentDir        = $(CURDIR)
139 + CombinedStaticLib = $(LibDir)/libOOPSE.a
140 + CombinedParallelStaticLib = $(LibDir)/libOOPSE_MPI.a
141  
142   ifdef Source
143   #get the relative path of current package to source directory
144   # /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside
145   #Package          = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g')
146   #use shell script to get the absolute path and then rip it off from $(CurrentDir)
147 < Package          = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
147 > #Package          = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
148 > # REMINDER: We are now using the Package line in each subdir makefile.
149 > # This avoids the strange path problem and the subshell
150  
151   PackageList              = $(Package)
152   PackageSourceDir         = $(SourceDir)/$(Package)
# Line 114 | Line 154 | PackageList              = $(Packages) $(JavaPackages)
154   PackageParallelTargetDir = $(ParallelTargetDir)
155   JavaMainClass            = $(subst /,.,$(Package)).$(Main)
156   else
157 < PackageList              = $(Packages) $(JavaPackages)
157 > PackageList              = $(PackageLibs) $(JavaPackages) $(Applications)
158   endif
159  
160   PackageListLoop          = $(patsubst %,$(SourceDir)/%/.loop,$(PackageList))
# Line 165 | Line 205 | ObjectFiles            = $(CFiles:%.c=        $(Packag
205   JniHeaders             = $(JniSource:%.java=  $(PackageSourceDir)/%.h)
206   ObjectFiles            = $(CFiles:%.c=        $(PackageTargetDir)/%.o)\
207                           $(CppFiles:%.cpp=    $(PackageTargetDir)/%.o)\
208 <                                     $(FortranFiles:%.f=  $(PackageTargetDir)/%.o)\
209 <                                     $(F90Files:%.F90=    $(PackageTargetDir)/%.o)\
210 <                                     $(LexFiles:%.l=      $(PackageTargetDir)/%.o)\
211 <                                     $(YaccFiles:%.y=     $(PackageTargetDir)/%.o)
208 >                         $(FortranFiles:%.f=  $(PackageTargetDir)/%.o)\
209 >                         $(F90Files:%.F90=    $(PackageTargetDir)/%.o)\
210 >                         $(LexFiles:%.l=      $(PackageTargetDir)/%.o)\
211 >                         $(YaccFiles:%.y=     $(PackageTargetDir)/%.o)
212   ParallelObjectFiles    = $(CFiles:%.c=        $(PackageParallelTargetDir)/%.o)\
213 <                                     $(CppFiles:%.cpp=    $(PackageParallelTargetDir)/%.o)\
214 <                                     $(FortranFiles:%.f=  $(PackageParallelTargetDir)/%.o)\
215 <                                     $(F90Files:%.F90=    $(PackageParallelTargetDir)/%.o)\
216 <                                     $(LexFiles:%.l=      $(PackageParallelTargetDir)/%.o)\
217 <                                     $(YaccFiles:%.y=     $(PackageParallelTargetDir)/%.o)
213 >                         $(CppFiles:%.cpp=    $(PackageParallelTargetDir)/%.o)\
214 >                         $(FortranFiles:%.f=  $(PackageParallelTargetDir)/%.o)\
215 >                         $(F90Files:%.F90=    $(PackageParallelTargetDir)/%.o)\
216 >                         $(LexFiles:%.l=      $(PackageParallelTargetDir)/%.o)\
217 >                         $(YaccFiles:%.y=     $(PackageParallelTargetDir)/%.o)
218  
219   DerivedSource          = $(YaccFiles:%.y=    %.h) \
220 <                               $(YaccFiles:%.y=    %.c) \
221 <                               $(LexFiles:%.l=     %.c)
220 >                         $(YaccFiles:%.y=    %.c) \
221 >                         $(LexFiles:%.l=     %.c)
222  
223   DerivedCFiles          = $(YaccFiles:%.y=    %.c) \
224 <                               $(LexFiles:%.l=     %.c)
224 >                         $(LexFiles:%.l=     %.c)
225  
226   OtherTargetFiles       = $(OtherSourceFiles:%=$(PackageTargetDir)/%)
227  
228 + ###########################################################################
229 + #
230 + # Figure out the names of the module files based on some work done by
231 + # configure.  The tr function below is from John Graham-Cumming
232 + # (http://www.jgc.org).
233 + #
234 + # The tr function.   Has three arguments:
235 + #
236 + # $1   The list of characters to translate from
237 + # $2   The list of characters to translate to
238 + # $3   The text to translate
239 + #
240 + # For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L.
241 +
242 + tr = $(eval __t := $3)                                                    \
243 +     $(foreach c,                                                         \
244 +         $(join $(addsuffix :,$1),$2),                                    \
245 +         $(eval __t :=                                                    \
246 +             $(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \
247 +                 $(__t))))$(__t)
248 +
249 + # Common character classes for use with the tr function.  Each of
250 + # these is actually a variable declaration and must be wrapped with
251 + # $() or ${} to be used.
252 +
253 + [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 #
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 + [0-9] := 0 1 2 3 4 5 6 7 8 9 #
256 + [A-F] := A B C D E F #
257 +
258 + # Figure out whether we have $(eval) or not (GNU Make 3.80 and above)
259 + # if we do not then we need to use the shell version of tr, and not the
260 + # faster tr function above:
261 +
262 + __have_eval := $(false)
263 + __ignore := $(eval __have_eval := $(true))
264 +
265 + ifndef __have_eval
266 +  uc = $(shell echo $1 | tr "a-z" "A-Z")
267 +  lc = $(shell echo $1 | tr "A-Z" "a-z")
268 + else
269 +  uc = $(call tr,$([a-z]),$([A-Z]),$1)
270 +  lc = $(call tr,$([A-Z]),$([a-z]),$1)
271 + endif
272 +
273 + # OK, now we can actually use these functions to figure out the names
274 + # of the module files:
275 +
276 + ifneq "$(words $(Modules))" "0"
277 + ifeq "$(ModuleCase)" "UPPER"
278 +  MODULES = $(call uc,$(Modules))
279 + else
280 +  ifeq "$(ModuleCase)" "lower"
281 +    MODULES = $(call lc,$(Modules))
282 +  else
283 +    MODULES = $(Modules)
284 +  endif
285 + endif
286 +  ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix))
287 +  ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix))
288 + endif
289 + #
290 + ###########################################################################
291 +
292   ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries))
293   ThirdPartyJars    = $(subst $(Space),$(X),$(ThirdPartyJarsTmp))
294  
# Line 196 | Line 300 | ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))
300   #if Main is defined, do not build library. It may not be true sometimes
301   ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0"
302    DependencyFile    = $(PackageSourceDir)/Makedepend
303 <  ifneq "$(Main)" ""
303 >  ifneq "$(words $(Main))" "0"
304      Executable             = $(BinDir)/$(Main)
305 <    ParallelExecutable     = $(BinDir)/$(Main)_MPI
305 >    ifeq "$(BuiltParallelExe)" "1"
306 >      ParallelExecutable     = $(BinDir)/$(Main)_MPI
307 >    endif
308    else
309 <    SharedLibrary          = $(LibDir)/lib$(subst /,,$(Package)).so
310 <    StaticLibrary          = $(LibDir)/lib$(subst /,,$(Package)).a
311 <    ParallelSharedLibrary  = $(LibDir)/lib$(subst /,,$(Package))_MPI.so
312 <    ParallelStaticLibrary  = $(LibDir)/lib$(subst /,,$(Package))_MPI.a
309 >    SharedLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so
310 >    StaticLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a
311 >    ParallelSharedLibrary  = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.so
312 >    ParallelStaticLibrary  = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.a
313    endif
314   endif
315 +
316   #
317   # Misc
318   #
# Line 213 | Line 320 | LocalLibs        = $(subst /,,$(PackageLibs))
320   JavaPackageNames = $(subst /,.,$(JavaPackages))
321   IncludePath      = -I$(SourceDir) $(IncludeDirs:%=-I%)
322   LibDirs          = -L$(LibDir)    $(LibraryDirs:%=-L%)
323 < LocalLibs        = $(subst /,,$(PackageLibs))
324 < LibList          = $(LocalLibs:%=-l%) $(Libraries:%=-l%)
323 > LocalLibs        = $(subst /,,$(patsubst %, oopse_%_UP, $(PackageLibs)))
324 > ParallelLocalLibs= $(subst /,,$(patsubst %, oopse_%_MPI, $(PackageLibs)))
325 > LibList          = $(LocalLibs:%=-l%) $(Libraries)
326 > LibNames         = $(LocalLibs:%=$(LibDir)/lib%.a)
327 > ParallelLibList  = $(ParallelLocalLibs:%=-l%) $(Libraries)
328 > ParallelLibNames = $(ParallelLocalLibs:%=$(LibDir)/lib%.a)
329  
330  
331   #---------------------------------------------------------------------------
# Line 223 | Line 334 | Move                   = mv
334   #
335   #---------------------------------------------------------------------------
336   Print                  = @echo
337 < Move                   = mv
337 > Move                   = mv -f
338   Copy                   = cp
339   CCompiler              = @CC@
340   CppCompiler            = @CXX@
341   Linker                 = @CXX@
342   MakeDepend             = makedepend
343 < Install                = @INSTALL@
343 > LN_S                   = @LN_S@
344 > INSTALL                = @INSTALL@
345 > EGREP                  = @EGREP@
346   InstallProgram         = @INSTALL_PROGRAM@
347 + InstallScript          = @INSTALL_SCRIPT@
348   InstallData            = @INSTALL_DATA@
349 < MakeDir                = @MKINSTALLDIRS@
350 < Delete                 = rm -fr
349 > MkDir                  = @MKINSTALLDIRS@
350 > Delete                 = rm -f
351   StaticArchiver         = @AR@
352   DynamicArchiver        = @CC@
353   FortranCompiler        = @FC@
# Line 250 | Line 364 | Lex                    = @LEX@
364   List                   = cat
365   Yacc                   = @YACC@
366   Lex                    = @LEX@
367 + Ranlib                 = @RANLIB@
368 + Doxygen                = @DOXYGEN@
369  
254
370   MakeOptions            = -k
371   MakeDependOptions      =
372   StaticArchiverOptions  = rc
# Line 260 | Line 375 | FortranOptions         =
375   JniOptions             =
376   RmiOptions             = -d $(TargetDir) -classpath $(ClassPath) \
377                           -sourcepath $(SourceDir)
378 + COptions               = $(FrcDeclare) @CFLAGS@
379 + CParallelOptions       = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@
380 + CppOptions             = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
381 + CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
382   FortranOptions         =
383 < F90Options             =  -I$(SourceDir) -module $(TargetDir)
383 > F90Options             =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir)
384 > F90ParallelOptions     =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir)  @PREPDEFFLAG@$(ParallelDeclare)
385   JavaCompilerOptions    = -d $(TargetDir) -classpath $(ClassPath) \
386                           -sourcepath $(SourceDir) -deprecation
387   JavaRunOptions         = -classpath $(ClassPath)
# Line 287 | Line 407 | Space                  = $(Empty) $(Empty)
407  
408   #---------------------------------------------------------------------------
409   #
410 + #  Install
411 + #
412 + #---------------------------------------------------------------------------
413 +
414 + ifneq "$(words $(SampleFiles))" "0"
415 +  MySample                 = $(subst $(shell cd $(DEV_ROOT)/samples; pwd)/,,$(CurrentDir))
416 +  MyInstallDir             = $(SampleSimDir)/$(MySample)
417 +  InstallFiles             = $(SampleFiles)
418 +  InstallCommand           = $(InstallData)
419 + endif
420 +
421 + ifneq "$(words $(Main))" "0"
422 +  MyInstallDir             = $(InstallBinDir)
423 +  ifeq "$(UseMPI)" "yes"
424 +    InstallFiles             = $(Executable) $(ParallelExecutable)
425 +  else
426 +    InstallFiles             = $(Executable)
427 +  endif
428 +  InstallCommand           = $(InstallProgram)
429 +  ifneq "$(words $(LinkTargets))" "0"
430 +    MyLinkSource = $(patsubst %, $(MyInstallDir)/%,$(Main))
431 +    MyLinkTargets = $(patsubst %, $(MyInstallDir)/%,$(LinkTargets))
432 +  endif
433 + endif
434 +
435 + ifneq "$(words $(ForcefieldFiles))" "0"
436 +  MyInstallDir             = $(ForceParamDir)
437 +  InstallFiles             = $(ForcefieldFiles)
438 +  InstallCommand           = $(InstallData)
439 + endif
440 +
441 + ifneq "$(words $(InstallFiles))" "0"
442 +  InstallList            =
443 + else
444 +  InstallList            = $(patsubst %,$(DEV_ROOT)/%,$(Samples)) $(DEV_ROOT)/forceFields $(patsubst %, $(SourceDir)/%,$(Applications))
445 + endif
446 +
447 + InstallListLoop          = $(patsubst %,$(SourceDir)/%/.install,$(PackageList))  $(patsubst %,%/.install,$(InstallList))
448 +
449 +
450 +
451 + #---------------------------------------------------------------------------
452 + #
453   # Rules
454   #
455   #---------------------------------------------------------------------------
# Line 297 | Line 460 | $(PackageTargetDir) :
460  
461   # Create target directory
462   $(PackageTargetDir) :
463 <        $(MakeDir) $@
463 >        $(MkDir) $@
464  
465 + $(BinDir) :
466 +        $(MkDir) $@
467 +
468   # .c -> .o
469 < $(PackageTargetDir)/%.o : %.c
469 > $(PackageTargetDir)/%.o : %.c $(MainMakefile)
470          $(Print) $@
471          $(CCompiler) $(COptions) -c $(IncludePath) $< -o $@
472  
473 < %.o : %.c
473 > $(PackageParallelTargetDir)/%.o : %.c $(MainMakefile)
474 >        $(Print) $@
475 >        $(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@
476 >
477 > ifeq "$(UseMPI)" "yes"
478 > %.o : %.c $(MainMakefile)
479          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
480 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
481 + else
482 + %.o : %.c $(MainMakefile)
483 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
484 + endif
485  
486   # .cpp -> .o
487 < $(PackageTargetDir)/%.o : %.cpp
487 > $(PackageTargetDir)/%.o : %.cpp $(MainMakefile)
488          $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@
489  
490 < %.o : %.cpp
490 > $(PackageParallelTargetDir)/%.o : %.cpp $(MainMakefile)
491 >        $(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@
492 >
493 > ifeq "$(UseMPI)" "yes"
494 > %.o : %.cpp $(MainMakefile)
495          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
496 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
497 + else
498 + %.o : %.cpp $(MainMakefile)
499 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
500 + endif
501  
502   # .f -> .o
503 < $(PackageTargetDir)/%.o : %.f
503 > $(PackageTargetDir)/%.o : %.f $(MainMakefile)
504          $(FortranCompiler) $(FortranOptions) -c $< -o $@
505  
506 < %.o : %.f
506 > $(PackageParallelTargetDir)/%.o : %.f $(MainMakefile)
507 >        $(FortranCompiler) $(FortranParallelOptions) -c $< -o $@
508 >
509 > ifeq "$(UseMPI)" "yes"
510 > %.o : %.f $(MainMakefile)
511          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
512 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
513 + else
514 + %.o : %.f $(MainMakefile)
515 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
516 + endif
517  
518   # .F90 -> .o
519 < $(PackageTargetDir)/%.o : %.F90
520 <        $(F90Compiler) $(F90Options) -c $< -o $@
519 > $(PackageTargetDir)/%.o : %.F90 $(MainMakefile)
520 >        $(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@
521 >        if test -n "`ls *.$(ModSuffix)`"; then \
522 >          $(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\
523 >        fi
524  
525 < %.o : %.F90
525 > $(PackageParallelTargetDir)/%.o : %.F90 $(MainMakefile)
526 >        $(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@
527 >        if test -n "`ls *.$(ModSuffix)`"; then \
528 >          $(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\
529 >        fi
530 >
531 > ifeq "$(UseMPI)" "yes"
532 > %.o : %.F90 $(MainMakefile)
533          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
534 +        if test -n "`ls *.$(ModSuffix)`"; then\
535 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
536 +        fi
537  
538 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
539 +        if test -n "`ls *.$(ModSuffix)`"; then\
540 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
541 +        fi
542 +
543 + else
544 + %.o : %.F90 $(MainMakefile)
545 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
546 +        if test -n "`ls *.$(ModSuffix)`"; then\
547 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
548 +        fi
549 + endif
550 +
551 +
552   # .java -> .class
553   $(PackageTargetDir)/%.class : $(PackageSourceDir)/%.java
554          $(JavaCompiler) $(JavaCompilerOptions) $<
# Line 361 | Line 582 | $(LibDir)/%.a : $(ObjectFiles)
582          @$(Lex) -o$@ $?
583  
584   # .o -> .a
585 < $(LibDir)/%.a : $(ObjectFiles)
585 >
586 > $(LibDir)/%_UP.a : $(ObjectFiles)
587          $(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles)
588 +        @touch $(LibDir)/.stamp_UP
589  
590 < %.a : $(ObjectFiles)
368 <        $(MAKE) $(MakeOptions) $(LibDir)/$@
369 <
370 < $(LibDir)/%_MPI.a : $(ParallelObjectFiles)
590 > $(LibDir)/%_MPI.a: $(ParallelObjectFiles)
591          $(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles)
592 +        @touch $(LibDir)/.stamp_MPI
593  
594 + %_UP.a : $(ObjectFiles)
595 +        $(MAKE) $(MakeOptions) $(LibDir)/$@
596 +
597   %_MPI.a : $(ParallelObjectFiles)
598          $(MAKE) $(MakeOptions) $(LibDir)/$@
599  
600   # .o -> .so
601 < $(LibDir)/%.so : $(ObjectFiles)
601 > $(LibDir)/%_UP.so : $(ObjectFiles)
602          $(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@
603  
380 %.so : $(ObjectFiles)
381        $(MAKE) $(MakeOptions) $(LibDir)/$@
382
604   $(LibDir)/%_MPI.so : $(ParallelObjectFiles)
605          $(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@
606  
607 + %_UP.so : $(ObjectFiles)
608 +        $(MAKE) $(MakeOptions) $(LibDir)/$@
609 +
610   %_MPI.so : $(ParallelObjectFiles)
611          $(MAKE) $(MakeOptions) $(LibDir)/$@
612  
# Line 418 | Line 642 | $(PackageTargetDir)/%_Skel.class : $(PackageTargetDir)
642   %_Skel.class : %.class
643          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
644  
645 + document :
646 +        $(Print) Generate Documentation for OOPSE-2.0
647 +        @cd $(DEV_ROOT)/src    
648 +        $(Doxygen) $(DEV_ROOT)/make/Doxyfile
649 +
650 + #GUN make funtions to merge the libraries
651 + find_objs = $(shell $(StaticArchiver) -t $(1) | $(EGREP) -v "SYMDEF")
652 + extract_objs = $(shell $(StaticArchiver) -x $(1) $(call find_objs, $(1)))
653 + create_archive = $(shell  $(StaticArchiver) $(StaticArchiverOptions) $(2) $(call find_objs, $(1)))
654 + remove_objs = $(shell $(Delete) $(call find_objs, $(1)))
655 + do_create = $(call extract_objs,$(1))$(call create_archive,$(1),$(2))$(call remove_objs,$(1))  
656 + do_link = $(shell $(LN_S) $(1) $(2))
657 + all_objs = $(foreach thisLib,$(LibNames), $(call find_objs, $(thisLib)))
658 + all_parallel_objs = $(foreach thisLib,$(ParallelLibNames), $(call find_objs, $(thisLib)))
659 + all_lib_objs = $(patsubst %,$(TargetDir)/%,$(call all_objs))
660 + all_lib_parallel_objs = $(patsubst %,$(TargetDir)/%,$(call all_parallel_objs))
661 +
662 + $(CombinedStaticLib) : $(LibDir)/.stamp_UP
663 +        $(Print) creating $@            
664 +        $(StaticArchiver) $(StaticArchiverOptions) $@ $(call all_lib_objs)
665 +        $(Ranlib) $(CombinedStaticLib)
666 +
667 + $(CombinedParallelStaticLib) : $(LibDir)/.stamp_MPI
668 +        $(Print) creating $@
669 +        $(StaticArchiver) $(StaticArchiverOptions) $@ $(call all_lib_parallel_objs)
670 +        $(Ranlib) $(CombinedParallelStaticLib)
671 +
672   # Executable
673 < $(Executable) : $(ObjectFiles)
674 <        $(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ObjectFiles) -o $@
673 > $(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir)
674 >        $(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@
675  
676 < $(ParallelExecutable) : $(ParallelObjectFiles)
677 <        $(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 436 | 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) \
701 +        $(StaticLibrary) \
702 +        $(ParallelStaticLibrary) \
703 +        $(JarFile) \
704 +        $(Executable) \
705 +        $(ParallelExecutable)
706 + else
707   _buildall : \
708          $(DependencyFile) \
709          $(PackageTargetDir) \
# Line 444 | Line 712 | _buildall : \
712          $(RmiStubFiles) \
713          $(RmiSkeletonFiles) \
714          $(OtherTargetFiles) \
447        $(SharedLibrary) \
715          $(StaticLibrary) \
716          $(JarFile) \
717 <        $(Executable)
718 <        
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) $(ObjectFiles) $(ParallelObjectFiles)
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 :
749 <        $(Delete) $(ObjectFiles) \
466 <                  $(ParallelObjectFiles) \
467 <                  $(JarFile) \
468 <                  $(SharedLibrary) \
469 <                  $(StaticLibrary) \
470 <                  $(ParallelSharedLibrary) \
471 <                  $(ParallelStaticLibrary) \
472 <                  $(Executable) \
748 > _distcleanall : _cleanall
749 >        $(Delete) $(Executable) \
750                    $(ParallelExecutable) \
751 <                  $(DependencyFile)
751 >                  $(DependencyFile)
752  
476
753   # make depend
754   depend : $(PackageListLoop)
755          $(Print) Done dependencies.
# Line 484 | Line 760 | $(DependencyFile) : $(DerivedSource)
760          $(Print) $@
761          @cd $(PackageSourceDir)
762  
487        touch Make.ctemp
488        touch Make.ctemp
489
763   ifneq "$(words $(CppFiles))" "0"
764 <        $(CppCompiler) $(IncludePath) -MM $(CppFiles)  > Make.cpptemp
765 <        cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile)
766 <        cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile)
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  
776   ifneq "$(words $(CFiles))" "0"
777 <        $(CCompiler)   $(IncludePath) -MM $(CFiles) $(DerivedCFiles)   > Make.ctemp
778 <        cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile)
779 <        cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile)
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  
789   ifneq "$(words $(F90Files))" "0"
790 <        $(DEV_ROOT)/scripts/sfmakedepend  -I $(DEV_ROOT)/src -d '$$(DEV_ROOT)/obj' -f ./Make.ftemp -h *.F90
791 <        cat Make.ftemp >> $(DependencyFile)
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
507        $(Delete) Make.cpptemp Make.ctemp Make.ftemp
801  
802   # make lib
803   lib    : $(PackageListLoop)
# Line 517 | 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 527 | 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