blob: 0cc87423de828082c2320fe5e5e7d54969258a2b [file] [log] [blame]
Gabriel Krisman Bertazi955405d2019-04-25 13:38:44 -04001# SPDX-License-Identifier: GPL-2.0
2
Christoph Hellwig5298d4b2022-01-18 07:56:14 +01003ifneq ($(CONFIG_UNICODE),)
4obj-y += unicode.o
5endif
6obj-$(CONFIG_UNICODE) += utf8data.o
Gabriel Krisman Bertazif0d6cc02019-04-25 13:56:01 -04007obj-$(CONFIG_UNICODE_NORMALIZATION_SELFTEST) += utf8-selftest.o
Gabriel Krisman Bertazi9d536902019-04-25 13:51:22 -04008
9unicode-y := utf8-norm.o utf8-core.o
Olaf Weber44594c22019-04-25 13:45:46 -040010
Christoph Hellwig2b3d0472021-09-15 09:00:05 +020011$(obj)/utf8-data.o: $(obj)/utf8data.c
Masahiro Yamada28ba53c2019-04-28 13:45:36 -040012
Christoph Hellwig2b3d0472021-09-15 09:00:05 +020013# In the normal build, the checked-in utf8data.c is just shipped.
Masahiro Yamada28ba53c2019-04-28 13:45:36 -040014#
Christoph Hellwig2b3d0472021-09-15 09:00:05 +020015# To generate utf8data.c from UCD, put *.txt files in this directory
Masahiro Yamada28ba53c2019-04-28 13:45:36 -040016# and pass REGENERATE_UTF8DATA=1 from the command line.
17ifdef REGENERATE_UTF8DATA
18
19quiet_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 Bertazi955405d2019-04-25 13:38:44 -040028 -o $@
Masahiro Yamada28ba53c2019-04-28 13:45:36 -040029
Christoph Hellwig2b3d0472021-09-15 09:00:05 +020030$(obj)/utf8data.c: $(obj)/mkutf8data $(filter %.txt, $(cmd_utf8data)) FORCE
Masahiro Yamada28ba53c2019-04-28 13:45:36 -040031 $(call if_changed,utf8data)
32
33else
34
Christoph Hellwig2b3d0472021-09-15 09:00:05 +020035$(obj)/utf8data.c: $(src)/utf8data.c_shipped FORCE
Masahiro Yamada28ba53c2019-04-28 13:45:36 -040036 $(call if_changed,shipped)
37
38endif
39
Christoph Hellwig2b3d0472021-09-15 09:00:05 +020040targets += utf8data.c
Masahiro Yamada5f2fb522020-02-02 01:49:24 +090041hostprogs += mkutf8data