From 4b2a7314ec85cd714910cb04ffce92d1cb203054 Mon Sep 17 00:00:00 2001 From: Thomas Wolff Date: Thu, 8 Mar 2018 00:10:41 +0100 Subject: [PATCH] make rules for implicit Unicode data tables generation Dependency rules to generate Unicode data tables for libc functions wcwidth, tow* and isw*. --- newlib/libc/ctype/Makefile.am | 20 ++++++++++++++++++++ newlib/libc/ctype/Makefile.in | 20 ++++++++++++++++++++ newlib/libc/string/Makefile.am | 24 ++++++++++++++++++++++++ newlib/libc/string/Makefile.in | 24 ++++++++++++++++++++++++ 4 files changed, 88 insertions(+) diff --git a/newlib/libc/ctype/Makefile.am b/newlib/libc/ctype/Makefile.am index fa6a70d..714b333 100644 --- a/newlib/libc/ctype/Makefile.am +++ b/newlib/libc/ctype/Makefile.am @@ -135,3 +135,23 @@ CHEWOUT_FILES= \ CHAPTERS = ctype.tex $(lpfx)ctype_.$(oext): ctype_.c ctype_iso.h ctype_cp.h + +############################################################################# +# Unicode data + +$(srcdir)/%.txt: + cd $(srcdir); test -r $(notdir $@) || ln -s /usr/share/unicode/ucd/$(notdir $@) . + +############################################################################# +# case conversion and character category data for libc/ctype/??w*.c + +$(lpfx)categories.$(oext): categories.c categories.t + +$(lpfx)towctrans_l.$(oext): towctrans_l.c caseconv.t + +$(srcdir)/categories.t: $(srcdir)/UnicodeData.txt + cd $(srcdir); sh ./mkcategories + +$(srcdir)/caseconv.t: $(srcdir)/UnicodeData.txt + cd $(srcdir); sh ./mkcaseconv + diff --git a/newlib/libc/ctype/Makefile.in b/newlib/libc/ctype/Makefile.in index 9932a94..ffcb384 100644 --- a/newlib/libc/ctype/Makefile.in +++ b/newlib/libc/ctype/Makefile.in @@ -1158,3 +1158,23 @@ $(lpfx)ctype_.$(oext): ctype_.c ctype_iso.h ctype_cp.h # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: + +############################################################################# +# Unicode data + +$(srcdir)/%.txt: + cd $(srcdir); test -r $(notdir $@) || ln -s /usr/share/unicode/ucd/$(notdir $@) . + +############################################################################# +# case conversion and character category data for libc/ctype/??w*.c + +$(lpfx)categories.$(oext): categories.c categories.t + +$(lpfx)towctrans_l.$(oext): towctrans_l.c caseconv.t + +$(srcdir)/categories.t: $(srcdir)/UnicodeData.txt + cd $(srcdir); sh ./mkcategories + +$(srcdir)/caseconv.t: $(srcdir)/UnicodeData.txt + cd $(srcdir); sh ./mkcaseconv + diff --git a/newlib/libc/string/Makefile.am b/newlib/libc/string/Makefile.am index 49de080..2617112 100644 --- a/newlib/libc/string/Makefile.am +++ b/newlib/libc/string/Makefile.am @@ -168,3 +168,27 @@ wcscasecmp_l.def wcscoll_l.def wcsncasecmp_l.def wcsxfrm_l.def \ strverscmp.def strnstr.def wmempcpy.def CHAPTERS = strings.tex wcstrings.tex + +############################################################################# +# Unicode data + +$(srcdir)/%.txt: + cd $(srcdir); test -r $(notdir $@) || ln -s /usr/share/unicode/ucd/$(notdir $@) . + +############################################################################# +# width data for libc/string/wcwidth.c + +$(lpfx)wcwidth.$(oext): wcwidth.c ambiguous.t combining.t wide.t + +$(srcdir)/combining.t: $(srcdir)/UnicodeData.txt $(srcdir)/Blocks.txt + cd $(srcdir); ./uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B +D7B0-D7C6 +D7CB-D7FB c > combining.t + +$(srcdir)/WIDTH-A: $(srcdir)/UnicodeData.txt $(srcdir)/Blocks.txt $(srcdir)/EastAsianWidth.txt + cd $(srcdir); sh ./mkwidthA + +$(srcdir)/ambiguous.t: $(srcdir)/WIDTH-A $(srcdir)/UnicodeData.txt $(srcdir)/Blocks.txt + cd $(srcdir); ./uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c > ambiguous.t + +$(srcdir)/wide.t: $(srcdir)/UnicodeData.txt $(srcdir)/Blocks.txt $(srcdir)/EastAsianWidth.txt + cd $(srcdir); sh ./mkwide + diff --git a/newlib/libc/string/Makefile.in b/newlib/libc/string/Makefile.in index eb8fafc..3758f71 100644 --- a/newlib/libc/string/Makefile.in +++ b/newlib/libc/string/Makefile.in @@ -1416,3 +1416,27 @@ docbook: $(DOCBOOK_OUT_FILES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: + +############################################################################# +# Unicode data + +$(srcdir)/%.txt: + cd $(srcdir); test -r $(notdir $@) || ln -s /usr/share/unicode/ucd/$(notdir $@) . + +############################################################################# +# width data for libc/string/wcwidth.c + +$(lpfx)wcwidth.$(oext): wcwidth.c ambiguous.t combining.t wide.t + +$(srcdir)/combining.t: $(srcdir)/UnicodeData.txt $(srcdir)/Blocks.txt + cd $(srcdir); ./uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B +D7B0-D7C6 +D7CB-D7FB c > combining.t + +$(srcdir)/WIDTH-A: $(srcdir)/UnicodeData.txt $(srcdir)/Blocks.txt $(srcdir)/EastAsianWidth.txt + cd $(srcdir); sh ./mkwidthA + +$(srcdir)/ambiguous.t: $(srcdir)/WIDTH-A $(srcdir)/UnicodeData.txt $(srcdir)/Blocks.txt + cd $(srcdir); ./uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c > ambiguous.t + +$(srcdir)/wide.t: $(srcdir)/UnicodeData.txt $(srcdir)/Blocks.txt $(srcdir)/EastAsianWidth.txt + cd $(srcdir); sh ./mkwide + -- 2.16.2