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 |
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 |
tim |
1525 |
UseMPI = @USE_MPI@ |
93 |
gezelter |
1521 |
|
94 |
gezelter |
1508 |
#--------------------------------------------------------------------------- |
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 |
tim |
1525 |
ParallelLibDir = $(DEV_ROOT)/MPIlib |
105 |
gezelter |
1508 |
MakeDir = $(DEV_ROOT)/make |
106 |
|
|
BinDir = $(DEV_ROOT)/bin |
107 |
|
|
DocsDir = $(DEV_ROOT)/docs |
108 |
|
|
CurrentDir = $(CURDIR) |
109 |
tim |
1527 |
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 |
gezelter |
1508 |
|
115 |
tim |
1527 |
ParallelLinkOptions = \ |
116 |
|
|
@F90LIBS@ \ |
117 |
|
|
-Wl,-R$(ParallelRPath) |
118 |
|
|
|
119 |
gezelter |
1508 |
ifdef Source |
120 |
tim |
1512 |
#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 |
gezelter |
1508 |
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 |
tim |
1512 |
PackageListLoop = $(patsubst %,$(SourceDir)/%/.loop,$(PackageList)) |
136 |
gezelter |
1508 |
|
137 |
tim |
1512 |
JRE = $(JAVA_HOME)/jre/lib/rt.jar |
138 |
gezelter |
1508 |
|
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 |
tim |
1512 |
SourceFiles = $(JavaFiles)\ |
167 |
|
|
$(CppFiles)\ |
168 |
|
|
$(CFiles)\ |
169 |
|
|
$(FortranFiles)\ |
170 |
|
|
$(F90Files)\ |
171 |
|
|
$(LexFiles)\ |
172 |
|
|
$(YaccFiles) |
173 |
gezelter |
1508 |
|
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 |
tim |
1512 |
$(CppFiles:%.cpp= $(PackageTargetDir)/%.o)\ |
183 |
tim |
1525 |
$(FortranFiles:%.f= $(PackageTargetDir)/%.o)\ |
184 |
|
|
$(F90Files:%.F90= $(PackageTargetDir)/%.o)\ |
185 |
|
|
$(LexFiles:%.l= $(PackageTargetDir)/%.o)\ |
186 |
|
|
$(YaccFiles:%.y= $(PackageTargetDir)/%.o) |
187 |
gezelter |
1508 |
ParallelObjectFiles = $(CFiles:%.c= $(PackageParallelTargetDir)/%.o)\ |
188 |
tim |
1525 |
$(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 |
gezelter |
1508 |
|
194 |
|
|
DerivedSource = $(YaccFiles:%.y= %.h) \ |
195 |
tim |
1525 |
$(YaccFiles:%.y= %.c) \ |
196 |
|
|
$(LexFiles:%.l= %.c) |
197 |
gezelter |
1508 |
|
198 |
|
|
DerivedCFiles = $(YaccFiles:%.y= %.c) \ |
199 |
tim |
1525 |
$(LexFiles:%.l= %.c) |
200 |
gezelter |
1508 |
|
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 |
tim |
1512 |
Executable = $(BinDir)/$(Main) |
216 |
gezelter |
1508 |
ParallelExecutable = $(BinDir)/$(Main)_MPI |
217 |
|
|
else |
218 |
tim |
1518 |
SharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).so |
219 |
|
|
StaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).a |
220 |
tim |
1525 |
ParallelSharedLibrary = $(ParallelLibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).so |
221 |
|
|
ParallelStaticLibrary = $(ParallelLibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).a |
222 |
gezelter |
1508 |
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 |
tim |
1525 |
ParallelLibDirs = -L$(ParallelLibDir) $(LibraryDirs:%=-L%) |
232 |
tim |
1518 |
LocalLibs = $(subst /,,$(patsubst %, oopse_%, $(PackageLibs))) |
233 |
tim |
1525 |
ParallelLocalLibs= $(subst /,,$(patsubst %, oopse_%, $(PackageLibs))) |
234 |
gezelter |
1521 |
LibList = $(LocalLibs:%=-l%) $(Libraries) |
235 |
tim |
1525 |
ParallelLibList = $(ParallelLocalLibs:%=-l%) $(Libraries) |
236 |
gezelter |
1508 |
|
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 |
tim |
1514 |
MakeOptions = -k |
274 |
gezelter |
1508 |
MakeDependOptions = |
275 |
|
|
StaticArchiverOptions = rc |
276 |
|
|
DynamicArchiverOptions = -shared |
277 |
|
|
JavaArchiverOptions = |
278 |
|
|
JniOptions = |
279 |
|
|
RmiOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
280 |
|
|
-sourcepath $(SourceDir) |
281 |
gezelter |
1521 |
COptions = $(FrcDeclare) |
282 |
|
|
CParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
283 |
|
|
CppOptions = $(FrcDeclare) |
284 |
|
|
CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
285 |
gezelter |
1508 |
FortranOptions = |
286 |
gezelter |
1521 |
F90Options = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir) |
287 |
tim |
1525 |
F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) |
288 |
gezelter |
1508 |
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 |
tim |
1512 |
$(PackageTargetDir)/%.o : %.c |
327 |
gezelter |
1508 |
$(Print) $@ |
328 |
tim |
1514 |
$(CCompiler) $(COptions) -c $(IncludePath) $< -o $@ |
329 |
gezelter |
1508 |
|
330 |
tim |
1525 |
$(PackageParallelTargetDir)/%.o : %.c |
331 |
|
|
$(Print) $@ |
332 |
|
|
$(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@ |
333 |
|
|
|
334 |
|
|
ifeq "$(UseMPI)" "yes" |
335 |
tim |
1512 |
%.o : %.c |
336 |
gezelter |
1508 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
337 |
tim |
1525 |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
338 |
|
|
else |
339 |
|
|
%.o : %.c |
340 |
|
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
341 |
|
|
endif |
342 |
gezelter |
1508 |
|
343 |
|
|
# .cpp -> .o |
344 |
tim |
1512 |
$(PackageTargetDir)/%.o : %.cpp |
345 |
gezelter |
1508 |
$(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@ |
346 |
|
|
|
347 |
tim |
1525 |
$(PackageParallelTargetDir)/%.o : %.cpp |
348 |
|
|
$(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@ |
349 |
|
|
|
350 |
|
|
ifeq "$(UseMPI)" "yes" |
351 |
tim |
1512 |
%.o : %.cpp |
352 |
gezelter |
1508 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
353 |
tim |
1525 |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
354 |
|
|
else |
355 |
|
|
%.o : %.cpp |
356 |
|
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
357 |
|
|
endif |
358 |
gezelter |
1508 |
|
359 |
|
|
# .f -> .o |
360 |
tim |
1512 |
$(PackageTargetDir)/%.o : %.f |
361 |
tim |
1514 |
$(FortranCompiler) $(FortranOptions) -c $< -o $@ |
362 |
gezelter |
1508 |
|
363 |
tim |
1525 |
$(PackageParallelTargetDir)/%.o : %.f |
364 |
|
|
$(FortranCompiler) $(FortranParallelOptions) -c $< -o $@ |
365 |
|
|
|
366 |
|
|
ifeq "$(UseMPI)" "yes" |
367 |
tim |
1512 |
%.o : %.f |
368 |
gezelter |
1508 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
369 |
tim |
1525 |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
370 |
|
|
else |
371 |
|
|
%.o : %.f |
372 |
|
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
373 |
|
|
endif |
374 |
gezelter |
1508 |
|
375 |
|
|
# .F90 -> .o |
376 |
tim |
1512 |
$(PackageTargetDir)/%.o : %.F90 |
377 |
tim |
1525 |
$(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@ |
378 |
gezelter |
1508 |
|
379 |
tim |
1525 |
$(PackageParallelTargetDir)/%.o : %.F90 |
380 |
|
|
$(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@ |
381 |
|
|
|
382 |
|
|
ifeq "$(UseMPI)" "yes" |
383 |
tim |
1512 |
%.o : %.F90 |
384 |
gezelter |
1508 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
385 |
tim |
1525 |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
386 |
|
|
else |
387 |
|
|
%.o : %.F90 |
388 |
|
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
389 |
|
|
endif |
390 |
gezelter |
1508 |
|
391 |
tim |
1525 |
|
392 |
gezelter |
1508 |
# .java -> .class |
393 |
|
|
$(PackageTargetDir)/%.class : $(PackageSourceDir)/%.java |
394 |
tim |
1514 |
$(JavaCompiler) $(JavaCompilerOptions) $< |
395 |
gezelter |
1508 |
|
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 |
tim |
1512 |
%.h : %.y |
408 |
tim |
1514 |
$(Yacc) -d $? |
409 |
gezelter |
1508 |
@$(Move) y.tab.h $*.h |
410 |
|
|
@$(Delete) y.tab.c |
411 |
|
|
|
412 |
|
|
#.y -> .c |
413 |
tim |
1512 |
%.c : %.y |
414 |
tim |
1514 |
$(Yacc) -d $? |
415 |
gezelter |
1508 |
@$(Move) y.tab.c $*.c |
416 |
|
|
@$(Delete) y.tab.h |
417 |
|
|
|
418 |
|
|
# .l -> .c |
419 |
tim |
1512 |
%.c : %.l |
420 |
gezelter |
1508 |
$(Print) $@ |
421 |
|
|
$(Print) $(Lex) -o$@ $? |
422 |
|
|
@$(Lex) -o$@ $? |
423 |
|
|
|
424 |
|
|
# .o -> .a |
425 |
tim |
1525 |
|
426 |
gezelter |
1508 |
$(LibDir)/%.a : $(ObjectFiles) |
427 |
tim |
1514 |
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles) |
428 |
gezelter |
1508 |
|
429 |
tim |
1525 |
$(ParallelLibDir)/%.a: $(ParallelObjectFiles) |
430 |
tim |
1514 |
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles) |
431 |
gezelter |
1508 |
|
432 |
tim |
1525 |
ifeq "$(UseMPI)" "yes" |
433 |
|
|
%.a : $(ObjectFiles) $(ParallelObjectFiles) |
434 |
gezelter |
1508 |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
435 |
tim |
1525 |
$(MAKE) $(MakeOptions) $(ParallelLibDir)/$@ |
436 |
|
|
else |
437 |
|
|
%.a : $(ObjectFiles) |
438 |
|
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
439 |
|
|
endif |
440 |
gezelter |
1508 |
|
441 |
|
|
# .o -> .so |
442 |
|
|
$(LibDir)/%.so : $(ObjectFiles) |
443 |
|
|
$(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@ |
444 |
|
|
|
445 |
tim |
1525 |
$(ParallelLibDir)/%.so : $(ParallelObjectFiles) |
446 |
gezelter |
1508 |
$(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@ |
447 |
|
|
|
448 |
tim |
1525 |
ifeq "$(UseMPI)" "yes" |
449 |
|
|
%.so : $(ObjectFiles) $(ParallelObjectFiles) |
450 |
gezelter |
1508 |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
451 |
tim |
1525 |
$(MAKE) $(MakeOptions) $(ParallelLibDir)/$@ |
452 |
|
|
else |
453 |
|
|
%.so : $(ObjectFiles) |
454 |
|
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
455 |
|
|
endif |
456 |
gezelter |
1508 |
|
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 |
tim |
1527 |
$(Linker) $(ObjectFiles) $(LinkOptions) $(LibDirs) $(LibList) -o $@ |
492 |
gezelter |
1508 |
|
493 |
|
|
$(ParallelExecutable) : $(ParallelObjectFiles) |
494 |
tim |
1527 |
$(Linker) $(ParallelObjectFiles) $(ParallelLinkOptions) $(ParallelLibDirs) $(LibList) -o $@ |
495 |
gezelter |
1508 |
|
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 |
tim |
1525 |
ifeq "$(UseMPI)" "yes" |
508 |
gezelter |
1508 |
_buildall : \ |
509 |
|
|
$(DependencyFile) \ |
510 |
|
|
$(PackageTargetDir) \ |
511 |
|
|
$(ObjectFiles) \ |
512 |
tim |
1525 |
$(ParallelObjectFiles) \ |
513 |
gezelter |
1508 |
$(JavaClassFiles) \ |
514 |
|
|
$(RmiStubFiles) \ |
515 |
|
|
$(RmiSkeletonFiles) \ |
516 |
|
|
$(OtherTargetFiles) \ |
517 |
tim |
1527 |
$(SharedLibrary) \ |
518 |
gezelter |
1508 |
$(StaticLibrary) \ |
519 |
tim |
1527 |
$(ParallelSharedLibrary) \ |
520 |
tim |
1525 |
$(ParallelStaticLibrary) \ |
521 |
gezelter |
1508 |
$(JarFile) \ |
522 |
tim |
1525 |
$(Executable) \ |
523 |
|
|
$(ParallelExecutable) |
524 |
|
|
else |
525 |
|
|
_buildall : \ |
526 |
|
|
$(DependencyFile) \ |
527 |
|
|
$(PackageTargetDir) \ |
528 |
|
|
$(ObjectFiles) \ |
529 |
|
|
$(JavaClassFiles) \ |
530 |
|
|
$(RmiStubFiles) \ |
531 |
|
|
$(RmiSkeletonFiles) \ |
532 |
|
|
$(OtherTargetFiles) \ |
533 |
tim |
1527 |
$(SharedLibrary) \ |
534 |
tim |
1525 |
$(StaticLibrary) \ |
535 |
|
|
$(JarFile) \ |
536 |
|
|
$(Executable) |
537 |
|
|
endif |
538 |
gezelter |
1508 |
|
539 |
tim |
1525 |
|
540 |
gezelter |
1508 |
# make clean |
541 |
|
|
clean : $(PackageListLoop) |
542 |
|
|
$(Print) Done clean. |
543 |
|
|
|
544 |
|
|
_cleanall : |
545 |
tim |
1514 |
$(Delete) $(ObjectFiles) $(ParallelObjectFiles) |
546 |
|
|
|
547 |
|
|
# make distclean |
548 |
|
|
distclean : $(PackageListLoop) |
549 |
|
|
$(Print) Done clean. |
550 |
|
|
|
551 |
|
|
_distcleanall : |
552 |
|
|
$(Delete) $(ObjectFiles) \ |
553 |
|
|
$(ParallelObjectFiles) \ |
554 |
tim |
1523 |
$(JarFile) \ |
555 |
gezelter |
1508 |
$(SharedLibrary) \ |
556 |
|
|
$(StaticLibrary) \ |
557 |
tim |
1514 |
$(ParallelSharedLibrary) \ |
558 |
|
|
$(ParallelStaticLibrary) \ |
559 |
gezelter |
1508 |
$(Executable) \ |
560 |
tim |
1514 |
$(ParallelExecutable) \ |
561 |
tim |
1523 |
$(DependencyFile) |
562 |
gezelter |
1508 |
|
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 |
tim |
1510 |
|
574 |
tim |
1523 |
@touch Make.ctemp |
575 |
|
|
@touch Make.ctemp |
576 |
tim |
1510 |
|
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 |
gezelter |
1508 |
endif |
582 |
tim |
1510 |
|
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 |
gezelter |
1508 |
endif |
589 |
tim |
1510 |
|
590 |
|
|
ifneq "$(words $(F90Files))" "0" |
591 |
tim |
1524 |
$(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 |
gezelter |
1508 |
cat Make.ftemp >> $(DependencyFile) |
594 |
|
|
endif |
595 |
tim |
1510 |
$(Delete) Make.cpptemp Make.ctemp Make.ftemp |
596 |
gezelter |
1508 |
|
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 |
tim |
1523 |
#make cvslog |
625 |
|
|
cvslog: |
626 |
|
|
$(DEV_ROOT)/scripts/cvs2cl.pl |
627 |
|
|
|
628 |
gezelter |
1508 |
# 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 |