forked from p4-jp-community/p4-16-spec-jp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 992 Bytes
/
Makefile
File metadata and controls
39 lines (28 loc) · 992 Bytes
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
# file: Makefile
UV ?= uv
PY := $(UV) run -q python
PANDOC ?= pandoc
BUILD_DIR := build
TMP_DIR := $(BUILD_DIR)/tmp
MAP_DIR := $(BUILD_DIR)/maps
REPORT_DIR := $(BUILD_DIR)/reports
SRC_MDK := upstream/P4-16-spec.mdk
ATX_MD := $(TMP_DIR)/P4-16-spec.atx.md
OUTLINE := $(MAP_DIR)/mdk_outline.json
DOCS := docs
.PHONY: all prep normalize outline split figs verify clean
all: prep normalize outline split figs verify
prep:
@mkdir -p $(TMP_DIR) $(MAP_DIR) $(REPORT_DIR) $(DOCS)/assets/figs
normalize: $(SRC_MDK)
@$(PY) scripts/normalize_mdk.py --in $(SRC_MDK) --out $(ATX_MD)
outline: normalize
@$(PY) scripts/outline_mdk.py --in $(ATX_MD) --out $(OUTLINE) --version v1.2.5
split: outline
@$(PY) scripts/split_mdk.py --in $(ATX_MD) --map $(OUTLINE) --docs $(DOCS)
figs:
@$(PY) scripts/sync_figs.py --src upstream/figs --dst $(DOCS)/assets/figs
verify:
@$(PY) scripts/verify_site.py --docs $(DOCS) --map $(OUTLINE) --report $(REPORT_DIR)/verify.json
clean:
@rm -rf $(BUILD_DIR)