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