Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (36 loc) · 1.84 KB
/
Copy pathMakefile
File metadata and controls
49 lines (36 loc) · 1.84 KB
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
# base16384-js — run `make help` for targets. Needs only a JavaScript runtime;
# `reference` needs git and a C compiler, `serve` uses python3, `licenses` uses gh.
NODE ?= node
PORT ?= 8000
REF_TAG ?= v2.3.2
REFERENCE ?= .reference/base16384
SITE := _site
.PHONY: help test conformance vectors reference bench images site serve licenses clean
help:
@grep -E '^[a-z]+:.*## ' $(MAKEFILE_LIST) | awk -F':.*## ' '{printf " %-12s %s\n", $$1, $$2}'
test: ## run the test suite
$(NODE) --test test/*.test.mjs
reference: ## fetch and build the reference tool into .reference/ (comparison only, never committed)
rm -rf .reference && git clone -q --depth 1 --branch $(REF_TAG) https://github.com/fumiama/base16384.git .reference/src
cd .reference/src && cc -O2 -DIS_64BIT_PROCESSOR -DBASE16384_VERSION='"$(REF_TAG:v%=%)"' \
-DBASE16384_VERSION_DATE='"$(REF_TAG)"' -o ../base16384 base16384.c wrap.c file.c base1464.c
conformance: ## compare with the reference tool on random data (REFERENCE=path)
REFERENCE=$(REFERENCE) $(NODE) tools/conformance.mjs
vectors: ## regenerate test/vectors.json from the reference tool (REFERENCE=path)
REFERENCE=$(REFERENCE) $(NODE) tools/vectors.mjs
bench: ## measure throughput on this machine
$(NODE) tools/bench.mjs
images: ## redraw images/format.svg and images/bench.svg
$(NODE) tools/diagram.mjs
$(NODE) tools/bench.mjs --svg
site: ## assemble the published site in _site/
rm -rf $(SITE) && mkdir -p $(SITE)/v1
cp -R site/. images $(SITE)/
cp src/base16384.mjs $(SITE)/
cp src/base16384.mjs $(SITE)/v1/
serve: site ## build the site and serve it on 127.0.0.1 (PORT=8000)
cd $(SITE) && python3 -m http.server $(PORT) --bind 127.0.0.1
licenses: ## fetch the licence text verbatim
gh api licenses/apache-2.0 --jq .body > LICENSE
clean: ## remove build output and the reference build
rm -rf $(SITE) .reference