forked from privacycg/nav-tracking-mitigations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (34 loc) · 1.22 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
# This Makefile assumes you have a local install of bikeshed. Like any
# other Python tool, you install it with pip:
#
# python3 -m pip install bikeshed && bikeshed update
# It also assumes you have doctoc installed. This is a tool that
# automatically generates Table of Contents for Markdown files. It can
# be installed like any other NPM module:
#
# npm install -g doctoc
SHELL=/bin/bash -o pipefail
.PHONY: all publish clean update-explainer-toc remote
.SUFFIXES: .bs .html
all: publish update-explainer-toc
clean:
rm -rf build *~
publish: build/index.html
update-explainer-toc: README.md Makefile
doctoc $< --title "## Table of Contents" > /dev/null
build/index.html: index.bs Makefile
mkdir -p build
bikeshed --die-on=warning spec $< $@
remote: index.bs
mkdir -p build
@ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \
--output build/index.html \
--write-out "%{http_code}" \
--header "Accept: text/plain, text/html" \
-F die-on=warning \
-F file=@index.bs) && \
[[ "$$HTTP_STATUS" -eq "200" ]]) || ( \
echo ""; cat build/index.html; echo ""; \
rm -f build/index.html; \
exit 22 \
);