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 2202 by tim, Fri Apr 15 18:41:38 2005 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines