60 lines
1.7 KiB
Makefile
60 lines
1.7 KiB
Makefile
#-------------------------------------------------------------------------
|
|
#
|
|
# Makefile
|
|
# Makefile for src/common/unicode
|
|
#
|
|
# IDENTIFICATION
|
|
# src/common/unicode/Makefile
|
|
#
|
|
#-------------------------------------------------------------------------
|
|
|
|
subdir = src/common/unicode
|
|
top_builddir = ../../..
|
|
include $(top_builddir)/src/Makefile.global
|
|
|
|
override CPPFLAGS := -DFRONTEND $(CPPFLAGS)
|
|
LIBS += $(PTHREAD_LIBS)
|
|
|
|
# By default, do nothing.
|
|
all:
|
|
|
|
update-unicode: unicode_norm_table.h unicode_combining_table.h
|
|
$(MAKE) normalization-check
|
|
mv unicode_norm_table.h unicode_combining_table.h ../../../src/include/common/
|
|
|
|
# These files are part of the Unicode Character Database. Download
|
|
# them on demand. The dependency on Makefile.global is for
|
|
# UNICODE_VERSION.
|
|
UnicodeData.txt CompositionExclusions.txt NormalizationTest.txt: $(top_builddir)/src/Makefile.global
|
|
$(DOWNLOAD) https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/$(@F)
|
|
|
|
# Generation of conversion tables used for string normalization with
|
|
# UTF-8 strings.
|
|
unicode_norm_table.h: generate-unicode_norm_table.pl UnicodeData.txt CompositionExclusions.txt
|
|
$(PERL) generate-unicode_norm_table.pl
|
|
|
|
unicode_combining_table.h: generate-unicode_combining_table.pl UnicodeData.txt
|
|
$(PERL) $^ >$@
|
|
|
|
# Test suite
|
|
normalization-check: norm_test
|
|
./norm_test
|
|
|
|
norm_test: norm_test.o ../unicode_norm.o
|
|
|
|
norm_test.o: norm_test_table.h
|
|
|
|
norm_test_table.h: generate-norm_test_table.pl NormalizationTest.txt
|
|
perl generate-norm_test_table.pl NormalizationTest.txt $@
|
|
|
|
.PHONY: normalization-check
|
|
|
|
|
|
clean:
|
|
rm -f $(OBJS) norm_test norm_test.o
|
|
|
|
distclean: clean
|
|
rm -f UnicodeData.txt CompositionExclusions.txt NormalizationTest.txt norm_test_table.h unicode_norm_table.h
|
|
|
|
maintainer-clean: distclean
|