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

Comparing trunk/OOPSE-4/make/Makefile.in (file contents):
Revision 1510 by tim, Wed Sep 29 18:37:08 2004 UTC vs.
Revision 2316 by gezelter, Tue Sep 20 22:13:44 2005 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines