scriptindex: Use DB_RETRY_LOCK to wait for lock
[xapian.git] / xapian-applications / omega / Makefile.am
blob930e21c2d5d6dbc7d5985575bb1ebcf672148151
1 ## Process this file with automake to produce Makefile.in
3 if MAINTAINER_MODE
4 # Export these so that we run the locally installed autotools when building
5 # from a bootstrapped git tree.
6 export ACLOCAL AUTOCONF AUTOHEADER AUTOM4TE AUTOMAKE
7 endif
9 SUBDIRS = . docs
11 my-html-tok.h: gen-myhtmltags Makefile.am common/Tokeniseise.pm myhtmlparse.tokens
12         $(PERL) -I'$(srcdir)/common' '$(srcdir)/gen-myhtmltags' '$(srcdir)' < '$(srcdir)/myhtmlparse.tokens'
14 # Recover from the removal of $@.  A full explanation of this is in the
15 # automake manual under the heading "Multiple Outputs".
16 make_many_locked = \
17 @if test -f $@; then :; else \
18   trap 'rm -rf "$(stamp)-lck" "$(stamp)"' 1 2 13 15; \
19   if mkdir '$(stamp)-lck' 2>/dev/null; then \
20     rm -f '$(stamp)'; \
21     $(MAKE) $(AM_MAKEFLAGS) '$(stamp)'; \
22     result=$$?; rm -rf '$(stamp)-lck'; exit $$result; \
23   else \
24     while test -d '$(stamp)-lck'; do sleep 1; done; \
25     test -f '$(stamp)'; \
26   fi; \
29 multitarget_begin = @rm -f $@-t; touch $@-t
30 multitarget_end = @mv -f $@-t $@
32 stamp = mimemap.stamp
33 mimemap.h docs/inc/ignored.rst docs/inc/mimetypes.rst: $(stamp)
34         $(make_many_locked)
35 $(stamp): gen-mimemap Makefile.am common/Tokeniseise.pm mimemap.tokens
36         $(multitarget_begin)
37         $(PERL) -I'$(srcdir)/common' '$(srcdir)/gen-mimemap' '$(srcdir)' < '$(srcdir)/mimemap.tokens'
38         $(multitarget_end)
40 namedents.h: gen-namedents Makefile.am common/Tokeniseise.pm
41         $(PERL) -I'$(srcdir)/common' '$(srcdir)/gen-namedents' '$(srcdir)'
43 BUILT_SOURCES = extra/omegascript.vim my-html-tok.h mimemap.h namedents.h
45 MAINTAINERCLEANFILES = my-html-tok.h mimemap.h namedents.h
47 EXTRA_DIST =\
48         common/Tokeniseise.pm \
49         extra/omegascript.vim \
50         extra/omegascript.vim.in \
51         gen-mimemap \
52         gen-myhtmltags \
53         gen-namedents \
54         gen-omegascript-vim \
55         mimemap.h \
56         mimemap.stamp \
57         mimemap.tokens \
58         my-html-tok.h \
59         myhtmlparse.tokens \
60         namedents.h \
61         templates/query \
62         templates/topterms \
63         templates/opensearch \
64         templates/godmode \
65         templates/xml \
66         templates/inc/anyalldropbox \
67         templates/inc/anyallradio \
68         templates/inc/toptermsjs \
69         images/nextoff.png \
70         images/next.png \
71         images/page-10.png \
72         images/page-10s.png \
73         images/page-11.png \
74         images/page-11s.png \
75         images/page-1.png \
76         images/page-1s.png \
77         images/page-2.png \
78         images/page-2s.png \
79         images/page-3.png \
80         images/page-3s.png \
81         images/page-4.png \
82         images/page-4s.png \
83         images/page-5.png \
84         images/page-5s.png \
85         images/page-6.png \
86         images/page-6s.png \
87         images/page-7.png \
88         images/page-7s.png \
89         images/page-8.png \
90         images/page-8s.png \
91         images/page-9.png \
92         images/page-9s.png \
93         images/previous.png \
94         images/prevoff.png \
95         images/score-0.png \
96         images/score-10.png \
97         images/score-1.png \
98         images/score-2.png \
99         images/score-3.png \
100         images/score-4.png \
101         images/score-5.png \
102         images/score-6.png \
103         images/score-7.png \
104         images/score-8.png \
105         images/score-9.png \
106         xapian-omega.spec
108 AM_CPPFLAGS = \
109         -I$(top_srcdir)/common \
110         -DCONFIGFILE_SYSTEM=\"$(sysconfdir)/omega.conf\" \
111         -DPKGLIBBINDIR=\"$(pkglibbindir)\"
112 AM_CXXFLAGS += $(XAPIAN_CXXFLAGS)
114 pkglibbindir = $(pkglibdir)/bin
115 pkglibbin_PROGRAMS = omega
116 dist_pkglibbin_SCRIPTS = mhtml2html outlookmsg2html rfc822tohtml vcard2text
117 bin_PROGRAMS = omindex scriptindex omindex-list
118 dist_bin_SCRIPTS = dbi2omega htdig2omega mbox2omega postprocess
120 check_PROGRAMS = atomparsetest csvesctest htmlparsetest jsonesctest md5test urlenctest utf8converttest
121 dist_check_SCRIPTS = omegatest
122 TESTS = atomparsetest$(EXEEXT)\
123         csvesctest$(EXEEXT)\
124         htmlparsetest$(EXEEXT)\
125         jsonesctest$(EXEEXT)\
126         md5test$(EXEEXT)\
127         omegatest\
128         urlenctest$(EXEEXT)\
129         utf8converttest$(EXEEXT)
131 omegadatadir = $(datadir)/omega
132 dist_omegadata_DATA = htdig2omega.script mbox2omega.script
134 dist_sysconf_DATA = omega.conf
136 noinst_HEADERS = omega.h query.h cgiparam.h index_file.h mime.h\
137  myhtmlparse.h htmlparse.h utils.h configfile.h date.h datetime.h\
138  commonhelp.h cdb.h cdb_int.h failed.h hashterm.h jsonescape.h loadfile.h\
139  md5.h md5wrap.h xmlparse.h metaxmlparse.h values.h utf8convert.h\
140  namedents.h pkglibbindir.h datevalue.h sample.h strcasecmp.h\
141  utf8truncate.h diritor.h runfilter.h freemem.h xpsxmlparse.h transform.h\
142  weight.h expand.h svgparse.h tmpdir.h urldecode.h urlencode.h unixperm.h atomparse.h\
143  xlsxparse.h opendocparse.h msxmlparse.h timegm.h csvescape.h\
144  portability/mkdtemp.h
146 # headers maintained in xapian-core
147 noinst_HEADERS +=\
148         common/append_filename_arg.h\
149         common/gnu_getopt.h\
150         common/keyword.h\
151         common/msvc_dirent.h\
152         common/omassert.h\
153         common/realtime.h\
154         common/safedirent.h\
155         common/safeerrno.h\
156         common/safefcntl.h\
157         common/safesysselect.h\
158         common/safesysstat.h\
159         common/safesyswait.h\
160         common/safeunistd.h\
161         common/safewindows.h\
162         common/safewinsock2.h\
163         common/str.h\
164         common/stringutils.h
166 AM_LDFLAGS = $(NO_UNDEFINED) $(ICONV_LDFLAGS) $(MAGIC_LDFLAGS)
168 # We want to compile transform.cc with PCRE_CFLAGS, but if this adds a -I for
169 # a directory with a different version of iconv, then we get problems (this
170 # has been reported on Mac OS X).  So we only add PCRE_CFLAGS when compiling
171 # transform.cc, using the convenience library technique suggested by the
172 # automake manual.
173 noinst_LTLIBRARIES = libtransform.la
174 libtransform_la_SOURCES = transform.cc
175 libtransform_la_CPPFLAGS = $(PCRE_CFLAGS)
176 libtransform_la_LIBADD = $(PCRE_LIBS)
178 omega_SOURCES = omega.cc query.cc cgiparam.cc utils.cc configfile.cc date.cc\
179  cdb_init.cc cdb_find.cc cdb_hash.cc cdb_unpack.cc jsonescape.cc loadfile.cc\
180  datevalue.cc common/str.cc sample.cc urlencode.cc weight.cc expand.cc\
181  csvescape.cc timegm.cc md5.cc md5wrap.cc
182 # Not currently used, and we ought to handle non-Unix perms too: unixperm.cc
183 omega_LDADD = $(XAPIAN_LIBS) libtransform.la
185 omindex_SOURCES = omindex.cc myhtmlparse.cc htmlparse.cc index_file.cc mime.cc\
186  common/getopt.cc commonhelp.cc utils.cc hashterm.cc loadfile.cc md5.cc\
187  md5wrap.cc xmlparse.cc metaxmlparse.cc utf8convert.cc sample.cc diritor.cc\
188  runfilter.cc freemem.cc common/msvc_dirent.cc xpsxmlparse.cc common/str.cc\
189  pkglibbindir.cc svgparse.cc tmpdir.cc urlencode.cc atomparse.cc xlsxparse.cc\
190  opendocparse.cc common/keyword.cc msxmlparse.cc common/safe.cc timegm.cc\
191  datetime.cc
192 if NEED_MKDTEMP
193 omindex_SOURCES += portability/mkdtemp.cc
194 endif
195 omindex_LDADD = $(MAGIC_LIBS) $(XAPIAN_LIBS) $(ZLIB_LIBS)
197 scriptindex_SOURCES = scriptindex.cc myhtmlparse.cc htmlparse.cc\
198  common/getopt.cc commonhelp.cc utils.cc hashterm.cc loadfile.cc\
199  utf8convert.cc utf8truncate.cc\
200  common/keyword.cc timegm.cc datetime.cc
201 scriptindex_LDADD = $(XAPIAN_LIBS)
203 omindex_list_SOURCES = common/getopt.cc omindex-list.cc
204 omindex_list_LDADD = $(XAPIAN_LIBS)
206 atomparsetest_SOURCES = atomparsetest.cc atomparse.cc htmlparse.cc\
207  myhtmlparse.cc utf8convert.cc common/keyword.cc datetime.cc timegm.cc
208 atomparsetest_LDADD = $(NO_INSTALL) $(XAPIAN_LIBS)
210 htmlparsetest_SOURCES = htmlparsetest.cc myhtmlparse.cc htmlparse.cc\
211  utf8convert.cc common/keyword.cc datetime.cc timegm.cc
212 htmlparsetest_LDADD = $(NO_INSTALL) $(XAPIAN_LIBS)
214 md5test_SOURCES = md5test.cc md5wrap.cc md5.cc
215 md5test_LDADD = $(NO_INSTALL)
217 utf8converttest_SOURCES = utf8converttest.cc utf8convert.cc
218 utf8converttest_LDADD = $(NO_INSTALL) $(XAPIAN_LIBS)
220 urlenctest_SOURCES = urlenctest.cc urlencode.cc
221 urlenctest_LDADD = $(NO_INSTALL) $(XAPIAN_LIBS)
223 csvesctest_SOURCES = csvesctest.cc csvescape.cc
224 csvesctest_LDADD = $(NO_INSTALL)
226 jsonesctest_SOURCES = jsonesctest.cc jsonescape.cc
227 jsonesctest_LDADD = $(NO_INSTALL) $(XAPIAN_LIBS)
229 if !MAINTAINER_NO_DOCS
230 dist_man_MANS = omindex.1 scriptindex.1 omindex-list.1
231 MAINTAINERCLEANFILES += $(dist_man_MANS)
232 endif
234 if DOCUMENTATION_RULES
235 omindex.1: omindex$(EXEEXT) makemanpage
236         ./makemanpage ./omindex $(srcdir)/omindex.cc omindex.1
238 scriptindex.1: scriptindex$(EXEEXT) makemanpage
239         ./makemanpage ./scriptindex $(srcdir)/scriptindex.cc scriptindex.1
241 omindex-list.1: omindex-list$(EXEEXT) makemanpage
242         ./makemanpage ./omindex-list $(srcdir)/omindex-list.cc omindex-list.1
243 endif
245 if MAINTAINER_MODE
246 extra/omegascript.vim: extra/omegascript.vim.in query.cc configure.ac
247         $(PERL) $(srcdir)/gen-omegascript-vim "$(srcdir)" "$(PACKAGE_VERSION)"
248 endif
250 DISTCHECK_CONFIGURE_FLAGS = "XAPIAN_CONFIG=$(XAPIAN_CONFIG)"
252 installcheck-local:
253         $(MAKE) check SCRIPTINDEX='${bindir}/scriptindex' OMEGA='${pkglibbindir}/omega'