ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/make/Makefile.in
(Generate patch)

Comparing trunk/OOPSE-3.0/make/Makefile.in (file contents):
Revision 1508 by gezelter, Wed Sep 29 17:56:08 2004 UTC vs.
Revision 2457 by tim, Fri Nov 18 20:17:14 2005 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines