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