ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/test/math/Makefile
Revision: 1593
Committed: Mon Oct 18 21:03:15 2004 UTC (19 years, 10 months ago) by tim
File size: 3842 byte(s)
Log Message:
adding more testing units

File Contents

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