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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines