xref: /OK3568_Linux_fs/kernel/fs/unicode/Makefile (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun
3*4882a593Smuzhiyunobj-$(CONFIG_UNICODE) += unicode.o
4*4882a593Smuzhiyunobj-$(CONFIG_UNICODE_NORMALIZATION_SELFTEST) += utf8-selftest.o
5*4882a593Smuzhiyun
6*4882a593Smuzhiyununicode-y := utf8-norm.o utf8-core.o
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun$(obj)/utf8-norm.o: $(obj)/utf8data.h
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun# In the normal build, the checked-in utf8data.h is just shipped.
11*4882a593Smuzhiyun#
12*4882a593Smuzhiyun# To generate utf8data.h from UCD, put *.txt files in this directory
13*4882a593Smuzhiyun# and pass REGENERATE_UTF8DATA=1 from the command line.
14*4882a593Smuzhiyunifdef REGENERATE_UTF8DATA
15*4882a593Smuzhiyun
16*4882a593Smuzhiyunquiet_cmd_utf8data = GEN     $@
17*4882a593Smuzhiyun      cmd_utf8data = $< \
18*4882a593Smuzhiyun		-a $(srctree)/$(src)/DerivedAge.txt \
19*4882a593Smuzhiyun		-c $(srctree)/$(src)/DerivedCombiningClass.txt \
20*4882a593Smuzhiyun		-p $(srctree)/$(src)/DerivedCoreProperties.txt \
21*4882a593Smuzhiyun		-d $(srctree)/$(src)/UnicodeData.txt \
22*4882a593Smuzhiyun		-f $(srctree)/$(src)/CaseFolding.txt \
23*4882a593Smuzhiyun		-n $(srctree)/$(src)/NormalizationCorrections.txt \
24*4882a593Smuzhiyun		-t $(srctree)/$(src)/NormalizationTest.txt \
25*4882a593Smuzhiyun		-o $@
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun$(obj)/utf8data.h: $(obj)/mkutf8data $(filter %.txt, $(cmd_utf8data)) FORCE
28*4882a593Smuzhiyun	$(call if_changed,utf8data)
29*4882a593Smuzhiyun
30*4882a593Smuzhiyunelse
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun$(obj)/utf8data.h: $(src)/utf8data.h_shipped FORCE
33*4882a593Smuzhiyun	$(call if_changed,shipped)
34*4882a593Smuzhiyun
35*4882a593Smuzhiyunendif
36*4882a593Smuzhiyun
37*4882a593Smuzhiyuntargets += utf8data.h
38*4882a593Smuzhiyunhostprogs += mkutf8data
39