ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/test/math/Makefile
Revision: 1594
Committed: Mon Oct 18 23:13:23 2004 UTC (19 years, 8 months ago) by tim
File size: 4075 byte(s)
Log Message:
more tests on math library

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