From 29b56ef4e4113bcd091b19d6926f18814162ca53 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Tue, 26 Oct 2021 21:01:41 -0700 Subject: Feat(libunicode): Added an explicit unicode library Refactored code to pull out utf8 functions from base into a standalone library. Also left the required function inside arg.c so that code that calls ARG_BEGIN doesn't have to link to libunicode. --- sys/libunicode/rules.mk | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sys/libunicode/rules.mk (limited to 'sys/libunicode/rules.mk') diff --git a/sys/libunicode/rules.mk b/sys/libunicode/rules.mk new file mode 100644 index 0000000..fb83819 --- /dev/null +++ b/sys/libunicode/rules.mk @@ -0,0 +1,32 @@ +include share/push.mk + +UNICODE = 14.0.0 + +SRCS_$(d) := \ + $(d)/runetobyte.c \ + $(d)/bytetorune.c \ + $(d)/findrune.c \ + $(d)/findlastrune.c \ + $(d)/fullrune.c \ + $(d)/runelen.c \ + $(d)/runetype-$(UNICODE).c + +LIBS_$(d) := $(d)/libunicode.a + +include share/paths.mk + +$(d)/vendor/UnicodeData-$(UNICODE).txt: + curl https://www.unicode.org/Public/$(UNICODE)/ucd/UnicodeData.txt > $@ + +$(d)/vendor/mkrunetype: $(d)/vendor/mkrunetype.c $(OBJ_DIR)/sys/base/base.a + $(COMPLINK) + +$(d)/runetype-$(UNICODE).c: $(d)/vendor/UnicodeData-$(UNICODE).txt $(d)/vendor/mkrunetype + $(dir $@)/vendor/mkrunetype $< > $@ + +GENS += $(d)/vendor/mkrunetype + +$(LIBS_$(d)): $(OBJS_$(d)) + $(ARCHIVE) + +include share/pop.mk -- cgit v1.2.1