ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/test/math/Makefile
Revision: 1797
Committed: Mon Nov 29 21:42:52 2004 UTC (19 years, 7 months ago) by tim
File size: 4102 byte(s)
Log Message:
add PolynomialTestCase

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