]> git.ipfire.org Git - thirdparty/glibc.git/blame - localedata/unicode-gen/Makefile
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / localedata / unicode-gen / Makefile
CommitLineData
04277e02 1# Copyright (C) 2015-2019 Free Software Foundation, Inc.
4a4839c9
AO
2# This file is part of the GNU C Library.
3
4# The GNU C Library is free software; you can redistribute it and/or
5# modify it under the terms of the GNU Lesser General Public
6# License as published by the Free Software Foundation; either
7# version 2.1 of the License, or (at your option) any later version.
8
9# The GNU C Library is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12# Lesser General Public License for more details.
13
14# You should have received a copy of the GNU Lesser General Public
15# License along with the GNU C Library; if not, see
5a82c748 16# <https://www.gnu.org/licenses/>.
4a4839c9
AO
17
18# Makefile for generating and updating Unicode-extracted files.
19
20
21# This Makefile is NOT used as part of the GNU libc build. It needs
22# to be run manually, within the source tree, at Unicode upgrades
8dc8be75 23# (change UNICODE_VERSION below), to update ../locales/i18n_ctype ctype
4a4839c9
AO
24# information (part of the file is preserved, so don't wipe it all
25# out), and ../charmaps/UTF-8.
26
27# Use make all to generate the files used in the glibc build out of
28# the original Unicode files; make check to verify that they are what
29# we expect; make install to copy them to the location expected by the
30# glibc build; and make clean to remove all generated files.
31
32# We keep a local copy of the downloaded Unicode files, to avoid
33# running afoul of the LGPL corresponding sources requirements, even
34# though it's not clear that they are preferred over the generated
35# files for making modifications.
36
37
f6efec90 38UNICODE_VERSION = 12.1.0
4a4839c9
AO
39
40PYTHON3 = python3
41WGET = wget
42
2ae5be04 43DOWNLOADS = UnicodeData.txt DerivedCoreProperties.txt EastAsianWidth.txt PropList.txt
8dc8be75
CD
44GENERATED = i18n_ctype tr_TR UTF-8 translit_combining translit_compat translit_circle translit_cjk_compat translit_font translit_fraction
45REPORTS = i18n_ctype-report UTF-8-report
4a4839c9
AO
46
47all: $(GENERATED)
48
8dc8be75 49check: check-i18n_ctype check-UTF-8
4a4839c9
AO
50
51install:
8dc8be75 52 cp -p i18n_ctype ../locales/i18n_ctype
85bafe6f 53 cp -p tr_TR ../locales/tr_TR
4a4839c9 54 cp -p UTF-8 ../charmaps/UTF-8
dd8e8e54
CD
55 cp -p translit_combining ../locales/translit_combining
56 cp -p translit_compat ../locales/translit_compat
57 cp -p translit_circle ../locales/translit_circle
58 cp -p translit_cjk_compat ../locales/translit_cjk_compat
59 cp -p translit_font ../locales/translit_font
60 cp -p translit_fraction ../locales/translit_fraction
4a4839c9
AO
61
62clean: mostlyclean
63 -rm -rf __pycache__
64mostlyclean:
65 -rm -f $(REPORTS) $(GENERATED)
66
67.PHONY: all check clean mostlyclean install
68
8dc8be75
CD
69i18n_ctype: UnicodeData.txt DerivedCoreProperties.txt
70i18n_ctype: ../locales/i18n_ctype # Preserve non-ctype information.
71i18n_ctype: gen_unicode_ctype.py
4a4839c9 72 $(PYTHON3) gen_unicode_ctype.py -u UnicodeData.txt \
8dc8be75 73 -d DerivedCoreProperties.txt -i ../locales/i18n_ctype -o $@ \
4a4839c9
AO
74 --unicode_version $(UNICODE_VERSION)
75
8dc8be75
CD
76i18n_ctype-report: i18n_ctype ../locales/i18n_ctype
77i18n_ctype-report: ctype_compatibility.py ctype_compatibility_test_cases.py
78 $(PYTHON3) ./ctype_compatibility.py -o ../locales/i18n_ctype \
79 -n i18n_ctype -a -m > $@
4a4839c9 80
337ff3c5 81check-i18n_ctype: i18n_ctype-report
4a4839c9 82 @if grep '\(Missing\|Added\) [^0]\|^Number of errors[^=]* = [^0]' \
337ff3c5 83 i18n_ctype-report; \
4a4839c9
AO
84 then echo manual verification required; false; else true; fi
85
85bafe6f
JM
86tr_TR: UnicodeData.txt DerivedCoreProperties.txt
87tr_TR: ../locales/tr_TR # Preserve non-ctype information.
88tr_TR: gen_unicode_ctype.py
89 $(PYTHON3) gen_unicode_ctype.py -u UnicodeData.txt \
90 -d DerivedCoreProperties.txt -i ../locales/tr_TR -o $@ \
91 --unicode_version $(UNICODE_VERSION) --turkish
92
4a4839c9
AO
93UTF-8: UnicodeData.txt EastAsianWidth.txt
94UTF-8: utf8_gen.py
4beefeeb
MF
95 $(PYTHON3) utf8_gen.py -u UnicodeData.txt \
96 -e EastAsianWidth.txt -p PropList.txt \
97 --unicode_version $(UNICODE_VERSION)
4a4839c9
AO
98
99UTF-8-report: UTF-8 ../charmaps/UTF-8
100UTF-8-report: utf8_compatibility.py
dd8e8e54
CD
101 $(PYTHON3) ./utf8_compatibility.py -u UnicodeData.txt \
102 -e EastAsianWidth.txt -o ../charmaps/UTF-8 \
103 -n UTF-8 -a -m -c > $@
4a4839c9
AO
104
105check-UTF-8: UTF-8-report
106 @if grep '^Total.*: [^0]' UTF-8-report; \
107 then echo manual verification required; false; else true; fi
108
dd8e8e54
CD
109translit_combining: UnicodeData.txt
110translit_combining: gen_translit_combining.py
111 $(PYTHON3) ./gen_translit_combining.py -u UnicodeData.txt \
112 -o $@ --unicode_version $(UNICODE_VERSION)
113
114translit_compat: UnicodeData.txt
115translit_compat: gen_translit_compat.py
116 $(PYTHON3) ./gen_translit_compat.py -u UnicodeData.txt \
117 -o $@ --unicode_version $(UNICODE_VERSION)
118
119translit_circle: UnicodeData.txt
120translit_circle: gen_translit_circle.py
121 $(PYTHON3) ./gen_translit_circle.py -u UnicodeData.txt \
122 -o $@ --unicode_version $(UNICODE_VERSION)
123
124translit_cjk_compat: UnicodeData.txt
125translit_cjk_compat: gen_translit_cjk_compat.py
126 $(PYTHON3) ./gen_translit_cjk_compat.py -u UnicodeData.txt \
127 -o $@ --unicode_version $(UNICODE_VERSION)
128
129translit_font: UnicodeData.txt
130translit_font: gen_translit_font.py
131 $(PYTHON3) ./gen_translit_font.py -u UnicodeData.txt \
132 -o $@ --unicode_version $(UNICODE_VERSION)
133
134translit_fraction: UnicodeData.txt
135translit_fraction: gen_translit_fraction.py
136 $(PYTHON3) ./gen_translit_fraction.py -u UnicodeData.txt \
137 -o $@ --unicode_version $(UNICODE_VERSION)
4a4839c9
AO
138
139.PHONY: downloads clean-downloads
140downloads: $(DOWNLOADS)
141clean-downloads:
142 -rm -f $(DOWNLOADS)
143
144$(DOWNLOADS):
145 $(WGET) http://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/$@