3 include $(TOPDIR)Rules.mak
5 CFLAGS_wc8bit=-DCTYPE_PACKED=1
7 ifeq ($(strip $(HAS_WCHAR)),true)
8 CFLAGS_wc8bit += -DDO_WIDE_CHAR=1
9 CFLAGS_mmap += -D__WCHAR_ENABLED=1
15 @if [ ! -f codesets.txt ] ; then \
18 echo "You do not have a codesets.txt file. Please create this "; \
19 echo "file in the extra/locale directory by running something like: "; \
20 echo -e " find ./charmaps -name \"*.pairs\" > ./codesets.txt"; \
21 echo "and then edit that file to disable/enable the codesets you wish to support. "; \
26 gen_wc8bit: gen_wc8bit.c
27 gcc -Os -Wall $(CFLAGS_wc8bit) gen_wc8bit.c -o gen_wc8bit
29 c8tables.h: gen_wc8bit codesets.txt
30 ./gen_wc8bit `cat codesets.txt`
32 gen_wctype: gen_wctype.c
33 gcc -Os -Wall gen_wctype.c -o gen_wctype
35 # Warning! Beware tr_TR toupper/tolower exceptions!
36 # Warning! Ignore the width table. It will go away.
37 wctables.h: gen_wctype
40 gen_locale: gen_locale.c c8tables.h
41 gcc -Os -Wall gen_locale.c -o gen_locale
43 # TODO: if no wide char support, we should auto-disable all UTF-8 locales
44 locale_tables.h: gen_locale locales.txt
45 ./gen_locale locales.txt
47 lt_defines.h: locale_tables.h
48 grep "^#define" locale_tables.h > lt_defines.h
51 @if [ ! -f locales.txt ] ; then \
54 echo "You do not have a locales.txt file. In the extra/locale "; \
55 echo "directory, Please copy the LOCALES file to locales.txt and "; \
56 echo "then edit that file to disable/enable the locales you wish "; \
57 echo "to support. "; \
62 ifneq ($(TARGET_ARCH),$(NATIVE_ARCH))
65 echo Your locale.mmap file is either missing or out of date.
66 echo The developmental code can only generate one for the
67 echo target arch == native arch case. Sorry.
70 gen_mmap: gen_mmap.c c8tables.h wctables.h locale_tables.h
71 gcc $(CFLAGS_mmap) -Os -Wall -static gen_mmap.c -o gen_mmap
79 gcc -Os -Wall lmmtolso.c -o lmmtolso
81 locale_data.c: lmmtolso locale.mmap
84 locale_data.o: locale_data.c lt_defines.h
85 $(CC) -c locale_data.c
86 $(STRIPTOOL) -x -R .note -R .comment locale_data.o
88 uClibc_locale_data.h: c8tables.h wctables.h lt_defines.h locale_mmap.h
89 grep -v "define __LC" lt_defines.h > uClibc_locale_data.h
90 cat c8tables.h wctables.h locale_mmap.h >> uClibc_locale_data.h
92 links-target: locale_data.o uClibc_locale_data.h
93 ln -sf ../../../extra/locale/locale_data.o ../../libc/misc/locale
94 cp uClibc_locale_data.h ../../libc/sysdeps/linux/common/bits/
98 rm -f gen_wc8bit gen_wctype gen_locale
99 rm -f c8tables.h wctables.h locale_tables.h lt_defines.h
100 rm -f gen_mmap locale.mmap lmmtolso
101 rm -f locale_data.c locale_data.o uClibc_locale_data.h