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 2456 by gezelter, Fri Nov 18 17:50:17 2005 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 +        openbabel
56 +
57 + #packages containing applications
58 + Applications = \
59 +        applications/oopse \
60 +        applications/dump2Xyz \
61 +        applications/staticProps \
62 +        applications/dynamicProps \
63 +        applications/simpleBuilder\
64 +        applications/nanoRodBuilder \
65 +        applications/atom2mdin
66 +
67 + Samples = \
68 +        samples/argon \
69 +        samples/water/dimer \
70 +        samples/water/spce \
71 +        samples/water/ssd \
72 +        samples/water/ssde \
73 +        samples/water/ssdrf \
74 +        samples/water/ssd-ion \
75 +        samples/water/tip3p_ice \
76 +        samples/water/tip4p \
77 +        samples/lipid \
78 +        samples/alkane \
79 +        samples/minimizer \
80 +        samples/metals \
81 +        samples/thermoIntegration/liquid \
82 +        samples/thermoIntegration/solid \
83 +        samples/dipole \
84 +        samples/shape \
85 +        samples/zcons \
86 +
87 + IncludeDirs = \
88 +        @CGAL_INC_DIR@ \
89 +        @MPI_INC_DIR@
90 +
91 + LibraryDirs = \
92 +        @CGAL_LIB_DIR@ \
93 +        @MPI_LIB_DIR@
94 +
95 + Libraries = \
96 +        @LIBS@ \
97 +        @CGAL_LIBS@ \
98 +        @MPI_LIB@ \
99 +        @MPI_F90_LIB@
100 +
101 + OopseHome       = @OOPSE_HOME@
102 + ForceParamDir   = $(OopseHome)/share/forceFields
103 + SampleSimDir    = $(OopseHome)/share/samples
104 + InstallBinDir   = $(OopseHome)/bin
105 + DocDir          = $(OopseHome)/doc
106 + FrcDeclare      = -DFRC_PATH="$(ForceParamDir)"
107 + F90Declare      = -D__FORTRAN90
108 + ParallelDeclare = -DIS_MPI
109 + UseMPI          = @USE_MPI@
110 + ModuleCase      = @F90_MODULE_NAMES@
111 + ModSuffix       = @MOD@
112 + LinkOptions = \
113 +        @F90LIBS@
114 +
115 + ParallelLinkOptions = \
116 +        @F90LIBS@
117 +
118 +
119   #---------------------------------------------------------------------------
120   #
121   #  Directories
122   #
123   #---------------------------------------------------------------------------
124  
83 srcdir = @srcdir@
125   SourceDir         = $(DEV_ROOT)/src
126   TargetDir         = $(DEV_ROOT)/obj
127   ParallelTargetDir = $(DEV_ROOT)/MPIobj
128   LibDir            = $(DEV_ROOT)/lib
129   MakeDir           = $(DEV_ROOT)/make
130 + MainMakefile      = $(MakeDir)/Makefile
131   BinDir            = $(DEV_ROOT)/bin
132   DocsDir           = $(DEV_ROOT)/docs
133   CurrentDir        = $(CURDIR)
134 + CombinedStaticLib = $(LibDir)/libOOPSE.a
135 + CombinedParallelStaticLib = $(LibDir)/libOOPSE_MPI.a
136  
137   ifdef Source
138 < Package                  = $(subst $(SourceDir)/,,$(CurrentDir))
138 > #get the relative path of current package to source directory
139 > # /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside
140 > #Package          = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g')
141 > #use shell script to get the absolute path and then rip it off from $(CurrentDir)
142 > #Package          = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
143 > # REMINDER: We are now using the Package line in each subdir makefile.
144 > # This avoids the strange path problem and the subshell
145 >
146   PackageList              = $(Package)
147   PackageSourceDir         = $(SourceDir)/$(Package)
148   PackageTargetDir         = $(TargetDir)
149   PackageParallelTargetDir = $(ParallelTargetDir)
150   JavaMainClass            = $(subst /,.,$(Package)).$(Main)
151   else
152 < PackageList              = $(Packages) $(JavaPackages)
152 > PackageList              = $(PackageLibs) $(JavaPackages) $(Applications)
153   endif
154  
155 < PackageListLoop  = $(patsubst %,$(SourceDir)/%/.loop,$(PackageList))
155 > PackageListLoop          = $(patsubst %,$(SourceDir)/%/.loop,$(PackageList))
156  
157 < JRE              = $(JAVA_HOME)/jre/lib/rt.jar
157 > JRE                      = $(JAVA_HOME)/jre/lib/rt.jar
158  
159   ifdef IS_UNIX
160   X = :
# Line 131 | Line 182 | SourceFiles            = $(JavaFiles:%.java=  $(Packag
182                                        $(YaccFiles) $(CorbaFiles), \
183                                        $(Source))
184   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)\
185  
186 + SourceFiles            = $(JavaFiles)\
187 +                         $(CppFiles)\
188 +                         $(CFiles)\
189 +                         $(FortranFiles)\
190 +                         $(F90Files)\
191 +                         $(LexFiles)\
192 +                         $(YaccFiles)
193  
194   # Target
195   JavaClassFiles         = $(JavaFiles:%.java=  $(PackageTargetDir)/%.class)
# Line 148 | Line 199 | ObjectFiles            = $(CFiles:%.c=        $(Packag
199   JniClassFiles          = $(JniSource:%.java=  $(PackageTargetDir)/%.class)
200   JniHeaders             = $(JniSource:%.java=  $(PackageSourceDir)/%.h)
201   ObjectFiles            = $(CFiles:%.c=        $(PackageTargetDir)/%.o)\
202 <                         $(CppFiles:%.cpp=    $(PackageTargetDir)/%.o)\
202 >                         $(CppFiles:%.cpp=    $(PackageTargetDir)/%.o)\
203                           $(FortranFiles:%.f=  $(PackageTargetDir)/%.o)\
204                           $(F90Files:%.F90=    $(PackageTargetDir)/%.o)\
205                           $(LexFiles:%.l=      $(PackageTargetDir)/%.o)\
# Line 168 | Line 219 | OtherTargetFiles       = $(OtherSourceFiles:%=$(Packag
219                           $(LexFiles:%.l=     %.c)
220  
221   OtherTargetFiles       = $(OtherSourceFiles:%=$(PackageTargetDir)/%)
222 +
223 + ###########################################################################
224 + #
225 + # Figure out the names of the module files based on some work done by
226 + # configure.  The tr function below is from John Graham-Cumming
227 + # (http://www.jgc.org).
228 + #
229 + # The tr function.   Has three arguments:
230 + #
231 + # $1   The list of characters to translate from
232 + # $2   The list of characters to translate to
233 + # $3   The text to translate
234 + #
235 + # For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L.
236 +
237 + tr = $(eval __t := $3)                                                    \
238 +     $(foreach c,                                                         \
239 +         $(join $(addsuffix :,$1),$2),                                    \
240 +         $(eval __t :=                                                    \
241 +             $(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \
242 +                 $(__t))))$(__t)
243 +
244 + # Common character classes for use with the tr function.  Each of
245 + # these is actually a variable declaration and must be wrapped with
246 + # $() or ${} to be used.
247 +
248 + [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 #
249 + [a-z] := a b c d e f g h i j k l m n o p q r s t u v w x y z #
250 + [0-9] := 0 1 2 3 4 5 6 7 8 9 #
251 + [A-F] := A B C D E F #
252  
253 + # Figure out whether we have $(eval) or not (GNU Make 3.80 and above)
254 + # if we do not then we need to use the shell version of tr, and not the
255 + # faster tr function above:
256 +
257 + __have_eval := $(false)
258 + __ignore := $(eval __have_eval := $(true))
259 +
260 + ifndef __have_eval
261 +  uc = $(shell echo $1 | tr "a-z" "A-Z")
262 +  lc = $(shell echo $1 | tr "A-Z" "a-z")
263 + else
264 +  uc = $(call tr,$([a-z]),$([A-Z]),$1)
265 +  lc = $(call tr,$([A-Z]),$([a-z]),$1)
266 + endif
267 +
268 + # OK, now we can actually use these functions to figure out the names
269 + # of the module files:
270 +
271 + ifneq "$(words $(Modules))" "0"
272 + ifeq "$(ModuleCase)" "UPPER"
273 +  MODULES = $(call uc,$(Modules))
274 + else
275 +  ifeq "$(ModuleCase)" "lower"
276 +    MODULES = $(call lc,$(Modules))
277 +  else
278 +    MODULES = $(Modules)
279 +  endif
280 + endif
281 +  ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix))
282 +  ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix))
283 + endif
284 + #
285 + ###########################################################################
286 +
287   ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries))
288   ThirdPartyJars    = $(subst $(Space),$(X),$(ThirdPartyJarsTmp))
289  
# Line 180 | Line 295 | ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))
295   #if Main is defined, do not build library. It may not be true sometimes
296   ifneq  "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0"
297    DependencyFile    = $(PackageSourceDir)/Makedepend
298 <  ifneq "$(Main)" ""
299 <    Executable        = $(BinDir)/$(Main)
300 <    ParallelExecutable     = $(BinDir)/$(Main)_MPI
298 >  ifneq "$(words $(Main))" "0"
299 >    Executable             = $(BinDir)/$(Main)
300 >    ifeq "$(BuiltParallelExe)" "1"
301 >      ParallelExecutable     = $(BinDir)/$(Main)_MPI
302 >    endif
303    else
304 <    SharedLibrary     = $(LibDir)/lib$(subst /,,$(Package)).so
305 <    StaticLibrary     = $(LibDir)/lib$(subst /,,$(Package)).a
306 <    ParallelSharedLibrary  = $(LibDir)/lib$(subst /,,$(Package))_MPI.so
307 <    ParallelStaticLibrary  = $(LibDir)/lib$(subst /,,$(Package))_MPI.a
304 >    SharedLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so
305 >    StaticLibrary          = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a
306 >    ParallelSharedLibrary  = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.so
307 >    ParallelStaticLibrary  = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.a
308    endif
309   endif
310 +
311   #
312   # Misc
313   #
# Line 197 | Line 315 | LocalLibs        = $(subst /,,$(PackageLibs))
315   JavaPackageNames = $(subst /,.,$(JavaPackages))
316   IncludePath      = -I$(SourceDir) $(IncludeDirs:%=-I%)
317   LibDirs          = -L$(LibDir)    $(LibraryDirs:%=-L%)
318 < LocalLibs        = $(subst /,,$(PackageLibs))
319 < LibList          = $(LocalLibs:%=-l%) $(Libraries:%=-l%)
318 > LocalLibs        = $(subst /,,$(patsubst %, oopse_%_UP, $(PackageLibs)))
319 > ParallelLocalLibs= $(subst /,,$(patsubst %, oopse_%_MPI, $(PackageLibs)))
320 > LibList          = $(LocalLibs:%=-l%) $(Libraries)
321 > LibNames         = $(LocalLibs:%=$(LibDir)/lib%.a)
322 > ParallelLibList  = $(ParallelLocalLibs:%=-l%) $(Libraries)
323 > ParallelLibNames = $(ParallelLocalLibs:%=$(LibDir)/lib%.a)
324  
325  
326   #---------------------------------------------------------------------------
# Line 207 | Line 329 | Move                   = mv
329   #
330   #---------------------------------------------------------------------------
331   Print                  = @echo
332 < Move                   = mv
332 > Move                   = mv -f
333   Copy                   = cp
334   CCompiler              = @CC@
335   CppCompiler            = @CXX@
336   Linker                 = @CXX@
337   MakeDepend             = makedepend
338 < Install                = @INSTALL@
338 > LN_S                   = @LN_S@
339 > INSTALL                = @INSTALL@
340   InstallProgram         = @INSTALL_PROGRAM@
341 + InstallScript          = @INSTALL_SCRIPT@
342   InstallData            = @INSTALL_DATA@
343 < MakeDir                = @MKINSTALLDIRS@
344 < Delete                 = rm -fr
343 > MkDir                  = @MKINSTALLDIRS@
344 > Delete                 = rm -f
345   StaticArchiver         = @AR@
346   DynamicArchiver        = @CC@
347   FortranCompiler        = @FC@
# Line 234 | Line 358 | Lex                    = @LEX@
358   List                   = cat
359   Yacc                   = @YACC@
360   Lex                    = @LEX@
361 + Ranlib                 = @RANLIB@
362 + Doxygen                = @DOXYGEN@
363  
364 <
239 < MakeOptions            = -k -s
364 > MakeOptions            = -k
365   MakeDependOptions      =
366   StaticArchiverOptions  = rc
367   DynamicArchiverOptions = -shared
# Line 244 | Line 369 | FortranOptions         =
369   JniOptions             =
370   RmiOptions             = -d $(TargetDir) -classpath $(ClassPath) \
371                           -sourcepath $(SourceDir)
372 + COptions               = $(FrcDeclare) @CFLAGS@
373 + CParallelOptions       = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@
374 + CppOptions             = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
375 + CppParallelOptions     = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@
376   FortranOptions         =
377 < F90Options             =  -I$(SourceDir) -module $(TargetDir)
377 > F90Options             =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir)
378 > F90ParallelOptions     =  @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir)  @PREPDEFFLAG@$(ParallelDeclare)
379   JavaCompilerOptions    = -d $(TargetDir) -classpath $(ClassPath) \
380                           -sourcepath $(SourceDir) -deprecation
381   JavaRunOptions         = -classpath $(ClassPath)
# Line 271 | Line 401 | Space                  = $(Empty) $(Empty)
401  
402   #---------------------------------------------------------------------------
403   #
404 + #  Install
405 + #
406 + #---------------------------------------------------------------------------
407 +
408 + ifneq "$(words $(SampleFiles))" "0"
409 +  MySample                 = $(subst $(shell cd $(DEV_ROOT)/samples; pwd)/,,$(CurrentDir))
410 +  MyInstallDir             = $(SampleSimDir)/$(MySample)
411 +  InstallFiles             = $(SampleFiles)
412 +  InstallCommand           = $(InstallData)
413 + endif
414 +
415 + ifneq "$(words $(Main))" "0"
416 +  MyInstallDir             = $(InstallBinDir)
417 +  ifeq "$(UseMPI)" "yes"
418 +    InstallFiles             = $(Executable) $(ParallelExecutable)
419 +  else
420 +    InstallFiles             = $(Executable)
421 +  endif
422 +  InstallCommand           = $(InstallProgram)
423 + endif
424 +
425 + ifneq "$(words $(ForcefieldFiles))" "0"
426 +  MyInstallDir             = $(ForceParamDir)
427 +  InstallFiles             = $(ForcefieldFiles)
428 +  InstallCommand           = $(InstallData)
429 + endif
430 +
431 + ifneq "$(words $(InstallFiles))" "0"
432 +  InstallList            =
433 + else
434 +  InstallList            = $(patsubst %,$(DEV_ROOT)/%,$(Samples)) $(DEV_ROOT)/forceFields $(patsubst %, $(SourceDir)/%,$(Applications))
435 + endif
436 +
437 + InstallListLoop          = $(patsubst %,$(SourceDir)/%/.install,$(PackageList))  $(patsubst %,%/.install,$(InstallList))
438 +
439 +
440 +
441 + #---------------------------------------------------------------------------
442 + #
443   # Rules
444   #
445   #---------------------------------------------------------------------------
# Line 281 | Line 450 | $(PackageTargetDir) :
450  
451   # Create target directory
452   $(PackageTargetDir) :
453 <        $(MakeDir) $@
453 >        $(MkDir) $@
454  
455 + $(BinDir) :
456 +        $(MkDir) $@
457 +
458   # .c -> .o
459 < $(PackageTargetDir)/%.o : $(PackageSourceDir)/%.c
459 > $(PackageTargetDir)/%.o : %.c $(MainMakefile)
460          $(Print) $@
461 <        $(Print) $(CCompiler) $(COptions) -c $(IncludePath) $< -o $@
290 <        @$(CCompiler) $(COptions) -c $(IncludePath) $< -o $@
461 >        $(CCompiler) $(COptions) -c $(IncludePath) $< -o $@
462  
463 < %.o : $(PackageSourceDir)/%.c
463 > $(PackageParallelTargetDir)/%.o : %.c $(MainMakefile)
464 >        $(Print) $@
465 >        $(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@
466 >
467 > ifeq "$(UseMPI)" "yes"
468 > %.o : %.c $(MainMakefile)
469          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
470 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
471 + else
472 + %.o : %.c $(MainMakefile)
473 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
474 + endif
475  
476   # .cpp -> .o
477 < $(PackageTargetDir)/%.o : $(PackageSourceDir)/%.cpp
297 <        $(Print) $@
298 <        $(Print) $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@
477 > $(PackageTargetDir)/%.o : %.cpp $(MainMakefile)
478          $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@
479  
480 < %.o : $(PackageSourceDir)/%.cpp
480 > $(PackageParallelTargetDir)/%.o : %.cpp $(MainMakefile)
481 >        $(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@
482 >
483 > ifeq "$(UseMPI)" "yes"
484 > %.o : %.cpp $(MainMakefile)
485          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
486 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
487 + else
488 + %.o : %.cpp $(MainMakefile)
489 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
490 + endif
491  
492   # .f -> .o
493 < $(PackageTargetDir)/%.o : $(PackageSourceDir)/%.f
494 <        $(Print) $@
307 <        $(Print) $(FortranCompiler) $(FortranOptions) -c $< -o $@
308 <        @$(FortranCompiler) $(FortranOptions) -c $< -o $@
493 > $(PackageTargetDir)/%.o : %.f $(MainMakefile)
494 >        $(FortranCompiler) $(FortranOptions) -c $< -o $@
495  
496 < %.o : $(PackageSourceDir)/%.f
496 > $(PackageParallelTargetDir)/%.o : %.f $(MainMakefile)
497 >        $(FortranCompiler) $(FortranParallelOptions) -c $< -o $@
498 >
499 > ifeq "$(UseMPI)" "yes"
500 > %.o : %.f $(MainMakefile)
501          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
502 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
503 + else
504 + %.o : %.f $(MainMakefile)
505 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
506 + endif
507  
508   # .F90 -> .o
509 < $(PackageTargetDir)/%.o : $(PackageSourceDir)/%.F90
510 <        $(Print) $@
511 <        $(Print) $(F90Compiler) $(F90Options) -c $< -o $@
512 <        @$(F90Compiler) $(F90Options) -c $< -o $@
509 > $(PackageTargetDir)/%.o : %.F90 $(MainMakefile)
510 >        $(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@
511 >        if test -n "`ls *.$(ModSuffix)`"; then \
512 >          $(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\
513 >        fi
514  
515 < %.o : $(PackageSourceDir)/%.F90
515 > $(PackageParallelTargetDir)/%.o : %.F90 $(MainMakefile)
516 >        $(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@
517 >        if test -n "`ls *.$(ModSuffix)`"; then \
518 >          $(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\
519 >        fi
520 >
521 > ifeq "$(UseMPI)" "yes"
522 > %.o : %.F90 $(MainMakefile)
523          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
524 +        if test -n "`ls *.$(ModSuffix)`"; then\
525 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
526 +        fi
527  
528 +        $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
529 +        if test -n "`ls *.$(ModSuffix)`"; then\
530 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
531 +        fi
532 +
533 + else
534 + %.o : %.F90 $(MainMakefile)
535 +        $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
536 +        if test -n "`ls *.$(ModSuffix)`"; then\
537 +          $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
538 +        fi
539 + endif
540 +
541 +
542   # .java -> .class
543   $(PackageTargetDir)/%.class : $(PackageSourceDir)/%.java
544 <        $(Print) $@
325 <        $(Print) $(JavaCompiler) $(JavaCompilerOptions) $<
326 <        @$(JavaCompiler) $(JavaCompilerOptions) $<
544 >        $(JavaCompiler) $(JavaCompilerOptions) $<
545  
546   %.class : $(PackageSourceDir)/%.java
547          @$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
548  
549   # .class -> .h
550   $(PackageSourceDir)/%.h : $(PackageTargetDir)/%.class
333        $(Print) $@
334        $(Print) $(JniCompiler) $(JniOptions) $(JavaPackageName).$*
551          $(JniCompiler) $(JniOptions) $(JavaPackageName).$*
552  
553   %.h : %.class
554          $(MAKE) $(MakeOptions) $(PackageSourceDir)/$@
555  
556   #.y -> .h
557 < $(PackageSourceDir)/%.h : $(PackageSourceDir)/%.y
558 <        $(Print) $@
343 <        $(Print) @$(Yacc) -d $?
344 <        @$(Yacc) -d  $?
557 > %.h : %.y
558 >        $(Yacc) -d  $?
559          @$(Move) y.tab.h $*.h
560          @$(Delete) y.tab.c
561  
562   #.y -> .c
563 < $(PackageSourceDir)/%.c : $(PackageSourceDir)/%.y
564 <        $(Print) $@
351 <        $(Print) $(Yacc) -d $?
352 <        @$(Yacc) -d  $?
563 > %.c : %.y
564 >        $(Yacc) -d  $?
565          @$(Move) y.tab.c $*.c
566          @$(Delete) y.tab.h
567  
568   # .l -> .c
569 < $(PackageSourceDir)/%.c : $(PackageSourceDir)/%.l
569 > %.c : %.l
570          $(Print) $@
571          $(Print) $(Lex) -o$@ $?
572          @$(Lex) -o$@ $?
573  
574   # .o -> .a
363 $(LibDir)/%.a : $(ObjectFiles)
364        $(Print) $@
365        $(Print) $(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles)
366        @$(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles)
575  
576 < %.a : $(ObjectFiles)
577 <        $(MAKE) $(MakeOptions) $(LibDir)/$@
576 > $(LibDir)/%_UP.a : $(ObjectFiles)
577 >        $(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles)
578 >        @touch $(LibDir)/.stamp_UP
579  
580 < $(LibDir)/%_MPI.a : $(ParallelObjectFiles)
581 <        $(Print) $@
582 <        $(Print) $(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles)
374 <        @$(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles)
580 > $(LibDir)/%_MPI.a: $(ParallelObjectFiles)
581 >        $(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles)
582 >        @touch $(LibDir)/.stamp_MPI
583  
584 + %_UP.a : $(ObjectFiles)
585 +        $(MAKE) $(MakeOptions) $(LibDir)/$@
586 +
587   %_MPI.a : $(ParallelObjectFiles)
588          $(MAKE) $(MakeOptions) $(LibDir)/$@
589  
590   # .o -> .so
591 < $(LibDir)/%.so : $(ObjectFiles)
381 <        $(Print) $@    
382 <        $(Print) $(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@
591 > $(LibDir)/%_UP.so : $(ObjectFiles)
592          $(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@
593  
385 %.so : $(ObjectFiles)
386        $(MAKE) $(MakeOptions) $(LibDir)/$@
387
594   $(LibDir)/%_MPI.so : $(ParallelObjectFiles)
389        $(Print) $@    
390        $(Print) $(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@
595          $(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@
596  
597 + %_UP.so : $(ObjectFiles)
598 +        $(MAKE) $(MakeOptions) $(LibDir)/$@
599 +
600   %_MPI.so : $(ParallelObjectFiles)
601          $(MAKE) $(MakeOptions) $(LibDir)/$@
602  
603   # .class -> .jar
604   $(LibDir)/%.jar : $(JavaClassFiles) $(OtherTargetFiles)
605          $(Print) $@
399        $(Print) $(JavaArchiver) -cf $@ $(JavaClassFilesRel) $(OtherTargetFiles)
606          @cd $(TargetDir); $(JavaArchiver) -cf $@ \
607          $(JavaClassFilesRel) $(OtherTargetFiles)
608  
# Line 426 | Line 632 | $(PackageTargetDir)/%_Skel.class : $(PackageTargetDir)
632   %_Skel.class : %.class
633          $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
634  
635 + document :
636 +        $(Print) Generate Documentation for OOPSE-2.0
637 +        @cd $(DEV_ROOT)/src    
638 +        $(Doxygen) $(DEV_ROOT)/make/Doxyfile
639 +
640 + #GUN make funtions to merge the libraries
641 + find_objs = $(shell $(StaticArchiver) -t $(1))
642 + extract_objs = $(shell $(StaticArchiver) -x $(1) $(call find_objs, $(1)))
643 + create_archive = $(shell  $(StaticArchiver) $(StaticArchiverOptions) $(2) $(call find_objs, $(1)))
644 + remove_objs = $(shell $(Delete) $(call find_objs, $(1)))
645 + do_create = $(call extract_objs,$(1))$(call create_archive,$(1),$(2))$(call remove_objs,$(1))  
646 + do_link = $(shell $(LN_S) $(1) $(2))
647 +
648 + $(CombinedStaticLib) : $(LibDir)/.stamp_UP
649 +        $(Print) create $@      
650 +        $(foreach thisLib,$(LibNames),$(call do_create,$(thisLib),$@))
651 +        $(Ranlib) $(CombinedStaticLib)
652 +
653 + $(CombinedParallelStaticLib) : $(LibDir)/.stamp_MPI
654 +        $(Print) create $@
655 +        $(foreach thisLib,$(ParallelLibNames), $(call do_create, $(thisLib), $@))
656 +        $(Ranlib) $(CombinedParallelStaticLib)
657 +
658   # Executable
659 < $(Executable) : $(ObjectFiles)
660 <        $(Print) $@
432 <        $(Print) $(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ObjectFiles) -o $@
433 <        $(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ObjectFiles) -o $@
659 > $(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir)
660 >        $(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@
661  
662 < $(ParallelExecutable) : $(ParallelObjectFiles)
663 <        $(Print) $@
437 <        $(Print) $(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ParallelObjectFiles) -o $@
438 <        $(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ParallelObjectFiles) -o $@
662 > $(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) $(BinDir)
663 >        $(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@
664  
665   # Anything else is just copied from source to target
666   $(PackageTargetDir)/% : $(PackageSourceDir)/%
# Line 448 | Line 673 | _buildall : \
673  
674   _all : _buildall
675  
676 + _buildall :
677 + ifeq "$(UseMPI)" "yes"
678   _buildall : \
679          $(DependencyFile) \
680          $(PackageTargetDir) \
681          $(ObjectFiles) \
682 +        $(ParallelObjectFiles) \
683          $(JavaClassFiles) \
684          $(RmiStubFiles) \
685          $(RmiSkeletonFiles) \
686          $(OtherTargetFiles) \
459        $(SharedLibrary) \
687          $(StaticLibrary) \
688 +        $(ParallelStaticLibrary) \
689          $(JarFile) \
690 <        $(Executable)
690 >        $(Executable) \
691 >        $(ParallelExecutable)
692 > else
693 > _buildall : \
694 >        $(DependencyFile) \
695 >        $(PackageTargetDir) \
696 >        $(ObjectFiles) \
697 >        $(JavaClassFiles) \
698 >        $(RmiStubFiles) \
699 >        $(RmiSkeletonFiles) \
700 >        $(OtherTargetFiles) \
701 >        $(StaticLibrary) \
702 >        $(JarFile) \
703 >        $(Executable)
704 > endif
705  
706 + echo : $(PackageListLoop)
707 +        $(Print) Done echo.
708  
709 + _echoall :
710 +        $(Print) $(Modules)
711 +
712   # make clean
713   clean : $(PackageListLoop)
714          $(Print) Done clean.    
715  
716   _cleanall :
717 <        $(Delete) $(PackageTargetDir)/* \
718 <                  $(JarFile) \
719 <                  $(SharedLibrary) \
720 <                  $(StaticLibrary) \
721 <                  $(Executable) \
722 <                  $(DependencyFile)
717 >        $(Delete) \
718 >                $(ObjectFiles) \
719 >                $(ModuleFiles) \
720 >                $(ParallelObjectFiles) \
721 >                $(ParallelModuleFiles) \
722 >                $(JarFile) \
723 >                $(SharedLibrary) \
724 >                $(StaticLibrary) \
725 >                $(ParallelSharedLibrary) \
726 >                $(ParallelStaticLibrary) \
727 >                $(CombinedStaticLib) \
728 >                $(CombinedParallelStaticLib)
729  
730 + # make distclean
731 + distclean : $(PackageListLoop)
732 +        $(Print) Done clean.    
733  
734 + _distcleanall : _cleanall
735 +        $(Delete) $(Executable) \
736 +                  $(ParallelExecutable) \
737 +                  $(DependencyFile)
738 +
739   # make depend
740   depend : $(PackageListLoop)
741          $(Print) Done dependencies.
# Line 485 | Line 746 | $(DependencyFile) : $(DerivedSource)
746          $(Print) $@
747          @cd $(PackageSourceDir)
748  
488        touch Make.ctemp
489        touch Make.ctemp
490
749   ifneq "$(words $(CppFiles))" "0"
750 <        $(Print) Make dependencies for $(CppFiles)
751 <        $(Print) $(CppCompiler) $(IncludePath) -MM $(CppFiles)  > Make.cpptemp
752 <        $(CppCompiler) $(IncludePath) -MM $(CppFiles)  > Make.cpptemp
753 <        cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile)
754 <        cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile)
750 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CppFiles)>> Make.cpptemp
751 >        @cat Make.cpptemp  >> $(DependencyFile)
752 >        $(Delete) Make.cpptemp
753 >
754 >  ifeq "$(UseMPI)" "yes"
755 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CppFiles)>> Make.cpptemp
756 >        @cat Make.cpptemp  >> $(DependencyFile)
757 >        @$(Delete) Make.cpptemp
758 >  endif
759 >
760   endif
761  
762   ifneq "$(words $(CFiles))" "0"
763 <        $(Print) Make dependencies for $(CFiles)
764 <        $(Print) $(CCompiler)   $(IncludePath) -MM $(CFiles) $(DerivedCFiles)   > Make.ctemp
765 <        $(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)
763 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/'  -MM $(CFiles) $(DerivedCFiles)  >> Make.ctemp
764 >        @cat Make.ctemp  >> $(DependencyFile)
765 >        $(Delete) Make.ctemp
766  
767 +  ifeq "$(UseMPI)" "yes"
768 +        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CFiles) $(DerivedCFiles)  >> Make.ctemp
769 +        @cat Make.ctemp  >> $(DependencyFile)
770 +        @$(Delete) Make.ctemp
771 +  endif
772 +
773   endif
774  
775   ifneq "$(words $(F90Files))" "0"
776 <        $(Print) Make dependencies for $(F90Files)
777 <        $(DEV_ROOT)/scripts/sfmakedepend  -I $(DEV_ROOT)/src -d '$$(DEV_ROOT)/obj' -f ./Make.ftemp -h *.F90
778 <        cat Make.ftemp >> $(DependencyFile)
776 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp
777 >        @cat Make.ftemp >> $(DependencyFile)
778 >        @$(Delete) Make.ftemp
779 >
780 >  ifeq "$(UseMPI)" "yes"
781 >        $(DEV_ROOT)/scripts/filepp  -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix)  $(F90Files) >> Make.ftemp
782 >        @cat Make.ftemp >> $(DependencyFile)
783 >        @$(Delete) Make.ftemp
784 >  endif
785 >
786   endif
513        $(Delete) Make.cpptemp Make.ctemp Make.ftemp
787  
788   # make lib
789   lib    : $(PackageListLoop)
# Line 523 | Line 796 | jarsign : $(JarFile)
796   jarsign : $(JarFile)
797          $(JarSigner) -keystore GeoSoftKeystore $(JarFile) myself
798  
799 + #make install
800 + %.install :
801 +        @$(MAKE) $(MakeOptions) -C $(subst .install,,$@) _installall    
802 +
803 + install : $(InstallListLoop)
804 +        $(Print) Done Install
805 +
806 + _installall : _buildall _installdata _installlinks
807 +
808 + $(MyInstallDir) :
809 +        $(MkDir) $@
810 +
811 + _installdata :  $(MyInstallDir)
812 +        $(Print) $(InstallFiles)
813 + ifneq "$(words $(InstallFiles))" "0"
814 +        $(InstallCommand) $(InstallFiles) $(MyInstallDir)
815 + endif      
816 +
817 + _installlinks :  $(MyInstallDir)
818 +        $(Print) $(LinkTargets)
819 + ifneq "$(words $(LinkTargets))" "0"
820 +        @cd $(MyInstallDir)
821 +        $(foreach thisLink,$(LinkTargets),$(call do_link,$(Executable),$(thisLink)))
822 + endif      
823 +
824   # make statistics
825   _statisticsall :
826 <        @$(Print) $(SourceFiles) >> $(DEV_ROOT)/files.tmp
826 >        @$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp
827  
828   statistics : $(PackageListLoop)
829          @$(List) $(DEV_ROOT)/files.tmp | xargs $(WordCount) $(WordCountOptions)
# Line 533 | Line 831 | $(Executable).pure :
831          $(Print) Done statistics.
832  
833   # make pure
834 < $(Executable).pure :
835 <        $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \
836 <        $(LibList) $(ObjectFiles) -o $@
834 > #$(Executable).pure :
835 > #       $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \
836 > #       $(LibList) $(ObjectFiles) -o $@
837 > #
838 > #pure : $(Executable).pure
839  
840 < pure : $(Executable).pure
840 > #make cvslog
841 > cvslog:
842 >        $(DEV_ROOT)/scripts/cvs2cl
843  
844   # Execute
845   _runexe :

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines