1 #-------------------------------------------------------------------------
3 # Makefile for src/backend/snowball
5 # src/backend/snowball/Makefile
7 #-------------------------------------------------------------------------
9 subdir = src/backend/snowball
10 top_builddir = ../../..
11 include $(top_builddir)/src/Makefile.global
13 override CPPFLAGS := -I$(top_srcdir)/src/include/snowball \
14 -I$(top_srcdir)/src/include/snowball/libstemmer $(CPPFLAGS)
16 OBJS= dict_snowball.o api.o utilities.o \
17 stem_ISO_8859_1_danish.o \
18 stem_ISO_8859_1_dutch.o \
19 stem_ISO_8859_1_english.o \
20 stem_ISO_8859_1_finnish.o \
21 stem_ISO_8859_1_french.o \
22 stem_ISO_8859_1_german.o \
23 stem_ISO_8859_1_hungarian.o \
24 stem_ISO_8859_1_italian.o \
25 stem_ISO_8859_1_norwegian.o \
26 stem_ISO_8859_1_porter.o \
27 stem_ISO_8859_1_portuguese.o \
28 stem_ISO_8859_1_spanish.o \
29 stem_ISO_8859_1_swedish.o \
30 stem_ISO_8859_2_romanian.o \
31 stem_KOI8_R_russian.o \
34 stem_UTF_8_english.o \
35 stem_UTF_8_finnish.o \
38 stem_UTF_8_hungarian.o \
39 stem_UTF_8_italian.o \
40 stem_UTF_8_norwegian.o \
42 stem_UTF_8_portuguese.o \
43 stem_UTF_8_romanian.o \
44 stem_UTF_8_russian.o \
45 stem_UTF_8_spanish.o \
46 stem_UTF_8_swedish.o \
49 # first column is language name and also name of dictionary for not-all-ASCII
50 # words, second is name of dictionary for all-ASCII words
51 # Note order dependency: use of some other language as ASCII dictionary
52 # must come after creation of that language
63 portuguese portuguese \
71 SQLSCRIPT= snowball_create.sql
74 VPATH += $(srcdir)/libstemmer
79 all: all-shared-lib $(SQLSCRIPT)
81 include $(top_srcdir)/src/Makefile.shlib
83 $(SQLSCRIPT): Makefile snowball_func.sql.in snowball.sql.in
84 ifeq ($(enable_shared), yes)
85 echo '-- Language-specific snowball dictionaries' > $@
86 cat $(srcdir)/snowball_func.sql.in >> $@
89 while [ "$$#" -gt 0 ] ; \
92 nonascdictname=$$lang; \
93 ascdictname=$$1; shift; \
94 if [ -s $(srcdir)/stopwords/$${lang}.stop ] ; then \
95 stop=", StopWords=$${lang}" ; \
99 cat $(srcdir)/snowball.sql.in | \
100 sed -e "s#_LANGNAME_#$$lang#g" | \
101 sed -e "s#_DICTNAME_#$${lang}_stem#g" | \
102 sed -e "s#_CFGNAME_#$$lang#g" | \
103 sed -e "s#_ASCDICTNAME_#$${ascdictname}_stem#g" | \
104 sed -e "s#_NONASCDICTNAME_#$${nonascdictname}_stem#g" | \
105 sed -e "s#_STOPWORDS_#$$stop#g" ; \
108 echo "-- No language-specific snowball dictionaries, for lack of shared library support" > $@
111 install: all installdirs install-lib
112 $(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
115 while [ "$$#" -gt 0 ] ; \
117 lang=$$1; shift; shift; \
118 if [ -s $(srcdir)/stopwords/$${lang}.stop ] ; then \
119 $(INSTALL_DATA) $(srcdir)/stopwords/$${lang}.stop '$(DESTDIR)$(datadir)/$(DICTDIR)' ; \
123 installdirs: installdirs-lib
124 $(MKDIR_P) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(datadir)/$(DICTDIR)'
126 uninstall: uninstall-lib
127 rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
130 while [ "$$#" -gt 0 ] ; \
132 lang=$$1; shift; shift; \
133 if [ -s $(srcdir)/stopwords/$${lang}.stop ] ; then \
134 rm -f '$(DESTDIR)$(datadir)/$(DICTDIR)/'$${lang}.stop ; \
138 clean distclean maintainer-clean: clean-lib
139 rm -f $(OBJS) $(SQLSCRIPT)