Merge new stemmers from Snowball
[xapian.git] / xapian-core / languages / Makefile.mk
blob5ac4932b45e0fed2397ebb65fb73092a14fead1d
1 if VPATH_BUILD
2 # We need this so that generated sources can find non-generated headers and
3 # non-generated sources can find generated headers in a VPATH build from git.
4 AM_CPPFLAGS += -I$(top_srcdir)/languages -Ilanguages
5 endif
7 noinst_HEADERS +=\
8 languages/steminternal.h
10 snowball_algorithms =\
11 languages/arabic.sbl\
12 languages/armenian.sbl\
13 languages/basque.sbl\
14 languages/catalan.sbl\
15 languages/danish.sbl\
16 languages/dutch.sbl\
17 languages/english.sbl\
18 languages/earlyenglish.sbl\
19 languages/finnish.sbl\
20 languages/french.sbl\
21 languages/german2.sbl\
22 languages/german.sbl\
23 languages/hungarian.sbl\
24 languages/indonesian.sbl\
25 languages/irish.sbl\
26 languages/italian.sbl\
27 languages/kraaij_pohlmann.sbl\
28 languages/lithuanian.sbl\
29 languages/lovins.sbl\
30 languages/nepali.sbl\
31 languages/norwegian.sbl\
32 languages/porter.sbl\
33 languages/portuguese.sbl\
34 languages/romanian.sbl\
35 languages/russian.sbl\
36 languages/spanish.sbl\
37 languages/swedish.sbl\
38 languages/tamil.sbl\
39 languages/turkish.sbl
41 snowball_built_sources =\
42 $(snowball_algorithms:.sbl=.cc)\
43 $(snowball_algorithms:.sbl=.h)
45 snowball_sources =\
46 languages/compiler/space.c\
47 languages/compiler/tokeniser.c\
48 languages/compiler/analyser.c\
49 languages/compiler/generator.c\
50 languages/compiler/driver.c
52 snowball_headers =\
53 languages/compiler/header.h\
54 languages/compiler/syswords.h\
55 languages/compiler/syswords2.h
57 EXTRA_DIST += $(snowball_sources) $(snowball_headers) $(snowball_algorithms) $(snowball_built_sources)\
58 languages/collate-sbl\
59 languages/allsnowballheaders.h\
60 languages/sbl-dispatch.h\
61 languages/Makefile
63 stopworddir = $(pkgdatadir)/stopwords
64 dist_stopword_DATA = $(snowball_stopwords:.txt=.list)
66 snowball_stopwords = \
67 languages/stopwords/arabic.txt\
68 languages/stopwords/danish.txt\
69 languages/stopwords/dutch.txt\
70 languages/stopwords/english.txt\
71 languages/stopwords/finnish.txt\
72 languages/stopwords/french.txt\
73 languages/stopwords/german.txt\
74 languages/stopwords/hungarian.txt\
75 languages/stopwords/indonesian.txt\
76 languages/stopwords/italian.txt\
77 languages/stopwords/norwegian.txt\
78 languages/stopwords/portuguese.txt\
79 languages/stopwords/russian.txt\
80 languages/stopwords/spanish.txt\
81 languages/stopwords/swedish.txt
83 .txt.list:
84 if VPATH_BUILD
85 $(MKDIR_P) languages/stopwords
86 endif
87 $(PERL) -pe 's/\|.*//g;s/\s+/\n/g;s/^\n//' $< |LC_COLLATE=C sort|uniq > $@
89 if MAINTAINER_MODE
90 $(snowball_built_sources): languages/snowball $(snowball_algorithms)
92 languages/snowball: $(snowball_sources) $(snowball_headers)
93 $(CC_FOR_BUILD) -o languages/snowball \
94 -DDISABLE_CSHARP -DDISABLE_GO -DDISABLE_JAVA -DDISABLE_JS -DDISABLE_PASCAL -DDISABLE_PYTHON -DDISABLE_RUST \
95 `for f in $(snowball_sources) ; do test -f $$f && echo $$f || echo $(srcdir)/$$f ; done`
97 .sbl.cc:
98 languages/snowball $< -o `echo $@|$(SED) 's!\.cc$$!!'` -c++ -u -n InternalStem`echo $<|$(SED) 's!.*/\(.\).*!\1!'|tr a-z A-Z``echo $<|$(SED) 's!.*/.!!;s!\.sbl!!'` -p SnowballStemImplementation
100 .sbl.h:
101 languages/snowball $< -o `echo $@|$(SED) 's!\.h$$!!'` -c++ -u -n InternalStem`echo $<|$(SED) 's!.*/\(.\).*!\1!'|tr a-z A-Z``echo $<|$(SED) 's!.*/.!!;s!\.sbl!!'` -p SnowballStemImplementation
103 languages/allsnowballheaders.h: languages/sbl-dispatch.h
104 languages/sbl-dispatch.h languages/allsnowballheaders.h: languages/collate-sbl languages/Makefile.mk common/Tokeniseise.pm
105 $(PERL) -I'$(srcdir)/common' '$(srcdir)/languages/collate-sbl' '$(srcdir)' $(snowball_algorithms)
107 BUILT_SOURCES += $(snowball_built_sources)\
108 languages/allsnowballheaders.h\
109 languages/sbl-dispatch.h
110 CLEANFILES += languages/snowball
111 endif
113 lib_src += $(snowball_built_sources)\
114 languages/stem.cc\
115 languages/steminternal.cc