ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/make/Makefile.in
Revision: 1086
Committed: Mon Oct 23 18:21:41 2006 UTC (18 years, 9 months ago) by gezelter
Original Path: trunk/make/Makefile.in
File size: 28135 byte(s)
Log Message:
fixes for CGAL

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