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 |
100 |
|
CurrentDir = $(CURDIR) |
101 |
|
|
102 |
|
ifdef Source |
103 |
< |
Package = $(subst $(SourceDir)/,,$(CurrentDir)) |
103 |
> |
#Package = $(subst $(SourceDir)/,,$(CurrentDir)) |
104 |
> |
#Package = $(notdir $(CurrentDir)) |
105 |
> |
|
106 |
> |
#get the relative path of current package to source directory |
107 |
> |
# /home/maul/gezelter/src/code/src/UseTheForce/Darkside --> UseTheForce/Darkside |
108 |
> |
#Package = $(shell echo $(CurrentDir) | sed -e 's/^.*\/src\/\(.*\)/\1/g') |
109 |
> |
Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(CurrentDir)) |
110 |
> |
|
111 |
|
PackageList = $(Package) |
112 |
|
PackageSourceDir = $(SourceDir)/$(Package) |
113 |
|
PackageTargetDir = $(TargetDir) |
117 |
|
endif |
118 |
|
|
119 |
|
PackageListLoop = $(patsubst %,$(SourceDir)/%/.loop,$(PackageList)) |
120 |
+ |
#PackageListLoop = $(PackageList) |
121 |
|
|
122 |
|
JRE = $(JAVA_HOME)/jre/lib/rt.jar |
123 |
|
|
147 |
|
$(YaccFiles) $(CorbaFiles), \ |
148 |
|
$(Source)) |
149 |
|
ManifestFile = $(PackageSourceDir)/Manifest |
150 |
< |
SourceFiles = $(JavaFiles:%.java= $(PackageSourceDir)/%.java)\ |
150 |
> |
|
151 |
> |
SourceFiles = $(JavaFiles)\ |
152 |
> |
$(CppFiles)\ |
153 |
> |
$(CFiles)\ |
154 |
> |
$(FortranFiles)\ |
155 |
> |
$(F90Files)\ |
156 |
> |
$(LexFiles)\ |
157 |
> |
$(YaccFiles) |
158 |
> |
|
159 |
> |
#SourceFiles = $(JavaFiles:%.java= $(PackageSourceDir)/%.java)\ |
160 |
|
$(CppFiles:%.cpp= $(PackageSourceDir)/%.cpp)\ |
161 |
|
$(CFiles:%.c= $(PackageSourceDir)/%.c)\ |
162 |
|
$(FortranFiles:%.f= $(PackageSourceDir)/%.f)\ |
164 |
|
$(LexFiles:%.l= $(PackageSourceDir)/%.l)\ |
165 |
|
$(YaccFiles:%.y= $(PackageSourceDir)/%.y)\ |
166 |
|
|
98 |
– |
|
167 |
|
# Target |
168 |
|
JavaClassFiles = $(JavaFiles:%.java= $(PackageTargetDir)/%.class) |
169 |
|
JavaClassFilesRel = $(JavaFiles:%.java= $(Package)/%.class) |
212 |
|
JavaPackageNames = $(subst /,.,$(JavaPackages)) |
213 |
|
IncludePath = -I$(SourceDir) $(IncludeDirs:%=-I%) |
214 |
|
LibDirs = -L$(LibDir) $(LibraryDirs:%=-L%) |
215 |
< |
LocalLibs = $(subst /,,$(Packages)) |
215 |
> |
LocalLibs = $(subst /,,$(PackageLibs)) |
216 |
|
LibList = $(LocalLibs:%=-l%) $(Libraries:%=-l%) |
217 |
|
|
218 |
|
|
289 |
|
default : build |
290 |
|
|
291 |
|
%.loop : |
292 |
+ |
$(Print) $(SourceFiles) |
293 |
|
@$(MAKE) $(MakeOptions) -C $(subst .loop,,$@) _$(MAKECMDGOALS)all |
294 |
|
|
295 |
|
# Create target directory |
426 |
|
# Executable |
427 |
|
$(Executable) : $(ObjectFiles) |
428 |
|
$(Print) $@ |
429 |
+ |
$(Print) $(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ObjectFiles) -o $@ |
430 |
|
$(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ObjectFiles) -o $@ |
431 |
|
|
432 |
|
# Anything else is just copied from source to target |
476 |
|
$(DependencyFile) : $(DerivedSource) |
477 |
|
$(Print) $@ |
478 |
|
@cd $(PackageSourceDir) |
479 |
< |
touch Make.temp |
480 |
< |
ifdef $(CppFiles) |
481 |
< |
$(CppCompiler) $(IncludePath) -MM $(CppFiles) > Make.temp |
482 |
< |
endif |
483 |
< |
ifdef $(CFiles) |
484 |
< |
$(CCompiler) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) >> Make.temp |
479 |
> |
|
480 |
> |
touch Make.ctemp |
481 |
> |
touch Make.ctemp |
482 |
> |
|
483 |
> |
ifneq "$(words $(CppFiles))" "0" |
484 |
> |
$(Print) Make dependencies for $(CppFiles) |
485 |
> |
$(Print) $(CppCompiler) $(IncludePath) -MM $(CppFiles) > Make.cpptemp |
486 |
> |
$(CppCompiler) $(IncludePath) -MM $(CppFiles) > Make.cpptemp |
487 |
> |
cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile) |
488 |
> |
cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile) |
489 |
|
endif |
490 |
< |
cat Make.temp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile) |
491 |
< |
cat Make.temp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile) |
492 |
< |
ifdef $(F90Files) |
490 |
> |
|
491 |
> |
ifneq "$(words $(CFiles))" "0" |
492 |
> |
$(Print) Make dependencies for $(CFiles) |
493 |
> |
$(Print) $(CCompiler) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp |
494 |
> |
$(CCompiler) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp |
495 |
> |
cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile) |
496 |
> |
cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile) |
497 |
> |
|
498 |
> |
endif |
499 |
> |
|
500 |
> |
ifneq "$(words $(F90Files))" "0" |
501 |
> |
$(Print) Make dependencies for $(F90Files) |
502 |
|
$(DEV_ROOT)/scripts/sfmakedepend -I $(DEV_ROOT)/src -d '$$(DEV_ROOT)/obj' -f ./Make.ftemp -h *.F90 |
503 |
|
cat Make.ftemp >> $(DependencyFile) |
504 |
|
endif |
505 |
< |
$(Delete) Make.temp Make.ftemp |
505 |
> |
$(Delete) Make.cpptemp Make.ctemp Make.ftemp |
506 |
|
|
507 |
|
# make lib |
508 |
|
lib : $(PackageListLoop) |