ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/test/utils/Makefile
Revision: 1643
Committed: Mon Oct 25 17:03:56 2004 UTC (19 years, 8 months ago) by tim
File size: 3778 byte(s)
Log Message:
adding GenericFactory Test Case. GenericFactory now can bed used to creat
ForcefieldFactory and IntegratorFactory etc.

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