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