Support: quest -f cjk_ngram
[xapian.git] / xapian-maintainer-tools / win32msvc / win32_bindings_csharp.mak
blobc7bb31c3177946c7ffdbfe2d639bde1ba6588fba
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
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 Flint.cs \
37 InMemory.cs \
38 KeyMaker.cs \
39 MatchSpy.cs \
40 MatchDecider.cs \
41 MSet.cs \
42 MSetIterator.cs \
43 MultiValueSorter.cs \
44 NumberValueRangeProcessor.cs \
45 PositionIterator.cs \
46 PostingIterator.cs \
47 PostingSource.cs \
48 Query.cs \
49 QueryParser.cs \
50 Registry.cs \
51 Remote.cs \
52 RSet.cs \
53 SimpleStopper.cs \
54 SmokeTest.cs \
55 Sorter.cs \
56 Stem.cs \
57 StemImplementation.cs \
58 Stopper.cs \
59 StringValueRangeProcessor.cs \
60 SWIGTYPE_p_std__string.cs \
61 SWIGTYPE_p_std__vectorT_std__string_t.cs \
62 SWIGTYPE_p_std__vectorT_Xapian__Query_t.cs \
63 TermGenerator.cs \
64 TermIterator.cs \
65 TradWeight.cs \
66 ValueIterator.cs \
67 ValueRangeProcessor.cs \
68 Version.cs \
69 Weight.cs \
70 WritableDatabase.cs \
71 Xapian.cs \
72 XapianPINVOKE.cs
74 ALL : "$(ASSEMBLY).dll" SmokeTest.exe "$(BINDING).dll"
75 # 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
76 $(MANIFEST) "$(BINDING).dll.manifest" -outputresource:"$(BINDING).dll;2"
77 copy "$(ASSEMBLY).dll" $(OUTDIR)
78 copy "$(BINDING).dll" $(OUTDIR)
79 copy "$(ZLIB_LIB_DIR)\zdll.lib"
80 copy "$(ZLIB_BIN_DIR)\zlib1.dll" $(OUTDIR)
82 CLEAN :
83 -@erase XapianSharp.snk
84 -@erase AssemblyInfo.cs
85 -@erase "$(BINDING).dll"
86 -@erase "$(OUTDIR)\$(BINDING).dll"
87 -@erase "$(BINDING).dll.manifest"
88 -@erase "$(ASSEMBLY).dll"
89 -@erase "$(OUTDIR)\$(ASSEMBLY).dll"
90 -@erase "$(ASSEMBLY).dll.manifest"
91 -@erase "SmokeTest.exe"
92 -@erase "$(OUTDIR)\SmokeTest.exe"
93 -@erase xapian_wrap.obj
94 -@erase *.pdb
95 -@erase *.ilk
96 -@erase *.lib
97 -@erase *.exp
98 -@erase version.res
100 CLEANSWIG: CLEAN
101 -@erase xapian_wrap.cc
102 -@erase xapian_wrap.h
103 -@erase $(XAPIAN_SWIG_CSHARP_SRCS)
105 DOTEST:
106 copy SmokeTest.exe "$(OUTDIR)\SmokeTest.exe"
107 cd $(OUTDIR)
108 SmokeTest
110 CHECK: ALL DOTEST
112 DIST: CHECK
113 cd $(MAKEDIR)
114 if not exist "$(OUTDIR)\dist\$(NULL)" mkdir "$(OUTDIR)\dist"
115 if not exist "$(OUTDIR)\dist\docs/$(NULL)" mkdir "$(OUTDIR)\dist\docs"
116 if not exist "$(OUTDIR)\dist\docs\examples/$(NULL)" mkdir "$(OUTDIR)\dist\docs\examples"
117 copy "$(OUTDIR)\_XapianSharp.dll" "$(OUTDIR)\dist"
118 copy "$(OUTDIR)\XapianCSharp.dll" "$(OUTDIR)\dist"
119 if exist docs copy docs\*.htm* "$(OUTDIR)\dist\docs"
120 if exist docs\examples copy docs\examples\*.* "$(OUTDIR)\dist\docs\examples"
122 "$(OUTDIR)" :
123 if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
125 XapianSharp.snk:
126 $(SN) -k $@
128 "$(ASSEMBLY).dll": $(XAPIAN_SWIG_CSHARP_SRCS) AssemblyInfo.cs XapianSharp.snk "$(OUTDIR)" $(BINDING).dll
129 $(CSC) -unsafe -target:library -out:"$(ASSEMBLY).dll" \
130 $(XAPIAN_SWIG_CSHARP_SRCS) AssemblyInfo.cs
132 AssemblyInfo.cs: AssemblyInfo.cs.in "$(XAPIAN_CORE_REL_CSHARP)\configure.ac"
133 $(PERL_EXE) "$(XAPIAN_CORE_REL_CSHARP)\win32\genversion.pl" "$(XAPIAN_CORE_REL_CSHARP)\configure.ac" AssemblyInfo.cs.in AssemblyInfo.cs
135 CPP_PROJ=$(CPPFLAGS_EXTRA) /GR \
136 /I "$(XAPIAN_CORE_REL_CSHARP)" /I "$(XAPIAN_CORE_REL_CSHARP)\include" \
137 /I"." /Fo"$(INTDIR)\\" /Tp$(INPUTNAME)
139 ALL_LINK32_FLAGS=$(LINK32_FLAGS) $(XAPIAN_LIBS)
141 "$(BINDING).dll" : "$(OUTDIR)" xapian_wrap.obj ".\version.res"
142 $(LINK32) @<<
143 $(ALL_LINK32_FLAGS) /DLL /out:"$(BINDING).dll" xapian_wrap.obj ".\version.res"
147 !IF "$(SWIGBUILD)" == "1"
148 xapian_wrap.cc xapian_wrap.h $(XAPIAN_SWIG_CSHARP_SRCS): util.i ..\xapian.i
149 # Make sure that we don't package stale generated sources in the
150 # case where SWIG changes its mind as to which files it generates.
151 -@erase $(XAPIAN_SWIG_CSHARP_SRCS)
152 $(SWIG) $(SWIG_FLAGS) -I$(XAPIAN_CORE_REL_CSHARP)\include -I..\generic \
153 -csharp -namespace Xapian -module Xapian -dllimport $(BINDING) \
154 -c++ -o xapian_wrap.cc ..\xapian.i
155 !ENDIF
158 # Rules
161 ".\version.res": version.rc
162 $(RSC) /v \
163 /I "$(XAPIAN_CORE_REL_CSHARP)\include" \
164 /fo version.res \
165 version.rc
167 xapian_wrap.obj : xapian_wrap.cc
168 $(CPP) @<<
169 $(CPP_PROJ) $**
172 SmokeTest.exe: SmokeTest.cs $(ASSEMBLY).dll $(BINDING).dll
173 $(CSC) -unsafe -target:exe -out:SmokeTest.exe SmokeTest.cs -r:$(ASSEMBLY).dll