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