scriptindex: Fix weird error cases
[xapian.git] / xapian-applications / omega / Makefile.am
blob27fc94fae9f0be361c10f7d9fb93a251665c1a71
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 ACLOCAL_AMFLAGS = -I m4
11 SUBDIRS = . docs
13 my-html-tok.h: gen-myhtmltags Makefile.am common/Tokeniseise.pm myhtmlparse.tokens
14         $(PERL) -I'$(srcdir)/common' '$(srcdir)/gen-myhtmltags' '$(srcdir)' < '$(srcdir)/myhtmlparse.tokens'
16 # Recover from the removal of $@.  A full explanation of this is in the
17 # automake manual under the heading "Multiple Outputs".
18 make_many_locked = \
19 @if test -f $@; then :; else \
20   trap 'rm -rf "$(stamp)-lck" "$(stamp)"' 1 2 13 15; \
21   if mkdir '$(stamp)-lck' 2>/dev/null; then \
22     rm -f '$(stamp)'; \
23     $(MAKE) $(AM_MAKEFLAGS) '$(stamp)'; \
24     result=$$?; rm -rf '$(stamp)-lck'; exit $$result; \
25   else \
26     while test -d '$(stamp)-lck'; do sleep 1; done; \
27     test -f '$(stamp)'; \
28   fi; \
31 multitarget_begin = @rm -f $@-t; touch $@-t
32 multitarget_end = @mv -f $@-t $@
34 stamp = mimemap.stamp
35 mimemap.h docs/inc/ignored.rst docs/inc/mimetypes.rst: $(stamp)
36         $(make_many_locked)
37 $(stamp): gen-mimemap Makefile.am common/Tokeniseise.pm mimemap.tokens
38         $(multitarget_begin)
39         $(PERL) -I'$(srcdir)/common' '$(srcdir)/gen-mimemap' '$(srcdir)' < '$(srcdir)/mimemap.tokens'
40         $(multitarget_end)
42 namedents.h: gen-namedents Makefile.am common/Tokeniseise.pm
43         $(PERL) -I'$(srcdir)/common' '$(srcdir)/gen-namedents' '$(srcdir)'
45 BUILT_SOURCES = extra/omegascript.vim my-html-tok.h mimemap.h namedents.h
47 MAINTAINERCLEANFILES = my-html-tok.h mimemap.h mimemap.stamp namedents.h
49 EXTRA_DIST =\
50         common/Tokeniseise.pm \
51         extra/omegascript.vim \
52         extra/omegascript.vim.in \
53         config.rpath \
54         gen-mimemap \
55         gen-myhtmltags \
56         gen-namedents \
57         gen-omegascript-vim \
58         mimemap.h \
59         mimemap.stamp \
60         mimemap.tokens \
61         my-html-tok.h \
62         myhtmlparse.tokens \
63         namedents.h \
64         templates/query \
65         templates/topterms \
66         templates/opensearch \
67         templates/godmode \
68         templates/xml \
69         templates/inc/anyalldropbox \
70         templates/inc/anyallradio \
71         templates/inc/toptermsjs \
72         images/nextoff.png \
73         images/next.png \
74         images/page-10.png \
75         images/page-10s.png \
76         images/page-11.png \
77         images/page-11s.png \
78         images/page-1.png \
79         images/page-1s.png \
80         images/page-2.png \
81         images/page-2s.png \
82         images/page-3.png \
83         images/page-3s.png \
84         images/page-4.png \
85         images/page-4s.png \
86         images/page-5.png \
87         images/page-5s.png \
88         images/page-6.png \
89         images/page-6s.png \
90         images/page-7.png \
91         images/page-7s.png \
92         images/page-8.png \
93         images/page-8s.png \
94         images/page-9.png \
95         images/page-9s.png \
96         images/previous.png \
97         images/prevoff.png \
98         images/score-0.png \
99         images/score-10.png \
100         images/score-1.png \
101         images/score-2.png \
102         images/score-3.png \
103         images/score-4.png \
104         images/score-5.png \
105         images/score-6.png \
106         images/score-7.png \
107         images/score-8.png \
108         images/score-9.png \
109         xapian-omega.spec
111 AM_CPPFLAGS = \
112         -I$(top_srcdir)/common \
113         -DCONFIGFILE_SYSTEM=\"$(sysconfdir)/omega.conf\" \
114         -DPKGLIBBINDIR=\"$(pkglibbindir)\"
115 AM_CXXFLAGS += $(XAPIAN_CXXFLAGS)
117 pkglibbindir = $(pkglibdir)/bin
118 pkglibbin_PROGRAMS = omega
119 dist_pkglibbin_SCRIPTS = mhtml2html outlookmsg2html rfc822tohtml vcard2text
120 bin_PROGRAMS = omindex scriptindex omindex-list
121 dist_bin_SCRIPTS = dbi2omega htdig2omega mbox2omega
123 check_PROGRAMS = atomparsetest csvesctest htmlparsetest jsonesctest md5test urlenctest utf8converttest
124 dist_check_SCRIPTS = omegatest sourcetest
125 TESTS = atomparsetest$(EXEEXT)\
126         csvesctest$(EXEEXT)\
127         htmlparsetest$(EXEEXT)\
128         jsonesctest$(EXEEXT)\
129         md5test$(EXEEXT)\
130         omegatest\
131         sourcetest\
132         urlenctest$(EXEEXT)\
133         utf8converttest$(EXEEXT)
135 omegadatadir = $(datadir)/omega
136 dist_omegadata_DATA = htdig2omega.script mbox2omega.script
138 dist_sysconf_DATA = omega.conf
140 noinst_HEADERS = omega.h query.h cgiparam.h index_file.h mime.h\
141  myhtmlparse.h htmlparse.h utils.h configfile.h date.h datetime.h\
142  commonhelp.h cdb.h cdb_int.h failed.h fields.h hashterm.h jsonescape.h\
143  loadfile.h md5.h md5wrap.h xmlparse.h metaxmlparse.h values.h utf8convert.h\
144  namedents.h pkglibbindir.h datevalue.h sample.h strcasecmp.h\
145  utf8truncate.h diritor.h runfilter.h freemem.h xpsxmlparse.h transform.h\
146  weight.h expand.h svgparse.h tmpdir.h urldecode.h urlencode.h unixperm.h atomparse.h\
147  xlsxparse.h opendocparse.h msxmlparse.h sort.h timegm.h csvescape.h\
148  portability/mkdtemp.h portability/strptime.h
150 # headers maintained in xapian-core
151 noinst_HEADERS +=\
152         common/append_filename_arg.h\
153         common/gnu_getopt.h\
154         common/keyword.h\
155         common/msvc_dirent.h\
156         common/noreturn.h\
157         common/omassert.h\
158         common/overflow.h\
159         common/parseint.h\
160         common/realtime.h\
161         common/safedirent.h\
162         common/safefcntl.h\
163         common/safesysselect.h\
164         common/safesysstat.h\
165         common/safesyswait.h\
166         common/safeunistd.h\
167         common/safewindows.h\
168         common/safewinsock2.h\
169         common/setenv.h\
170         common/str.h\
171         common/stringutils.h
173 AM_LDFLAGS = $(NO_UNDEFINED) $(MAGIC_LDFLAGS)
175 # We want to compile transform.cc with PCRE2_CFLAGS, but if this adds a -I for
176 # a directory with a different version of iconv, then we get problems (this
177 # has been reported on macOS).  We solve this using a technique suggested by
178 # the automake manual: compile each of transform.cc and utf8convert.cc into
179 # its own convenience library so each only gets its own CPPFLAGS.
180 noinst_LTLIBRARIES = libtransform.la libutf8convert.la
182 libtransform_la_SOURCES = transform.cc
183 libtransform_la_CPPFLAGS = $(PCRE2_CFLAGS)
184 libtransform_la_LIBADD = $(PCRE2_LIBS)
186 libutf8convert_la_SOURCES = utf8convert.cc
187 libutf8convert_la_CPPFLAGS = $(AM_CPPFLAGS) $(INCICONV)
188 libutf8convert_la_LIBADD = $(XAPIAN_LIBS) $(LTLIBICONV)
190 omega_SOURCES = omega.cc query.cc cgiparam.cc utils.cc configfile.cc date.cc\
191  cdb_init.cc cdb_find.cc cdb_hash.cc cdb_unpack.cc jsonescape.cc loadfile.cc\
192  datevalue.cc common/str.cc sample.cc sort.cc urlencode.cc weight.cc expand.cc\
193  csvescape.cc timegm.cc
194 # Not currently used, and we ought to handle non-Unix perms too: unixperm.cc
195 omega_LDADD = $(XAPIAN_LIBS) libtransform.la
197 omindex_SOURCES = omindex.cc myhtmlparse.cc htmlparse.cc index_file.cc mime.cc\
198  common/getopt.cc commonhelp.cc utils.cc hashterm.cc loadfile.cc md5.cc\
199  md5wrap.cc xmlparse.cc metaxmlparse.cc sample.cc diritor.cc\
200  runfilter.cc freemem.cc common/msvc_dirent.cc xpsxmlparse.cc common/str.cc\
201  pkglibbindir.cc svgparse.cc tmpdir.cc urlencode.cc atomparse.cc xlsxparse.cc\
202  opendocparse.cc common/keyword.cc msxmlparse.cc common/safe.cc timegm.cc\
203  datetime.cc
204 if NEED_MKDTEMP
205 omindex_SOURCES += portability/mkdtemp.cc
206 endif
207 omindex_LDADD = $(MAGIC_LIBS) $(XAPIAN_LIBS) $(ZLIB_LIBS) libutf8convert.la
209 scriptindex_SOURCES = scriptindex.cc myhtmlparse.cc htmlparse.cc\
210  common/getopt.cc common/str.cc commonhelp.cc utils.cc hashterm.cc loadfile.cc\
211  utf8truncate.cc\
212  common/keyword.cc timegm.cc datetime.cc
213 if NEED_STRPTIME
214 scriptindex_SOURCES += portability/strptime.cc
215 endif
216 scriptindex_LDADD = $(XAPIAN_LIBS) libutf8convert.la
218 omindex_list_SOURCES = common/getopt.cc omindex-list.cc
219 omindex_list_LDADD = $(XAPIAN_LIBS)
221 atomparsetest_SOURCES = atomparsetest.cc atomparse.cc htmlparse.cc\
222  myhtmlparse.cc common/keyword.cc datetime.cc timegm.cc
223 atomparsetest_LDADD = $(NO_INSTALL) $(XAPIAN_LIBS) libutf8convert.la
225 htmlparsetest_SOURCES = htmlparsetest.cc myhtmlparse.cc htmlparse.cc\
226  common/keyword.cc datetime.cc timegm.cc
227 htmlparsetest_LDADD = $(NO_INSTALL) $(XAPIAN_LIBS) libutf8convert.la
229 md5test_SOURCES = md5test.cc md5wrap.cc md5.cc
230 md5test_LDADD = $(NO_INSTALL)
232 utf8converttest_SOURCES = utf8converttest.cc
233 utf8converttest_LDADD = $(NO_INSTALL) $(XAPIAN_LIBS) libutf8convert.la
235 urlenctest_SOURCES = urlenctest.cc urlencode.cc
236 urlenctest_LDADD = $(NO_INSTALL) $(XAPIAN_LIBS)
238 csvesctest_SOURCES = csvesctest.cc csvescape.cc
239 csvesctest_LDADD = $(NO_INSTALL)
241 jsonesctest_SOURCES = jsonesctest.cc jsonescape.cc
242 jsonesctest_LDADD = $(NO_INSTALL) $(XAPIAN_LIBS)
244 if !MAINTAINER_NO_DOCS
245 dist_man_MANS = omindex.1 scriptindex.1 omindex-list.1
246 MAINTAINERCLEANFILES += $(dist_man_MANS)
247 endif
249 if DOCUMENTATION_RULES
250 omindex.1: omindex$(EXEEXT) makemanpage
251         ./makemanpage ./omindex $(srcdir)/omindex.cc omindex.1
253 scriptindex.1: scriptindex$(EXEEXT) makemanpage
254         ./makemanpage ./scriptindex $(srcdir)/scriptindex.cc scriptindex.1
256 omindex-list.1: omindex-list$(EXEEXT) makemanpage
257         ./makemanpage ./omindex-list $(srcdir)/omindex-list.cc omindex-list.1
258 endif
260 if MAINTAINER_MODE
261 extra/omegascript.vim: extra/omegascript.vim.in query.cc configure.ac
262         $(PERL) $(srcdir)/gen-omegascript-vim "$(srcdir)" "$(PACKAGE_VERSION)"
263 endif
265 DISTCHECK_CONFIGURE_FLAGS = "XAPIAN_CONFIG=$(XAPIAN_CONFIG)"
267 installcheck-local:
268         $(MAKE) check SCRIPTINDEX='${bindir}/scriptindex' OMEGA='${pkglibbindir}/omega'