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