Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. TOPDIR = ../../
  2. include $(TOPDIR)Rules.mak
  3. CFLAGS_wc8bit=-DCTYPE_PACKED=1
  4. CFLAGS_mmap=
  5. ifeq ($(strip $(HAS_WCHAR)),true)
  6. CFLAGS_wc8bit += -DDO_WIDE_CHAR=1
  7. CFLAGS_mmap += -D__WCHAR_ENABLED=1
  8. endif
  9. all: links-target
  10. codesets.txt:
  11. @if [ ! -f codesets.txt ] ; then \
  12. set -e; \
  13. echo " "; \
  14. echo "You do not have a codesets.txt file. Please create this "; \
  15. echo "file in the extra/locale directory by running something like: "; \
  16. echo -e " find ./charmaps -name \"*.pairs\" > ./codesets.txt"; \
  17. echo "and then edit that file to disable/enable the codesets you wish to support. "; \
  18. echo " "; \
  19. /bin/false; \
  20. fi;
  21. gen_wc8bit: gen_wc8bit.c
  22. gcc -Os -Wall $(CFLAGS_wc8bit) gen_wc8bit.c -o gen_wc8bit
  23. c8tables.h: gen_wc8bit codesets.txt
  24. ./gen_wc8bit `cat codesets.txt`
  25. gen_wctype: gen_wctype.c
  26. gcc -Os -Wall gen_wctype.c -o gen_wctype
  27. # Warning! Beware tr_TR toupper/tolower exceptions!
  28. # Warning! Ignore the width table. It will go away.
  29. wctables.h: gen_wctype
  30. ./gen_wctype en_US
  31. gen_locale: gen_locale.c c8tables.h
  32. gcc -Os -Wall gen_locale.c -o gen_locale
  33. # TODO: if no wide char support, we should auto-disable all UTF-8 locales
  34. locale_tables.h: gen_locale locales.txt
  35. ./gen_locale locales.txt
  36. lt_defines.h: locale_tables.h
  37. grep "^#define" locale_tables.h > lt_defines.h
  38. locales.txt:
  39. @if [ ! -f locales.txt ] ; then \
  40. set -e; \
  41. echo " "; \
  42. echo "You do not have a locales.txt file. In the extra/locale "; \
  43. echo "directory, Please copy the LOCALES file to locales.txt and "; \
  44. echo "then edit that file to disable/enable the locales you wish "; \
  45. echo "to support. "; \
  46. echo " "; \
  47. /bin/false; \
  48. fi;
  49. ifneq ($(TARGET_ARCH),$(NATIVE_ARCH))
  50. locale.mmap: gen_mmap
  51. echo Your locale.mmap file is either missing or out of date.
  52. echo The developmental code can only generate one for the
  53. echo target arch == native arch case. Sorry.
  54. else
  55. gen_mmap: gen_mmap.c c8tables.h wctables.h locale_tables.h
  56. gcc $(CFLAGS_mmap) -Os -Wall -static gen_mmap.c -o gen_mmap
  57. locale.mmap: gen_mmap
  58. ./gen_mmap
  59. endif
  60. lmmtolso: lmmtolso.c
  61. gcc -Os -Wall lmmtolso.c -o lmmtolso
  62. locale_data.c: lmmtolso locale.mmap
  63. ./lmmtolso
  64. locale_data.o: locale_data.c lt_defines.h
  65. $(CC) -c locale_data.c
  66. $(STRIPTOOL) -x -R .note -R .comment locale_data.o
  67. uClibc_locale_data.h: c8tables.h wctables.h lt_defines.h locale_mmap.h
  68. grep -v "define __LC" lt_defines.h > uClibc_locale_data.h
  69. cat c8tables.h wctables.h locale_mmap.h >> uClibc_locale_data.h
  70. links-target: locale_data.o uClibc_locale_data.h
  71. ln -sf ../../../extra/locale/locale_data.o ../../libc/misc/locale
  72. cp uClibc_locale_data.h ../../libc/sysdeps/linux/common/bits/
  73. clean:
  74. rm -f *.[oa] *~ core
  75. rm -f gen_wc8bit gen_wctype gen_locale
  76. rm -f c8tables.h wctables.h locale_tables.h lt_defines.h
  77. rm -f gen_mmap locale.mmap lmmtolso
  78. rm -f locale_data.c locale_data.o uClibc_locale_data.h