replace_document: Only force load values for same docid
[xapian.git] / xapian-maintainer-tools / win32msvc / win32_bindings_csharp.mak
blobf8fa3f554d680b8ee56f6b73f57ac5684b272bb2
1 # Makefile for Microsoft Visual C++ 7.0 (or compatible)
2 # Charlie Hull
3 # 12th December 2008
5 # Will build the Csharp bindings
7 # Where the core is, relative to the Csharp bindings
8 # Change this to match your environment
10 XAPIAN_CORE_REL_CSHARP=..\..\xapian-core$(VERSION_SUFFIX)
11 OUTLIBDIR=$(XAPIAN_CORE_REL_CSHARP)\win32\$(XAPIAN_DEBUG_OR_RELEASE)\libs
13 !INCLUDE $(XAPIAN_CORE_REL_CSHARP)\win32\config.mak
15 OUTDIR=$(XAPIAN_CORE_REL_CSHARP)\win32\$(XAPIAN_DEBUG_OR_RELEASE)\CSharp
16 INTDIR=.
18 # Note we have two DLLs: the Assembly is built by the Csharp compiler and references the Binding which is built by the C compiler
19 ASSEMBLY=XapianCSharp
20 BINDING=_XapianSharp
22 XAPIAN_SWIG_CSHARP_SRCS=\
23 Auto.cs \
24 BM25Weight.cs \
25 BoolWeight.cs \
26 Brass.cs \
27 Compactor.cs \
28 Chert.cs \
29 Database.cs \
30 DateValueRangeProcessor.cs \
31 Document.cs \
32 Enquire.cs \
33 ESet.cs \
34 ESetIterator.cs \
35 ExpandDecider.cs \
36 InMemory.cs \
37 KeyMaker.cs \
38 MatchSpy.cs \
39 MatchDecider.cs \
40 MSet.cs \
41 MSetIterator.cs \
42 NumberValueRangeProcessor.cs \
43 PositionIterator.cs \
44 PostingIterator.cs \
45 PostingSource.cs \
46 Query.cs \
47 QueryParser.cs \
48 Registry.cs \
49 Remote.cs \
50 RSet.cs \
51 SimpleStopper.cs \
52 SmokeTest.cs \
53 Stem.cs \
54 StemImplementation.cs \
55 Stopper.cs \
56 StringValueRangeProcessor.cs \
57 SWIGTYPE_p_std__string.cs \
58 SWIGTYPE_p_std__vectorT_std__string_t.cs \
59 SWIGTYPE_p_std__vectorT_Xapian__Query_t.cs \
60 TermGenerator.cs \
61 TermIterator.cs \
62 TradWeight.cs \
63 ValueIterator.cs \
64 ValueRangeProcessor.cs \
65 Version.cs \
66 Weight.cs \
67 WritableDatabase.cs \
68 Xapian.cs \
69 XapianPINVOKE.cs
71 ALL : "$(ASSEMBLY).dll" SmokeTest.exe "$(BINDING).dll"
72 $(MANIFEST) "$(BINDING).dll.manifest" -outputresource:"$(BINDING).dll;2"
73 copy "$(ASSEMBLY).dll" $(OUTDIR)
74 copy "$(BINDING).dll" $(OUTDIR)
75 copy "$(ZLIB_LIB_DIR)\zdll.lib"
76 copy "$(ZLIB_BIN_DIR)\zlib1.dll" $(OUTDIR)
78 CLEAN :
79 -@erase XapianSharp.snk
80 -@erase AssemblyInfo.cs
81 -@erase "$(BINDING).dll"
82 -@erase "$(OUTDIR)\$(BINDING).dll"
83 -@erase "$(BINDING).dll.manifest"
84 -@erase "$(ASSEMBLY).dll"
85 -@erase "$(OUTDIR)\$(ASSEMBLY).dll"
86 -@erase "$(ASSEMBLY).dll.manifest"
87 -@erase "SmokeTest.exe"
88 -@erase "$(OUTDIR)\SmokeTest.exe"
89 -@erase xapian_wrap.obj
90 -@erase *.pdb
91 -@erase *.ilk
92 -@erase *.lib
93 -@erase *.exp
94 -@erase version.res
96 CLEANSWIG: CLEAN
97 -@erase xapian_wrap.cc
98 -@erase xapian_wrap.h
99 -@erase $(XAPIAN_SWIG_CSHARP_SRCS)
101 DOTEST:
102 copy SmokeTest.exe "$(OUTDIR)\SmokeTest.exe"
103 cd $(OUTDIR)
104 SmokeTest
106 CHECK: ALL DOTEST
108 DIST: CHECK
109 cd $(MAKEDIR)
110 if not exist "$(OUTDIR)\dist\$(NULL)" mkdir "$(OUTDIR)\dist"
111 if not exist "$(OUTDIR)\dist\docs/$(NULL)" mkdir "$(OUTDIR)\dist\docs"
112 if not exist "$(OUTDIR)\dist\docs\examples/$(NULL)" mkdir "$(OUTDIR)\dist\docs\examples"
113 copy "$(OUTDIR)\_XapianSharp.dll" "$(OUTDIR)\dist"
114 copy "$(OUTDIR)\XapianCSharp.dll" "$(OUTDIR)\dist"
115 if exist docs copy docs\*.htm* "$(OUTDIR)\dist\docs"
116 if exist docs\examples copy docs\examples\*.* "$(OUTDIR)\dist\docs\examples"
118 "$(OUTDIR)" :
119 if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
121 XapianSharp.snk:
122 $(SN) -k $@
124 "$(ASSEMBLY).dll": $(XAPIAN_SWIG_CSHARP_SRCS) AssemblyInfo.cs XapianSharp.snk "$(OUTDIR)" $(BINDING).dll
125 $(CSC) -unsafe -target:library -out:"$(ASSEMBLY).dll" \
126 $(XAPIAN_SWIG_CSHARP_SRCS) AssemblyInfo.cs
128 AssemblyInfo.cs: AssemblyInfo.cs.in "$(XAPIAN_CORE_REL_CSHARP)\configure.ac"
129 $(PERL_EXE) "$(XAPIAN_CORE_REL_CSHARP)\win32\genversion.pl" "$(XAPIAN_CORE_REL_CSHARP)\configure.ac" AssemblyInfo.cs.in AssemblyInfo.cs
131 CPP_PROJ=$(CPPFLAGS_EXTRA) /GR \
132 /I "$(XAPIAN_CORE_REL_CSHARP)" /I "$(XAPIAN_CORE_REL_CSHARP)\include" \
133 /I"." /Fo"$(INTDIR)\\" /Tp$(INPUTNAME)
135 ALL_LINK32_FLAGS=$(LINK32_FLAGS) $(XAPIAN_LIBS)
137 "$(BINDING).dll" : "$(OUTDIR)" xapian_wrap.obj ".\version.res"
138 $(LINK32) @<<
139 $(ALL_LINK32_FLAGS) /DLL /out:"$(BINDING).dll" xapian_wrap.obj ".\version.res"
143 !IF "$(SWIGBUILD)" == "1"
144 xapian_wrap.cc xapian_wrap.h $(XAPIAN_SWIG_CSHARP_SRCS): util.i ..\xapian.i
145 # Make sure that we don't package stale generated sources in the
146 # case where SWIG changes its mind as to which files it generates.
147 -@erase $(XAPIAN_SWIG_CSHARP_SRCS)
148 $(SWIG) $(SWIG_FLAGS) -I$(XAPIAN_CORE_REL_CSHARP)\include -I..\generic \
149 -csharp -namespace Xapian -module Xapian -dllimport $(BINDING) \
150 -c++ -o xapian_wrap.cc ..\xapian.i
151 !ENDIF
154 # Rules
157 ".\version.res": version.rc
158 $(RSC) /v \
159 /I "$(XAPIAN_CORE_REL_CSHARP)\include" \
160 /fo version.res \
161 version.rc
163 xapian_wrap.obj : xapian_wrap.cc
164 $(CPP) @<<
165 $(CPP_PROJ) $**
168 SmokeTest.exe: SmokeTest.cs $(ASSEMBLY).dll $(BINDING).dll
169 $(CSC) -unsafe -target:exe -out:SmokeTest.exe SmokeTest.cs -r:$(ASSEMBLY).dll