ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/devel_omp/make/Makefile.in
Revision: 1167
Committed: Fri Jul 13 14:20:08 2007 UTC (18 years ago) by gezelter
Original Path: trunk/make/Makefile.in
File size: 28327 byte(s)
Log Message:
Install process is incomplete

File Contents

# Content
1 #---------------------------------------------------------------------------
2 # (C) 1999 - 2002 Jacob Dreyer - Geotechnical Software Services
3 # jacob.dreyer@geosoft.no - http://geosoft.no
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18 # MA 02111-1307, USA.
19 #---------------------------------------------------------------------------
20 #---------------------------------------------------------------------------
21 #
22 # GnuMake crash course:
23 #
24 # target : depends
25 # rule
26 #
27 # target - the parameter given to make. I.e. what to build
28 # depends - file or other targets target depends on
29 # rule - how to create target (note that rule is preceeded by a TAB char)
30 # $(VAR) - environment variable or variable defined above
31 # $@ - Current target
32 # $* - Current target without extension
33 # $< - Current dependency
34 #
35 #---------------------------------------------------------------------------
36 IS_UNIX=1
37
38 #packages containing libraries
39 PackageLibs = \
40 utils \
41 visitors \
42 QuickHull \
43 math \
44 types \
45 primitives \
46 UseTheForce/DarkSide \
47 UseTheForce \
48 brains \
49 io \
50 integrators\
51 constraints \
52 minimizers \
53 selection \
54 restraints \
55 lattice \
56 hydrodynamics \
57 openbabel\
58 antlr\
59 mdParser
60 #packages containing applications
61 Applications = \
62 applications/oopse \
63 applications/dump2Xyz \
64 applications/staticProps \
65 applications/dynamicProps \
66 applications/simpleBuilder \
67 applications/randomBuilder \
68 applications/nanoparticleBuilder \
69 applications/thermalizer \
70 applications/atom2md \
71 applications/hydrodynamics \
72 applications/utilities
73
74
75 Samples = \
76 samples/builders \
77 samples/alkane \
78 samples/argon \
79 samples/cutoff \
80 samples/dipole \
81 samples/gbljtest \
82 samples/lipid \
83 samples/metals/EAM \
84 samples/metals/EAM/nanoparticle \
85 samples/metals/EAM/nanorod \
86 samples/metals/Sutton-Chen \
87 samples/minimizer \
88 samples/thermoIntegration/liquid \
89 samples/thermoIntegration/solid \
90 samples/water/dimer \
91 samples/water/spce \
92 samples/water/ssd \
93 samples/water/ssde \
94 samples/water/ssdrf \
95 samples/water/ssd-ion \
96 samples/water/tip3p_ice \
97 samples/water/tip4p \
98 samples/zcons
99
100 IncludeDirs = \
101 @MPI_INC_DIR@ \
102 @FFTW_INC_DIR@ \
103 @ZLIB_INC_DIR@
104
105 LibraryDirs = \
106 @MPI_LIB_DIR@ \
107 @FFTW_LIB_DIR@ \
108 @ZLIB_LIB_DIR@
109
110 Libraries = \
111 @LIBS@ \
112 @MPI_LIB@ \
113 @MPI_F90_LIB@ \
114 @FFTW_LIBS@ \
115 @ZLIB@
116
117 OopseHome = @OOPSE_HOME@
118 ForceParamDir = $(OopseHome)/forceFields
119 SampleSimDir = $(OopseHome)/samples
120 InstallBinDir = $(OopseHome)/bin
121 DocDir = $(OopseHome)/doc
122 FrcDeclare = -DFRC_PATH="$(ForceParamDir)"
123 F90Declare = -D__FORTRAN90
124 UseSingle = @USE_SINGLE_PRECISION@
125 ifeq "$(UseSingle)" "yes"
126 SingleDeclare = -DSINGLE_PRECISION
127 else
128 SingleDeclare =
129 endif
130 ParallelDeclare = -DIS_MPI
131 SinglePrecision = -DSINGLE_PRECISION
132 UseMPI = @USE_MPI@
133 ModuleCase = @F90_MODULE_NAMES@
134 ModSuffix = @MOD@
135 LinkOptions = \
136 @LDFLAGS@ \
137 @FCLIBS@ \
138 @CXXFLAGS@
139
140
141 ParallelLinkOptions = \
142 @LDFLAGS@ \
143 @FCLIBS@ \
144 @CXXFLAGS@
145
146
147 #---------------------------------------------------------------------------
148 #
149 # Directories
150 #
151 #---------------------------------------------------------------------------
152
153 SourceDir = $(DEV_ROOT)/src
154 TargetDir = $(DEV_ROOT)/obj
155 ParallelTargetDir = $(DEV_ROOT)/MPIobj
156 LibDir = $(DEV_ROOT)/lib
157 MakeDir = $(DEV_ROOT)/make
158 MainMakefile = $(MakeDir)/Makefile
159 BinDir = $(DEV_ROOT)/bin
160 DocsDir = $(DEV_ROOT)/docs
161 CurrentDir = $(CURDIR)
162 CombinedStaticLib = $(LibDir)/libOOPSE.a
163 CombinedParallelStaticLib = $(LibDir)/libOOPSE_MPI.a
164
165 ifdef Source
166 #get the relative path of current package to source directory
167 # /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside
168 #Package = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g')
169 #use shell script to get the absolute path and then rip it off from $(CurrentDir)
170 #Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir))
171 # REMINDER: We are now using the Package line in each subdir makefile.
172 # This avoids the strange path problem and the subshell
173
174 PackageList = $(Package)
175 PackageSourceDir = $(SourceDir)/$(Package)
176 PackageTargetDir = $(TargetDir)
177 PackageParallelTargetDir = $(ParallelTargetDir)
178 JavaMainClass = $(subst /,.,$(Package)).$(Main)
179 else
180 PackageList = $(PackageLibs) $(JavaPackages) $(Applications)
181 endif
182
183 PackageListLoop = $(patsubst %,$(SourceDir)/%/.loop,$(PackageList))
184
185 JRE = $(JAVA_HOME)/jre/lib/rt.jar
186
187 ifdef IS_UNIX
188 X = :
189 else
190 X = \;
191 endif
192
193 #---------------------------------------------------------------------------
194 #
195 # Classification of files
196 #
197 #---------------------------------------------------------------------------
198
199 # Source
200 JavaFiles = $(filter %.java, $(Source))
201 CppFiles = $(filter %.cpp, $(Source))
202 CFiles = $(filter %.c, $(Source))
203 FortranFiles = $(filter %.f, $(Source))
204 F90Files = $(filter %.F90, $(Source))
205 CorbaFiles = $(filter %.idl, $(Source))
206 LexFiles = $(filter %.l, $(Source))
207 YaccFiles = $(filter %.y, $(Source))
208 OtherSourceFiles = $(filter-out $(JavaFiles) $(CppFiles) $(CFiles) \
209 $(FortranFiles) $(F90Files) $(LexFiles) \
210 $(YaccFiles) $(CorbaFiles), \
211 $(Source))
212 ManifestFile = $(PackageSourceDir)/Manifest
213
214 SourceFiles = $(JavaFiles)\
215 $(CppFiles)\
216 $(CFiles)\
217 $(FortranFiles)\
218 $(F90Files)\
219 $(LexFiles)\
220 $(YaccFiles)
221
222 # Target
223 JavaClassFiles = $(JavaFiles:%.java= $(PackageTargetDir)/%.class)
224 JavaClassFilesRel = $(JavaFiles:%.java= $(Package)/%.class)
225 RmiStubFiles = $(RmiSource:%.java= $(PackageTargetDir)/%_Stub.class)
226 RmiSkeletonFiles = $(RmiSource:%.java= $(PackageTargetDir)/%_Skel.class)
227 JniClassFiles = $(JniSource:%.java= $(PackageTargetDir)/%.class)
228 JniHeaders = $(JniSource:%.java= $(PackageSourceDir)/%.h)
229 ObjectFiles = $(CFiles:%.c= $(PackageTargetDir)/%.o)\
230 $(CppFiles:%.cpp= $(PackageTargetDir)/%.o)\
231 $(FortranFiles:%.f= $(PackageTargetDir)/%.o)\
232 $(F90Files:%.F90= $(PackageTargetDir)/%.o)\
233 $(LexFiles:%.l= $(PackageTargetDir)/%.o)\
234 $(YaccFiles:%.y= $(PackageTargetDir)/%.o)
235 ParallelObjectFiles = $(CFiles:%.c= $(PackageParallelTargetDir)/%.o)\
236 $(CppFiles:%.cpp= $(PackageParallelTargetDir)/%.o)\
237 $(FortranFiles:%.f= $(PackageParallelTargetDir)/%.o)\
238 $(F90Files:%.F90= $(PackageParallelTargetDir)/%.o)\
239 $(LexFiles:%.l= $(PackageParallelTargetDir)/%.o)\
240 $(YaccFiles:%.y= $(PackageParallelTargetDir)/%.o)
241
242 DerivedSource = $(YaccFiles:%.y= %.h) \
243 $(YaccFiles:%.y= %.c) \
244 $(LexFiles:%.l= %.c)
245
246 DerivedCFiles = $(YaccFiles:%.y= %.c) \
247 $(LexFiles:%.l= %.c)
248
249 OtherTargetFiles = $(OtherSourceFiles:%=$(PackageTargetDir)/%)
250
251 ###########################################################################
252 #
253 # Figure out the names of the module files based on some work done by
254 # configure. The tr function below is from John Graham-Cumming
255 # (http://www.jgc.org).
256 #
257 # The tr function. Has three arguments:
258 #
259 # $1 The list of characters to translate from
260 # $2 The list of characters to translate to
261 # $3 The text to translate
262 #
263 # For example, $(call tr,A B C,1 2 3,CAPITAL) becomes 21PIT1L.
264
265 tr = $(eval __t := $3) \
266 $(foreach c, \
267 $(join $(addsuffix :,$1),$2), \
268 $(eval __t := \
269 $(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)), \
270 $(__t))))$(__t)
271
272 # Common character classes for use with the tr function. Each of
273 # these is actually a variable declaration and must be wrapped with
274 # $() or ${} to be used.
275
276 [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 #
277 [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 #
278 [0-9] := 0 1 2 3 4 5 6 7 8 9 #
279 [A-F] := A B C D E F #
280
281 # Figure out whether we have $(eval) or not (GNU Make 3.80 and above)
282 # if we do not then we need to use the shell version of tr, and not the
283 # faster tr function above:
284
285 __have_eval := $(false)
286 __ignore := $(eval __have_eval := $(true))
287
288 ifndef __have_eval
289 uc = $(shell echo $1 | tr "a-z" "A-Z")
290 lc = $(shell echo $1 | tr "A-Z" "a-z")
291 else
292 uc = $(call tr,$([a-z]),$([A-Z]),$1)
293 lc = $(call tr,$([A-Z]),$([a-z]),$1)
294 endif
295
296 # OK, now we can actually use these functions to figure out the names
297 # of the module files:
298
299 ifneq "$(words $(Modules))" "0"
300 ifeq "$(ModuleCase)" "UPPER"
301 MODULES = $(call uc,$(Modules))
302 else
303 ifeq "$(ModuleCase)" "lower"
304 MODULES = $(call lc,$(Modules))
305 else
306 MODULES = $(Modules)
307 endif
308 endif
309 ModuleFiles = $(MODULES:%= $(PackageTargetDir)/%.$(ModSuffix))
310 ParallelModuleFiles = $(MODULES:%= $(PackageParallelTargetDir)/%.$(ModSuffix))
311 endif
312 #
313 ###########################################################################
314
315 ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries))
316 ThirdPartyJars = $(subst $(Space),$(X),$(ThirdPartyJarsTmp))
317
318 ifneq "$(words $(JavaFiles))" "0"
319 JavaPackageName = $(subst /,.,$(Package))
320 JarFile = $(LibDir)/$(subst /,,$(Package)).jar
321 endif
322
323 #if Main is defined, do not build library. It may not be true sometimes
324 ifneq "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0"
325 DependencyFile = $(PackageSourceDir)/Makedepend
326 ifneq "$(words $(Main))" "0"
327 Executable = $(BinDir)/$(Main)
328 ifeq "$(BuiltParallelExe)" "1"
329 ParallelExecutable = $(BinDir)/$(Main)_MPI
330 endif
331 else
332 SharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so
333 StaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a
334 ParallelSharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.so
335 ParallelStaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.a
336 endif
337 endif
338
339 #
340 # Misc
341 #
342 ClassPath = $(JRE)$(X)$(TargetDir)$(X)$(ThirdPartyJars)
343 JavaPackageNames = $(subst /,.,$(JavaPackages))
344 IncludePath = -I$(SourceDir) $(IncludeDirs:%=-I%)
345 LibDirs = -L$(LibDir) $(LibraryDirs:%=-L%)
346 LocalLibs = $(subst /,,$(patsubst %, oopse_%_UP, $(PackageLibs)))
347 ParallelLocalLibs= $(subst /,,$(patsubst %, oopse_%_MPI, $(PackageLibs)))
348 LibList = $(LocalLibs:%=-l%) $(Libraries)
349 LibNames = $(LocalLibs:%=$(LibDir)/lib%.a)
350 ParallelLibList = $(ParallelLocalLibs:%=-l%) $(Libraries)
351 ParallelLibNames = $(ParallelLocalLibs:%=$(LibDir)/lib%.a)
352
353
354 #---------------------------------------------------------------------------
355 #
356 # Tools & Options
357 #
358 #---------------------------------------------------------------------------
359 Print = @echo
360 Move = mv -f
361 Copy = cp
362 CCompiler = @CC@
363 CppCompiler = @CXX@
364 Linker = @CXX@
365 MakeDepend = makedepend
366 LN_S = @LN_S@
367 INSTALL = @INSTALL@
368 EGREP = @EGREP@
369 InstallProgram = @INSTALL_PROGRAM@
370 InstallScript = @INSTALL_SCRIPT@
371 InstallData = @INSTALL_DATA@
372 MkDir = @MKINSTALLDIRS@
373 Delete = rm -f
374 StaticArchiver = @AR@
375 DynamicArchiver = @CC@
376 FortranCompiler = @FC@
377 JavaCompiler = $(JAVA_HOME)/bin/javac
378 JavaArchiver = $(JAVA_HOME)/bin/jar
379 JarSigner = $(JAVA_HOME)/bin/jarsigner
380 JavadocGenerator = $(JAVA_HOME)/bin/javadoc
381 JniCompiler = $(JAVA_HOME)/bin/javah
382 RmiCompiler = $(JAVA_HOME)/bin/rmic
383 JavaExecute = $(JAVA_HOME)/bin/java
384 Purify = purify
385 WordCount = wc
386 List = cat
387 Yacc = @YACC@
388 Lex = @LEX@
389 Ranlib = @RANLIB@
390 Doxygen = @DOXYGEN@
391
392 MakeOptions = -k
393 MakeDependOptions =
394 StaticArchiverOptions = rc
395 DynamicArchiverOptions = -shared
396 JavaArchiverOptions =
397 JniOptions =
398 RmiOptions = -d $(TargetDir) -classpath $(ClassPath) \
399 -sourcepath $(SourceDir)
400 COptions = $(FrcDeclare) $(SingleDeclare) @CFLAGS@
401 CParallelOptions = $(FrcDeclare) $(SingleDeclare) $(ParallelDeclare) @CFLAGS@
402 CppOptions = $(FrcDeclare) $(SingleDeclare) @CXXFLAGS@
403 CppParallelOptions = $(FrcDeclare) $(SingleDeclare) $(ParallelDeclare) @CXXFLAGS@
404 ifeq "$(UseSingle)" "yes"
405 FortranOptions = @FCFLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir) @PREPDEFFLAG@$(SingleDeclare) @FCFLAGS_SRCEXT@
406 FortranParallelOptions = @FCFLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir) @PREPDEFFLAG@$(SingleDeclare) @PREPDEFFLAG@$(ParallelDeclare) @FCFLAGS_SRCEXT@
407 else
408 FortranOptions = @FCFLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir) @FCFLAGS_SRCEXT@
409 FortranParallelOptions = @FCFLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) @FCFLAGS_SRCEXT@
410 endif
411 JavaCompilerOptions = -d $(TargetDir) -classpath $(ClassPath) \
412 -sourcepath $(SourceDir) -deprecation
413 JavaRunOptions = -classpath $(ClassPath)
414 PurifyOptions =
415 JavadocOptions = -d $(DocsDir) \
416 -sourcepath $(SourceDir) \
417 -classpath $(ClassPath) \
418 -author \
419 -package \
420 -use \
421 -splitIndex \
422 -version \
423 -link file:$(JAVA_HOME)/docs/api \
424 -windowtitle $(JavadocWindowTitle) \
425 -doctitle $(JavadocDocTitle) \
426 -header $(JavadocHeader) \
427 -bottom $(JavadocFooter)
428 WordCountOptions = --lines
429
430 Empty =
431 Space = $(Empty) $(Empty)
432
433
434 #---------------------------------------------------------------------------
435 #
436 # Install
437 #
438 #---------------------------------------------------------------------------
439
440 ifneq "$(words $(SampleFiles))" "0"
441 MySample = $(subst $(shell cd $(DEV_ROOT)/samples; pwd)/,,$(CurrentDir))
442 MyInstallDir = $(SampleSimDir)/$(MySample)
443 InstallFiles = $(SampleFiles)
444 InstallCommand = $(InstallData)
445 endif
446
447 ifneq "$(words $(ScriptFiles))" "0"
448 MyInstallDir = $(InstallBinDir)
449 InstallFiles = $(ScriptFiles)
450 InstallCommand = $(InstallProgram)
451 endif
452
453 ifneq "$(words $(DocFiles))" "0"
454 MyInstallDir = $(InstallDocDir)
455 InstallFiles = $(DocFiles)
456 InstallCommand = $(InstallData)
457 endif
458
459 ifneq "$(words $(RootFiles))" "0"
460 MyInstallDir = $(OopseHome)
461 InstallFiles = $(RootFiles)
462 InstallCommand = $(InstallData)
463 endif
464
465 ifneq "$(words $(Main))" "0"
466 MyInstallDir = $(InstallBinDir)
467 ifeq "$(UseMPI)" "yes"
468 InstallFiles = $(Executable) $(ParallelExecutable)
469 else
470 InstallFiles = $(Executable)
471 endif
472 InstallCommand = $(InstallProgram)
473 ifneq "$(words $(LinkTargets))" "0"
474 MyLinkSource = $(patsubst %, $(MyInstallDir)/%,$(Main))
475 MyLinkTargets = $(patsubst %, $(MyInstallDir)/%,$(LinkTargets))
476 endif
477 endif
478
479 ifneq "$(words $(ForcefieldFiles))" "0"
480 MyInstallDir = $(ForceParamDir)
481 InstallFiles = $(ForcefieldFiles)
482 InstallCommand = $(InstallData)
483 endif
484
485 ifneq "$(words $(InstallFiles))" "0"
486 InstallList =
487 else
488 InstallList = $(patsubst %,$(DEV_ROOT)/%,$(Samples)) $(DEV_ROOT)/forceFields $(patsubst %, $(SourceDir)/%,$(Applications))
489 endif
490
491 InstallListLoop = $(patsubst %,$(SourceDir)/%/.install,$(PackageList)) $(patsubst %,%/.install,$(InstallList))
492
493
494
495 #---------------------------------------------------------------------------
496 #
497 # Rules
498 #
499 #---------------------------------------------------------------------------
500 default : build
501
502 %.loop :
503 @$(MAKE) $(MakeOptions) -C $(subst .loop,,$@) _$(MAKECMDGOALS)all
504
505 # Create target directory
506 $(PackageTargetDir) :
507 $(MkDir) $@
508
509 $(BinDir) :
510 $(MkDir) $@
511
512 # .c -> .o
513 $(PackageTargetDir)/%.o : %.c $(MainMakefile)
514 $(Print) $@
515 $(CCompiler) $(COptions) -c $(IncludePath) $< -o $@
516
517 $(PackageParallelTargetDir)/%.o : %.c $(MainMakefile)
518 $(Print) $@
519 $(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@
520
521 ifeq "$(UseMPI)" "yes"
522 %.o : %.c $(MainMakefile)
523 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
524 $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
525 else
526 %.o : %.c $(MainMakefile)
527 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
528 endif
529
530 # .cpp -> .o
531 $(PackageTargetDir)/%.o : %.cpp $(MainMakefile)
532 $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@
533
534 $(PackageParallelTargetDir)/%.o : %.cpp $(MainMakefile)
535 $(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@
536
537 ifeq "$(UseMPI)" "yes"
538 %.o : %.cpp $(MainMakefile)
539 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
540 $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
541 else
542 %.o : %.cpp $(MainMakefile)
543 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
544 endif
545
546 # .f -> .o
547 $(PackageTargetDir)/%.o : %.f $(MainMakefile)
548 $(FortranCompiler) $(FortranOptions) -c $< -o $@
549
550 $(PackageParallelTargetDir)/%.o : %.f $(MainMakefile)
551 $(FortranCompiler) $(FortranParallelOptions) -c $< -o $@
552
553 ifeq "$(UseMPI)" "yes"
554 %.o : %.f $(MainMakefile)
555 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
556 $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
557 else
558 %.o : %.f $(MainMakefile)
559 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
560 endif
561
562 # .F90 -> .o
563 $(PackageTargetDir)/%.o : %.F90 $(MainMakefile)
564 $(FortranCompiler) $(FortranOptions) $(IncludePath) -c $< -o $@
565 if test -n "`ls *.$(ModSuffix)`"; then \
566 $(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\
567 fi
568
569 $(PackageParallelTargetDir)/%.o : %.F90 $(MainMakefile)
570 $(FortranCompiler) $(FortranParallelOptions) $(IncludePath) -c $< -o $@
571 if test -n "`ls *.$(ModSuffix)`"; then \
572 $(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\
573 fi
574
575 ifeq "$(UseMPI)" "yes"
576 %.o : %.F90 $(MainMakefile)
577 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
578 if test -n "`ls *.$(ModSuffix)`"; then\
579 $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
580 fi
581
582 $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
583 if test -n "`ls *.$(ModSuffix)`"; then\
584 $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
585 fi
586
587 else
588 %.o : %.F90 $(MainMakefile)
589 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
590 if test -n "`ls *.$(ModSuffix)`"; then\
591 $(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\
592 fi
593 endif
594
595
596 # .java -> .class
597 $(PackageTargetDir)/%.class : $(PackageSourceDir)/%.java
598 $(JavaCompiler) $(JavaCompilerOptions) $<
599
600 %.class : $(PackageSourceDir)/%.java
601 @$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
602
603 # .class -> .h
604 $(PackageSourceDir)/%.h : $(PackageTargetDir)/%.class
605 $(JniCompiler) $(JniOptions) $(JavaPackageName).$*
606
607 %.h : %.class
608 $(MAKE) $(MakeOptions) $(PackageSourceDir)/$@
609
610 #.y -> .h
611 %.h : %.y
612 $(Yacc) -d $?
613 @$(Move) y.tab.h $*.h
614 @$(Delete) y.tab.c
615
616 #.y -> .c
617 %.c : %.y
618 $(Yacc) -d $?
619 @$(Move) y.tab.c $*.c
620 @$(Delete) y.tab.h
621
622 # .l -> .c
623 %.c : %.l
624 $(Print) $@
625 $(Print) $(Lex) -o$@ $?
626 @$(Lex) -o$@ $?
627
628 # .o -> .a
629
630 $(LibDir)/%_UP.a : $(ObjectFiles)
631 $(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles)
632 @touch $(LibDir)/.stamp_UP
633
634 $(LibDir)/%_MPI.a: $(ParallelObjectFiles)
635 $(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles)
636 @touch $(LibDir)/.stamp_MPI
637
638 %_UP.a : $(ObjectFiles)
639 $(MAKE) $(MakeOptions) $(LibDir)/$@
640
641 %_MPI.a : $(ParallelObjectFiles)
642 $(MAKE) $(MakeOptions) $(LibDir)/$@
643
644 # .o -> .so
645 $(LibDir)/%_UP.so : $(ObjectFiles)
646 $(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@
647
648 $(LibDir)/%_MPI.so : $(ParallelObjectFiles)
649 $(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@
650
651 %_UP.so : $(ObjectFiles)
652 $(MAKE) $(MakeOptions) $(LibDir)/$@
653
654 %_MPI.so : $(ParallelObjectFiles)
655 $(MAKE) $(MakeOptions) $(LibDir)/$@
656
657 # .class -> .jar
658 $(LibDir)/%.jar : $(JavaClassFiles) $(OtherTargetFiles)
659 $(Print) $@
660 @cd $(TargetDir); $(JavaArchiver) -cf $@ \
661 $(JavaClassFilesRel) $(OtherTargetFiles)
662
663 %.jar : $(JavaClassFiles) $(OtherTargetFiles)
664 $(MAKE) $(MakeOptions) $(LibDir)/$@
665
666 # .class -> JavaDoc
667 javadoc :
668 $(Print) $(JavaPackageNames) > $(DEV_ROOT)/packages.tmp
669 $(JavadocGenerator) $(JavadocOptions) @$(DEV_ROOT)/packages.tmp
670 $(Delete) $(DEV_ROOT)/packages.tmp
671 $(Print) Done JavaDoc.
672
673 # .class -> _Stub.class
674 $(PackageTargetDir)/%_Stub.class : $(PackageTargetDir)/%.class
675 $(Print) $@
676 $(RmiCompiler) $(RmiOptions) $(JavaPackageName).$*
677
678 %_Stub.class : %.class
679 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
680
681 # .class -> _Skel.class
682 $(PackageTargetDir)/%_Skel.class : $(PackageTargetDir)/%.class
683 $(Print) $@
684 $(RmiCompiler) $(RmiOptions) $(JavaPackageName).$*
685
686 %_Skel.class : %.class
687 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
688
689 document :
690 $(Print) Generate Documentation for OOPSE-2.0
691 @cd $(DEV_ROOT)/src
692 $(Doxygen) $(DEV_ROOT)/make/Doxyfile
693
694 #GUN make funtions to merge the libraries
695 find_objs = $(shell $(StaticArchiver) -t $(1) | $(EGREP) -v "SYMDEF")
696 extract_objs = $(shell $(StaticArchiver) -x $(1) $(call find_objs, $(1)))
697 create_archive = $(shell $(StaticArchiver) $(StaticArchiverOptions) $(2) $(call find_objs, $(1)))
698 remove_objs = $(shell $(Delete) $(call find_objs, $(1)))
699 do_create = $(call extract_objs,$(1))$(call create_archive,$(1),$(2))$(call remove_objs,$(1))
700 do_link = $(shell $(LN_S) $(1) $(2))
701 all_objs = $(foreach thisLib,$(LibNames), $(call find_objs, $(thisLib)))
702 all_parallel_objs = $(foreach thisLib,$(ParallelLibNames), $(call find_objs, $(thisLib)))
703 all_lib_objs = $(patsubst %,$(TargetDir)/%,$(call all_objs))
704 all_lib_parallel_objs = $(patsubst %,$(ParallelTargetDir)/%,$(call all_parallel_objs))
705
706 $(CombinedStaticLib) : $(LibDir)/.stamp_UP
707 $(Print) creating $@
708 $(StaticArchiver) $(StaticArchiverOptions) $@ $(call all_lib_objs)
709 $(Ranlib) $(CombinedStaticLib)
710
711 $(CombinedParallelStaticLib) : $(LibDir)/.stamp_MPI
712 $(Print) creating $@
713 $(StaticArchiver) $(StaticArchiverOptions) $@ $(call all_lib_parallel_objs)
714 $(Ranlib) $(CombinedParallelStaticLib)
715
716 # Executable
717 $(Executable) : $(CombinedStaticLib) $(ObjectFiles)
718 if test ! -d $(BinDir); then \
719 $(MkDir) $(BinDir) ;\
720 fi
721 $(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@
722
723 $(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles)
724 if test ! -d $(BinDir); then \
725 $(MkDir) $(BinDir) ;\
726 fi
727 $(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@
728
729 # Anything else is just copied from source to target
730 $(PackageTargetDir)/% : $(PackageSourceDir)/%
731 $(Print) $@
732 $(Copy) $< $@
733
734 # make (or make build)
735 build : $(PackageListLoop)
736 $(Print) Done build.
737
738 _all : _buildall
739
740 _buildall :
741 ifeq "$(UseMPI)" "yes"
742 _buildall : \
743 $(DependencyFile) \
744 $(PackageTargetDir) \
745 $(ObjectFiles) \
746 $(ParallelObjectFiles) \
747 $(JavaClassFiles) \
748 $(RmiStubFiles) \
749 $(RmiSkeletonFiles) \
750 $(OtherTargetFiles) \
751 $(StaticLibrary) \
752 $(ParallelStaticLibrary) \
753 $(JarFile) \
754 $(Executable) \
755 $(ParallelExecutable)
756 else
757 _buildall : \
758 $(DependencyFile) \
759 $(PackageTargetDir) \
760 $(ObjectFiles) \
761 $(JavaClassFiles) \
762 $(RmiStubFiles) \
763 $(RmiSkeletonFiles) \
764 $(OtherTargetFiles) \
765 $(StaticLibrary) \
766 $(JarFile) \
767 $(Executable)
768 endif
769
770 echo : $(PackageListLoop)
771 $(Print) Done echo.
772
773 _echoall :
774 $(Print) $(Modules)
775
776 # make clean
777 clean : $(PackageListLoop)
778 $(Print) Done clean.
779
780 _cleanall :
781 $(Delete) \
782 $(ObjectFiles) \
783 $(ModuleFiles) \
784 $(ParallelObjectFiles) \
785 $(ParallelModuleFiles) \
786 $(JarFile) \
787 $(SharedLibrary) \
788 $(StaticLibrary) \
789 $(ParallelSharedLibrary) \
790 $(ParallelStaticLibrary) \
791 $(CombinedStaticLib) \
792 $(CombinedParallelStaticLib)
793
794 # make distclean
795 distclean : $(PackageListLoop)
796 $(Print) Done clean.
797
798 _distcleanall : _cleanall
799 $(Delete) $(Executable) \
800 $(ParallelExecutable) \
801 $(DependencyFile)
802
803 # make depend
804 depend : $(PackageListLoop)
805 $(Print) Done dependencies.
806
807 _dependall : $(DependencyFile)
808
809 $(DependencyFile) : $(DerivedSource)
810 $(Print) $@
811 @cd $(PackageSourceDir)
812
813 ifneq "$(words $(CppFiles))" "0"
814 $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CppFiles)>> Make.cpptemp
815 @cat Make.cpptemp >> $(DependencyFile)
816 $(Delete) Make.cpptemp
817
818 ifeq "$(UseMPI)" "yes"
819 $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CppFiles)>> Make.cpptemp
820 @cat Make.cpptemp >> $(DependencyFile)
821 @$(Delete) Make.cpptemp
822 endif
823
824 endif
825
826 ifneq "$(words $(CFiles))" "0"
827 $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CFiles) $(DerivedCFiles) >> Make.ctemp
828 @cat Make.ctemp >> $(DependencyFile)
829 $(Delete) Make.ctemp
830
831 ifeq "$(UseMPI)" "yes"
832 $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CFiles) $(DerivedCFiles) >> Make.ctemp
833 @cat Make.ctemp >> $(DependencyFile)
834 @$(Delete) Make.ctemp
835 endif
836
837 endif
838
839 ifneq "$(words $(F90Files))" "0"
840 $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp
841 @cat Make.ftemp >> $(DependencyFile)
842 @$(Delete) Make.ftemp
843
844 ifeq "$(UseMPI)" "yes"
845 $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) >> Make.ftemp
846 @cat Make.ftemp >> $(DependencyFile)
847 @$(Delete) Make.ftemp
848 endif
849
850 endif
851
852 # make lib
853 lib : $(PackageListLoop)
854 $(Print) Libraries built.
855
856 _liball : $(JarFile) $(SharedLibrary) $(StaticLibrary)
857
858 jar : $(JarFile)
859
860 jarsign : $(JarFile)
861 $(JarSigner) -keystore GeoSoftKeystore $(JarFile) myself
862
863 #make install
864 %.install :
865 @$(MAKE) $(MakeOptions) -C $(subst .install,,$@) _installall
866
867 install : $(InstallListLoop)
868 $(Print) Done Install
869
870 _installall : _buildall _installdata _installlinks
871
872 $(MyInstallDir) :
873 $(MkDir) $@
874
875 _installdata : $(MyInstallDir)
876 $(Print) $(InstallFiles)
877 ifneq "$(words $(InstallFiles))" "0"
878 $(InstallCommand) $(InstallFiles) $(MyInstallDir)
879 endif
880
881 _installlinks : $(MyInstallDir)
882 ifneq "$(words $(MyLinkTargets))" "0"
883 @cd $(MyInstallDir)
884 $(foreach thisLink,$(MyLinkTargets),$(call do_link,$(MyLinkSource),$(thisLink)))
885 endif
886
887 # make statistics
888 _statisticsall :
889 @$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp
890
891 statistics : $(PackageListLoop)
892 @$(List) $(DEV_ROOT)/files.tmp | xargs $(WordCount) $(WordCountOptions)
893 @$(Delete) $(DEV_ROOT)/files.tmp
894 $(Print) Done statistics.
895
896 # make pure
897 #$(Executable).pure :
898 # $(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \
899 # $(LibList) $(ObjectFiles) -o $@
900 #
901 #pure : $(Executable).pure
902
903 #make cvslog
904 cvslog:
905 $(DEV_ROOT)/scripts/cvs2cl
906
907 # Execute
908 _runexe :
909 $(Executable) $(RunParameters)
910
911 _runjava :
912 $(JavaExecute) $(JavaRunOptions) $(JavaMainClass) $(RunParameters)
913
914 run : _runjava
915
916
917 ifdef $(DependencyFile)
918 -include $(DependencyFile)
919 endif