1 ## Process this file with automake to produce Makefile.in
3 include ../generic/generic.mk
5 ## Test programs to be run
7 LOG_COMPILER = $(MACOS_SIP_HACK_ENV) $(RUBY)
8 AM_LOG_FLAGS = -I'$(_libs)' -I'$(srcdir)'
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) \
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.
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)
40 stamp = xapian_wrap.stamp
41 SWIG_FLAGS += -MD -MP -MT $(stamp)
43 xapian_wrap.cc xapian_wrap.h: $(stamp)
47 $(SWIG) $(SWIG_WERROR) -I'$(srcdir)' $(SWIG_FLAGS) -c++ \
48 -initname _xapian -ruby \
49 -o xapian_wrap.cc '$(srcdir)/'ruby.i
52 -include xapian_wrap.d
54 CLEANFILES += $(stamp)
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
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
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"; \
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)
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"; \
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
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
117 -case "$@" in */*) d=`echo "$@"|sed 's,/[^/]*$$,,'`; $(MKDIR_P) "$$d" ;; esac
118 $(RST2HTML) --exit-status=warning $< $@
120 CLEANFILES += docs/xapian.rb