ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/test/math/Makefile
Revision: 2071
Committed: Tue Mar 1 23:00:40 2005 UTC (19 years, 4 months ago) by tim
File size: 3908 byte(s)
Log Message:
Change the name of test case

File Contents

# User Rev Content
1 tim 1575 Main = MathTest
2    
3     TestMain = $(Main)
4    
5 tim 1594
6 tim 1575 Source = MainTest.cpp \
7     RectMatrixTestCase.cpp \
8 tim 1593 SquareMatrixTestCase.cpp \
9     SquareMatrix3TestCase.cpp \
10     VectorTestCase.cpp \
11     Vector3TestCase.cpp \
12 tim 1797 QuaternionTestCase.cpp \
13 tim 2071 PolynomialTestCase.cpp \
14     ParallelRandNumGenTestCase.cpp
15 tim 1575
16 tim 1593
17 tim 1575 DEV_ROOT = ../..
18     UseMPI = no
19     ParallelDeclare = -DIS_MPI
20 tim 2070 CppCompiler = g++ -g
21     Linker = g++ -g
22 tim 1575 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 tim 2070 /home/maul/gezelter/tim/include \
42 tim 1575 /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 tim 2070 /home/maul/gezelter/tim/lib
52 tim 1575
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