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

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines