Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # SPDX-License-Identifier: GPL-2.0
  2. ifneq ($(CONFIG_UNICODE),)
  3. obj-y += unicode.o
  4. endif
  5. obj-$(CONFIG_UNICODE) += utf8data.o
  6. obj-$(CONFIG_UNICODE_NORMALIZATION_SELFTEST) += utf8-selftest.o
  7. unicode-y := utf8-norm.o utf8-core.o
  8. $(obj)/utf8-data.o: $(obj)/utf8data.c
  9. # In the normal build, the checked-in utf8data.c is just shipped.
  10. #
  11. # To generate utf8data.c from UCD, put *.txt files in this directory
  12. # and pass REGENERATE_UTF8DATA=1 from the command line.
  13. ifdef REGENERATE_UTF8DATA
  14. quiet_cmd_utf8data = GEN $@
  15. cmd_utf8data = $< \
  16. -a $(srctree)/$(src)/DerivedAge.txt \
  17. -c $(srctree)/$(src)/DerivedCombiningClass.txt \
  18. -p $(srctree)/$(src)/DerivedCoreProperties.txt \
  19. -d $(srctree)/$(src)/UnicodeData.txt \
  20. -f $(srctree)/$(src)/CaseFolding.txt \
  21. -n $(srctree)/$(src)/NormalizationCorrections.txt \
  22. -t $(srctree)/$(src)/NormalizationTest.txt \
  23. -o $@
  24. $(obj)/utf8data.c: $(obj)/mkutf8data $(filter %.txt, $(cmd_utf8data)) FORCE
  25. $(call if_changed,utf8data)
  26. else
  27. $(obj)/utf8data.c: $(src)/utf8data.c_shipped FORCE
  28. $(call if_changed,copy)
  29. endif
  30. targets += utf8data.c
  31. hostprogs += mkutf8data