ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/test/utils/Makefile
Revision: 1674
Committed: Thu Oct 28 19:06:59 2004 UTC (19 years, 8 months ago) by tim
File size: 3848 byte(s)
Log Message:
STL next_permutation like next_combination is working

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 1661 GenericFactoryTestCase.cpp \
9 tim 1668 ReplaceWildCardTestCase.cpp \
10     NextCombinationTestCase.cpp
11 tim 1620
12     DEV_ROOT = ../..
13     UseMPI = no
14     ParallelDeclare = -DIS_MPI
15 tim 1674 CppCompiler = icpc -g
16     Linker = icpc -g
17 tim 1620 Delete = /bin/rm -rf
18     MakeDepend = makedepend
19    
20     MPIRun = /usr/local/mpich/bin/mpirun
21     MPINumProc = -np 2
22    
23     CppOptions =
24     CppParallelOptions = $(ParallelDeclare)
25    
26     OOPSESrcDir = $(DEV_ROOT)/src
27     SourceDir = $(DEV_ROOT)/test
28     Package = $(subst $(shell cd $(SourceDir); pwd)/,,$(shell pwd))
29     PackageSourceDir = $(SourceDir)/$(Package)
30     PackageTargetDir = $(DEV_ROOT)/obj
31     PackageParallelTargetDir = $(DEV_ROOT)/MPIobj
32    
33     MakeOptions = -k
34    
35     IncludeDirs = \
36     /home/maul/gezelter/tim/cppunit/include \
37     /usr/local/include \
38     /usr/local/mpich/include \
39     $(OOPSESrcDir)
40    
41     IncludePath = -I$(SourceDir) $(IncludeDirs:%=-I%)
42    
43     LibraryDirs = \
44     /usr/local/lib \
45     /usr/local/mpich/lib \
46 tim 1622 /home/maul/gezelter/tim/cppunit/lib \
47 tim 1627 $(DEV_ROOT)/lib
48 tim 1620
49     LibDirs = -L$(LibDir) $(LibraryDirs:%=-L%)
50    
51     Libraries = \
52     -lcppunit \
53     -ldl \
54     -lsprng \
55     -lmpich \
56 tim 1622 -lfmpich \
57 tim 1627 -lOOPSE \
58 tim 1620
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