mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 18:34:36 +08:00
d8783c512e
metaphone() in a contrib. There seem to be a fair number of different approaches to both of these algorithms. I used the simplest case for levenshtein which has a cost of 1 for any character insertion, deletion, or substitution. For metaphone, I adapted the same code from CPAN that the PHP folks did. A couple of questions: 1. Does it make sense to fold the soundex contrib together with this one? 2. I was debating trying to add multibyte support to levenshtein (it would make no sense at all for metaphone), but a quick search through the contrib directory found no hits on the word MULTIBYTE. Should worry about adding multibyte support to levenshtein()? Joe Conway
42 lines
829 B
Makefile
42 lines
829 B
Makefile
subdir = contrib/fuzzystrmatch
|
|
top_builddir = ../..
|
|
include $(top_builddir)/src/Makefile.global
|
|
|
|
# override libdir to install shlib in contrib not main directory
|
|
libdir := $(libdir)/contrib
|
|
|
|
# shared library parameters
|
|
NAME= fuzzystrmatch
|
|
SO_MAJOR_VERSION= 0
|
|
SO_MINOR_VERSION= 1
|
|
|
|
override CPPFLAGS := -I$(srcdir)/src/include $(CPPFLAGS)
|
|
|
|
OBJS= fuzzystrmatch.o
|
|
|
|
all: all-lib $(NAME).sql
|
|
|
|
# Shared library stuff
|
|
include $(top_srcdir)/src/Makefile.shlib
|
|
|
|
|
|
$(NAME).sql: $(NAME).sql.in
|
|
sed -e 's:MODULE_PATHNAME:$(libdir)/$(shlib):g' < $< > $@
|
|
|
|
install: all installdirs install-lib
|
|
|
|
installdirs:
|
|
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
|
|
|
uninstall: uninstall-lib
|
|
|
|
clean distclean maintainer-clean: clean-lib
|
|
rm -f $(OBJS) $(NAME).sql
|
|
|
|
depend dep:
|
|
$(CC) -MM $(CFLAGS) *.c >depend
|
|
|
|
ifeq (depend,$(wildcard depend))
|
|
include depend
|
|
endif
|