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 1524 by tim, Tue Oct 5 14:14:46 2004 UTC vs.
Revision 2157 by gezelter, Mon Apr 11 16:14:05 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 +
55 + #packages containing applications
56 + Applications = \
57          applications/oopse \
58          applications/dump2Xyz \
59 <        applications/simpleBuilder \
59 >        applications/simpleBuilder\
60 >        applications/staticProps \
61 >        applications/dynamicProps \
62  
63 < #packages contain libraries
64 < PackageLibs = \
65 <        utils \
66 <        math \
67 <        types \
68 <        primitives \
69 <        visitors \
70 <        UseTheForce/DarkSide \
71 <        UseTheForce \
72 <        brains \
73 <        io \
74 <        integrators \
75 <        minimizers \
70 <        constraints \
71 <        profiling \
72 <        restraints \
63 > Samples = \
64 >        samples/argon \
65 >        samples/water/dimer \
66 >        samples/water/spce \
67 >        samples/water/ssd \
68 >        samples/water/ssde \
69 >        samples/water/tip3p_ice \
70 >        samples/water/tip4p \
71 >        samples/lipid \
72 >        samples/alkane \
73 >        samples/minimizer \
74 >        samples/metals \
75 >        samples/zcons \
76  
77   IncludeDirs = \
75        @SPRNG_INC_DIR@ \
78          @MPI_INC_DIR@
79  
80   LibraryDirs = \
79        @SPRNG_LIB_DIR@ \
81          @MPI_LIB_DIR@
82  
83   Libraries = \
84 <        @SPRNG_LIB@ \
85 <        @MPI_LIB@
84 >        @MPI_LIB@ \
85 >        @MPI_F90_LIB@
86  
86 LinkOptions = \
87        @F90LIBS@
88
87   OopseHome       = @OOPSE_HOME@
88 < ForceParamDir   = @OOPSE_HOME@/share/forceFields/
89 < SampleSimDir    = @OOPSE_HOME@/share/samples/
88 > ForceParamDir   = $(OopseHome)/share/forceFields
89 > SampleSimDir    = $(OopseHome)/share/samples
90 > InstallBinDir   = $(OopseHome)/bin
91 > DocDir          = $(OopseHome)/doc
92   FrcDeclare      = -DFRC_PATH="$(ForceParamDir)"
93 + F90Declare      = -D__FORTRAN90
94   ParallelDeclare = -DIS_MPI
95 + UseMPI          = @USE_MPI@
96 + ModuleCase      = @F90_MODULE_NAMES@
97 + ModSuffix       = @MOD@
98 + LinkOptions = \
99 +        @F90LIBS@
100  
101 + ParallelLinkOptions = \
102 +        @F90LIBS@
103  
104 +
105   #---------------------------------------------------------------------------
106   #
107   #  Directories
# Line 107 | Line 116 | CurrentDir        = $(CURDIR)
116   BinDir            = $(DEV_ROOT)/bin
117   DocsDir           = $(DEV_ROOT)/docs
118   CurrentDir        = $(CURDIR)
119 + CombinedStaticLib = $(LibDir)/libOOPSE.a
120 + CombinedParallelStaticLib = $(LibDir)/libOOPSE_MPI.a
121  
122   ifdef Source
123   #get the relative path of current package to source directory
124   # /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside
125   #Package          = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g')
126   #use shell script to get the absolute path and then rip it off from $(CurrentDir)
127 < Package          = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
127 > #Package          = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
128 > # REMINDER: We are now using the Package line in each subdir makefile.
129 > # This avoids the strange path problem and the subshell
130  
131   PackageList              = $(Package)
132   PackageSourceDir         = $(SourceDir)/$(Package)
# Line 121 | Line 134 | PackageList              = $(Packages) $(JavaPackages)
134   PackageParallelTargetDir = $(ParallelTargetDir)
135   JavaMainClass            = $(subst /,.,$(Package)).$(Main)
136   else
137 < PackageList              = $(Packages) $(JavaPackages)
137 > PackageList              = $(PackageLibs) $(JavaPackages) $(Applications)
138   endif
139  
140   PackageListLoop          = $(patsubst %,$(SourceDir)/%/.loop,$(PackageList))
# Line 172 | Line 185 | ObjectFiles            = $(CFiles:%.c=        $(Packag
185   JniHeaders             = $(JniSource:%.java=  $(PackageSourceDir)/%.h)
186   ObjectFiles            = $(CFiles:%.c=        $(PackageTargetDir)/%.o)\
187                           $(CppFiles:%.cpp=    $(PackageTargetDir)/%.o)\
188 <                                     $(FortranFiles:%.f=  $(PackageTargetDir)/%.o)\
189 <                                     $(F90Files:%.F90=    $(PackageTargetDir)/%.o)\
190 <                                     $(LexFiles:%.l=      $(PackageTargetDir)/%.o)\
191 <                                     $(YaccFiles:%.y=     $(PackageTargetDir)/%.o)
188 >                         $(FortranFiles:%.f=  $(PackageTargetDir)/%.o)\
189 >                         $(F90Files:%.F90=    $(PackageTargetDir)/%.o)\
190 >                         $(LexFiles:%.l=      $(PackageTargetDir)/%.o)\
191 >                         $(YaccFiles:%.y=     $(PackageTargetDir)/%.o)
192   ParallelObjectFiles    = $(CFiles:%.c=        $(PackageParallelTargetDir)/%.o)\
193 <                                     $(CppFiles:%.cpp=    $(PackageParallelTargetDir)/%.o)\
194 <                                     $(FortranFiles:%.f=  $(PackageParallelTargetDir)/%.o)\
195 <                                     $(F90Files:%.F90=    $(PackageParallelTargetDir)/%.o)\
196 <                                     $(LexFiles:%.l=      $(PackageParallelTargetDir)/%.o)\
197 <                                     $(YaccFiles:%.y=     $(PackageParallelTargetDir)/%.o)
193 >                         $(CppFiles:%.cpp=    $(PackageParallelTargetDir)/%.o)\
194 >                         $(FortranFiles:%.f=  $(PackageParallelTargetDir)/%.o)\
195 >                         $(F90Files:%.F90=    $(PackageParallelTargetDir)/%.o)\
196 >                         $(LexFiles:%.l=      $(PackageParallelTargetDir)/%.o)\
197 >                         $(YaccFiles:%.y=     $(PackageParallelTargetDir)/%.o)
198  
199   DerivedSource          = $(YaccFiles:%.y=    %.h) \
200 <                               $(YaccFiles:%.y=    %.c) \
201 <                               $(LexFiles:%.l=     %.c)
200 >                         $(YaccFiles:%.y=    %.c) \
201 >                         $(LexFiles:%.l=     %.c)
202  
203   DerivedCFiles          = $(YaccFiles:%.y=    %.c) \
204 <                               $(LexFiles:%.l=     %.c)
204 >                         $(LexFiles:%.l=     %.c)
205  
206   OtherTargetFiles       = $(OtherSourceFiles:%=$(PackageTargetDir)/%)
207 +
208 + ###########################################################################
209 + #
210 + # Figure out the names of the module files based on some work done by
211 + # configure.  The tr function below is from John Graham-Cumming
212 + # (http://www.jgc.org).
213 + #
214 + # The tr function.   Has three arguments:
215 + #
216 + # $1   The list of characters to translate from
217 + # $2   The list of characters to translate to
218 + # $3   The text to translate
219 + #
220 + # For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L.
221 +
222 + tr = $(eval __t := $3)                                                    \
223 +     $(foreach c,                                                         \
224 +         $(join $(addsuffix :,$1),$2),                                    \
225 +         $(eval __t :=                                                    \
226 +             $(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \
227 +                 $(__t))))$(__t)
228  
229 + # Common character classes for use with the tr function.  Each of
230 + # these is actually a variable declaration and must be wrapped with
231 + # $() or ${} to be used.
232 +
233 + [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 #
234 + [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 #
235 + [0-9] := 0 1 2 3 4 5 6 7 8 9 #
236 + [A-F] := A B C D E F #
237 +
238 + # Upper case and lower case functions.  Each function has a single
239 + # argument which is the text to alter
240 +
241 + uc = $(call tr,$([a-z]),$([A-Z]),$1)
242 + lc = $(call tr,$([A-Z]),$([a-z]),$1)
243 +
244 + # OK, now we can actually use these functions to figure out the names
245 + # of the module files:
246 +
247 + ifneq "$(words $(Modules))" "0"
248 + ifeq "$(ModuleCase)" "UPPER"
249 +  MODULES = $(call uc,$(Modules))
250 + else
251 +  ifeq "$(ModuleCase)" "lower"
252 +    MODULES = $(call lc,$(Modules))
253 +  else
254 +    MODULES = $(Modules)
255 +  endif
256 + endif
257 +  ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix))
258 +  ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix))
259 + endif
260 + #
261 + ###########################################################################
262 +
263   ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries))
264   ThirdPartyJars    = $(subst $(Space),$(X),$(ThirdPartyJarsTmp))
265  
# Line 203 | Line 271 | ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))
271   #if Main is defined, do not build library. It may not be true sometimes
272   ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0"
273    DependencyFile    = $(PackageSourceDir)/Makedepend
274 <  ifneq "$(Main)" ""
274 >  ifneq "$(words $(Main))" "0"
275      Executable             = $(BinDir)/$(Main)
276 <    ParallelExecutable     = $(BinDir)/$(Main)_MPI
276 >    ifeq "$(BuiltParallelExe)" "1"
277 >      ParallelExecutable     = $(BinDir)/$(Main)_MPI
278 >    endif
279    else
280 <    SharedLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).so
281 <    StaticLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).a
280 >    SharedLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so
281 >    StaticLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a
282      ParallelSharedLibrary  = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.so
283      ParallelStaticLibrary  = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.a
284    endif
285   endif
286 +
287   #
288   # Misc
289   #
# Line 220 | Line 291 | LocalLibs        = $(subst /,,$(patsubst %, oopse_%, $
291   JavaPackageNames = $(subst /,.,$(JavaPackages))
292   IncludePath      = -I$(SourceDir) $(IncludeDirs:%=-I%)
293   LibDirs          = -L$(LibDir)    $(LibraryDirs:%=-L%)
294 < LocalLibs        = $(subst /,,$(patsubst %, oopse_%, $(PackageLibs)))
294 > LocalLibs        = $(subst /,,$(patsubst %, oopse_%_UP, $(PackageLibs)))
295   ParallelLocalLibs= $(subst /,,$(patsubst %, oopse_%_MPI, $(PackageLibs)))
296   LibList          = $(LocalLibs:%=-l%) $(Libraries)
297 < ParallelLibList  = $(LocalLibs:%=-l%) $(Libraries)
297 > LibNames         = $(LocalLibs:%=$(LibDir)/lib%.a)
298 > ParallelLibList  = $(ParallelLocalLibs:%=-l%) $(Libraries)
299 > ParallelLibNames = $(ParallelLocalLibs:%=$(LibDir)/lib%.a)
300  
301  
302   #---------------------------------------------------------------------------
# Line 232 | Line 305 | Move                   = mv
305   #
306   #---------------------------------------------------------------------------
307   Print                  = @echo
308 < Move                   = mv
308 > Move                   = mv -f
309   Copy                   = cp
310   CCompiler              = @CC@
311   CppCompiler            = @CXX@
312   Linker                 = @CXX@
313   MakeDepend             = makedepend
314 < Install                = @INSTALL@
314 > INSTALL                = @INSTALL@
315   InstallProgram         = @INSTALL_PROGRAM@
316 + InstallScript          = @INSTALL_SCRIPT@
317   InstallData            = @INSTALL_DATA@
318 < MakeDir                = @MKINSTALLDIRS@
318 > MkDir                  = @MKINSTALLDIRS@
319   Delete                 = rm -fr
320   StaticArchiver         = @AR@
321   DynamicArchiver        = @CC@
# Line 259 | Line 333 | Lex                    = @LEX@
333   List                   = cat
334   Yacc                   = @YACC@
335   Lex                    = @LEX@
336 + Ranlib                 = @RANLIB@
337 + Doxygen                = @DOXYGEN@
338  
263
339   MakeOptions            = -k
340   MakeDependOptions      =
341   StaticArchiverOptions  = rc
# Line 269 | Line 344 | COptions               = $(FrcDeclare)
344   JniOptions             =
345   RmiOptions             = -d $(TargetDir) -classpath $(ClassPath) \
346                           -sourcepath $(SourceDir)
347 < COptions               = $(FrcDeclare)
348 < CParallelOptions       = $(FrcDeclare) $(ParallelDeclare)
349 < CppOptions             = $(FrcDeclare)
350 < CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare)
347 > COptions               = $(FrcDeclare) @CFLAGS@
348 > CParallelOptions       = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@
349 > CppOptions             = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
350 > CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
351   FortranOptions         =
352 < F90Options             =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir)
353 < F90ParallelOptions     =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir)  @PREPDEFFLAG@$(ParallelDeclare)
352 > F90Options             =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir)
353 > F90ParallelOptions     =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir)  @PREPDEFFLAG@$(ParallelDeclare)
354   JavaCompilerOptions    = -d $(TargetDir) -classpath $(ClassPath) \
355                           -sourcepath $(SourceDir) -deprecation
356   JavaRunOptions         = -classpath $(ClassPath)
# Line 297 | Line 372 | Space                  = $(Empty) $(Empty)
372  
373   Empty                  =
374   Space                  = $(Empty) $(Empty)
375 +
376 +
377 + #---------------------------------------------------------------------------
378 + #
379 + #  Install
380 + #
381 + #---------------------------------------------------------------------------
382 +
383 + ifneq "$(words $(SampleFiles))" "0"
384 +  MySample                 = $(subst $(shell cd $(DEV_ROOT)/samples; pwd)/,,$(CurrentDir))
385 +  MyInstallDir             = $(SampleSimDir)/$(MySample)
386 +  InstallFiles             = $(SampleFiles)
387 +  InstallCommand           = $(InstallData)
388 + endif
389 +
390 + ifneq "$(words $(Main))" "0"
391 +  MyInstallDir             = $(InstallBinDir)
392 +  ifeq "$(UseMPI)" "yes"
393 +    InstallFiles             = $(Executable) $(ParallelExecutable)
394 +  else
395 +    InstallFiles             = $(Executable)
396 +  endif
397 +  InstallCommand           = $(InstallProgram)
398 + endif
399 +
400 + ifneq "$(words $(ForcefieldFiles))" "0"
401 +  MyInstallDir             = $(ForceParamDir)
402 +  InstallFiles             = $(ForcefieldFiles)
403 +  InstallCommand           = $(InstallData)
404 + endif
405 +
406 + ifneq "$(words $(InstallFiles))" "0"
407 +  InstallList            =
408 + else
409 +  InstallList            = $(patsubst %,$(DEV_ROOT)/%,$(Samples)) $(DEV_ROOT)/forceFields $(patsubst %, $(SourceDir)/%,$(Applications))
410 + endif
411 +
412 + InstallListLoop          = $(patsubst %,$(SourceDir)/%/.install,$(PackageList))  $(patsubst %,%/.install,$(InstallList))
413  
414  
415 +
416   #---------------------------------------------------------------------------
417   #
418   # Rules
# Line 311 | Line 425 | $(PackageTargetDir) :
425  
426   # Create target directory
427   $(PackageTargetDir) :
428 <        $(MakeDir) $@
428 >        $(MkDir) $@
429  
430 + $(BinDir) :
431 +        $(MkDir) $@
432 +
433   # .c -> .o
434   $(PackageTargetDir)/%.o : %.c
435          $(Print) $@
436          $(CCompiler) $(COptions) -c $(IncludePath) $< -o $@
437  
438 + $(PackageParallelTargetDir)/%.o : %.c
439 +        $(Print) $@
440 +        $(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@
441 +
442 + ifeq "$(UseMPI)" "yes"
443   %.o : %.c
444          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
445 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
446 + else
447 + %.o : %.c
448 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
449 + endif
450  
451   # .cpp -> .o
452   $(PackageTargetDir)/%.o : %.cpp
453          $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@
454  
455 + $(PackageParallelTargetDir)/%.o : %.cpp
456 +        $(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@
457 +
458 + ifeq "$(UseMPI)" "yes"
459   %.o : %.cpp
460          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
461 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
462 + else
463 + %.o : %.cpp
464 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
465 + endif
466  
467   # .f -> .o
468   $(PackageTargetDir)/%.o : %.f
469          $(FortranCompiler) $(FortranOptions) -c $< -o $@
470  
471 + $(PackageParallelTargetDir)/%.o : %.f
472 +        $(FortranCompiler) $(FortranParallelOptions) -c $< -o $@
473 +
474 + ifeq "$(UseMPI)" "yes"
475   %.o : %.f
476          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
477 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
478 + else
479 + %.o : %.f
480 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
481 + endif
482  
483   # .F90 -> .o
484   $(PackageTargetDir)/%.o : %.F90
485 <        $(F90Compiler) $(F90Options) -c $< -o $@
485 >        $(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@
486 >        if test -n "`ls *.$(ModSuffix)`"; then \
487 >          $(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\
488 >        fi
489  
490 + $(PackageParallelTargetDir)/%.o : %.F90
491 +        $(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@
492 +        if test -n "`ls *.$(ModSuffix)`"; then \
493 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\
494 +        fi
495 +
496 + ifeq "$(UseMPI)" "yes"
497   %.o : %.F90
498          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
499 +        if test -n "`ls *.$(ModSuffix)`"; then\
500 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
501 +        fi
502  
503 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
504 +        if test -n "`ls *.$(ModSuffix)`"; then\
505 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
506 +        fi
507 +
508 + else
509 + %.o : %.F90
510 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
511 +        if test -n "`ls *.$(ModSuffix)`"; then\
512 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
513 +        fi
514 + endif
515 +
516 +
517   # .java -> .class
518   $(PackageTargetDir)/%.class : $(PackageSourceDir)/%.java
519          $(JavaCompiler) $(JavaCompilerOptions) $<
# Line 375 | Line 547 | $(LibDir)/%.a : $(ObjectFiles)
547          @$(Lex) -o$@ $?
548  
549   # .o -> .a
550 < $(LibDir)/%.a : $(ObjectFiles)
550 >
551 > $(LibDir)/%_UP.a : $(ObjectFiles)
552          $(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles)
553 +        @touch $(LibDir)/.stamp_UP
554  
555 < %.a : $(ObjectFiles)
382 <        $(MAKE) $(MakeOptions) $(LibDir)/$@
383 <
384 < $(LibDir)/%_MPI.a : $(ParallelObjectFiles)
555 > $(LibDir)/%_MPI.a: $(ParallelObjectFiles)
556          $(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles)
557 +        @touch $(LibDir)/.stamp_MPI
558  
559 + %_UP.a : $(ObjectFiles)
560 +        $(MAKE) $(MakeOptions) $(LibDir)/$@
561 +
562   %_MPI.a : $(ParallelObjectFiles)
563          $(MAKE) $(MakeOptions) $(LibDir)/$@
564  
565   # .o -> .so
566 < $(LibDir)/%.so : $(ObjectFiles)
566 > $(LibDir)/%_UP.so : $(ObjectFiles)
567          $(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@
568  
394 %.so : $(ObjectFiles)
395        $(MAKE) $(MakeOptions) $(LibDir)/$@
396
569   $(LibDir)/%_MPI.so : $(ParallelObjectFiles)
570          $(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@
571  
572 + %_UP.so : $(ObjectFiles)
573 +        $(MAKE) $(MakeOptions) $(LibDir)/$@
574 +
575   %_MPI.so : $(ParallelObjectFiles)
576          $(MAKE) $(MakeOptions) $(LibDir)/$@
577  
# Line 432 | Line 607 | $(PackageTargetDir)/%_Skel.class : $(PackageTargetDir)
607   %_Skel.class : %.class
608          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
609  
610 + document :
611 +        $(Print) Generate Documentation for OOPSE-2.0
612 +        @cd $(DEV_ROOT)/src    
613 +        $(Doxygen) $(DEV_ROOT)/make/Doxyfile
614 +
615 + #GUN make funtions to merge the libraries
616 + find_objs = $(shell $(StaticArchiver) -t $(1))
617 + extract_objs = $(shell $(StaticArchiver) -x $(1) $(call find_objs, $(1)))
618 + create_archive = $(shell  $(StaticArchiver) $(StaticArchiverOptions) $(2) $(call find_objs, $(1)))
619 + remove_objs = $(shell $(Delete) $(call find_objs, $(1)))
620 + do_create = $(call extract_objs,$(1))$(call create_archive,$(1),$(2))$(call remove_objs,$(1))  
621 +
622 + $(CombinedStaticLib) : $(LibDir)/.stamp_UP
623 +        $(Print) create $@      
624 +        $(foreach thisLib,$(LibNames),$(call do_create,$(thisLib),$@))
625 +        $(Ranlib) $(CombinedStaticLib)
626 +
627 + $(CombinedParallelStaticLib) : $(LibDir)/.stamp_MPI
628 +        $(Print) create $@
629 +        $(foreach thisLib,$(ParallelLibNames), $(call do_create, $(thisLib), $@))
630 +        $(Ranlib) $(CombinedParallelStaticLib)
631 +
632   # Executable
633 < $(Executable) : $(ObjectFiles)
634 <        $(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ObjectFiles) -o $@
633 > $(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir)
634 >        $(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@
635  
636 < $(ParallelExecutable) : $(ParallelObjectFiles)
637 <        $(Linker) $(LinkOptions) $(LibDirs) $(ParallelLibList) $(ParallelObjectFiles) -o $@
636 > $(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) $(BinDir)
637 >        $(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@
638  
639   # Anything else is just copied from source to target
640   $(PackageTargetDir)/% : $(PackageSourceDir)/%
# Line 450 | Line 647 | _buildall : \
647  
648   _all : _buildall
649  
650 + _buildall :
651 + ifeq "$(UseMPI)" "yes"
652   _buildall : \
653          $(DependencyFile) \
654          $(PackageTargetDir) \
655          $(ObjectFiles) \
656 +        $(ParallelObjectFiles) \
657          $(JavaClassFiles) \
658          $(RmiStubFiles) \
659          $(RmiSkeletonFiles) \
660          $(OtherTargetFiles) \
461        $(SharedLibrary) \
661          $(StaticLibrary) \
662 +        $(ParallelStaticLibrary) \
663          $(JarFile) \
664 <        $(Executable)
665 <        
664 >        $(Executable) \
665 >        $(ParallelExecutable)
666 > else
667 > _buildall : \
668 >        $(DependencyFile) \
669 >        $(PackageTargetDir) \
670 >        $(ObjectFiles) \
671 >        $(JavaClassFiles) \
672 >        $(RmiStubFiles) \
673 >        $(RmiSkeletonFiles) \
674 >        $(OtherTargetFiles) \
675 >        $(StaticLibrary) \
676 >        $(JarFile) \
677 >        $(Executable)
678 > endif
679  
680 + echo : $(PackageListLoop)
681 +        $(Print) Done echo.
682 +
683 + _echoall :
684 +        $(Print) $(Modules)
685 +
686   # make clean
687   clean : $(PackageListLoop)
688          $(Print) Done clean.    
689  
690   _cleanall :
691 <        $(Delete) $(ObjectFiles) $(ParallelObjectFiles)
691 >        $(Delete) \
692 >                $(ObjectFiles) \
693 >                $(ModuleFiles) \
694 >                $(ParallelObjectFiles) \
695 >                $(ParallelModuleFiles) \
696 >                $(JarFile) \
697 >                $(SharedLibrary) \
698 >                $(StaticLibrary) \
699 >                $(ParallelSharedLibrary) \
700 >                $(ParallelStaticLibrary) \
701 >                $(CombinedStaticLib) \
702 >                $(CombinedParallelStaticLib)
703  
704   # make distclean
705   distclean : $(PackageListLoop)
706          $(Print) Done clean.    
707  
708 < _distcleanall :
709 <        $(Delete) $(ObjectFiles) \
480 <                  $(ParallelObjectFiles) \
481 <                        $(JarFile) \
482 <                  $(SharedLibrary) \
483 <                  $(StaticLibrary) \
484 <                  $(ParallelSharedLibrary) \
485 <                  $(ParallelStaticLibrary) \
486 <                  $(Executable) \
708 > _distcleanall : _cleanall
709 >        $(Delete) $(Executable) \
710                    $(ParallelExecutable) \
711                    $(DependencyFile)
712  
490
713   # make depend
714   depend : $(PackageListLoop)
715          $(Print) Done dependencies.
# Line 498 | Line 720 | $(DependencyFile) : $(DerivedSource)
720          $(Print) $@
721          @cd $(PackageSourceDir)
722  
501        @touch Make.ctemp
502        @touch Make.ctemp
503
723   ifneq "$(words $(CppFiles))" "0"
724 <        $(CppCompiler) $(IncludePath) -MM $(CppFiles)  > Make.cpptemp
725 <        cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile)
726 <        cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile)
724 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CppFiles)>> Make.cpptemp
725 >        @cat Make.cpptemp  >> $(DependencyFile)
726 >        $(Delete) Make.cpptemp
727 >
728 >  ifeq "$(UseMPI)" "yes"
729 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CppFiles)>> Make.cpptemp
730 >        @cat Make.cpptemp  >> $(DependencyFile)
731 >        @$(Delete) Make.cpptemp
732 >  endif
733 >
734   endif
735  
736   ifneq "$(words $(CFiles))" "0"
737 <        $(CCompiler)   $(IncludePath) -MM $(CFiles) $(DerivedCFiles)   > Make.ctemp
738 <        cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile)
739 <        cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile)
737 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/'  -MM $(CFiles) $(DerivedCFiles)  >> Make.ctemp
738 >        @cat Make.ctemp  >> $(DependencyFile)
739 >        $(Delete) Make.ctemp
740  
741 +  ifeq "$(UseMPI)" "yes"
742 +        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CFiles) $(DerivedCFiles)  >> Make.ctemp
743 +        @cat Make.ctemp  >> $(DependencyFile)
744 +        @$(Delete) Make.ctemp
745 +  endif
746 +
747   endif
748  
749   ifneq "$(words $(F90Files))" "0"
750 <        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/obj/' -D__FORTRAN90  $(F90Files) > Make.ftemp
751 <        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/MPIobj/' -DIS_MPI -D__FORTRAN90  $(F90Files) >> Make.ftemp
752 <        cat Make.ftemp >> $(DependencyFile)
750 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp
751 >        @cat Make.ftemp >> $(DependencyFile)
752 >        @$(Delete) Make.ftemp
753 >
754 >  ifeq "$(UseMPI)" "yes"
755 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix)  $(F90Files) >> Make.ftemp
756 >        @cat Make.ftemp >> $(DependencyFile)
757 >        @$(Delete) Make.ftemp
758 >  endif
759 >
760   endif
522        $(Delete) Make.cpptemp Make.ctemp Make.ftemp
761  
762   # make lib
763   lib    : $(PackageListLoop)
# Line 532 | Line 770 | jarsign : $(JarFile)
770   jarsign : $(JarFile)
771          $(JarSigner) -keystore GeoSoftKeystore $(JarFile) myself
772  
773 + #make install
774 + %.install :
775 +        @$(MAKE) $(MakeOptions) -C $(subst .install,,$@) _installall    
776 +
777 + install : $(InstallListLoop)
778 +        $(Print) Done Install
779 +
780 + _installall : _buildall _installdata
781 +
782 + $(MyInstallDir) :
783 +        $(MkDir) $@
784 +
785 + _installdata :  $(MyInstallDir)
786 +        $(Print) $(InstallFiles)
787 + ifneq "$(words $(InstallFiles))" "0"
788 +        $(InstallCommand) $(InstallFiles) $(MyInstallDir)
789 + endif      
790 +
791   # make statistics
792   _statisticsall :
793 <        @$(Print) $(SourceFiles) >> $(DEV_ROOT)/files.tmp
793 >        @$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp
794  
795   statistics : $(PackageListLoop)
796          @$(List) $(DEV_ROOT)/files.tmp | xargs $(WordCount) $(WordCountOptions)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines