forked from SwiftDocOrg/CommonMark
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
24 lines (19 loc) · 754 Bytes
/
Makefile
File metadata and controls
24 lines (19 loc) · 754 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
COMMONMARK_SPEC_VERSION=0.29
Tests/CommonMarkSpecTests: Resources/spec.json | Resources/spec
@mkdir -p $@
@for section in $(shell jq -c '.[].section' $< | uniq); do \
filename=`echo "$${section}" | awk -f Resources/camelcase.awk`; \
jq "map(select(.section == \"$${section}\"))" $< > "$|/$${filename}.json" ; \
gyb --line-directive '' -o $@/$${filename}Tests.swift -D filename="$${filename}" Resources/CommonMarkSpecTests.swift.gyb; \
done
Resources/spec:
@mkdir -p Resources/spec
Resources/spec.json:
@curl "https://spec.commonmark.org/${COMMONMARK_SPEC_VERSION}/spec.json" > $@
%.swift: %.swift.gyb
@gyb --line-directive '' -o $@ $<
.PHONY:
clean:
@rm -f Resources/spec.json
@rm -rf Resources/spec
@rm -rf Tests/CommonMarkSpecTests