[ci] Fix macOS build
[xapian.git] / xapian-bindings / csharp / Makefile.am
blobd2b9c941b4b47c29c7af7ee6b3f30b5a31222f9d
1 ## Process this file with automake to produce Makefile.in
3 include ../generic/generic.mk
5 ## Test programs to be run
6 TESTS = SmokeTest.exe
7 LOG_COMPILER = $(OSX_SIP_HACK_ENV) $(RUN_CSHARP)
9 ASSEMBLY=XapianSharp
11 XAPIAN_SWIG_CS_SRCS=\
12         generated-csharp/BB2Weight.cs \
13         generated-csharp/BM25PlusWeight.cs\
14         generated-csharp/BM25Weight.cs \
15         generated-csharp/BoolWeight.cs \
16         generated-csharp/Compactor.cs \
17         generated-csharp/CoordWeight.cs \
18         generated-csharp/Database.cs \
19         generated-csharp/DateRangeProcessor.cs \
20         generated-csharp/DateValueRangeProcessor.cs \
21         generated-csharp/DecreasingValueWeightPostingSource.cs \
22         generated-csharp/DLHWeight.cs \
23         generated-csharp/DPHWeight.cs \
24         generated-csharp/Document.cs \
25         generated-csharp/ESet.cs \
26         generated-csharp/ESetIterator.cs \
27         generated-csharp/Enquire.cs \
28         generated-csharp/ExpandDecider.cs \
29         generated-csharp/ExpandDeciderAnd.cs \
30         generated-csharp/ExpandDeciderFilterPrefix.cs \
31         generated-csharp/FieldProcessor.cs \
32         generated-csharp/FixedWeightPostingSource.cs \
33         generated-csharp/GreatCircleMetric.cs \
34         generated-csharp/IfB2Weight.cs \
35         generated-csharp/IneB2Weight.cs \
36         generated-csharp/InL2Weight.cs \
37         generated-csharp/KeyMaker.cs \
38         generated-csharp/LMWeight.cs \
39         generated-csharp/LatLongCoord.cs \
40         generated-csharp/LatLongCoords.cs \
41         generated-csharp/LatLongCoordsIterator.cs \
42         generated-csharp/LatLongDistanceKeyMaker.cs \
43         generated-csharp/LatLongDistancePostingSource.cs \
44         generated-csharp/LatLongMetric.cs \
45         generated-csharp/MatchDecider.cs \
46         generated-csharp/MatchSpy.cs \
47         generated-csharp/MSet.cs \
48         generated-csharp/MSetIterator.cs \
49         generated-csharp/MultiValueKeyMaker.cs \
50         generated-csharp/NumberRangeProcessor.cs \
51         generated-csharp/NumberValueRangeProcessor.cs \
52         generated-csharp/PL2PlusWeight.cs \
53         generated-csharp/PL2Weight.cs \
54         generated-csharp/PositionIterator.cs \
55         generated-csharp/PostingIterator.cs \
56         generated-csharp/PostingSource.cs \
57         generated-csharp/Query.cs \
58         generated-csharp/QueryParser.cs \
59         generated-csharp/Remote.cs \
60         generated-csharp/RSet.cs \
61         generated-csharp/SWIGTYPE_p_std__string.cs \
62         generated-csharp/RangeProcessor.cs \
63         generated-csharp/Registry.cs \
64         generated-csharp/SimpleStopper.cs \
65         generated-csharp/Stem.cs \
66         generated-csharp/StemImplementation.cs \
67         generated-csharp/Stopper.cs \
68         generated-csharp/StringValueRangeProcessor.cs \
69         generated-csharp/TermGenerator.cs \
70         generated-csharp/TermIterator.cs \
71         generated-csharp/TfIdfWeight.cs \
72         generated-csharp/TradWeight.cs \
73         generated-csharp/ValueCountMatchSpy.cs \
74         generated-csharp/ValueIterator.cs \
75         generated-csharp/ValueMapPostingSource.cs \
76         generated-csharp/ValuePostingSource.cs \
77         generated-csharp/ValueRangeProcessor.cs \
78         generated-csharp/ValueSetMatchDecider.cs \
79         generated-csharp/ValueWeightPostingSource.cs \
80         generated-csharp/Version.cs \
81         generated-csharp/Weight.cs \
82         generated-csharp/WritableDatabase.cs \
83         generated-csharp/Xapian.cs \
84         generated-csharp/XapianPINVOKE.cs
86 XapianSharp.snk:
87         $(SN) -k $@
89 $(ASSEMBLY).dll: $(XAPIAN_SWIG_CS_SRCS) AssemblyInfo.cs XapianSharp.snk
90 ## We specify both -keyfile and -keycontainer - hopefully this means that if
91 ## this is the first time we're signing, the key in the file is used and
92 ## then stored in the key container.  From then on, the key in the container
93 ## is used.
94         $(CSC) -unsafe -target:library -out:$(ASSEMBLY).dll \
95             -keyfile:XapianSharp.snk -keycontainer:"Xapian Signing Key" \
96             `for f in $(XAPIAN_SWIG_CS_SRCS); do if test -f "$$f"; then echo $$f; else echo $(srcdir)/$$f ; fi ; done` \
97             AssemblyInfo.cs
99 SWIG_GENERATED = xapian_wrap.cc xapian_wrap.h $(XAPIAN_SWIG_CS_SRCS)
101 BUILT_SOURCES = $(SWIG_GENERATED)
103 EXTRA_DIST = csharp.i SmokeTest.cs docs/index.rst $(SWIG_GENERATED)
105 lib_LTLIBRARIES = _XapianSharp.la
107 # Remove the .la file - _XapianSharp.la is never linked against (it's a module)
108 # and C# doesn't use libltdl.  Note that the library gets installed by
109 # install-data, so that's where we need to hook.
110 install-data-hook:
111         rm -f $(DESTDIR)$(libdir)/_XapianSharp.la
113 # Because we don't install the .la file, "make uninstall" doesn't work and
114 # we need to remove the file ourselves.
115 uninstall-local:
116         eval `grep '^dlname=' $(lib_LTLIBRARIES)` ; \
117           rm -f $(DESTDIR)$(libdir)/"$$dlname"
118         $(GACUTIL) /u $(ASSEMBLY) /f $(GACUTIL_FLAGS)
120 AM_CXXFLAGS = @SWIG_CXXFLAGS@ $(XAPIAN_CXXFLAGS)
121 _XapianSharp_la_LDFLAGS = -avoid-version -module $(NO_UNDEFINED)
122 _XapianSharp_la_SOURCES = xapian_wrap.cc
123 _XapianSharp_la_LIBADD = $(XAPIAN_LIBS)
125 install-data-local: $(ASSEMBLY).dll
126         $(GACUTIL) /i $(ASSEMBLY).dll /f $(GACUTIL_FLAGS)
128 SmokeTest.exe: SmokeTest.cs $(ASSEMBLY).dll
129         $(CSC) -unsafe -target:exe -out:SmokeTest.exe `test -f SmokeTest.cs||echo '$(srcdir)/'`SmokeTest.cs -r:$(ASSEMBLY).dll
131 all-am: $(ASSEMBLY).dll
133 CLEANFILES = XapianSharp.snk $(ASSEMBLY).dll SmokeTest.exe
135 if MAINTAINER_MODE
136 stamp = xapian_wrap.stamp
137 RUN_SWIG = stamp='$(stamp)' $(PERL) '$(top_srcdir)'/swig-depcomp $(SWIG)
139 xapian_wrap.cc xapian_wrap.h $(XAPIAN_SWIG_CS_SRCS): $(stamp)
140         $(make_many_locked)
141 $(stamp):
142         $(multitarget_begin)
143         : # Make sure that we don't package stale generated sources in the
144         : # case where SWIG changes its mind as to which files it generates.
145         -rm -f generated-csharp/*
146         $(MKDIR_P) generated-csharp
147         $(RUN_SWIG) $(SWIG_WERROR) -I'$(srcdir)' $(SWIG_FLAGS) -c++ \
148             -csharp -namespace Xapian -module Xapian -dllimport _XapianSharp \
149             -o xapian_wrap.cc -outdir generated-csharp '$(srcdir)/'csharp.i
150         : # Check that exactly the sources we expected were generated.
151         $(PERL) -e 'print "$$_\n" for sort @ARGV' generated-csharp/*.cs > generated-csharp/list
152         $(PERL) -e 'print "$$_\n" for sort @ARGV' $(XAPIAN_SWIG_CS_SRCS)|diff -c - generated-csharp/list
153         $(multitarget_end)
155 -include xapian_wrap.d
157 CLEANFILES += $(stamp)
158 endif
159 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
161 maintainer-clean-local:
162         rm -rf generated-csharp
164 exampledatadir = $(docdir)/csharp/examples
165 dist_exampledata_DATA =\
166         docs/examples/SimpleSearch.cs\
167         docs/examples/SimpleIndex.cs\
168         docs/examples/SimpleExpand.cs
170 docdatadir = $(docdir)/csharp
171 dist_docdata_DATA = docs/index.html
173 if DOCUMENTATION_RULES
174 BUILT_SOURCES += docs/index.html
176 .rst.html:
177         -case "$@" in */*) d=`echo "$@"|sed 's,/[^/]*$$,,'`; $(MKDIR_P) "$$d" ;; esac
178         $(RST2HTML) --exit-status=warning $< $@
179 endif