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