164 | | # Makefile for Microsoft Visual C++ 7.0 (or compatible) |
165 | | # Charlie Hull |
166 | | # 12th December 2008 |
167 | | |
168 | | # Will build the Csharp bindings |
169 | | |
170 | | # Where the core is, relative to the Csharp bindings |
171 | | # Change this to match your environment |
172 | | |
173 | | XAPIAN_CORE_REL_CSHARP=..\..\xapian-core |
174 | | OUTLIBDIR=$(XAPIAN_CORE_REL_CSHARP)\win32\$(XAPIAN_DEBUG_OR_RELEASE)\libs |
175 | | |
176 | | !INCLUDE $(XAPIAN_CORE_REL_CSHARP)\win32\config.mak |
177 | | |
178 | | OUTDIR=$(XAPIAN_CORE_REL_CSHARP)\win32\$(XAPIAN_DEBUG_OR_RELEASE)\CSharp |
179 | | INTDIR=. |
180 | | |
181 | | # Note we have two DLLs: the Assembly is built by the Csharp compiler and references the Binding which is built by the C compiler |
182 | | ASSEMBLY=XapianCSharp |
183 | | BINDING=XapianSharp |
184 | | |
185 | | XAPIAN_SWIG_CSHARP_SRCS=\ |
186 | | Auto.cs \ |
187 | | BM25Weight.cs \ |
188 | | BoolWeight.cs \ |
189 | | Chert.cs \ |
190 | | Database.cs \ |
191 | | DatabaseMaster.cs \ |
192 | | DatabaseReplica.cs \ |
193 | | DateValueRangeProcessor.cs \ |
194 | | Document.cs \ |
195 | | Enquire.cs \ |
196 | | ESet.cs \ |
197 | | ESetIterator.cs \ |
198 | | ExpandDecider.cs \ |
199 | | FixedWeightPostingSource.cs \ |
200 | | Flint.cs \ |
201 | | InMemory.cs \ |
202 | | MatchDecider.cs \ |
203 | | MSet.cs \ |
204 | | MSetIterator.cs \ |
205 | | MultiValueSorter.cs \ |
206 | | NumberValueRangeProcessor.cs \ |
207 | | PositionIterator.cs \ |
208 | | PostingIterator.cs \ |
209 | | PostingSource.cs \ |
210 | | Query.cs \ |
211 | | QueryParser.cs \ |
212 | | Remote.cs \ |
213 | | ReplicationInfo.cs \ |
214 | | RSet.cs \ |
215 | | SimpleStopper.cs \ |
216 | | Sorter.cs \ |
217 | | Stem.cs \ |
218 | | Stopper.cs \ |
219 | | StringValueRangeProcessor.cs \ |
220 | | SWIGTYPE_p_std__string.cs \ |
221 | | SWIGTYPE_p_std__vectorTstd__string_t.cs \ |
222 | | SWIGTYPE_p_std__vectorTXapian__Query_t.cs \ |
223 | | TermGenerator.cs \ |
224 | | TermIterator.cs \ |
225 | | TradWeight.cs \ |
226 | | ValueIterator.cs \ |
227 | | ValueRangeProcessor.cs \ |
228 | | ValueSetMatchDecider.cs \ |
229 | | ValueWeightPostingSource.cs \ |
230 | | Version.cs \ |
231 | | Weight.cs \ |
232 | | WritableDatabase.cs \ |
233 | | Xapian.cs \ |
234 | | XapianPINVOKE.cs |
235 | | |
236 | | |
237 | | ALL : "$(ASSEMBLY).dll" SmokeTest.exe "$(BINDING).dll" |
238 | | # REMOVE THIS NEXT LINE if using Visual C++ .net 2003 - you won't need to worry about manifests. For later compilers this prevents error R6034 |
239 | | $(MANIFEST) "$(BINDING).dll.manifest" -outputresource:"$(BINDING).dll;2" |
240 | | copy "$(ASSEMBLY).dll" $(OUTDIR) |
241 | | copy "$(BINDING).dll" $(OUTDIR) |
242 | | copy "$(ZLIB_LIB_DIR)\zdll.lib" |
243 | | copy "$(ZLIB_BIN_DIR)\zlib1.dll" $(OUTDIR) |
244 | | |
245 | | CLEAN : |
246 | | -@erase XapianSharp.snk |
247 | | -@erase AssemblyInfo.cs |
248 | | -@erase "$(BINDING).dll" |
249 | | -@erase "$(OUTDIR)\$(BINDING).dll" |
250 | | -@erase "$(BINDING).dll.manifest" |
251 | | -@erase "$(ASSEMBLY).dll" |
252 | | -@erase "$(OUTDIR)\$(ASSEMBLY).dll |
253 | | -@erase "$(ASSEMBLY).dll.manifest" |
254 | | -@erase "SmokeTest.exe" |
255 | | -@erase "$(OUTDIR)\SmokeTest.exe" |
256 | | -@erase xapian_wrap.obj |
257 | | -@erase *.pdb |
258 | | -@erase *.ilk |
259 | | -@erase *.lib |
260 | | -@erase *.exp |
261 | | -@erase version.res |
262 | | |
263 | | CLEANSWIG: CLEAN |
264 | | -@erase xapian_wrap.cc |
265 | | -@erase xapian_wrap.h |
266 | | -@erase $(XAPIAN_SWIG_CSHARP_SRCS) |
267 | | |
268 | | DOTEST: |
269 | | copy SmokeTest.exe "$(OUTDIR)\SmokeTest.exe" |
270 | | cd $(OUTDIR) |
271 | | SmokeTest |
272 | | |
273 | | CHECK: ALL DOTEST |
274 | | |
275 | | "$(OUTDIR)" : |
276 | | if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" |
277 | | |
278 | | XapianSharp.snk: |
279 | | $(SN) -k $@ |
280 | | |
281 | | "$(ASSEMBLY).dll": $(XAPIAN_SWIG_CSHARP_SRCS) AssemblyInfo.cs XapianSharp.snk "$(OUTDIR)" $(BINDING).dll |
282 | | $(CSC) -unsafe -target:library -out:"$(ASSEMBLY).dll" \ |
283 | | $(XAPIAN_SWIG_CSHARP_SRCS) AssemblyInfo.cs |
284 | | |
285 | | AssemblyInfo.cs: AssemblyInfo.cs.in "$(XAPIAN_CORE_REL_CSHARP)\configure.ac" |
286 | | $(PERL_EXE) "$(XAPIAN_CORE_REL_CSHARP)\win32\genversion.pl" "$(XAPIAN_CORE_REL_CSHARP)\configure.ac" AssemblyInfo.cs.in AssemblyInfo.cs |
287 | | |
288 | | CPP_PROJ=$(CPPFLAGS_EXTRA) /GR \ |
289 | | /I "$(XAPIAN_CORE_REL_CSHARP)" /I "$(XAPIAN_CORE_REL_CSHARP)\include" \ |
290 | | /I"." /Fo"$(INTDIR)\\" /Tp$(INPUTNAME) |
291 | | |
292 | | ALL_LINK32_FLAGS=$(LINK32_FLAGS) $(XAPIAN_LIBS) |
293 | | |
294 | | "$(BINDING).dll" : "$(OUTDIR)" xapian_wrap.obj ".\version.res" |
295 | | $(LINK32) @<< |
296 | | $(ALL_LINK32_FLAGS) /DLL /out:"$(BINDING).dll" xapian_wrap.obj ".\version.res" |
297 | | |
298 | | << |
299 | | |
300 | | !IF "$(SWIGBUILD)" == "1" |
301 | | xapian_wrap.cc xapian_wrap.h $(XAPIAN_SWIG_CSHARP_SRCS): util.i ..\xapian.i |
302 | | # Make sure that we don't package stale generated sources in the |
303 | | # case where SWIG changes its mind as to which files it generates. |
304 | | -@erase $(XAPIAN_SWIG_CSHARP_SRCS) |
305 | | $(SWIG) $(SWIG_FLAGS) -I$(XAPIAN_CORE_REL_CSHARP)\include -I..\generic \ |
306 | | -csharp -namespace Xapian -module Xapian -dllimport $(BINDING) \ |
307 | | -c++ -o xapian_wrap.cc ..\xapian.i |
308 | | !ENDIF |
309 | | |
310 | | # |
311 | | # Rules |
312 | | # |
313 | | |
314 | | ".\version.res": version.rc |
315 | | $(RSC) /v \ |
316 | | /I "$(XAPIAN_CORE_REL_CSHARP)\include" \ |
317 | | /fo version.res \ |
318 | | version.rc |
319 | | |
320 | | xapian_wrap.obj : xapian_wrap.cc |
321 | | $(CPP) @<< |
322 | | $(CPP_PROJ) $** |
323 | | << |
324 | | |
325 | | SmokeTest.exe: SmokeTest.cs $(ASSEMBLY).dll $(BINDING).dll |
326 | | $(CSC) -unsafe -target:exe -out:SmokeTest.exe SmokeTest.cs -r:$(ASSEMBLY).dll |