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 |
#packages to be made |
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/oopse \ |
54 |
applications/dump2Xyz \ |
55 |
applications/simpleBuilder \ |
56 |
|
57 |
#packages contain libraries |
58 |
PackageLibs = \ |
59 |
utils \ |
60 |
math \ |
61 |
types \ |
62 |
primitives \ |
63 |
visitors \ |
64 |
UseTheForce/DarkSide \ |
65 |
UseTheForce \ |
66 |
brains \ |
67 |
io \ |
68 |
integrators \ |
69 |
minimizers \ |
70 |
constraints \ |
71 |
profiling \ |
72 |
restraints \ |
73 |
|
74 |
IncludeDirs = \ |
75 |
@SPRNG_INC_DIR@ \ |
76 |
@MPI_INC_DIR@ |
77 |
|
78 |
LibraryDirs = \ |
79 |
@SPRNG_LIB_DIR@ \ |
80 |
@MPI_LIB_DIR@ |
81 |
|
82 |
Libraries = \ |
83 |
@SPRNG_LIB@ \ |
84 |
@MPI_LIB@ \ |
85 |
@MPI_F90_LIB@ |
86 |
|
87 |
OopseHome = @OOPSE_HOME@ |
88 |
ForceParamDir = @OOPSE_HOME@/share/forceFields/ |
89 |
SampleSimDir = @OOPSE_HOME@/share/samples/ |
90 |
FrcDeclare = -DFRC_PATH="$(ForceParamDir)" |
91 |
ParallelDeclare = -DIS_MPI |
92 |
UseMPI = @USE_MPI@ |
93 |
|
94 |
#--------------------------------------------------------------------------- |
95 |
# |
96 |
# Directories |
97 |
# |
98 |
#--------------------------------------------------------------------------- |
99 |
|
100 |
SourceDir = $(DEV_ROOT)/src |
101 |
TargetDir = $(DEV_ROOT)/obj |
102 |
ParallelTargetDir = $(DEV_ROOT)/MPIobj |
103 |
LibDir = $(DEV_ROOT)/lib |
104 |
ParallelLibDir = $(DEV_ROOT)/MPIlib |
105 |
MakeDir = $(DEV_ROOT)/make |
106 |
BinDir = $(DEV_ROOT)/bin |
107 |
DocsDir = $(DEV_ROOT)/docs |
108 |
CurrentDir = $(CURDIR) |
109 |
RPath = $(shell cd $(DEV_ROOT); pwd)/lib:$(OopseHome)/lib |
110 |
ParallelRPath = $(shell cd $(DEV_ROOT); pwd)/MPIlib:$(OopseHome)/MPIlib |
111 |
LinkOptions = \ |
112 |
@F90LIBS@ \ |
113 |
-Wl,-R$(RPath) |
114 |
|
115 |
ParallelLinkOptions = \ |
116 |
@F90LIBS@ \ |
117 |
-Wl,-R$(ParallelRPath) |
118 |
|
119 |
ifdef Source |
120 |
#get the relative path of current package to source directory |
121 |
# /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside |
122 |
#Package = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g') |
123 |
#use shell script to get the absolute path and then rip it off from $(CurrentDir) |
124 |
Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir)) |
125 |
|
126 |
PackageList = $(Package) |
127 |
PackageSourceDir = $(SourceDir)/$(Package) |
128 |
PackageTargetDir = $(TargetDir) |
129 |
PackageParallelTargetDir = $(ParallelTargetDir) |
130 |
JavaMainClass = $(subst /,.,$(Package)).$(Main) |
131 |
else |
132 |
PackageList = $(Packages) $(JavaPackages) |
133 |
endif |
134 |
|
135 |
PackageListLoop = $(patsubst %,$(SourceDir)/%/.loop,$(PackageList)) |
136 |
|
137 |
JRE = $(JAVA_HOME)/jre/lib/rt.jar |
138 |
|
139 |
ifdef IS_UNIX |
140 |
X = : |
141 |
else |
142 |
X = \; |
143 |
endif |
144 |
|
145 |
#--------------------------------------------------------------------------- |
146 |
# |
147 |
# Classification of files |
148 |
# |
149 |
#--------------------------------------------------------------------------- |
150 |
|
151 |
# Source |
152 |
JavaFiles = $(filter %.java, $(Source)) |
153 |
CppFiles = $(filter %.cpp, $(Source)) |
154 |
CFiles = $(filter %.c, $(Source)) |
155 |
FortranFiles = $(filter %.f, $(Source)) |
156 |
F90Files = $(filter %.F90, $(Source)) |
157 |
CorbaFiles = $(filter %.idl, $(Source)) |
158 |
LexFiles = $(filter %.l, $(Source)) |
159 |
YaccFiles = $(filter %.y, $(Source)) |
160 |
OtherSourceFiles = $(filter-out $(JavaFiles) $(CppFiles) $(CFiles) \ |
161 |
$(FortranFiles) $(F90Files) $(LexFiles) \ |
162 |
$(YaccFiles) $(CorbaFiles), \ |
163 |
$(Source)) |
164 |
ManifestFile = $(PackageSourceDir)/Manifest |
165 |
|
166 |
SourceFiles = $(JavaFiles)\ |
167 |
$(CppFiles)\ |
168 |
$(CFiles)\ |
169 |
$(FortranFiles)\ |
170 |
$(F90Files)\ |
171 |
$(LexFiles)\ |
172 |
$(YaccFiles) |
173 |
|
174 |
# Target |
175 |
JavaClassFiles = $(JavaFiles:%.java= $(PackageTargetDir)/%.class) |
176 |
JavaClassFilesRel = $(JavaFiles:%.java= $(Package)/%.class) |
177 |
RmiStubFiles = $(RmiSource:%.java= $(PackageTargetDir)/%_Stub.class) |
178 |
RmiSkeletonFiles = $(RmiSource:%.java= $(PackageTargetDir)/%_Skel.class) |
179 |
JniClassFiles = $(JniSource:%.java= $(PackageTargetDir)/%.class) |
180 |
JniHeaders = $(JniSource:%.java= $(PackageSourceDir)/%.h) |
181 |
ObjectFiles = $(CFiles:%.c= $(PackageTargetDir)/%.o)\ |
182 |
$(CppFiles:%.cpp= $(PackageTargetDir)/%.o)\ |
183 |
$(FortranFiles:%.f= $(PackageTargetDir)/%.o)\ |
184 |
$(F90Files:%.F90= $(PackageTargetDir)/%.o)\ |
185 |
$(LexFiles:%.l= $(PackageTargetDir)/%.o)\ |
186 |
$(YaccFiles:%.y= $(PackageTargetDir)/%.o) |
187 |
ParallelObjectFiles = $(CFiles:%.c= $(PackageParallelTargetDir)/%.o)\ |
188 |
$(CppFiles:%.cpp= $(PackageParallelTargetDir)/%.o)\ |
189 |
$(FortranFiles:%.f= $(PackageParallelTargetDir)/%.o)\ |
190 |
$(F90Files:%.F90= $(PackageParallelTargetDir)/%.o)\ |
191 |
$(LexFiles:%.l= $(PackageParallelTargetDir)/%.o)\ |
192 |
$(YaccFiles:%.y= $(PackageParallelTargetDir)/%.o) |
193 |
|
194 |
DerivedSource = $(YaccFiles:%.y= %.h) \ |
195 |
$(YaccFiles:%.y= %.c) \ |
196 |
$(LexFiles:%.l= %.c) |
197 |
|
198 |
DerivedCFiles = $(YaccFiles:%.y= %.c) \ |
199 |
$(LexFiles:%.l= %.c) |
200 |
|
201 |
OtherTargetFiles = $(OtherSourceFiles:%=$(PackageTargetDir)/%) |
202 |
|
203 |
ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries)) |
204 |
ThirdPartyJars = $(subst $(Space),$(X),$(ThirdPartyJarsTmp)) |
205 |
|
206 |
ifneq "$(words $(JavaFiles))" "0" |
207 |
JavaPackageName = $(subst /,.,$(Package)) |
208 |
JarFile = $(LibDir)/$(subst /,,$(Package)).jar |
209 |
endif |
210 |
|
211 |
#if Main is defined, do not build library. It may not be true sometimes |
212 |
ifneq "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0" |
213 |
DependencyFile = $(PackageSourceDir)/Makedepend |
214 |
ifneq "$(Main)" "" |
215 |
Executable = $(BinDir)/$(Main) |
216 |
ParallelExecutable = $(BinDir)/$(Main)_MPI |
217 |
else |
218 |
SharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).so |
219 |
StaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).a |
220 |
ParallelSharedLibrary = $(ParallelLibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).so |
221 |
ParallelStaticLibrary = $(ParallelLibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).a |
222 |
endif |
223 |
endif |
224 |
# |
225 |
# Misc |
226 |
# |
227 |
ClassPath = $(JRE)$(X)$(TargetDir)$(X)$(ThirdPartyJars) |
228 |
JavaPackageNames = $(subst /,.,$(JavaPackages)) |
229 |
IncludePath = -I$(SourceDir) $(IncludeDirs:%=-I%) |
230 |
LibDirs = -L$(LibDir) $(LibraryDirs:%=-L%) |
231 |
ParallelLibDirs = -L$(ParallelLibDir) $(LibraryDirs:%=-L%) |
232 |
LocalLibs = $(subst /,,$(patsubst %, oopse_%, $(PackageLibs))) |
233 |
ParallelLocalLibs= $(subst /,,$(patsubst %, oopse_%, $(PackageLibs))) |
234 |
LibList = $(LocalLibs:%=-l%) $(Libraries) |
235 |
ParallelLibList = $(ParallelLocalLibs:%=-l%) $(Libraries) |
236 |
|
237 |
|
238 |
#--------------------------------------------------------------------------- |
239 |
# |
240 |
# Tools & Options |
241 |
# |
242 |
#--------------------------------------------------------------------------- |
243 |
Print = @echo |
244 |
Move = mv |
245 |
Copy = cp |
246 |
CCompiler = @CC@ |
247 |
CppCompiler = @CXX@ |
248 |
Linker = @CXX@ |
249 |
MakeDepend = makedepend |
250 |
Install = @INSTALL@ |
251 |
InstallProgram = @INSTALL_PROGRAM@ |
252 |
InstallData = @INSTALL_DATA@ |
253 |
MakeDir = @MKINSTALLDIRS@ |
254 |
Delete = rm -fr |
255 |
StaticArchiver = @AR@ |
256 |
DynamicArchiver = @CC@ |
257 |
FortranCompiler = @FC@ |
258 |
F90Compiler = @F90@ |
259 |
JavaCompiler = $(JAVA_HOME)/bin/javac |
260 |
JavaArchiver = $(JAVA_HOME)/bin/jar |
261 |
JarSigner = $(JAVA_HOME)/bin/jarsigner |
262 |
JavadocGenerator = $(JAVA_HOME)/bin/javadoc |
263 |
JniCompiler = $(JAVA_HOME)/bin/javah |
264 |
RmiCompiler = $(JAVA_HOME)/bin/rmic |
265 |
JavaExecute = $(JAVA_HOME)/bin/java |
266 |
Purify = purify |
267 |
WordCount = wc |
268 |
List = cat |
269 |
Yacc = @YACC@ |
270 |
Lex = @LEX@ |
271 |
|
272 |
|
273 |
MakeOptions = -k |
274 |
MakeDependOptions = |
275 |
StaticArchiverOptions = rc |
276 |
DynamicArchiverOptions = -shared |
277 |
JavaArchiverOptions = |
278 |
JniOptions = |
279 |
RmiOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
280 |
-sourcepath $(SourceDir) |
281 |
COptions = $(FrcDeclare) |
282 |
CParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
283 |
CppOptions = $(FrcDeclare) |
284 |
CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
285 |
FortranOptions = |
286 |
F90Options = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir) |
287 |
F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) |
288 |
JavaCompilerOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
289 |
-sourcepath $(SourceDir) -deprecation |
290 |
JavaRunOptions = -classpath $(ClassPath) |
291 |
PurifyOptions = |
292 |
JavadocOptions = -d $(DocsDir) \ |
293 |
-sourcepath $(SourceDir) \ |
294 |
-classpath $(ClassPath) \ |
295 |
-author \ |
296 |
-package \ |
297 |
-use \ |
298 |
-splitIndex \ |
299 |
-version \ |
300 |
-link file:$(JAVA_HOME)/docs/api \ |
301 |
-windowtitle $(JavadocWindowTitle) \ |
302 |
-doctitle $(JavadocDocTitle) \ |
303 |
-header $(JavadocHeader) \ |
304 |
-bottom $(JavadocFooter) |
305 |
WordCountOptions = --lines |
306 |
|
307 |
Empty = |
308 |
Space = $(Empty) $(Empty) |
309 |
|
310 |
|
311 |
#--------------------------------------------------------------------------- |
312 |
# |
313 |
# Rules |
314 |
# |
315 |
#--------------------------------------------------------------------------- |
316 |
default : build |
317 |
|
318 |
%.loop : |
319 |
@$(MAKE) $(MakeOptions) -C $(subst .loop,,$@) _$(MAKECMDGOALS)all |
320 |
|
321 |
# Create target directory |
322 |
$(PackageTargetDir) : |
323 |
$(MakeDir) $@ |
324 |
|
325 |
# .c -> .o |
326 |
$(PackageTargetDir)/%.o : %.c |
327 |
$(Print) $@ |
328 |
$(CCompiler) $(COptions) -c $(IncludePath) $< -o $@ |
329 |
|
330 |
$(PackageParallelTargetDir)/%.o : %.c |
331 |
$(Print) $@ |
332 |
$(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@ |
333 |
|
334 |
ifeq "$(UseMPI)" "yes" |
335 |
%.o : %.c |
336 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
337 |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
338 |
else |
339 |
%.o : %.c |
340 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
341 |
endif |
342 |
|
343 |
# .cpp -> .o |
344 |
$(PackageTargetDir)/%.o : %.cpp |
345 |
$(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@ |
346 |
|
347 |
$(PackageParallelTargetDir)/%.o : %.cpp |
348 |
$(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@ |
349 |
|
350 |
ifeq "$(UseMPI)" "yes" |
351 |
%.o : %.cpp |
352 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
353 |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
354 |
else |
355 |
%.o : %.cpp |
356 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
357 |
endif |
358 |
|
359 |
# .f -> .o |
360 |
$(PackageTargetDir)/%.o : %.f |
361 |
$(FortranCompiler) $(FortranOptions) -c $< -o $@ |
362 |
|
363 |
$(PackageParallelTargetDir)/%.o : %.f |
364 |
$(FortranCompiler) $(FortranParallelOptions) -c $< -o $@ |
365 |
|
366 |
ifeq "$(UseMPI)" "yes" |
367 |
%.o : %.f |
368 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
369 |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
370 |
else |
371 |
%.o : %.f |
372 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
373 |
endif |
374 |
|
375 |
# .F90 -> .o |
376 |
$(PackageTargetDir)/%.o : %.F90 |
377 |
$(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@ |
378 |
|
379 |
$(PackageParallelTargetDir)/%.o : %.F90 |
380 |
$(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@ |
381 |
|
382 |
ifeq "$(UseMPI)" "yes" |
383 |
%.o : %.F90 |
384 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
385 |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
386 |
else |
387 |
%.o : %.F90 |
388 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
389 |
endif |
390 |
|
391 |
|
392 |
# .java -> .class |
393 |
$(PackageTargetDir)/%.class : $(PackageSourceDir)/%.java |
394 |
$(JavaCompiler) $(JavaCompilerOptions) $< |
395 |
|
396 |
%.class : $(PackageSourceDir)/%.java |
397 |
@$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
398 |
|
399 |
# .class -> .h |
400 |
$(PackageSourceDir)/%.h : $(PackageTargetDir)/%.class |
401 |
$(JniCompiler) $(JniOptions) $(JavaPackageName).$* |
402 |
|
403 |
%.h : %.class |
404 |
$(MAKE) $(MakeOptions) $(PackageSourceDir)/$@ |
405 |
|
406 |
#.y -> .h |
407 |
%.h : %.y |
408 |
$(Yacc) -d $? |
409 |
@$(Move) y.tab.h $*.h |
410 |
@$(Delete) y.tab.c |
411 |
|
412 |
#.y -> .c |
413 |
%.c : %.y |
414 |
$(Yacc) -d $? |
415 |
@$(Move) y.tab.c $*.c |
416 |
@$(Delete) y.tab.h |
417 |
|
418 |
# .l -> .c |
419 |
%.c : %.l |
420 |
$(Print) $@ |
421 |
$(Print) $(Lex) -o$@ $? |
422 |
@$(Lex) -o$@ $? |
423 |
|
424 |
# .o -> .a |
425 |
|
426 |
$(LibDir)/%.a : $(ObjectFiles) |
427 |
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles) |
428 |
|
429 |
$(ParallelLibDir)/%.a: $(ParallelObjectFiles) |
430 |
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles) |
431 |
|
432 |
ifeq "$(UseMPI)" "yes" |
433 |
%.a : $(ObjectFiles) $(ParallelObjectFiles) |
434 |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
435 |
$(MAKE) $(MakeOptions) $(ParallelLibDir)/$@ |
436 |
else |
437 |
%.a : $(ObjectFiles) |
438 |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
439 |
endif |
440 |
|
441 |
# .o -> .so |
442 |
$(LibDir)/%.so : $(ObjectFiles) |
443 |
$(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@ |
444 |
|
445 |
$(ParallelLibDir)/%.so : $(ParallelObjectFiles) |
446 |
$(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@ |
447 |
|
448 |
ifeq "$(UseMPI)" "yes" |
449 |
%.so : $(ObjectFiles) $(ParallelObjectFiles) |
450 |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
451 |
$(MAKE) $(MakeOptions) $(ParallelLibDir)/$@ |
452 |
else |
453 |
%.so : $(ObjectFiles) |
454 |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
455 |
endif |
456 |
|
457 |
# .class -> .jar |
458 |
$(LibDir)/%.jar : $(JavaClassFiles) $(OtherTargetFiles) |
459 |
$(Print) $@ |
460 |
@cd $(TargetDir); $(JavaArchiver) -cf $@ \ |
461 |
$(JavaClassFilesRel) $(OtherTargetFiles) |
462 |
|
463 |
%.jar : $(JavaClassFiles) $(OtherTargetFiles) |
464 |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
465 |
|
466 |
# .class -> JavaDoc |
467 |
javadoc : |
468 |
$(Print) $(JavaPackageNames) > $(DEV_ROOT)/packages.tmp |
469 |
$(JavadocGenerator) $(JavadocOptions) @$(DEV_ROOT)/packages.tmp |
470 |
$(Delete) $(DEV_ROOT)/packages.tmp |
471 |
$(Print) Done JavaDoc. |
472 |
|
473 |
# .class -> _Stub.class |
474 |
$(PackageTargetDir)/%_Stub.class : $(PackageTargetDir)/%.class |
475 |
$(Print) $@ |
476 |
$(RmiCompiler) $(RmiOptions) $(JavaPackageName).$* |
477 |
|
478 |
%_Stub.class : %.class |
479 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
480 |
|
481 |
# .class -> _Skel.class |
482 |
$(PackageTargetDir)/%_Skel.class : $(PackageTargetDir)/%.class |
483 |
$(Print) $@ |
484 |
$(RmiCompiler) $(RmiOptions) $(JavaPackageName).$* |
485 |
|
486 |
%_Skel.class : %.class |
487 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
488 |
|
489 |
# Executable |
490 |
$(Executable) : $(ObjectFiles) |
491 |
$(Linker) $(ObjectFiles) $(LinkOptions) $(LibDirs) $(LibList) -o $@ |
492 |
|
493 |
$(ParallelExecutable) : $(ParallelObjectFiles) |
494 |
$(Linker) $(ParallelObjectFiles) $(ParallelLinkOptions) $(ParallelLibDirs) $(LibList) -o $@ |
495 |
|
496 |
# Anything else is just copied from source to target |
497 |
$(PackageTargetDir)/% : $(PackageSourceDir)/% |
498 |
$(Print) $@ |
499 |
$(Copy) $< $@ |
500 |
|
501 |
# make (or make build) |
502 |
build : $(PackageListLoop) |
503 |
$(Print) Done build. |
504 |
|
505 |
_all : _buildall |
506 |
|
507 |
ifeq "$(UseMPI)" "yes" |
508 |
_buildall : \ |
509 |
$(DependencyFile) \ |
510 |
$(PackageTargetDir) \ |
511 |
$(ObjectFiles) \ |
512 |
$(ParallelObjectFiles) \ |
513 |
$(JavaClassFiles) \ |
514 |
$(RmiStubFiles) \ |
515 |
$(RmiSkeletonFiles) \ |
516 |
$(OtherTargetFiles) \ |
517 |
$(SharedLibrary) \ |
518 |
$(StaticLibrary) \ |
519 |
$(ParallelSharedLibrary) \ |
520 |
$(ParallelStaticLibrary) \ |
521 |
$(JarFile) \ |
522 |
$(Executable) \ |
523 |
$(ParallelExecutable) |
524 |
else |
525 |
_buildall : \ |
526 |
$(DependencyFile) \ |
527 |
$(PackageTargetDir) \ |
528 |
$(ObjectFiles) \ |
529 |
$(JavaClassFiles) \ |
530 |
$(RmiStubFiles) \ |
531 |
$(RmiSkeletonFiles) \ |
532 |
$(OtherTargetFiles) \ |
533 |
$(SharedLibrary) \ |
534 |
$(StaticLibrary) \ |
535 |
$(JarFile) \ |
536 |
$(Executable) |
537 |
endif |
538 |
|
539 |
|
540 |
# make clean |
541 |
clean : $(PackageListLoop) |
542 |
$(Print) Done clean. |
543 |
|
544 |
_cleanall : |
545 |
$(Delete) $(ObjectFiles) $(ParallelObjectFiles) |
546 |
|
547 |
# make distclean |
548 |
distclean : $(PackageListLoop) |
549 |
$(Print) Done clean. |
550 |
|
551 |
_distcleanall : |
552 |
$(Delete) $(ObjectFiles) \ |
553 |
$(ParallelObjectFiles) \ |
554 |
$(JarFile) \ |
555 |
$(SharedLibrary) \ |
556 |
$(StaticLibrary) \ |
557 |
$(ParallelSharedLibrary) \ |
558 |
$(ParallelStaticLibrary) \ |
559 |
$(Executable) \ |
560 |
$(ParallelExecutable) \ |
561 |
$(DependencyFile) |
562 |
|
563 |
|
564 |
# make depend |
565 |
depend : $(PackageListLoop) |
566 |
$(Print) Done dependencies. |
567 |
|
568 |
_dependall : $(DependencyFile) |
569 |
|
570 |
$(DependencyFile) : $(DerivedSource) |
571 |
$(Print) $@ |
572 |
@cd $(PackageSourceDir) |
573 |
|
574 |
@touch Make.ctemp |
575 |
@touch Make.ctemp |
576 |
|
577 |
ifneq "$(words $(CppFiles))" "0" |
578 |
$(CppCompiler) $(IncludePath) -MM $(CppFiles) > Make.cpptemp |
579 |
cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile) |
580 |
cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile) |
581 |
endif |
582 |
|
583 |
ifneq "$(words $(CFiles))" "0" |
584 |
$(CCompiler) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp |
585 |
cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile) |
586 |
cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile) |
587 |
|
588 |
endif |
589 |
|
590 |
ifneq "$(words $(F90Files))" "0" |
591 |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/obj/' -D__FORTRAN90 $(F90Files) > Make.ftemp |
592 |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/MPIobj/' -DIS_MPI -D__FORTRAN90 $(F90Files) >> Make.ftemp |
593 |
cat Make.ftemp >> $(DependencyFile) |
594 |
endif |
595 |
$(Delete) Make.cpptemp Make.ctemp Make.ftemp |
596 |
|
597 |
# make lib |
598 |
lib : $(PackageListLoop) |
599 |
$(Print) Libraries built. |
600 |
|
601 |
_liball : $(JarFile) $(SharedLibrary) $(StaticLibrary) |
602 |
|
603 |
jar : $(JarFile) |
604 |
|
605 |
jarsign : $(JarFile) |
606 |
$(JarSigner) -keystore GeoSoftKeystore $(JarFile) myself |
607 |
|
608 |
# make statistics |
609 |
_statisticsall : |
610 |
@$(Print) $(SourceFiles) >> $(DEV_ROOT)/files.tmp |
611 |
|
612 |
statistics : $(PackageListLoop) |
613 |
@$(List) $(DEV_ROOT)/files.tmp | xargs $(WordCount) $(WordCountOptions) |
614 |
@$(Delete) $(DEV_ROOT)/files.tmp |
615 |
$(Print) Done statistics. |
616 |
|
617 |
# make pure |
618 |
$(Executable).pure : |
619 |
$(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \ |
620 |
$(LibList) $(ObjectFiles) -o $@ |
621 |
|
622 |
pure : $(Executable).pure |
623 |
|
624 |
#make cvslog |
625 |
cvslog: |
626 |
$(DEV_ROOT)/scripts/cvs2cl.pl |
627 |
|
628 |
# Execute |
629 |
_runexe : |
630 |
$(Executable) $(RunParameters) |
631 |
|
632 |
_runjava : |
633 |
$(JavaExecute) $(JavaRunOptions) $(JavaMainClass) $(RunParameters) |
634 |
|
635 |
run : _runjava |
636 |
|
637 |
|
638 |
ifdef $(DependencyFile) |
639 |
-include $(DependencyFile) |
640 |
endif |