1#-------------------------------------------------------------------------
2#
3# Makefile for backend/tsearch
4#
5# Copyright (c) 2006-2019, PostgreSQL Global Development Group
6#
7# src/backend/tsearch/Makefile
8#
9#-------------------------------------------------------------------------
10subdir = src/backend/tsearch
11top_builddir = ../../..
12include $(top_builddir)/src/Makefile.global
13
14DICTDIR=tsearch_data
15
16# List of dictionaries files
17DICTFILES=synonym_sample.syn thesaurus_sample.ths \
18	hunspell_sample.affix \
19	ispell_sample.affix ispell_sample.dict \
20	hunspell_sample_long.affix hunspell_sample_long.dict \
21	hunspell_sample_num.affix hunspell_sample_num.dict
22
23# Local paths to dictionaries files
24DICTFILES_PATH=$(addprefix dicts/,$(DICTFILES))
25
26OBJS = ts_locale.o ts_parse.o wparser.o wparser_def.o dict.o \
27	dict_simple.o dict_synonym.o dict_thesaurus.o \
28	dict_ispell.o regis.o spell.o \
29	to_tsany.o ts_selfuncs.o ts_typanalyze.o ts_utils.o
30
31include $(top_srcdir)/src/backend/common.mk
32
33.PHONY: install-data
34install-data: $(DICTFILES_PATH) installdirs
35	$(INSTALL_DATA) $(addprefix $(srcdir)/,$(DICTFILES_PATH)) '$(DESTDIR)$(datadir)/$(DICTDIR)/'
36
37installdirs:
38	$(MKDIR_P) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(datadir)/$(DICTDIR)'
39
40.PHONY: uninstall-data
41uninstall-data:
42	rm -rf $(addprefix '$(DESTDIR)$(datadir)/$(DICTDIR)/',$(DICTFILES))
43