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