Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / src / backend / snowball / Makefile
blob3e6901b10f8034432a18a793058ec2cfda63b619
1 #-------------------------------------------------------------------------
3 # Makefile for src/backend/snowball
5 # $PostgreSQL$
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 \
32 stem_UTF_8_danish.o \
33 stem_UTF_8_dutch.o \
34 stem_UTF_8_english.o \
35 stem_UTF_8_finnish.o \
36 stem_UTF_8_french.o \
37 stem_UTF_8_german.o \
38 stem_UTF_8_hungarian.o \
39 stem_UTF_8_italian.o \
40 stem_UTF_8_norwegian.o \
41 stem_UTF_8_porter.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 \
47 stem_UTF_8_turkish.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
53 LANGUAGES= \
54 danish danish \
55 dutch dutch \
56 english english \
57 finnish finnish \
58 french french \
59 german german \
60 hungarian hungarian \
61 italian italian \
62 norwegian norwegian \
63 portuguese portuguese \
64 romanian romanian \
65 russian english \
66 spanish spanish \
67 swedish swedish \
68 turkish turkish
71 SQLSCRIPT= snowball_create.sql
72 DICTDIR=tsearch_data
74 ifdef VPATH
75 override VPATH := $(srcdir)/libstemmer:$(VPATH)
76 else
77 VPATH = $(srcdir)/libstemmer
78 endif
80 NAME := dict_snowball
81 rpath =
83 all: all-shared-lib $(SQLSCRIPT)
85 include $(top_srcdir)/src/Makefile.shlib
87 $(SQLSCRIPT): Makefile snowball_func.sql.in snowball.sql.in
88 ifeq ($(enable_shared), yes)
89 echo '-- Language-specific snowball dictionaries' > $@
90 cat $(srcdir)/snowball_func.sql.in >> $@
91 @set -e; \
92 set $(LANGUAGES) ; \
93 while [ "$$#" -gt 0 ] ; \
94 do \
95 lang=$$1; shift; \
96 nonascdictname=$$lang; \
97 ascdictname=$$1; shift; \
98 if [ -s $(srcdir)/stopwords/$${lang}.stop ] ; then \
99 stop=", StopWords=$${lang}" ; \
100 else \
101 stop=""; \
102 fi; \
103 cat $(srcdir)/snowball.sql.in | \
104 sed -e "s#_LANGNAME_#$$lang#g" | \
105 sed -e "s#_DICTNAME_#$${lang}_stem#g" | \
106 sed -e "s#_CFGNAME_#$$lang#g" | \
107 sed -e "s#_ASCDICTNAME_#$${ascdictname}_stem#g" | \
108 sed -e "s#_NONASCDICTNAME_#$${nonascdictname}_stem#g" | \
109 sed -e "s#_STOPWORDS_#$$stop#g" ; \
110 done >> $@
111 else
112 echo "-- No language-specific snowball dictionaries, for lack of shared library support" > $@
113 endif
115 install: all installdirs install-lib
116 $(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
117 @set -e; \
118 set $(LANGUAGES) ; \
119 while [ "$$#" -gt 0 ] ; \
120 do \
121 lang=$$1; shift; shift; \
122 if [ -s $(srcdir)/stopwords/$${lang}.stop ] ; then \
123 $(INSTALL_DATA) $(srcdir)/stopwords/$${lang}.stop '$(DESTDIR)$(datadir)/$(DICTDIR)' ; \
124 fi \
125 done
127 installdirs: installdirs-lib
128 $(mkinstalldirs) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(datadir)/$(DICTDIR)'
130 uninstall: uninstall-lib
131 rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
132 @set -e; \
133 set $(LANGUAGES) ; \
134 while [ "$$#" -gt 0 ] ; \
135 do \
136 lang=$$1; shift; shift; \
137 if [ -s $(srcdir)/stopwords/$${lang}.stop ] ; then \
138 rm -f '$(DESTDIR)$(datadir)/$(DICTDIR)/'$${lang}.stop ; \
139 fi \
140 done
142 clean distclean maintainer-clean: clean-lib
143 rm -f $(OBJS) $(SQLSCRIPT)