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 2470 by tim, Fri Dec 2 15:38:25 2005 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/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  
60 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 108 | Line 183 | SourceFiles            = $(JavaFiles:%.java=  $(Packag
183                                        $(YaccFiles) $(CorbaFiles), \
184                                        $(Source))
185   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)\
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 125 | 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 146 | Line 221 | ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLib
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 157 | 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 174 | Line 316 | LocalLibs        = $(subst /,,$(Packages))
316   JavaPackageNames = $(subst /,.,$(JavaPackages))
317   IncludePath      = -I$(SourceDir) $(IncludeDirs:%=-I%)
318   LibDirs          = -L$(LibDir)    $(LibraryDirs:%=-L%)
319 < LocalLibs        = $(subst /,,$(Packages))
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 184 | 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   InstallProgram         = @INSTALL_PROGRAM@
342 + InstallScript          = @INSTALL_SCRIPT@
343   InstallData            = @INSTALL_DATA@
344 < MakeDir                = @MKINSTALLDIRS@
345 < Delete                 = rm -fr
344 > MkDir                  = @MKINSTALLDIRS@
345 > Delete                 = rm -f
346   StaticArchiver         = @AR@
347   DynamicArchiver        = @CC@
348   FortranCompiler        = @FC@
# Line 211 | Line 359 | Lex                    = @LEX@
359   List                   = cat
360   Yacc                   = @YACC@
361   Lex                    = @LEX@
362 + Ranlib                 = @RANLIB@
363 + Doxygen                = @DOXYGEN@
364  
365 <
216 < MakeOptions            = -k -s
365 > MakeOptions            = -k
366   MakeDependOptions      =
367   StaticArchiverOptions  = rc
368   DynamicArchiverOptions = -shared
# Line 221 | Line 370 | FortranOptions         =
370   JniOptions             =
371   RmiOptions             = -d $(TargetDir) -classpath $(ClassPath) \
372                           -sourcepath $(SourceDir)
373 + COptions               = $(FrcDeclare) @CFLAGS@
374 + CParallelOptions       = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@
375 + CppOptions             = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
376 + CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
377   FortranOptions         =
378 < F90Options             =  -I$(SourceDir) -module $(TargetDir)
378 > F90Options             =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir)
379 > F90ParallelOptions     =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir)  @PREPDEFFLAG@$(ParallelDeclare)
380   JavaCompilerOptions    = -d $(TargetDir) -classpath $(ClassPath) \
381                           -sourcepath $(SourceDir) -deprecation
382   JavaRunOptions         = -classpath $(ClassPath)
# Line 248 | Line 402 | Space                  = $(Empty) $(Empty)
402  
403   #---------------------------------------------------------------------------
404   #
405 + #  Install
406 + #
407 + #---------------------------------------------------------------------------
408 +
409 + ifneq "$(words $(SampleFiles))" "0"
410 +  MySample                 = $(subst $(shell cd $(DEV_ROOT)/samples; pwd)/,,$(CurrentDir))
411 +  MyInstallDir             = $(SampleSimDir)/$(MySample)
412 +  InstallFiles             = $(SampleFiles)
413 +  InstallCommand           = $(InstallData)
414 + endif
415 +
416 + ifneq "$(words $(Main))" "0"
417 +  MyInstallDir             = $(InstallBinDir)
418 +  ifeq "$(UseMPI)" "yes"
419 +    InstallFiles             = $(Executable) $(ParallelExecutable)
420 +  else
421 +    InstallFiles             = $(Executable)
422 +  endif
423 +  InstallCommand           = $(InstallProgram)
424 +  ifneq "$(words $(LinkTargets))" "0"
425 +    MyLinkSource = $(patsubst %, $(MyInstallDir)/%,$(Main))
426 +    MyLinkTargets = $(patsubst %, $(MyInstallDir)/%,$(LinkTargets))
427 +  endif
428 + endif
429 +
430 + ifneq "$(words $(ForcefieldFiles))" "0"
431 +  MyInstallDir             = $(ForceParamDir)
432 +  InstallFiles             = $(ForcefieldFiles)
433 +  InstallCommand           = $(InstallData)
434 + endif
435 +
436 + ifneq "$(words $(InstallFiles))" "0"
437 +  InstallList            =
438 + else
439 +  InstallList            = $(patsubst %,$(DEV_ROOT)/%,$(Samples)) $(DEV_ROOT)/forceFields $(patsubst %, $(SourceDir)/%,$(Applications))
440 + endif
441 +
442 + InstallListLoop          = $(patsubst %,$(SourceDir)/%/.install,$(PackageList))  $(patsubst %,%/.install,$(InstallList))
443 +
444 +
445 +
446 + #---------------------------------------------------------------------------
447 + #
448   # Rules
449   #
450   #---------------------------------------------------------------------------
# Line 258 | Line 455 | $(PackageTargetDir) :
455  
456   # Create target directory
457   $(PackageTargetDir) :
458 <        $(MakeDir) $@
458 >        $(MkDir) $@
459  
460 + $(BinDir) :
461 +        $(MkDir) $@
462 +
463   # .c -> .o
464 < $(PackageTargetDir)/%.o : $(PackageSourceDir)/%.c
464 > $(PackageTargetDir)/%.o : %.c $(MainMakefile)
465          $(Print) $@
466 <        $(Print) $(CCompiler) $(COptions) -c $(IncludePath) $< -o $@
267 <        @$(CCompiler) $(COptions) -c $(IncludePath) $< -o $@
466 >        $(CCompiler) $(COptions) -c $(IncludePath) $< -o $@
467  
468 < %.o : $(PackageSourceDir)/%.c
468 > $(PackageParallelTargetDir)/%.o : %.c $(MainMakefile)
469 >        $(Print) $@
470 >        $(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@
471 >
472 > ifeq "$(UseMPI)" "yes"
473 > %.o : %.c $(MainMakefile)
474          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
475 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
476 + else
477 + %.o : %.c $(MainMakefile)
478 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
479 + endif
480  
481   # .cpp -> .o
482 < $(PackageTargetDir)/%.o : $(PackageSourceDir)/%.cpp
274 <        $(Print) $@
275 <        $(Print) $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@
482 > $(PackageTargetDir)/%.o : %.cpp $(MainMakefile)
483          $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@
484  
485 < %.o : $(PackageSourceDir)/%.cpp
485 > $(PackageParallelTargetDir)/%.o : %.cpp $(MainMakefile)
486 >        $(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@
487 >
488 > ifeq "$(UseMPI)" "yes"
489 > %.o : %.cpp $(MainMakefile)
490          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
491 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
492 + else
493 + %.o : %.cpp $(MainMakefile)
494 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
495 + endif
496  
497   # .f -> .o
498 < $(PackageTargetDir)/%.o : $(PackageSourceDir)/%.f
499 <        $(Print) $@
284 <        $(Print) $(FortranCompiler) $(FortranOptions) -c $< -o $@
285 <        @$(FortranCompiler) $(FortranOptions) -c $< -o $@
498 > $(PackageTargetDir)/%.o : %.f $(MainMakefile)
499 >        $(FortranCompiler) $(FortranOptions) -c $< -o $@
500  
501 < %.o : $(PackageSourceDir)/%.f
501 > $(PackageParallelTargetDir)/%.o : %.f $(MainMakefile)
502 >        $(FortranCompiler) $(FortranParallelOptions) -c $< -o $@
503 >
504 > ifeq "$(UseMPI)" "yes"
505 > %.o : %.f $(MainMakefile)
506          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
507 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
508 + else
509 + %.o : %.f $(MainMakefile)
510 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
511 + endif
512  
513   # .F90 -> .o
514 < $(PackageTargetDir)/%.o : $(PackageSourceDir)/%.F90
515 <        $(Print) $@
516 <        $(Print) $(F90Compiler) $(F90Options) -c $< -o $@
517 <        @$(F90Compiler) $(F90Options) -c $< -o $@
514 > $(PackageTargetDir)/%.o : %.F90 $(MainMakefile)
515 >        $(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@
516 >        if test -n "`ls *.$(ModSuffix)`"; then \
517 >          $(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\
518 >        fi
519  
520 < %.o : $(PackageSourceDir)/%.F90
520 > $(PackageParallelTargetDir)/%.o : %.F90 $(MainMakefile)
521 >        $(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@
522 >        if test -n "`ls *.$(ModSuffix)`"; then \
523 >          $(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\
524 >        fi
525 >
526 > ifeq "$(UseMPI)" "yes"
527 > %.o : %.F90 $(MainMakefile)
528          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
529 +        if test -n "`ls *.$(ModSuffix)`"; then\
530 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
531 +        fi
532  
533 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
534 +        if test -n "`ls *.$(ModSuffix)`"; then\
535 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
536 +        fi
537 +
538 + else
539 + %.o : %.F90 $(MainMakefile)
540 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
541 +        if test -n "`ls *.$(ModSuffix)`"; then\
542 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
543 +        fi
544 + endif
545 +
546 +
547   # .java -> .class
548   $(PackageTargetDir)/%.class : $(PackageSourceDir)/%.java
549 <        $(Print) $@
302 <        $(Print) $(JavaCompiler) $(JavaCompilerOptions) $<
303 <        @$(JavaCompiler) $(JavaCompilerOptions) $<
549 >        $(JavaCompiler) $(JavaCompilerOptions) $<
550  
551   %.class : $(PackageSourceDir)/%.java
552          @$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
553  
554   # .class -> .h
555   $(PackageSourceDir)/%.h : $(PackageTargetDir)/%.class
310        $(Print) $@
311        $(Print) $(JniCompiler) $(JniOptions) $(JavaPackageName).$*
556          $(JniCompiler) $(JniOptions) $(JavaPackageName).$*
557  
558   %.h : %.class
559          $(MAKE) $(MakeOptions) $(PackageSourceDir)/$@
560  
561   #.y -> .h
562 < $(PackageSourceDir)/%.h : $(PackageSourceDir)/%.y
563 <        $(Print) $@
320 <        $(Print) @$(Yacc) -d $?
321 <        @$(Yacc) -d  $?
562 > %.h : %.y
563 >        $(Yacc) -d  $?
564          @$(Move) y.tab.h $*.h
565          @$(Delete) y.tab.c
566  
567   #.y -> .c
568 < $(PackageSourceDir)/%.c : $(PackageSourceDir)/%.y
569 <        $(Print) $@
328 <        $(Print) $(Yacc) -d $?
329 <        @$(Yacc) -d  $?
568 > %.c : %.y
569 >        $(Yacc) -d  $?
570          @$(Move) y.tab.c $*.c
571          @$(Delete) y.tab.h
572  
573   # .l -> .c
574 < $(PackageSourceDir)/%.c : $(PackageSourceDir)/%.l
574 > %.c : %.l
575          $(Print) $@
576          $(Print) $(Lex) -o$@ $?
577          @$(Lex) -o$@ $?
578  
579   # .o -> .a
340 $(LibDir)/%.a : $(ObjectFiles)
341        $(Print) $@
342        $(Print) $(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles)
343        @$(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles)
580  
581 < %.a : $(ObjectFiles)
582 <        $(MAKE) $(MakeOptions) $(LibDir)/$@
581 > $(LibDir)/%_UP.a : $(ObjectFiles)
582 >        $(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles)
583 >        @touch $(LibDir)/.stamp_UP
584  
585 < $(LibDir)/%_MPI.a : $(ParallelObjectFiles)
586 <        $(Print) $@
587 <        $(Print) $(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles)
351 <        @$(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles)
585 > $(LibDir)/%_MPI.a: $(ParallelObjectFiles)
586 >        $(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles)
587 >        @touch $(LibDir)/.stamp_MPI
588  
589 + %_UP.a : $(ObjectFiles)
590 +        $(MAKE) $(MakeOptions) $(LibDir)/$@
591 +
592   %_MPI.a : $(ParallelObjectFiles)
593          $(MAKE) $(MakeOptions) $(LibDir)/$@
594  
595   # .o -> .so
596 < $(LibDir)/%.so : $(ObjectFiles)
358 <        $(Print) $@    
359 <        $(Print) $(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@
596 > $(LibDir)/%_UP.so : $(ObjectFiles)
597          $(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@
598  
362 %.so : $(ObjectFiles)
363        $(MAKE) $(MakeOptions) $(LibDir)/$@
364
599   $(LibDir)/%_MPI.so : $(ParallelObjectFiles)
366        $(Print) $@    
367        $(Print) $(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@
600          $(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@
601  
602 + %_UP.so : $(ObjectFiles)
603 +        $(MAKE) $(MakeOptions) $(LibDir)/$@
604 +
605   %_MPI.so : $(ParallelObjectFiles)
606          $(MAKE) $(MakeOptions) $(LibDir)/$@
607  
608   # .class -> .jar
609   $(LibDir)/%.jar : $(JavaClassFiles) $(OtherTargetFiles)
610          $(Print) $@
376        $(Print) $(JavaArchiver) -cf $@ $(JavaClassFilesRel) $(OtherTargetFiles)
611          @cd $(TargetDir); $(JavaArchiver) -cf $@ \
612          $(JavaClassFilesRel) $(OtherTargetFiles)
613  
# Line 403 | Line 637 | $(PackageTargetDir)/%_Skel.class : $(PackageTargetDir)
637   %_Skel.class : %.class
638          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
639  
640 + document :
641 +        $(Print) Generate Documentation for OOPSE-2.0
642 +        @cd $(DEV_ROOT)/src    
643 +        $(Doxygen) $(DEV_ROOT)/make/Doxyfile
644 +
645 + #GUN make funtions to merge the libraries
646 + find_objs = $(shell $(StaticArchiver) -t $(1))
647 + extract_objs = $(shell $(StaticArchiver) -x $(1) $(call find_objs, $(1)))
648 + create_archive = $(shell  $(StaticArchiver) $(StaticArchiverOptions) $(2) $(call find_objs, $(1)))
649 + remove_objs = $(shell $(Delete) $(call find_objs, $(1)))
650 + do_create = $(call extract_objs,$(1))$(call create_archive,$(1),$(2))$(call remove_objs,$(1))  
651 + do_link = $(shell $(LN_S) $(1) $(2))
652 +
653 + $(CombinedStaticLib) : $(LibDir)/.stamp_UP
654 +        $(Print) create $@      
655 +        $(foreach thisLib,$(LibNames),$(call do_create,$(thisLib),$@))
656 +        $(Ranlib) $(CombinedStaticLib)
657 +
658 + $(CombinedParallelStaticLib) : $(LibDir)/.stamp_MPI
659 +        $(Print) create $@
660 +        $(foreach thisLib,$(ParallelLibNames), $(call do_create, $(thisLib), $@))
661 +        $(Ranlib) $(CombinedParallelStaticLib)
662 +
663   # Executable
664 < $(Executable) : $(ObjectFiles)
665 <        $(Print) $@
409 <        $(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ObjectFiles) -o $@
664 > $(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir)
665 >        $(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@
666  
667 < $(ParallelExecutable) : $(ParallelObjectFiles)
668 <        $(Print) $@
413 <        $(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ParallelObjectFiles) -o $@
667 > $(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) $(BinDir)
668 >        $(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@
669  
670   # Anything else is just copied from source to target
671   $(PackageTargetDir)/% : $(PackageSourceDir)/%
# Line 423 | Line 678 | _buildall : \
678  
679   _all : _buildall
680  
681 + _buildall :
682 + ifeq "$(UseMPI)" "yes"
683   _buildall : \
684          $(DependencyFile) \
685          $(PackageTargetDir) \
686          $(ObjectFiles) \
687 +        $(ParallelObjectFiles) \
688          $(JavaClassFiles) \
689          $(RmiStubFiles) \
690          $(RmiSkeletonFiles) \
691          $(OtherTargetFiles) \
434        $(SharedLibrary) \
692          $(StaticLibrary) \
693 +        $(ParallelStaticLibrary) \
694          $(JarFile) \
695 <        $(Executable)
695 >        $(Executable) \
696 >        $(ParallelExecutable)
697 > else
698 > _buildall : \
699 >        $(DependencyFile) \
700 >        $(PackageTargetDir) \
701 >        $(ObjectFiles) \
702 >        $(JavaClassFiles) \
703 >        $(RmiStubFiles) \
704 >        $(RmiSkeletonFiles) \
705 >        $(OtherTargetFiles) \
706 >        $(StaticLibrary) \
707 >        $(JarFile) \
708 >        $(Executable)
709 > endif
710  
711 + echo : $(PackageListLoop)
712 +        $(Print) Done echo.
713  
714 + _echoall :
715 +        $(Print) $(Modules)
716 +
717   # make clean
718   clean : $(PackageListLoop)
719          $(Print) Done clean.    
720  
721   _cleanall :
722 <        $(Delete) $(PackageTargetDir)/* \
723 <                  $(JarFile) \
724 <                  $(SharedLibrary) \
725 <                  $(StaticLibrary) \
726 <                  $(Executable) \
727 <                  $(DependencyFile)
722 >        $(Delete) \
723 >                $(ObjectFiles) \
724 >                $(ModuleFiles) \
725 >                $(ParallelObjectFiles) \
726 >                $(ParallelModuleFiles) \
727 >                $(JarFile) \
728 >                $(SharedLibrary) \
729 >                $(StaticLibrary) \
730 >                $(ParallelSharedLibrary) \
731 >                $(ParallelStaticLibrary) \
732 >                $(CombinedStaticLib) \
733 >                $(CombinedParallelStaticLib)
734  
735 + # make distclean
736 + distclean : $(PackageListLoop)
737 +        $(Print) Done clean.    
738  
739 + _distcleanall : _cleanall
740 +        $(Delete) $(Executable) \
741 +                  $(ParallelExecutable) \
742 +                  $(DependencyFile)
743 +
744   # make depend
745   depend : $(PackageListLoop)
746          $(Print) Done dependencies.
# Line 459 | Line 750 | $(DependencyFile) : $(DerivedSource)
750   $(DependencyFile) : $(DerivedSource)
751          $(Print) $@
752          @cd $(PackageSourceDir)
753 <        touch Make.temp
754 < ifdef $(CppFiles)
755 <        $(CppCompiler) $(IncludePath) -MM $(CppFiles)  > Make.temp
753 >
754 > ifneq "$(words $(CppFiles))" "0"
755 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CppFiles)>> Make.cpptemp
756 >        @cat Make.cpptemp  >> $(DependencyFile)
757 >        $(Delete) Make.cpptemp
758 >
759 >  ifeq "$(UseMPI)" "yes"
760 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CppFiles)>> Make.cpptemp
761 >        @cat Make.cpptemp  >> $(DependencyFile)
762 >        @$(Delete) Make.cpptemp
763 >  endif
764 >
765   endif
766 < ifdef $(CFiles)
767 <        $(CCompiler)   $(IncludePath) -MM $(CFiles) $(DerivedCFiles)   >> Make.temp
766 >
767 > ifneq "$(words $(CFiles))" "0"
768 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/'  -MM $(CFiles) $(DerivedCFiles)  >> Make.ctemp
769 >        @cat Make.ctemp  >> $(DependencyFile)
770 >        $(Delete) Make.ctemp
771 >
772 >  ifeq "$(UseMPI)" "yes"
773 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CFiles) $(DerivedCFiles)  >> Make.ctemp
774 >        @cat Make.ctemp  >> $(DependencyFile)
775 >        @$(Delete) Make.ctemp
776 >  endif
777 >
778   endif
779 <        cat Make.temp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile)
780 <        cat Make.temp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile)
781 <        echo $(F90Files)
782 < ifdef $(F90Files)
783 <        $(DEV_ROOT)/scripts/sfmakedepend  -I $(DEV_ROOT)/src -d '$$(DEV_ROOT)/obj' -f ./Make.ftemp -h *.F90
784 <        cat Make.ftemp >> $(DependencyFile)
779 >
780 > ifneq "$(words $(F90Files))" "0"
781 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp
782 >        @cat Make.ftemp >> $(DependencyFile)
783 >        @$(Delete) Make.ftemp
784 >
785 >  ifeq "$(UseMPI)" "yes"
786 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix)  $(F90Files) >> Make.ftemp
787 >        @cat Make.ftemp >> $(DependencyFile)
788 >        @$(Delete) Make.ftemp
789 >  endif
790 >
791   endif
476        $(Delete) Make.temp Make.ftemp
792  
793   # make lib
794   lib    : $(PackageListLoop)
# Line 486 | Line 801 | jarsign : $(JarFile)
801   jarsign : $(JarFile)
802          $(JarSigner) -keystore GeoSoftKeystore $(JarFile) myself
803  
804 + #make install
805 + %.install :
806 +        @$(MAKE) $(MakeOptions) -C $(subst .install,,$@) _installall    
807 +
808 + install : $(InstallListLoop)
809 +        $(Print) Done Install
810 +
811 + _installall : _buildall _installdata _installlinks
812 +
813 + $(MyInstallDir) :
814 +        $(MkDir) $@
815 +
816 + _installdata :  $(MyInstallDir)
817 +        $(Print) $(InstallFiles)
818 + ifneq "$(words $(InstallFiles))" "0"
819 +        $(InstallCommand) $(InstallFiles) $(MyInstallDir)
820 + endif      
821 +
822 + _installlinks :  $(MyInstallDir)
823 + ifneq "$(words $(MyLinkTargets))" "0"
824 +        @cd $(MyInstallDir)
825 +        $(foreach thisLink,$(MyLinkTargets),$(call do_link,$(MyLinkSource),$(thisLink)))
826 + endif      
827 +
828   # make statistics
829   _statisticsall :
830 <        @$(Print) $(SourceFiles) >> $(DEV_ROOT)/files.tmp
830 >        @$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp
831  
832   statistics : $(PackageListLoop)
833          @$(List) $(DEV_ROOT)/files.tmp | xargs $(WordCount) $(WordCountOptions)
# Line 496 | Line 835 | $(Executable).pure :
835          $(Print) Done statistics.
836  
837   # make pure
838 < $(Executable).pure :
839 <        $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \
840 <        $(LibList) $(ObjectFiles) -o $@
838 > #$(Executable).pure :
839 > #       $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \
840 > #       $(LibList) $(ObjectFiles) -o $@
841 > #
842 > #pure : $(Executable).pure
843  
844 < pure : $(Executable).pure
844 > #make cvslog
845 > cvslog:
846 >        $(DEV_ROOT)/scripts/cvs2cl
847  
848   # Execute
849   _runexe :

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines