ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/test/utils/Makefile
Revision: 1866
Committed: Tue Dec 7 14:43:58 2004 UTC (19 years, 7 months ago) by tim
File size: 3897 byte(s)
Log Message:
*** empty log message ***

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