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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines