utf8proc

A clean C library for processing UTF-8 Unicode data
git clone https://git.sinitax.com/juliastrings/utf8proc
Log | Files | Refs | README | LICENSE | sfeed.txt

Makefile (2523B)


      1# Unicode data generation rules.  Except for the test data files, most
      2# users will not use these Makefile rules, which are primarily to re-generate
      3# unicode_data.c when we get a new Unicode version or charwidth data; they
      4# require julia to be installed.
      5
      6# programs
      7CURL=curl
      8PERL=perl
      9MAKE=make
     10JULIA=julia
     11CURLFLAGS = --retry 5 --location
     12
     13.PHONY: clean
     14
     15.DELETE_ON_ERROR:
     16
     17RAWDATA = UnicodeData.txt GraphemeBreakProperty.txt DerivedCoreProperties.txt CompositionExclusions.txt CaseFolding.txt EastAsianWidth.txt emoji-data.txt
     18
     19utf8proc_data.c.new: data_generator.jl $(RAWDATA)
     20	$(JULIA) --project=. -e 'using Pkg; Pkg.instantiate()'
     21	$(JULIA) --project=. data_generator.jl > $@
     22
     23# Unicode data version (must also update utf8proc_unicode_version function)
     24UNICODE_VERSION=15.1.0
     25
     26UnicodeData.txt:
     27	$(CURL) $(CURLFLAGS) -o $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/UnicodeData.txt
     28
     29EastAsianWidth.txt:
     30	$(CURL) $(CURLFLAGS) -o $@ $(URLCACHE)https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/EastAsianWidth.txt
     31
     32GraphemeBreakProperty.txt:
     33	$(CURL) $(CURLFLAGS) -o $@ $(URLCACHE)https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/auxiliary/GraphemeBreakProperty.txt
     34
     35DerivedCoreProperties.txt:
     36	$(CURL) $(CURLFLAGS) -o $@ $(URLCACHE)https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/DerivedCoreProperties.txt
     37
     38CompositionExclusions.txt:
     39	$(CURL) $(CURLFLAGS) -o $@ $(URLCACHE)https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/CompositionExclusions.txt
     40
     41CaseFolding.txt:
     42	$(CURL) $(CURLFLAGS) -o $@ $(URLCACHE)https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/CaseFolding.txt
     43
     44NormalizationTest.txt:
     45	$(CURL) $(CURLFLAGS) -o $@ $(URLCACHE)https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/NormalizationTest.txt
     46
     47GraphemeBreakTest.txt:
     48	$(CURL) $(CURLFLAGS) -o $@ $(URLCACHE)https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/auxiliary/GraphemeBreakTest.txt
     49
     50emoji-data.txt:
     51	$(CURL) $(CURLFLAGS) -o $@ $(URLCACHE)https://unicode.org/Public/$(UNICODE_VERSION)/ucd/emoji/emoji-data.txt
     52
     53Uppercase.txt: DerivedCoreProperties.txt
     54	$(JULIA) -e 'print(match(r"# Derived Property: Uppercase.*?# Total code points:"s, read("DerivedCoreProperties.txt", String)).match)' > $@
     55
     56Lowercase.txt: DerivedCoreProperties.txt
     57	$(JULIA) -e 'print(match(r"# Derived Property: Lowercase.*?# Total code points:"s, read("DerivedCoreProperties.txt", String)).match)' > $@
     58
     59clean:
     60	rm -f $(RAWDATA) NormalizationTest.txt GraphemeBreakTest.txt
     61	rm -f Uppercase.txt Lowercase.txt
     62	rm -f utf8proc_data.c.new