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 |
gezelter |
1930 |
visitors \ |
42 |
tim |
1514 |
math \ |
43 |
|
|
types \ |
44 |
|
|
primitives \ |
45 |
|
|
UseTheForce/DarkSide \ |
46 |
|
|
UseTheForce \ |
47 |
|
|
brains \ |
48 |
|
|
io \ |
49 |
gezelter |
1930 |
integrators\ |
50 |
tim |
1514 |
constraints \ |
51 |
chrisfen |
1715 |
minimizers \ |
52 |
tim |
1529 |
|
53 |
|
|
#packages containing applications |
54 |
|
|
Applications = \ |
55 |
tim |
1514 |
applications/oopse \ |
56 |
|
|
applications/dump2Xyz \ |
57 |
gezelter |
1930 |
applications/simpleBuilder\ |
58 |
gezelter |
1508 |
|
59 |
gezelter |
1535 |
Samples = \ |
60 |
|
|
samples/argon \ |
61 |
|
|
samples/water/dimer \ |
62 |
|
|
samples/water/spce \ |
63 |
|
|
samples/water/ssd \ |
64 |
|
|
samples/water/ssde \ |
65 |
|
|
samples/water/tip3p_ice \ |
66 |
|
|
samples/water/tip4p \ |
67 |
|
|
samples/lipid \ |
68 |
|
|
samples/alkane \ |
69 |
|
|
samples/minimizer \ |
70 |
|
|
samples/metals \ |
71 |
|
|
samples/zcons \ |
72 |
|
|
|
73 |
tim |
1514 |
IncludeDirs = \ |
74 |
gezelter |
1521 |
@SPRNG_INC_DIR@ \ |
75 |
|
|
@MPI_INC_DIR@ |
76 |
tim |
1514 |
|
77 |
|
|
LibraryDirs = \ |
78 |
gezelter |
1521 |
@SPRNG_LIB_DIR@ \ |
79 |
|
|
@MPI_LIB_DIR@ |
80 |
tim |
1514 |
|
81 |
|
|
Libraries = \ |
82 |
gezelter |
1521 |
@SPRNG_LIB@ \ |
83 |
tim |
1525 |
@MPI_LIB@ \ |
84 |
|
|
@MPI_F90_LIB@ |
85 |
tim |
1514 |
|
86 |
gezelter |
1521 |
OopseHome = @OOPSE_HOME@ |
87 |
gezelter |
1552 |
ForceParamDir = $(OopseHome)/share/forceFields |
88 |
|
|
SampleSimDir = $(OopseHome)/share/samples |
89 |
|
|
InstallBinDir = $(OopseHome)/bin |
90 |
|
|
DocDir = $(OopseHome)/doc |
91 |
gezelter |
1521 |
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 |
gezelter |
1951 |
#Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir)) |
127 |
|
|
# REMINDER: We are now using the Package line in each subdir makefile. |
128 |
|
|
# This avoids the strange path problem and the subshell |
129 |
tim |
1512 |
|
130 |
gezelter |
1508 |
PackageList = $(Package) |
131 |
|
|
PackageSourceDir = $(SourceDir)/$(Package) |
132 |
|
|
PackageTargetDir = $(TargetDir) |
133 |
|
|
PackageParallelTargetDir = $(ParallelTargetDir) |
134 |
|
|
JavaMainClass = $(subst /,.,$(Package)).$(Main) |
135 |
|
|
else |
136 |
tim |
1529 |
PackageList = $(PackageLibs) $(JavaPackages) $(Applications) |
137 |
gezelter |
1508 |
endif |
138 |
|
|
|
139 |
tim |
1512 |
PackageListLoop = $(patsubst %,$(SourceDir)/%/.loop,$(PackageList)) |
140 |
gezelter |
1508 |
|
141 |
tim |
1512 |
JRE = $(JAVA_HOME)/jre/lib/rt.jar |
142 |
gezelter |
1508 |
|
143 |
|
|
ifdef IS_UNIX |
144 |
|
|
X = : |
145 |
|
|
else |
146 |
|
|
X = \; |
147 |
|
|
endif |
148 |
|
|
|
149 |
|
|
#--------------------------------------------------------------------------- |
150 |
|
|
# |
151 |
|
|
# Classification of files |
152 |
|
|
# |
153 |
|
|
#--------------------------------------------------------------------------- |
154 |
|
|
|
155 |
|
|
# Source |
156 |
|
|
JavaFiles = $(filter %.java, $(Source)) |
157 |
|
|
CppFiles = $(filter %.cpp, $(Source)) |
158 |
|
|
CFiles = $(filter %.c, $(Source)) |
159 |
|
|
FortranFiles = $(filter %.f, $(Source)) |
160 |
|
|
F90Files = $(filter %.F90, $(Source)) |
161 |
|
|
CorbaFiles = $(filter %.idl, $(Source)) |
162 |
|
|
LexFiles = $(filter %.l, $(Source)) |
163 |
|
|
YaccFiles = $(filter %.y, $(Source)) |
164 |
|
|
OtherSourceFiles = $(filter-out $(JavaFiles) $(CppFiles) $(CFiles) \ |
165 |
|
|
$(FortranFiles) $(F90Files) $(LexFiles) \ |
166 |
|
|
$(YaccFiles) $(CorbaFiles), \ |
167 |
|
|
$(Source)) |
168 |
|
|
ManifestFile = $(PackageSourceDir)/Manifest |
169 |
|
|
|
170 |
tim |
1512 |
SourceFiles = $(JavaFiles)\ |
171 |
|
|
$(CppFiles)\ |
172 |
|
|
$(CFiles)\ |
173 |
|
|
$(FortranFiles)\ |
174 |
|
|
$(F90Files)\ |
175 |
|
|
$(LexFiles)\ |
176 |
|
|
$(YaccFiles) |
177 |
gezelter |
1508 |
|
178 |
|
|
# Target |
179 |
|
|
JavaClassFiles = $(JavaFiles:%.java= $(PackageTargetDir)/%.class) |
180 |
|
|
JavaClassFilesRel = $(JavaFiles:%.java= $(Package)/%.class) |
181 |
|
|
RmiStubFiles = $(RmiSource:%.java= $(PackageTargetDir)/%_Stub.class) |
182 |
|
|
RmiSkeletonFiles = $(RmiSource:%.java= $(PackageTargetDir)/%_Skel.class) |
183 |
|
|
JniClassFiles = $(JniSource:%.java= $(PackageTargetDir)/%.class) |
184 |
|
|
JniHeaders = $(JniSource:%.java= $(PackageSourceDir)/%.h) |
185 |
|
|
ObjectFiles = $(CFiles:%.c= $(PackageTargetDir)/%.o)\ |
186 |
tim |
1512 |
$(CppFiles:%.cpp= $(PackageTargetDir)/%.o)\ |
187 |
tim |
1525 |
$(FortranFiles:%.f= $(PackageTargetDir)/%.o)\ |
188 |
|
|
$(F90Files:%.F90= $(PackageTargetDir)/%.o)\ |
189 |
|
|
$(LexFiles:%.l= $(PackageTargetDir)/%.o)\ |
190 |
|
|
$(YaccFiles:%.y= $(PackageTargetDir)/%.o) |
191 |
gezelter |
1508 |
ParallelObjectFiles = $(CFiles:%.c= $(PackageParallelTargetDir)/%.o)\ |
192 |
tim |
1525 |
$(CppFiles:%.cpp= $(PackageParallelTargetDir)/%.o)\ |
193 |
|
|
$(FortranFiles:%.f= $(PackageParallelTargetDir)/%.o)\ |
194 |
|
|
$(F90Files:%.F90= $(PackageParallelTargetDir)/%.o)\ |
195 |
|
|
$(LexFiles:%.l= $(PackageParallelTargetDir)/%.o)\ |
196 |
|
|
$(YaccFiles:%.y= $(PackageParallelTargetDir)/%.o) |
197 |
gezelter |
1508 |
|
198 |
|
|
DerivedSource = $(YaccFiles:%.y= %.h) \ |
199 |
tim |
1525 |
$(YaccFiles:%.y= %.c) \ |
200 |
|
|
$(LexFiles:%.l= %.c) |
201 |
gezelter |
1508 |
|
202 |
|
|
DerivedCFiles = $(YaccFiles:%.y= %.c) \ |
203 |
tim |
1525 |
$(LexFiles:%.l= %.c) |
204 |
gezelter |
1508 |
|
205 |
|
|
OtherTargetFiles = $(OtherSourceFiles:%=$(PackageTargetDir)/%) |
206 |
|
|
|
207 |
|
|
ThirdPartyJarsTmp = $(patsubst %,$(LibDir)/%,$(JavaLibraries)) |
208 |
|
|
ThirdPartyJars = $(subst $(Space),$(X),$(ThirdPartyJarsTmp)) |
209 |
|
|
|
210 |
|
|
ifneq "$(words $(JavaFiles))" "0" |
211 |
|
|
JavaPackageName = $(subst /,.,$(Package)) |
212 |
|
|
JarFile = $(LibDir)/$(subst /,,$(Package)).jar |
213 |
|
|
endif |
214 |
|
|
|
215 |
|
|
#if Main is defined, do not build library. It may not be true sometimes |
216 |
|
|
ifneq "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0" |
217 |
|
|
DependencyFile = $(PackageSourceDir)/Makedepend |
218 |
|
|
ifneq "$(Main)" "" |
219 |
tim |
1512 |
Executable = $(BinDir)/$(Main) |
220 |
gezelter |
1508 |
ParallelExecutable = $(BinDir)/$(Main)_MPI |
221 |
|
|
else |
222 |
tim |
1529 |
SharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.so |
223 |
|
|
StaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_UP.a |
224 |
|
|
ParallelSharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.so |
225 |
|
|
ParallelStaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.a |
226 |
gezelter |
1508 |
endif |
227 |
|
|
endif |
228 |
tim |
1544 |
|
229 |
gezelter |
1508 |
# |
230 |
|
|
# Misc |
231 |
|
|
# |
232 |
|
|
ClassPath = $(JRE)$(X)$(TargetDir)$(X)$(ThirdPartyJars) |
233 |
|
|
JavaPackageNames = $(subst /,.,$(JavaPackages)) |
234 |
|
|
IncludePath = -I$(SourceDir) $(IncludeDirs:%=-I%) |
235 |
|
|
LibDirs = -L$(LibDir) $(LibraryDirs:%=-L%) |
236 |
tim |
1529 |
LocalLibs = $(subst /,,$(patsubst %, oopse_%_UP, $(PackageLibs))) |
237 |
|
|
ParallelLocalLibs= $(subst /,,$(patsubst %, oopse_%_MPI, $(PackageLibs))) |
238 |
gezelter |
1521 |
LibList = $(LocalLibs:%=-l%) $(Libraries) |
239 |
tim |
1529 |
LibNames = $(LocalLibs:%=$(LibDir)/lib%.a) |
240 |
tim |
1525 |
ParallelLibList = $(ParallelLocalLibs:%=-l%) $(Libraries) |
241 |
tim |
1529 |
ParallelLibNames = $(ParallelLocalLibs:%=$(LibDir)/lib%.a) |
242 |
gezelter |
1508 |
|
243 |
|
|
|
244 |
|
|
#--------------------------------------------------------------------------- |
245 |
|
|
# |
246 |
|
|
# Tools & Options |
247 |
|
|
# |
248 |
|
|
#--------------------------------------------------------------------------- |
249 |
|
|
Print = @echo |
250 |
gezelter |
1930 |
Move = mv -f |
251 |
gezelter |
1508 |
Copy = cp |
252 |
|
|
CCompiler = @CC@ |
253 |
|
|
CppCompiler = @CXX@ |
254 |
|
|
Linker = @CXX@ |
255 |
|
|
MakeDepend = makedepend |
256 |
gezelter |
1552 |
INSTALL = @INSTALL@ |
257 |
gezelter |
1508 |
InstallProgram = @INSTALL_PROGRAM@ |
258 |
|
|
InstallData = @INSTALL_DATA@ |
259 |
gezelter |
1938 |
MkDir = @MKINSTALLDIRS@ |
260 |
gezelter |
1508 |
Delete = rm -fr |
261 |
|
|
StaticArchiver = @AR@ |
262 |
|
|
DynamicArchiver = @CC@ |
263 |
|
|
FortranCompiler = @FC@ |
264 |
|
|
F90Compiler = @F90@ |
265 |
|
|
JavaCompiler = $(JAVA_HOME)/bin/javac |
266 |
|
|
JavaArchiver = $(JAVA_HOME)/bin/jar |
267 |
|
|
JarSigner = $(JAVA_HOME)/bin/jarsigner |
268 |
|
|
JavadocGenerator = $(JAVA_HOME)/bin/javadoc |
269 |
|
|
JniCompiler = $(JAVA_HOME)/bin/javah |
270 |
|
|
RmiCompiler = $(JAVA_HOME)/bin/rmic |
271 |
|
|
JavaExecute = $(JAVA_HOME)/bin/java |
272 |
|
|
Purify = purify |
273 |
|
|
WordCount = wc |
274 |
|
|
List = cat |
275 |
|
|
Yacc = @YACC@ |
276 |
|
|
Lex = @LEX@ |
277 |
tim |
1529 |
Ranlib = @RANLIB@ |
278 |
tim |
1539 |
Doxygen = @DOXYGEN@ |
279 |
gezelter |
1508 |
|
280 |
tim |
1514 |
MakeOptions = -k |
281 |
gezelter |
1508 |
MakeDependOptions = |
282 |
|
|
StaticArchiverOptions = rc |
283 |
|
|
DynamicArchiverOptions = -shared |
284 |
|
|
JavaArchiverOptions = |
285 |
|
|
JniOptions = |
286 |
|
|
RmiOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
287 |
|
|
-sourcepath $(SourceDir) |
288 |
chrisfen |
1635 |
COptions = $(FrcDeclare) @CFLAGS@ |
289 |
|
|
CParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CFLAGS@ |
290 |
gezelter |
1940 |
CppOptions = $(FrcDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@ |
291 |
|
|
CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) @CXXFLAGS@ @OOPSE_TEMPLATE_FLAGS@ |
292 |
gezelter |
1508 |
FortranOptions = |
293 |
tim |
1554 |
F90Options = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(TargetDir) |
294 |
|
|
F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) @MODDIRFLAG@$(ParallelTargetDir) @PREPDEFFLAG@$(ParallelDeclare) |
295 |
gezelter |
1508 |
JavaCompilerOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
296 |
|
|
-sourcepath $(SourceDir) -deprecation |
297 |
|
|
JavaRunOptions = -classpath $(ClassPath) |
298 |
|
|
PurifyOptions = |
299 |
|
|
JavadocOptions = -d $(DocsDir) \ |
300 |
|
|
-sourcepath $(SourceDir) \ |
301 |
|
|
-classpath $(ClassPath) \ |
302 |
|
|
-author \ |
303 |
|
|
-package \ |
304 |
|
|
-use \ |
305 |
|
|
-splitIndex \ |
306 |
|
|
-version \ |
307 |
|
|
-link file:$(JAVA_HOME)/docs/api \ |
308 |
|
|
-windowtitle $(JavadocWindowTitle) \ |
309 |
|
|
-doctitle $(JavadocDocTitle) \ |
310 |
|
|
-header $(JavadocHeader) \ |
311 |
|
|
-bottom $(JavadocFooter) |
312 |
|
|
WordCountOptions = --lines |
313 |
|
|
|
314 |
|
|
Empty = |
315 |
|
|
Space = $(Empty) $(Empty) |
316 |
|
|
|
317 |
|
|
|
318 |
|
|
#--------------------------------------------------------------------------- |
319 |
|
|
# |
320 |
tim |
1544 |
# Install |
321 |
|
|
# |
322 |
|
|
#--------------------------------------------------------------------------- |
323 |
|
|
|
324 |
|
|
ifneq "$(words $(SampleFiles))" "0" |
325 |
tim |
1546 |
MySample = $(subst $(shell cd $(DEV_ROOT)/samples; pwd)/,,$(CurrentDir)) |
326 |
|
|
MyInstallDir = $(SampleSimDir)/$(MySample) |
327 |
|
|
InstallFiles = $(SampleFiles) |
328 |
|
|
InstallCommand = $(InstallData) |
329 |
tim |
1544 |
endif |
330 |
|
|
|
331 |
|
|
ifneq "$(words $(Main))" "0" |
332 |
tim |
1546 |
MyInstallDir = $(InstallBinDir) |
333 |
|
|
ifeq "$(UseMPI)" "yes" |
334 |
|
|
InstallFiles = $(Executable) $(ParallelExecutable) |
335 |
|
|
else |
336 |
|
|
InstallFiles = $(Executable) |
337 |
|
|
endif |
338 |
|
|
InstallCommand = $(InstallProgram) |
339 |
tim |
1544 |
endif |
340 |
|
|
|
341 |
tim |
1545 |
ifneq "$(words $(ForcefieldFiles))" "0" |
342 |
tim |
1546 |
MyInstallDir = $(ForceParamDir) |
343 |
|
|
InstallFiles = $(ForcefieldFiles) |
344 |
|
|
InstallCommand = $(InstallData) |
345 |
tim |
1544 |
endif |
346 |
|
|
|
347 |
|
|
ifneq "$(words $(InstallFiles))" "0" |
348 |
|
|
InstallList = |
349 |
|
|
else |
350 |
tim |
1545 |
InstallList = $(patsubst %,$(DEV_ROOT)/%,$(Samples)) $(DEV_ROOT)/forceFields $(patsubst %, $(SourceDir)/%,$(Applications)) |
351 |
tim |
1544 |
endif |
352 |
|
|
|
353 |
|
|
InstallListLoop = $(patsubst %,$(SourceDir)/%/.install,$(PackageList)) $(patsubst %,%/.install,$(InstallList)) |
354 |
|
|
|
355 |
|
|
|
356 |
|
|
|
357 |
|
|
#--------------------------------------------------------------------------- |
358 |
|
|
# |
359 |
gezelter |
1508 |
# Rules |
360 |
|
|
# |
361 |
|
|
#--------------------------------------------------------------------------- |
362 |
|
|
default : build |
363 |
|
|
|
364 |
|
|
%.loop : |
365 |
|
|
@$(MAKE) $(MakeOptions) -C $(subst .loop,,$@) _$(MAKECMDGOALS)all |
366 |
|
|
|
367 |
|
|
# Create target directory |
368 |
|
|
$(PackageTargetDir) : |
369 |
gezelter |
1938 |
$(MkDir) $@ |
370 |
gezelter |
1508 |
|
371 |
gezelter |
1938 |
$(BinDir) : |
372 |
|
|
$(MkDir) $@ |
373 |
|
|
|
374 |
gezelter |
1508 |
# .c -> .o |
375 |
tim |
1512 |
$(PackageTargetDir)/%.o : %.c |
376 |
gezelter |
1508 |
$(Print) $@ |
377 |
tim |
1514 |
$(CCompiler) $(COptions) -c $(IncludePath) $< -o $@ |
378 |
gezelter |
1508 |
|
379 |
tim |
1525 |
$(PackageParallelTargetDir)/%.o : %.c |
380 |
|
|
$(Print) $@ |
381 |
|
|
$(CCompiler) $(CParallelOptions) -c $(IncludePath) $< -o $@ |
382 |
|
|
|
383 |
|
|
ifeq "$(UseMPI)" "yes" |
384 |
tim |
1512 |
%.o : %.c |
385 |
gezelter |
1508 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
386 |
tim |
1525 |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
387 |
|
|
else |
388 |
|
|
%.o : %.c |
389 |
|
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
390 |
|
|
endif |
391 |
gezelter |
1508 |
|
392 |
|
|
# .cpp -> .o |
393 |
tim |
1512 |
$(PackageTargetDir)/%.o : %.cpp |
394 |
gezelter |
1508 |
$(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@ |
395 |
|
|
|
396 |
tim |
1525 |
$(PackageParallelTargetDir)/%.o : %.cpp |
397 |
|
|
$(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@ |
398 |
|
|
|
399 |
|
|
ifeq "$(UseMPI)" "yes" |
400 |
tim |
1512 |
%.o : %.cpp |
401 |
gezelter |
1508 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
402 |
tim |
1525 |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
403 |
|
|
else |
404 |
|
|
%.o : %.cpp |
405 |
|
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
406 |
|
|
endif |
407 |
gezelter |
1508 |
|
408 |
|
|
# .f -> .o |
409 |
tim |
1512 |
$(PackageTargetDir)/%.o : %.f |
410 |
tim |
1514 |
$(FortranCompiler) $(FortranOptions) -c $< -o $@ |
411 |
gezelter |
1508 |
|
412 |
tim |
1525 |
$(PackageParallelTargetDir)/%.o : %.f |
413 |
|
|
$(FortranCompiler) $(FortranParallelOptions) -c $< -o $@ |
414 |
|
|
|
415 |
|
|
ifeq "$(UseMPI)" "yes" |
416 |
tim |
1512 |
%.o : %.f |
417 |
gezelter |
1508 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
418 |
tim |
1525 |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
419 |
|
|
else |
420 |
|
|
%.o : %.f |
421 |
|
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
422 |
|
|
endif |
423 |
gezelter |
1508 |
|
424 |
|
|
# .F90 -> .o |
425 |
tim |
1512 |
$(PackageTargetDir)/%.o : %.F90 |
426 |
tim |
1525 |
$(F90Compiler) $(F90Options) $(IncludePath) -c $< -o $@ |
427 |
gezelter |
1930 |
if test -n "`ls *.$(ModSuffix)`"; then \ |
428 |
|
|
$(Move) `ls *.$(ModSuffix)` $(PackageTargetDir);\ |
429 |
|
|
fi |
430 |
gezelter |
1508 |
|
431 |
tim |
1525 |
$(PackageParallelTargetDir)/%.o : %.F90 |
432 |
|
|
$(F90Compiler) $(F90ParallelOptions) $(IncludePath) -c $< -o $@ |
433 |
gezelter |
1930 |
if test -n "`ls *.$(ModSuffix)`"; then \ |
434 |
|
|
$(Move) "`ls *.$(ModSuffix)`" $(PackageParallelTargetDir);\ |
435 |
|
|
fi |
436 |
tim |
1525 |
|
437 |
|
|
ifeq "$(UseMPI)" "yes" |
438 |
tim |
1512 |
%.o : %.F90 |
439 |
gezelter |
1508 |
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
440 |
tim |
1932 |
if test -n "`ls *.$(ModSuffix)`"; then\ |
441 |
|
|
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
442 |
chuckv |
1899 |
fi |
443 |
tim |
1553 |
|
444 |
tim |
1525 |
$(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@ |
445 |
tim |
1933 |
if test -n "`ls *.$(ModSuffix)`"; then\ |
446 |
|
|
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
447 |
|
|
fi |
448 |
tim |
1553 |
|
449 |
tim |
1525 |
else |
450 |
|
|
%.o : %.F90 |
451 |
|
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
452 |
tim |
1932 |
if test -n "`ls *.$(ModSuffix)`"; then\ |
453 |
|
|
$(Move) "`ls *.$(ModSuffix)`" $(PackageTargetDir);\ |
454 |
chuckv |
1899 |
fi |
455 |
tim |
1525 |
endif |
456 |
gezelter |
1508 |
|
457 |
tim |
1525 |
|
458 |
gezelter |
1508 |
# .java -> .class |
459 |
|
|
$(PackageTargetDir)/%.class : $(PackageSourceDir)/%.java |
460 |
tim |
1514 |
$(JavaCompiler) $(JavaCompilerOptions) $< |
461 |
gezelter |
1508 |
|
462 |
|
|
%.class : $(PackageSourceDir)/%.java |
463 |
|
|
@$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
464 |
|
|
|
465 |
|
|
# .class -> .h |
466 |
|
|
$(PackageSourceDir)/%.h : $(PackageTargetDir)/%.class |
467 |
|
|
$(JniCompiler) $(JniOptions) $(JavaPackageName).$* |
468 |
|
|
|
469 |
|
|
%.h : %.class |
470 |
|
|
$(MAKE) $(MakeOptions) $(PackageSourceDir)/$@ |
471 |
|
|
|
472 |
|
|
#.y -> .h |
473 |
tim |
1512 |
%.h : %.y |
474 |
tim |
1514 |
$(Yacc) -d $? |
475 |
gezelter |
1508 |
@$(Move) y.tab.h $*.h |
476 |
|
|
@$(Delete) y.tab.c |
477 |
|
|
|
478 |
|
|
#.y -> .c |
479 |
tim |
1512 |
%.c : %.y |
480 |
tim |
1514 |
$(Yacc) -d $? |
481 |
gezelter |
1508 |
@$(Move) y.tab.c $*.c |
482 |
|
|
@$(Delete) y.tab.h |
483 |
|
|
|
484 |
|
|
# .l -> .c |
485 |
tim |
1512 |
%.c : %.l |
486 |
gezelter |
1508 |
$(Print) $@ |
487 |
|
|
$(Print) $(Lex) -o$@ $? |
488 |
|
|
@$(Lex) -o$@ $? |
489 |
|
|
|
490 |
|
|
# .o -> .a |
491 |
tim |
1525 |
|
492 |
tim |
1529 |
$(LibDir)/%_UP.a : $(ObjectFiles) |
493 |
tim |
1514 |
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles) |
494 |
tim |
1530 |
@touch $(LibDir)/.stamp_UP |
495 |
gezelter |
1508 |
|
496 |
tim |
1529 |
$(LibDir)/%_MPI.a: $(ParallelObjectFiles) |
497 |
tim |
1514 |
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles) |
498 |
tim |
1530 |
@touch $(LibDir)/.stamp_MPI |
499 |
gezelter |
1508 |
|
500 |
tim |
1529 |
%_UP.a : $(ObjectFiles) |
501 |
gezelter |
1508 |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
502 |
tim |
1529 |
|
503 |
|
|
%_MPI.a : $(ParallelObjectFiles) |
504 |
tim |
1525 |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
505 |
gezelter |
1508 |
|
506 |
|
|
# .o -> .so |
507 |
tim |
1529 |
$(LibDir)/%_UP.so : $(ObjectFiles) |
508 |
gezelter |
1508 |
$(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@ |
509 |
|
|
|
510 |
tim |
1529 |
$(LibDir)/%_MPI.so : $(ParallelObjectFiles) |
511 |
gezelter |
1508 |
$(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@ |
512 |
|
|
|
513 |
tim |
1529 |
%_UP.so : $(ObjectFiles) |
514 |
gezelter |
1508 |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
515 |
tim |
1529 |
|
516 |
|
|
%_MPI.so : $(ParallelObjectFiles) |
517 |
tim |
1525 |
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
518 |
gezelter |
1508 |
|
519 |
|
|
# .class -> .jar |
520 |
|
|
$(LibDir)/%.jar : $(JavaClassFiles) $(OtherTargetFiles) |
521 |
|
|
$(Print) $@ |
522 |
|
|
@cd $(TargetDir); $(JavaArchiver) -cf $@ \ |
523 |
|
|
$(JavaClassFilesRel) $(OtherTargetFiles) |
524 |
|
|
|
525 |
|
|
%.jar : $(JavaClassFiles) $(OtherTargetFiles) |
526 |
|
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
527 |
|
|
|
528 |
|
|
# .class -> JavaDoc |
529 |
|
|
javadoc : |
530 |
|
|
$(Print) $(JavaPackageNames) > $(DEV_ROOT)/packages.tmp |
531 |
|
|
$(JavadocGenerator) $(JavadocOptions) @$(DEV_ROOT)/packages.tmp |
532 |
|
|
$(Delete) $(DEV_ROOT)/packages.tmp |
533 |
|
|
$(Print) Done JavaDoc. |
534 |
|
|
|
535 |
|
|
# .class -> _Stub.class |
536 |
|
|
$(PackageTargetDir)/%_Stub.class : $(PackageTargetDir)/%.class |
537 |
|
|
$(Print) $@ |
538 |
|
|
$(RmiCompiler) $(RmiOptions) $(JavaPackageName).$* |
539 |
|
|
|
540 |
|
|
%_Stub.class : %.class |
541 |
|
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
542 |
|
|
|
543 |
|
|
# .class -> _Skel.class |
544 |
|
|
$(PackageTargetDir)/%_Skel.class : $(PackageTargetDir)/%.class |
545 |
|
|
$(Print) $@ |
546 |
|
|
$(RmiCompiler) $(RmiOptions) $(JavaPackageName).$* |
547 |
|
|
|
548 |
|
|
%_Skel.class : %.class |
549 |
|
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
550 |
|
|
|
551 |
tim |
1539 |
document : |
552 |
|
|
$(Print) Generate Documentation for OOPSE-2.0 |
553 |
|
|
@cd $(DEV_ROOT)/src |
554 |
|
|
$(Doxygen) $(DEV_ROOT)/make/Doxyfile |
555 |
|
|
|
556 |
tim |
1529 |
#GUN make funtions to merge the libraries |
557 |
|
|
find_objs = $(shell $(StaticArchiver) -t $(1)) |
558 |
|
|
extract_objs = $(shell $(StaticArchiver) -x $(1) $(call find_objs, $(1))) |
559 |
|
|
create_archive = $(shell $(StaticArchiver) $(StaticArchiverOptions) $(2) $(call find_objs, $(1))) |
560 |
|
|
remove_objs = $(shell $(Delete) $(call find_objs, $(1))) |
561 |
|
|
do_create = $(call extract_objs,$(1))$(call create_archive,$(1),$(2))$(call remove_objs,$(1)) |
562 |
|
|
|
563 |
tim |
1530 |
$(CombinedStaticLib) : $(LibDir)/.stamp_UP |
564 |
|
|
$(Print) create $@ |
565 |
tim |
1529 |
$(foreach thisLib,$(LibNames),$(call do_create,$(thisLib),$@)) |
566 |
|
|
$(Ranlib) $(CombinedStaticLib) |
567 |
|
|
|
568 |
|
|
$(CombinedParallelStaticLib) : $(LibDir)/.stamp_MPI |
569 |
tim |
1530 |
$(Print) create $@ |
570 |
tim |
1529 |
$(foreach thisLib,$(ParallelLibNames), $(call do_create, $(thisLib), $@)) |
571 |
|
|
$(Ranlib) $(CombinedParallelStaticLib) |
572 |
|
|
|
573 |
gezelter |
1508 |
# Executable |
574 |
gezelter |
1938 |
$(Executable) : $(CombinedStaticLib) $(ObjectFiles) $(BinDir) |
575 |
tim |
1936 |
$(Linker) $(ObjectFiles) $(CombinedStaticLib) $(LinkOptions) $(LibDirs) $(Libraries) -o $@ |
576 |
gezelter |
1508 |
|
577 |
gezelter |
1938 |
$(ParallelExecutable) : $(CombinedParallelStaticLib) $(ParallelObjectFiles) $(BinDir) |
578 |
tim |
1936 |
$(Linker) $(ParallelObjectFiles) $(CombinedParallelStaticLib) $(ParallelLinkOptions) $(LibDirs) $(Libraries) -o $@ |
579 |
gezelter |
1508 |
|
580 |
|
|
# Anything else is just copied from source to target |
581 |
|
|
$(PackageTargetDir)/% : $(PackageSourceDir)/% |
582 |
|
|
$(Print) $@ |
583 |
|
|
$(Copy) $< $@ |
584 |
|
|
|
585 |
|
|
# make (or make build) |
586 |
|
|
build : $(PackageListLoop) |
587 |
|
|
$(Print) Done build. |
588 |
|
|
|
589 |
|
|
_all : _buildall |
590 |
|
|
|
591 |
tim |
1544 |
_buildall : |
592 |
tim |
1525 |
ifeq "$(UseMPI)" "yes" |
593 |
gezelter |
1508 |
_buildall : \ |
594 |
|
|
$(DependencyFile) \ |
595 |
|
|
$(PackageTargetDir) \ |
596 |
|
|
$(ObjectFiles) \ |
597 |
tim |
1525 |
$(ParallelObjectFiles) \ |
598 |
gezelter |
1508 |
$(JavaClassFiles) \ |
599 |
|
|
$(RmiStubFiles) \ |
600 |
|
|
$(RmiSkeletonFiles) \ |
601 |
|
|
$(OtherTargetFiles) \ |
602 |
|
|
$(StaticLibrary) \ |
603 |
tim |
1525 |
$(ParallelStaticLibrary) \ |
604 |
gezelter |
1508 |
$(JarFile) \ |
605 |
tim |
1525 |
$(Executable) \ |
606 |
|
|
$(ParallelExecutable) |
607 |
|
|
else |
608 |
|
|
_buildall : \ |
609 |
|
|
$(DependencyFile) \ |
610 |
|
|
$(PackageTargetDir) \ |
611 |
|
|
$(ObjectFiles) \ |
612 |
|
|
$(JavaClassFiles) \ |
613 |
|
|
$(RmiStubFiles) \ |
614 |
|
|
$(RmiSkeletonFiles) \ |
615 |
|
|
$(OtherTargetFiles) \ |
616 |
|
|
$(StaticLibrary) \ |
617 |
|
|
$(JarFile) \ |
618 |
|
|
$(Executable) |
619 |
|
|
endif |
620 |
gezelter |
1508 |
|
621 |
tim |
1525 |
|
622 |
gezelter |
1508 |
# make clean |
623 |
|
|
clean : $(PackageListLoop) |
624 |
|
|
$(Print) Done clean. |
625 |
|
|
|
626 |
|
|
_cleanall : |
627 |
tim |
1514 |
$(Delete) $(ObjectFiles) $(ParallelObjectFiles) |
628 |
|
|
|
629 |
|
|
# make distclean |
630 |
|
|
distclean : $(PackageListLoop) |
631 |
|
|
$(Print) Done clean. |
632 |
|
|
|
633 |
|
|
_distcleanall : |
634 |
|
|
$(Delete) $(ObjectFiles) \ |
635 |
|
|
$(ParallelObjectFiles) \ |
636 |
tim |
1523 |
$(JarFile) \ |
637 |
gezelter |
1508 |
$(SharedLibrary) \ |
638 |
|
|
$(StaticLibrary) \ |
639 |
tim |
1514 |
$(ParallelSharedLibrary) \ |
640 |
|
|
$(ParallelStaticLibrary) \ |
641 |
gezelter |
1508 |
$(Executable) \ |
642 |
tim |
1514 |
$(ParallelExecutable) \ |
643 |
tim |
1523 |
$(DependencyFile) |
644 |
gezelter |
1508 |
|
645 |
|
|
|
646 |
|
|
# make depend |
647 |
|
|
depend : $(PackageListLoop) |
648 |
|
|
$(Print) Done dependencies. |
649 |
|
|
|
650 |
|
|
_dependall : $(DependencyFile) |
651 |
|
|
|
652 |
|
|
$(DependencyFile) : $(DerivedSource) |
653 |
|
|
$(Print) $@ |
654 |
|
|
@cd $(PackageSourceDir) |
655 |
tim |
1510 |
|
656 |
|
|
ifneq "$(words $(CppFiles))" "0" |
657 |
tim |
1557 |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CppFiles)>> Make.cpptemp |
658 |
|
|
@cat Make.cpptemp >> $(DependencyFile) |
659 |
gezelter |
1535 |
$(Delete) Make.cpptemp |
660 |
tim |
1554 |
|
661 |
|
|
ifeq "$(UseMPI)" "yes" |
662 |
tim |
1557 |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CppFiles)>> Make.cpptemp |
663 |
|
|
@cat Make.cpptemp >> $(DependencyFile) |
664 |
tim |
1539 |
@$(Delete) Make.cpptemp |
665 |
tim |
1554 |
endif |
666 |
|
|
|
667 |
gezelter |
1508 |
endif |
668 |
tim |
1510 |
|
669 |
|
|
ifneq "$(words $(CFiles))" "0" |
670 |
tim |
1557 |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(CFiles) $(DerivedCFiles) >> Make.ctemp |
671 |
|
|
@cat Make.ctemp >> $(DependencyFile) |
672 |
gezelter |
1535 |
$(Delete) Make.ctemp |
673 |
tim |
1554 |
|
674 |
|
|
ifeq "$(UseMPI)" "yes" |
675 |
tim |
1557 |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(CFiles) $(DerivedCFiles) >> Make.ctemp |
676 |
|
|
@cat Make.ctemp >> $(DependencyFile) |
677 |
tim |
1539 |
@$(Delete) Make.ctemp |
678 |
tim |
1554 |
endif |
679 |
|
|
|
680 |
gezelter |
1508 |
endif |
681 |
tim |
1510 |
|
682 |
|
|
ifneq "$(words $(F90Files))" "0" |
683 |
tim |
1557 |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) > Make.ftemp |
684 |
tim |
1554 |
@cat Make.ftemp >> $(DependencyFile) |
685 |
|
|
@$(Delete) Make.ftemp |
686 |
|
|
|
687 |
|
|
ifeq "$(UseMPI)" "yes" |
688 |
tim |
1557 |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) $(F90Declare) -MM -mc $(ModuleCase) -ms $(ModSuffix) $(F90Files) >> Make.ftemp |
689 |
tim |
1539 |
@cat Make.ftemp >> $(DependencyFile) |
690 |
|
|
@$(Delete) Make.ftemp |
691 |
tim |
1554 |
endif |
692 |
|
|
|
693 |
gezelter |
1508 |
endif |
694 |
|
|
|
695 |
|
|
# make lib |
696 |
|
|
lib : $(PackageListLoop) |
697 |
|
|
$(Print) Libraries built. |
698 |
|
|
|
699 |
|
|
_liball : $(JarFile) $(SharedLibrary) $(StaticLibrary) |
700 |
|
|
|
701 |
|
|
jar : $(JarFile) |
702 |
|
|
|
703 |
|
|
jarsign : $(JarFile) |
704 |
|
|
$(JarSigner) -keystore GeoSoftKeystore $(JarFile) myself |
705 |
|
|
|
706 |
tim |
1544 |
#make install |
707 |
|
|
%.install : |
708 |
|
|
@$(MAKE) $(MakeOptions) -C $(subst .install,,$@) _installall |
709 |
|
|
|
710 |
|
|
install : $(InstallListLoop) |
711 |
|
|
$(Print) Done Install |
712 |
|
|
|
713 |
|
|
_installall : _buildall _installdata |
714 |
|
|
|
715 |
|
|
$(MyInstallDir) : |
716 |
|
|
$(MkDir) $@ |
717 |
|
|
|
718 |
|
|
_installdata : $(MyInstallDir) |
719 |
|
|
$(Print) $(InstallFiles) |
720 |
|
|
ifneq "$(words $(InstallFiles))" "0" |
721 |
|
|
$(InstallData) $(InstallFiles) $(MyInstallDir) |
722 |
|
|
endif |
723 |
gezelter |
1930 |
|
724 |
gezelter |
1508 |
# make statistics |
725 |
|
|
_statisticsall : |
726 |
tim |
1530 |
@$(Print) $(patsubst %,$(CurrentDir)/%,$(SourceFiles)) >> $(DEV_ROOT)/files.tmp |
727 |
gezelter |
1508 |
|
728 |
|
|
statistics : $(PackageListLoop) |
729 |
|
|
@$(List) $(DEV_ROOT)/files.tmp | xargs $(WordCount) $(WordCountOptions) |
730 |
|
|
@$(Delete) $(DEV_ROOT)/files.tmp |
731 |
|
|
$(Print) Done statistics. |
732 |
|
|
|
733 |
|
|
# make pure |
734 |
|
|
$(Executable).pure : |
735 |
|
|
$(Purify) $(PurifyOptions) $(CppCompiler) $(LinkOptions) $(LibDirs) \ |
736 |
|
|
$(LibList) $(ObjectFiles) -o $@ |
737 |
|
|
|
738 |
|
|
pure : $(Executable).pure |
739 |
|
|
|
740 |
tim |
1523 |
#make cvslog |
741 |
|
|
cvslog: |
742 |
|
|
$(DEV_ROOT)/scripts/cvs2cl.pl |
743 |
|
|
|
744 |
gezelter |
1508 |
# Execute |
745 |
|
|
_runexe : |
746 |
|
|
$(Executable) $(RunParameters) |
747 |
|
|
|
748 |
|
|
_runjava : |
749 |
|
|
$(JavaExecute) $(JavaRunOptions) $(JavaMainClass) $(RunParameters) |
750 |
|
|
|
751 |
|
|
run : _runjava |
752 |
|
|
|
753 |
|
|
|
754 |
|
|
ifdef $(DependencyFile) |
755 |
|
|
-include $(DependencyFile) |
756 |
|
|
endif |