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 1510 by tim, Wed Sep 29 18:37:08 2004 UTC vs.
Revision 2960 by gezelter, Wed Jul 26 21:00:44 2006 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines