[ci] Fix clang-santisers job for GHA change
[xapian.git] / xapian-bindings / ruby / Makefile.am
blob615d7fe76a0a4b9b6673a4b6a9d24657367ea494
1 ## Process this file with automake to produce Makefile.in
3 include ../generic/generic.mk
5 ## Test programs to be run
6 TESTS = smoketest.rb
7 LOG_COMPILER = $(MACOS_SIP_HACK_ENV) $(RUBY)
8 AM_LOG_FLAGS = -I'$(_libs)' -I'$(srcdir)'
10 installcheck-local:
11         $(MAKE) check AM_LOG_FLAGS=
13 SWIG_GENERATED = xapian_wrap.cc xapian_wrap.h
15 EXTRA_DIST = ruby.i extra.i docs/index.rst $(TESTS) \
16         $(SWIG_GENERATED)
18 BUILT_SOURCES = $(SWIG_GENERATED)
20 rubylibdir = $(RUBY_LIB)
21 dist_rubylib_DATA = xapian.rb
23 rubylibarchdir = $(RUBY_LIB_ARCH)
24 rubylibarch_LTLIBRARIES = _xapian.la
26 # Remove the .la file - _xapian.la is never linked against (it's a module)
27 # and Ruby doesn't use libltdl.  Note that the library gets installed by
28 # install-data, so that's where we need to hook.
29 install-data-hook:
30         rm -f $(DESTDIR)$(rubylibarchdir)/_xapian.la
32 AM_CPPFLAGS = -I$(RUBY_INC) -I$(RUBY_INC_ARCH)
33 AM_CXXFLAGS = @SWIG_CXXFLAGS@ $(XAPIAN_CXXFLAGS)
34 _xapian_la_LDFLAGS = -avoid-version -module -shrext ".$(RUBY_DLEXT)" $(NO_UNDEFINED)
35 _xapian_la_SOURCES = xapian_wrap.cc xapian_wrap.h
36 _xapian_la_LIBADD = $(XAPIAN_LIBS) $(RUBY_LIBS)
38 CLEANFILES =
39 if MAINTAINER_MODE
40 stamp = xapian_wrap.stamp
41 SWIG_FLAGS += -MD -MP -MT $(stamp)
43 xapian_wrap.cc xapian_wrap.h: $(stamp)
44         $(make_many_locked)
45 $(stamp):
46         $(multitarget_begin)
47         $(SWIG) $(SWIG_WERROR) -I'$(srcdir)' $(SWIG_FLAGS) -c++ \
48             -initname _xapian -ruby \
49             -o xapian_wrap.cc '$(srcdir)/'ruby.i
50         $(multitarget_end)
52 -include xapian_wrap.d
54 CLEANFILES += $(stamp)
55 endif
56 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
58 # Compatibility wrapper which configure creates when required.
59 DISTCLEANFILES = rubyio.h
61 exampledatadir = $(docdir)/ruby/examples
62 dist_exampledata_DATA = \
63         docs/examples/simpleexpand.rb \
64         docs/examples/simpleindex.rb \
65         docs/examples/simplematchdecider.rb \
66         docs/examples/simplesearch.rb
68 install-data-local:
69         $(mkinstalldirs) $(DESTDIR)$(docdatadir)
70         ## In a VPATH build, install files from srcdir first.  Use
71         ## $(abs_builddir) because we need to cd there having already
72         ## changed directory.
73         @paths=docs ; \
74           test '$(abs_srcdir)' = '$(abs_builddir)' || paths='$(srcdir)/docs $(abs_builddir)/docs' ; \
75           for docs in $$paths ; do \
76             cd "$$docs" && for dir in `find rdocs -type d -print` ; do \
77               echo " $(mkinstalldirs) '$(DESTDIR)$(docdatadir)/$$dir'"; \
78               $(mkinstalldirs) "$(DESTDIR)$(docdatadir)/$$dir"; \
79             done && for f in `find rdocs -type f -print` ; do \
80               echo " $(INSTALL_DATA) '$$f' '$(DESTDIR)$(docdatadir)/$$f'"; \
81               $(INSTALL_DATA) "$$f" "$(DESTDIR)$(docdatadir)/$$f"; \
82             done ; \
83           done
85 uninstall-local:
86         ## Because we don't install the .la file, "make uninstall" doesn't work
87         ## and we need to remove the file ourselves.
88         rm -f $(DESTDIR)$(rubylibarchdir)/_xapian.$(RUBY_DLEXT)
89         @paths=docs ; \
90           test '$(abs_srcdir)' = '$(abs_builddir)' || paths='$(srcdir)/docs $(abs_builddir)/docs' ; \
91           for docs in $$paths ; do \
92             cd "$$docs" && for f in `find rdocs -type f -print` ; do \
93               echo " rm -f '$(DESTDIR)$(docdatadir)/$$f'"; \
94               rm -f "$(DESTDIR)$(docdatadir)/$$f"; \
95             done; \
96           done
98 docdatadir = $(docdir)/ruby
99 dist_docdata_DATA = docs/index.html
101 EXTRA_DIST += generate-rdoc-stubs docs/xapian.rb
103 BUILT_SOURCES += docs/rdocs/index.html
105 docs/rdocs/index.html: docs/xapian.rb
106         rm -rf docs/rdocs
107         $(MKDIR_P) docs
108         cd docs && $(RDOC) --op rdocs `test -f xapian.rb||echo '$(abs_srcdir)/docs/'`xapian.rb
110 if DOCUMENTATION_RULES
111 docs/xapian.rb: generate-rdoc-stubs xapian.rb ../doxygen-xml/index.xml
112         $(PERL) $(srcdir)/generate-rdoc-stubs
114 BUILT_SOURCES += docs/index.html
116 .rst.html:
117         -case "$@" in */*) d=`echo "$@"|sed 's,/[^/]*$$,,'`; $(MKDIR_P) "$$d" ;; esac
118         $(RST2HTML) --exit-status=warning $< $@
120 CLEANFILES += docs/xapian.rb
121 endif