| 1 |
# contrib/unaccent/Makefile |
| 2 |
|
| 3 |
MODULE_big = unaccent |
| 4 |
OBJS = \ |
| 5 |
$(WIN32RES) \ |
| 6 |
unaccent.o |
| 7 |
|
| 8 |
EXTENSION = unaccent |
| 9 |
DATA = unaccent--1.1.sql unaccent--1.0--1.1.sql |
| 10 |
DATA_TSEARCH = unaccent.rules |
| 11 |
PGFILEDESC = "unaccent - text search dictionary that removes accents" |
| 12 |
|
| 13 |
REGRESS = unaccent |
| 14 |
|
| 15 |
ifdef USE_PGXS |
| 16 |
PG_CONFIG = pg_config |
| 17 |
PGXS := $(shell $(PG_CONFIG) --pgxs) |
| 18 |
include $(PGXS) |
| 19 |
else |
| 20 |
subdir = contrib/unaccent |
| 21 |
top_builddir = ../.. |
| 22 |
include $(top_builddir)/src/Makefile.global |
| 23 |
include $(top_srcdir)/contrib/contrib-global.mk |
| 24 |
endif |
| 25 |
|
| 26 |
update-unicode: $(srcdir)/unaccent.rules |
| 27 |
|
| 28 |
# Allow running this even without --with-python |
| 29 |
ifeq ($(PYTHON),) |
| 30 |
PYTHON = python |
| 31 |
endif |
| 32 |
|
| 33 |
$(srcdir)/unaccent.rules: generate_unaccent_rules.py ../../src/common/unicode/UnicodeData.txt Latin-ASCII.xml |
| 34 |
$(PYTHON) $< --unicode-data-file $(word 2,$^) --latin-ascii-file $(word 3,$^) >$@ |
| 35 |
|
| 36 |
# Only download it once; dependencies must match src/common/unicode/ |
| 37 |
../../src/common/unicode/UnicodeData.txt: $(top_builddir)/src/Makefile.global |
| 38 |
$(MAKE) -C $(@D) $(@F) |
| 39 |
|
| 40 |
# Dependency on Makefile.global is for CLDR_VERSION |
| 41 |
Latin-ASCII.xml: $(top_builddir)/src/Makefile.global |
| 42 |
$(DOWNLOAD) https://raw.githubusercontent.com/unicode-org/cldr/release-$(subst .,-,$(CLDR_VERSION))/common/transforms/Latin-ASCII.xml |
| 43 |
|
| 44 |
distclean: |
| 45 |
rm -f Latin-ASCII.xml |