ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/test/utils/Makefile
Revision: 1661
Committed: Thu Oct 28 02:28:03 2004 UTC (19 years, 8 months ago) by tim
File size: 3810 byte(s)
Log Message:
ReplaceWildCard in progress

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