Gabriel Krisman Bertazi | 955405d | 2019-04-25 13:38:44 -0400 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | |
Christoph Hellwig | 5298d4b | 2022-01-18 07:56:14 +0100 | [diff] [blame] | 3 | ifneq ($(CONFIG_UNICODE),) |
| 4 | obj-y += unicode.o |
| 5 | endif |
| 6 | obj-$(CONFIG_UNICODE) += utf8data.o |
Gabriel Krisman Bertazi | f0d6cc0 | 2019-04-25 13:56:01 -0400 | [diff] [blame] | 7 | obj-$(CONFIG_UNICODE_NORMALIZATION_SELFTEST) += utf8-selftest.o |
Gabriel Krisman Bertazi | 9d53690 | 2019-04-25 13:51:22 -0400 | [diff] [blame] | 8 | |
| 9 | unicode-y := utf8-norm.o utf8-core.o |
Olaf Weber | 44594c2 | 2019-04-25 13:45:46 -0400 | [diff] [blame] | 10 | |
Christoph Hellwig | 2b3d047 | 2021-09-15 09:00:05 +0200 | [diff] [blame] | 11 | $(obj)/utf8-data.o: $(obj)/utf8data.c |
Masahiro Yamada | 28ba53c | 2019-04-28 13:45:36 -0400 | [diff] [blame] | 12 | |
Christoph Hellwig | 2b3d047 | 2021-09-15 09:00:05 +0200 | [diff] [blame] | 13 | # In the normal build, the checked-in utf8data.c is just shipped. |
Masahiro Yamada | 28ba53c | 2019-04-28 13:45:36 -0400 | [diff] [blame] | 14 | # |
Christoph Hellwig | 2b3d047 | 2021-09-15 09:00:05 +0200 | [diff] [blame] | 15 | # To generate utf8data.c from UCD, put *.txt files in this directory |
Masahiro Yamada | 28ba53c | 2019-04-28 13:45:36 -0400 | [diff] [blame] | 16 | # and pass REGENERATE_UTF8DATA=1 from the command line. |
| 17 | ifdef REGENERATE_UTF8DATA |
| 18 | |
| 19 | quiet_cmd_utf8data = GEN $@ |
| 20 | cmd_utf8data = $< \ |
| 21 | -a $(srctree)/$(src)/DerivedAge.txt \ |
| 22 | -c $(srctree)/$(src)/DerivedCombiningClass.txt \ |
| 23 | -p $(srctree)/$(src)/DerivedCoreProperties.txt \ |
| 24 | -d $(srctree)/$(src)/UnicodeData.txt \ |
| 25 | -f $(srctree)/$(src)/CaseFolding.txt \ |
| 26 | -n $(srctree)/$(src)/NormalizationCorrections.txt \ |
| 27 | -t $(srctree)/$(src)/NormalizationTest.txt \ |
Gabriel Krisman Bertazi | 955405d | 2019-04-25 13:38:44 -0400 | [diff] [blame] | 28 | -o $@ |
Masahiro Yamada | 28ba53c | 2019-04-28 13:45:36 -0400 | [diff] [blame] | 29 | |
Christoph Hellwig | 2b3d047 | 2021-09-15 09:00:05 +0200 | [diff] [blame] | 30 | $(obj)/utf8data.c: $(obj)/mkutf8data $(filter %.txt, $(cmd_utf8data)) FORCE |
Masahiro Yamada | 28ba53c | 2019-04-28 13:45:36 -0400 | [diff] [blame] | 31 | $(call if_changed,utf8data) |
| 32 | |
| 33 | else |
| 34 | |
Christoph Hellwig | 2b3d047 | 2021-09-15 09:00:05 +0200 | [diff] [blame] | 35 | $(obj)/utf8data.c: $(src)/utf8data.c_shipped FORCE |
Masahiro Yamada | 28ba53c | 2019-04-28 13:45:36 -0400 | [diff] [blame] | 36 | $(call if_changed,shipped) |
| 37 | |
| 38 | endif |
| 39 | |
Christoph Hellwig | 2b3d047 | 2021-09-15 09:00:05 +0200 | [diff] [blame] | 40 | targets += utf8data.c |
Masahiro Yamada | 5f2fb52 | 2020-02-02 01:49:24 +0900 | [diff] [blame] | 41 | hostprogs += mkutf8data |