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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines