ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/test/utils/Makefile
Revision: 1781
Committed: Wed Nov 24 19:49:33 2004 UTC (19 years, 7 months ago) by tim
File size: 3881 byte(s)
Log Message:
Addint StringTokenizerTestCase

File Contents

# User Rev Content
1 tim 1620 Main = UtilTest
2    
3     TestMain = $(Main)
4    
5     Source = UtilTest.cpp \
6 tim 1622 GenericDataTestCase.cpp \
7 tim 1643 PropertyMapTestCase.cpp \
8 tim 1781 PropertyMap.cpp \
9 tim 1661 GenericFactoryTestCase.cpp \
10 tim 1781 NextCombinationTestCase.cpp \
11     StringTokenizerTestCase.cpp \
12     StringTokenizer.cpp
13 tim 1620
14     DEV_ROOT = ../..
15     UseMPI = no
16     ParallelDeclare = -DIS_MPI
17 tim 1674 CppCompiler = icpc -g
18     Linker = icpc -g
19 tim 1620 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 tim 1622 /home/maul/gezelter/tim/cppunit/lib \
49 tim 1627 $(DEV_ROOT)/lib
50 tim 1620
51     LibDirs = -L$(LibDir) $(LibraryDirs:%=-L%)
52    
53     Libraries = \
54     -lcppunit \
55     -ldl \
56     -lsprng \
57     -lmpich \
58 tim 1622 -lfmpich \
59 tim 1620
60    
61     #LinkOptions = \
62     -L/usr/local/intel/compiler81/lib -L/usr/lib -lifport -lifcore -limf -lm -lcxa -lirc -lunwind -lirc_s
63    
64     #ParallelLinkOptions = \
65     -L/usr/local/intel/compiler81/lib -L/usr/lib -lifport -lifcore -limf -lm -lcxa -lirc -lunwind -lirc_s
66    
67    
68     ObjectFiles = $(Source:%.cpp= $(PackageTargetDir)/%.o)
69     ParallelObjectFiles = $(Source:%.cpp= $(PackageParallelTargetDir)/%.o)
70    
71     ifneq "$(words $(ObjectFiles) $(ParallelObjectFiles))" "0"
72     # DependencyFile = $(PackageSourceDir)/Makedepend
73     endif
74    
75     ifneq "$(words $(Main))" "0"
76     Executable = $(PackageSourceDir)/$(Main)
77     ParallelExecutable = $(PackageSourceDir)/$(Main)_MPI
78     endif
79     #Rules
80     default : test
81    
82     # .cpp -> .o
83     $(PackageTargetDir)/%.o : %.cpp
84     @echo $(shell cd $(SourceDir); pwd)
85     @echo $(Package)
86     $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@
87    
88     $(PackageParallelTargetDir)/%.o : %.cpp
89     $(CppCompiler) $(CppParallelOptions) -c $(IncludePath) $< -o $@
90    
91     ifeq "$(UseMPI)" "yes"
92     %.o : %.cpp
93     $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
94     $(MAKE) $(MakeOptions) $(PackageParallelTargetDir)/$@
95     else
96     %.o : %.cpp
97     $(MAKE) $(MakeOptions) $(PackageTargetDir)/$@
98     endif
99    
100    
101     # Executable
102     $(Executable) : $(ObjectFiles)
103    
104     $(Linker) $(ObjectFiles) $(LibDirs) $(Libraries) $(LinkOptions) -o $@
105    
106     $(ParallelExecutable) : $(ParallelObjectFiles)
107     $(Linker) $(ParallelObjectFiles)$(LibDirs) $(Libraries) $(ParallelLinkOptions) -o $@
108    
109    
110     $(DependencyFile):
111     $(Print) $@
112    
113     $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(TargetDir)/' -MM $(Source)>> Make.cpptemp
114     @cat Make.cpptemp >> $(DependencyFile)
115     $(Delete) Make.cpptemp
116    
117     ifeq "$(UseMPI)" "yes"
118     $(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(ParallelTargetDir)/' $(ParallelDeclare) -MM $(Source)>> Make.cpptemp
119     @cat Make.cpptemp >> $(DependencyFile)
120     @$(Delete) Make.cpptemp
121     endif
122    
123    
124    
125    
126    
127     ifeq "$(UseMPI)" "yes"
128     test : \
129     $(DependencyFile) \
130     $(ObjectFiles) \
131     $(ParallelObjectFiles) \
132     $(Executable) \
133     $(ParallelExecutable)
134     else
135     test : \
136     $(DependencyFile) \
137     $(ObjectFiles) \
138     $(Executable)
139     endif
140    
141     ifeq "$(UseMPI)" "yes"
142     runtest : test
143     @echo
144     @echo test single version
145     $(Executable)
146     @echo
147     @echo test MPI version
148     $(MPIRun) $(MPINumProc) $(ParallelExecutable)
149     else
150     runtest : test
151     @echo test single version
152     $(Executable)
153     endif
154     clean:
155     $(Delete) $(ObjectFiles) $(ParallelObjectFiles) $(Executable) $(ParallelExecutable)
156    
157     ifdef $(DependencyFile)
158     -include $(DependencyFile)
159     endif