1 # Copyright (C) 2015-2024 Free Software Foundation, Inc
2 # Copyright The GNU Toolchain Authors.
3 # This file is part of the GNU C Library.
5 # The GNU C Library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # The GNU C Library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with the GNU C Library; if not, see
17 # <https://www.gnu.org/licenses/>.
19 # Makefile for generating and updating Unicode-extracted files.
22 # This Makefile is NOT used as part of the GNU libc build. It needs
23 # to be run manually, within the source tree, at Unicode upgrades
24 # (change UNICODE_VERSION below), to update ../locales/i18n_ctype ctype
25 # information (part of the file is preserved, so don't wipe it all
26 # out), and ../charmaps/UTF-8.
28 # Use make all to generate the files used in the glibc build out of
29 # the original Unicode files; make check to verify that they are what
30 # we expect; make install to copy them to the location expected by the
31 # glibc build; and make clean to remove all generated files.
33 # We keep a local copy of the downloaded Unicode files, to avoid
34 # running afoul of the LGPL corresponding sources requirements, even
35 # though it's not clear that they are preferred over the generated
36 # files for making modifications.
39 UNICODE_VERSION
= 15.1.0
44 DOWNLOADS
= UnicodeData.txt DerivedCoreProperties.txt EastAsianWidth.txt HangulSyllableType.txt
45 LICENSE
= unicode-license.txt
46 GENERATED
= i18n_ctype tr_TR UTF-8 translit_combining translit_compat translit_circle translit_cjk_compat translit_font translit_fraction
47 REPORTS
= i18n_ctype-report UTF-8-report
51 check: check-i18n_ctype check-UTF-8
54 cp
-p i18n_ctype ..
/locales
/i18n_ctype
55 cp
-p tr_TR ..
/locales
/tr_TR
56 cp
-p UTF-8 ..
/charmaps
/UTF-8
57 cp
-p translit_combining ..
/locales
/translit_combining
58 cp
-p translit_compat ..
/locales
/translit_compat
59 cp
-p translit_circle ..
/locales
/translit_circle
60 cp
-p translit_cjk_compat ..
/locales
/translit_cjk_compat
61 cp
-p translit_font ..
/locales
/translit_font
62 cp
-p translit_fraction ..
/locales
/translit_fraction
67 -rm -f
$(REPORTS
) $(GENERATED
)
69 .PHONY
: all check clean mostlyclean install
71 i18n_ctype
: UnicodeData.txt DerivedCoreProperties.txt
72 i18n_ctype
: ..
/locales
/i18n_ctype
# Preserve non-ctype information.
73 i18n_ctype
: gen_unicode_ctype.py
74 $(PYTHON3
) gen_unicode_ctype.py
-u UnicodeData.txt \
75 -d DerivedCoreProperties.txt
-i ..
/locales
/i18n_ctype
-o
$@ \
76 --unicode_version
$(UNICODE_VERSION
)
78 i18n_ctype-report
: i18n_ctype ..
/locales
/i18n_ctype
79 i18n_ctype-report
: ctype_compatibility.py ctype_compatibility_test_cases.py
80 $(PYTHON3
) .
/ctype_compatibility.py
-o ..
/locales
/i18n_ctype \
81 -n i18n_ctype
-a
-m
> $@
83 check-i18n_ctype
: i18n_ctype-report
84 @if grep
'\(Missing\|Added\) [^0]\|^Number of errors[^=]* = [^0]' \
86 then echo manual verification required
; false
; else true
; fi
88 tr_TR
: UnicodeData.txt DerivedCoreProperties.txt
89 tr_TR
: ..
/locales
/tr_TR
# Preserve non-ctype information.
90 tr_TR
: gen_unicode_ctype.py
91 $(PYTHON3
) gen_unicode_ctype.py
-u UnicodeData.txt \
92 -d DerivedCoreProperties.txt
-i ..
/locales
/tr_TR
-o
$@ \
93 --unicode_version
$(UNICODE_VERSION
) --turkish
95 UTF-8
: UnicodeData.txt DerivedCoreProperties.txt EastAsianWidth.txt HangulSyllableType.txt
97 $(PYTHON3
) utf8_gen.py
-u UnicodeData.txt \
98 -d DerivedCoreProperties.txt \
99 -e EastAsianWidth.txt \
100 -k HangulSyllableType.txt \
101 --unicode_version
$(UNICODE_VERSION
)
103 UTF-8-report
: UTF-8 ..
/charmaps
/UTF-8
104 UTF-8-report
: utf8_compatibility.py
105 $(PYTHON3
) .
/utf8_compatibility.py
-u UnicodeData.txt \
106 -e EastAsianWidth.txt
-o ..
/charmaps
/UTF-8 \
107 -n UTF-8
-a
-m
-c
> $@
109 check-UTF-8
: UTF-8-report
110 @if grep
'^Total.*: [^0]' UTF-8-report
; \
111 then echo manual verification required
; false
; else true
; fi
113 translit_combining
: UnicodeData.txt
114 translit_combining
: gen_translit_combining.py
115 $(PYTHON3
) .
/gen_translit_combining.py
-u UnicodeData.txt \
116 -o
$@
--unicode_version
$(UNICODE_VERSION
)
118 translit_compat
: UnicodeData.txt
119 translit_compat
: gen_translit_compat.py
120 $(PYTHON3
) .
/gen_translit_compat.py
-u UnicodeData.txt \
121 -o
$@
--unicode_version
$(UNICODE_VERSION
)
123 translit_circle
: UnicodeData.txt
124 translit_circle
: gen_translit_circle.py
125 $(PYTHON3
) .
/gen_translit_circle.py
-u UnicodeData.txt \
126 -o
$@
--unicode_version
$(UNICODE_VERSION
)
128 translit_cjk_compat
: UnicodeData.txt
129 translit_cjk_compat
: gen_translit_cjk_compat.py
130 $(PYTHON3
) .
/gen_translit_cjk_compat.py
-u UnicodeData.txt \
131 -o
$@
--unicode_version
$(UNICODE_VERSION
)
133 translit_font
: UnicodeData.txt
134 translit_font
: gen_translit_font.py
135 $(PYTHON3
) .
/gen_translit_font.py
-u UnicodeData.txt \
136 -o
$@
--unicode_version
$(UNICODE_VERSION
)
138 translit_fraction
: UnicodeData.txt
139 translit_fraction
: gen_translit_fraction.py
140 $(PYTHON3
) .
/gen_translit_fraction.py
-u UnicodeData.txt \
141 -o
$@
--unicode_version
$(UNICODE_VERSION
)
143 .PHONY
: downloads clean-downloads
144 downloads
: $(DOWNLOADS
) $(LICENSE
)
146 -rm -f
$(DOWNLOADS
) $(LICENSE
)
149 $(WGET
) http
://www.unicode.org
/Public
/$(UNICODE_VERSION
)/ucd
/$@
152 $(WGET
) https
://www.unicode.org
/license.txt
--output-document
=$@