1#-------------------------------------------------------------------------
2#
3# Makefile
4#    Makefile for src/common/unicode
5#
6# IDENTIFICATION
7#    src/common/unicode/Makefile
8#
9#-------------------------------------------------------------------------
10
11subdir = src/common/unicode
12top_builddir = ../../..
13include $(top_builddir)/src/Makefile.global
14
15override CPPFLAGS := -DFRONTEND $(CPPFLAGS)
16LIBS += $(PTHREAD_LIBS)
17
18# By default, do nothing.
19all:
20
21DOWNLOAD = wget -O $@ --no-use-server-timestamps
22
23# These files are part of the Unicode Character Database. Download
24# them on demand.
25UnicodeData.txt CompositionExclusions.txt NormalizationTest.txt:
26	$(DOWNLOAD) http://unicode.org/Public/UNIDATA/$(@F)
27
28# Generation of conversion tables used for string normalization with
29# UTF-8 strings.
30unicode_norm_table.h: generate-unicode_norm_table.pl UnicodeData.txt CompositionExclusions.txt
31	$(PERL) generate-unicode_norm_table.pl
32
33# Test suite
34normalization-check: norm_test
35	./norm_test
36
37norm_test: norm_test.o ../unicode_norm.o
38
39norm_test.o: norm_test_table.h
40
41norm_test_table.h: generate-norm_test_table.pl NormalizationTest.txt
42	perl generate-norm_test_table.pl NormalizationTest.txt $@
43
44.PHONY: normalization-check
45
46
47clean:
48	rm -f $(OBJS) norm_test norm_test.o
49
50distclean: clean
51	rm -f UnicodeData.txt CompositionExclusions.txt NormalizationTest.txt norm_test_table.h unicode_norm_table.h
52
53maintainer-clean: distclean
54