gen-locales.mk 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. # defines target $(gen-locales) that generates the locales given in $(LOCALES)
  2. LOCALE_SRCS := $(shell echo "$(LOCALES)"|sed 's/\([^ .]*\)[^@ ]*\(@[^ ]*\)\?/\1\2/g')
  3. # The CHARMAPS dependency handling must be able to process:
  4. # 1. No character map e.g. eo, en_US
  5. # 2. Character maps e.g. en_US.UTF-8
  6. # 3. Character maps with modifier e.g. tt_RU.UTF-8@iqtelif
  7. # This complicates the processing slightly so we do it in multiple edits,
  8. # the first captures the character map with the anchoring period while
  9. # the rest of the edits remove the period to get a valid file or adjust
  10. # the name to match the true name.
  11. CHARMAPS := $(shell echo "$(LOCALES)" | \
  12. sed -e 's/\([^ .]*\)\([^@ ]*\)\(@[^@ ]*\)*/\2/g' \
  13. -e 's/^\./ /g' \
  14. -e 's/ \./ /g' \
  15. -e s/SJIS/SHIFT_JIS/g)
  16. CTYPE_FILES = $(addsuffix /LC_CTYPE,$(LOCALES))
  17. gen-locales := $(addprefix $(common-objpfx)localedata/,$(CTYPE_FILES))
  18. # Dependency for the locale files. We actually make it depend only on
  19. # one of the files.
  20. $(addprefix $(common-objpfx)localedata/,$(CTYPE_FILES)): %: \
  21. ../localedata/gen-locale.sh \
  22. $(common-objpfx)locale/localedef \
  23. ../localedata/Makefile \
  24. $(addprefix ../localedata/charmaps/,$(CHARMAPS)) \
  25. $(addprefix ../localedata/locales/,$(LOCALE_SRCS))
  26. @$(SHELL) ../localedata/gen-locale.sh $(common-objpfx) \
  27. '$(built-program-cmd-before-env)' '$(run-program-env)' \
  28. '$(built-program-cmd-after-env)' $@; \
  29. $(evaluate-test)