-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
56 lines (40 loc) · 1.89 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# modules
.PHONY: all
all: generated
.PHONY: test
test: generated
elm-verify-examples
elm-test
.PHONY: ci
ci: test documentation.json
test -z "$(shell git diff)"
.PHONY: generated
generated: $(foreach class,CR LF Control Prepend Regional_Indicator L V T LV LVT Extended_Pictographic Extend SpacingMark ZWJ,src/String/Graphemes/Data/$(class).elm) tests/GraphemeBreakTest.elm
src/String/Graphemes/Data/%.elm: data/GraphemeBreakProperty.json script/generate-matcher.py
@mkdir -p $(@D)
python script/generate-matcher.py $@ < $<
tests/GraphemeBreakTest.elm: data/GraphemeBreakTest.txt script/generate-grapheme-break-test.py
python script/generate-grapheme-break-test.py $@ < $<
elm-format --yes $@
documentation.json: $(find src -name '*.elm') elm.json
elm make --docs $@
# data
data/GraphemeBreakProperty.txt:
@mkdir -p $(@D)
curl https://www.unicode.org/Public/15.0.0/ucd/auxiliary/GraphemeBreakProperty.txt > $@
curl https://www.unicode.org/Public/15.0.0/ucd/emoji/emoji-data.txt >> $@
data/GraphemeBreakProperty.json: data/GraphemeBreakProperty.txt script/ucd_to_json.py
@mkdir -p $(@D)
python script/ucd_to_json.py < $< > $@
data/GraphemeBreakTest.txt:
@mkdir -p $(@D)
curl https://www.unicode.org/Public/15.0.0/ucd/auxiliary/GraphemeBreakTest.txt > $@
# benchmarks
size-benchmarks/report.txt: generated $(shell find src size-benchmarks -name '*.elm') size-benchmarks/stats.py
cd $(@D); ./stats.py > $(@F)
size-benchmarks/names-in-%.txt: size-benchmarks/%.js size-benchmarks/report.txt
grep -E '^var .+ =' $< | cut -f 2 -d ' ' | sort > $@
size-benchmarks/new-names.txt: size-benchmarks/names-in-withoutSegmentation.txt size-benchmarks/names-in-withSegmentation.txt
grep -v size-benchmarks/names-in-withoutSegmentation.txt size-benchmarks/names-in-withSegmentation.txt > $@
benchmarks/benchmark.html: generated $(shell find src benchmarks -name '*.elm')
cd $(@D); elm make --output=$(@F) src/Main.elm