ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/test/math/Makefile
Revision: 2073
Committed: Tue Mar 1 23:17:05 2005 UTC (19 years, 4 months ago) by tim
File size: 3930 byte(s)
Log Message:
fixed compilation problem

File Contents

# Content
1 Main = MathTest
2
3 TestMain = $(Main)
4
5
6 Source = MainTest.cpp \
7 RectMatrixTestCase.cpp \
8 SquareMatrixTestCase.cpp \
9 SquareMatrix3TestCase.cpp \
10 VectorTestCase.cpp \
11 Vector3TestCase.cpp \
12 QuaternionTestCase.cpp \
13 PolynomialTestCase.cpp \
14 RandNumGenTestCase.cpp \
15 ParallelandNumGen.cpp
16
17 DEV_ROOT = ../..
18 UseMPI = no
19 ParallelDeclare = -DIS_MPI
20 CppCompiler = icpc7 -g
21 Linker = icpc7 -g
22 Delete = /bin/rm -rf
23 MakeDepend = makedepend
24
25 MPIRun = /usr/local/mpich/bin/mpirun
26 MPINumProc = -np 2
27
28 CppOptions =
29 CppParallelOptions = $(ParallelDeclare)
30
31 OOPSESrcDir = $(DEV_ROOT)/src
32 SourceDir = $(DEV_ROOT)/test
33 Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(shell pwd))
34 PackageSourceDir = $(SourceDir)/$(Package)
35 PackageTargetDir = $(DEV_ROOT)/obj
36 PackageParallelTargetDir = $(DEV_ROOT)/MPIobj
37
38 MakeOptions = -k
39
40 IncludeDirs = \
41 /home/maul/gezelter/tim/include \
42 /usr/local/include \
43 /usr/local/mpich/include \
44 $(OOPSESrcDir)
45
46 IncludePath = -I$(SourceDir) $(IncludeDirs:%=-I%)
47
48 LibraryDirs = \
49 /usr/local/lib \
50 /usr/local/mpich/lib \
51 /home/maul/gezelter/tim/lib
52
53 LibDirs = -L$(LibDir) $(LibraryDirs:%=-L%)
54
55 Libraries = \
56 -lcppunit \
57 -ldl \
58 -lsprng \
59 -lmpich \
60 -lfmpich
61
62
63 #LinkOptions = \
64 -L/usr/local/intel/compiler81/lib -L/usr/lib -lifport -lifcore -limf -lm -lcxa -lirc -lunwind -lirc_s
65
66 #ParallelLinkOptions = \
67 -L/usr/local/intel/compiler81/lib -L/usr/lib -lifport -lifcore -limf -lm -lcxa -lirc -lunwind -lirc_s
68
69
70 ObjectFiles = $(Source:%.cpp= $(PackageTargetDir)/%.o)
71 ParallelObjectFiles = $(Source:%.cpp= $(PackageParallelTargetDir)/%.o)
72
73 ifneq "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0"
74 # DependencyFile = $(PackageSourceDir)/Makedepend
75 endif
76
77 ifneq "$(words $(Main))" "0"
78 Executable = $(PackageSourceDir)/$(Main)
79 ParallelExecutable = $(PackageSourceDir)/$(Main)_MPI
80 endif
81 #Rules
82 default : test
83
84 # .cpp -> .o
85 $(PackageTargetDir)/%.o : %.cpp
86 @echo $(shell cd $(SourceDir); pwd)
87 @echo $(Package)
88 $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@
89
90 $(PackageParallelTargetDir)/%.o : %.cpp
91 $(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@
92
93 ifeq "$(UseMPI)" "yes"
94 %.o : %.cpp
95 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
96 $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
97 else
98 %.o : %.cpp
99 $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
100 endif
101
102
103 # Executable
104 $(Executable) : $(ObjectFiles)
105
106 $(Linker) $(ObjectFiles) $(LibDirs) $(Libraries) $(LinkOptions) -o $@
107
108 $(ParallelExecutable) : $(ParallelObjectFiles)
109 $(Linker) $(ParallelObjectFiles)$(LibDirs) $(Libraries) $(ParallelLinkOptions) -o $@
110
111
112 $(DependencyFile):
113 $(Print) $@
114
115 $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(Source)>> Make.cpptemp
116 @cat Make.cpptemp >> $(DependencyFile)
117 $(Delete) Make.cpptemp
118
119 ifeq "$(UseMPI)" "yes"
120 $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(Source)>> Make.cpptemp
121 @cat Make.cpptemp >> $(DependencyFile)
122 @$(Delete) Make.cpptemp
123 endif
124
125
126
127
128
129 ifeq "$(UseMPI)" "yes"
130 test : \
131 $(DependencyFile) \
132 $(ObjectFiles) \
133 $(ParallelObjectFiles) \
134 $(Executable) \
135 $(ParallelExecutable)
136 else
137 test : \
138 $(DependencyFile) \
139 $(ObjectFiles) \
140 $(Executable)
141 endif
142
143 ifeq "$(UseMPI)" "yes"
144 runtest : test
145 @echo
146 @echo test single version
147 $(Executable)
148 @echo
149 @echo test MPI version
150 $(MPIRun) $(MPINumProc) $(ParallelExecutable)
151 else
152 runtest : test
153 @echo test single version
154 $(Executable)
155 endif
156 clean:
157 $(Delete) $(ObjectFiles) $(ParallelObjectFiles) $(Executable) $(ParallelExecutable)
158
159 ifdef $(DependencyFile)
160 -include $(DependencyFile)
161 endif