forked from WICG/nav-speculation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (23 loc) · 795 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
SHELL=/bin/bash
bikeshed_files = prefetch.bs prerendering.bs speculation-rules.bs
.PHONY: ci clean local remote
local: $(bikeshed_files)
$(foreach source,$(bikeshed_files),bikeshed --die-on=warning spec $(source) $(source:.bs=.html);)
remote: $(bikeshed_files:.bs=.html)
ci: index.html $(bikeshed_files:.bs=.html)
mkdir -p out
cp $^ out/
clean:
rm -f $(bikeshed_files:.bs=.html)
%.html: %.bs
@ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \
--output $@ \
--write-out "%{http_code}" \
--header "Accept: text/plain, text/html" \
-F die-on=warning \
-F file=@$<) && \
[[ "$$HTTP_STATUS" -eq "200" ]]) || ( \
echo ""; cat $@; echo ""; \
rm -f $@; \
exit 22 \
);