-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
47 lines (32 loc) · 998 Bytes
/
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
SHELL := bash
ROOT := $(shell pwd)
SPEC12_URL := https://yaml.org/spec/1.2/spec.html
SPEC12_TXT := yaml-spec-1.2.txt
SPEC12_YAML := yaml-spec-1.2.yaml
SPEC12_JSON := yaml-spec-1.2.json
SPEC12_COMMENTS := yaml-spec-1.2-comments.yaml
BUILD := $(SPEC12_YAML) $(SPEC12_JSON)
PATH := $(ROOT)/bin:$(PATH)
PATH := $(ROOT)/node_modules/.bin:$(PATH)
export PATH
.DELETE_ON_ERROR:
#------------------------------------------------------------------------------
default:
force:
build: node_modules $(BUILD)
build-yaml: $(SPEC12_YAML)
comments: $(SPEC12_COMMENTS)
clean:
rm -fr node_modules
rm -f package-lock.json
$(SPEC12_TXT):
lynx --dump $(SPEC12_URL) > $@
$(SPEC12_YAML): $(SPEC12_TXT) Makefile bin
yaml-grammar-html-to-yaml $< $(SPEC12_COMMENTS) > $@
$(SPEC12_JSON): $(SPEC12_YAML)
yaml-grammar-yaml-to-json < $< > $@
$(SPEC12_COMMENTS): force
yaml-grammar-to-comments $(SPEC12_YAML) > $@
node_modules:
git branch --track $@ origin/$@ 2>/dev/null || true
git worktree add -f $@ $@