-
Notifications
You must be signed in to change notification settings - Fork 175
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (36 loc) · 1.01 KB
/
Makefile
File metadata and controls
42 lines (36 loc) · 1.01 KB
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
SHELL := /bin/bash
DST := $(patsubst %.src.html,%.html,$(wildcard *.src.html))
REMOTE := $(filter remote,$(MAKECMDGOALS))
%.html : %.src.html
ifndef REMOTE
# When addding a new registry entry, bikeshed will error out, this allows
# bypassing the error.
ifdef WEBCODECS_IGNORE_WARNINGS
@ echo "Building $@, ignoring warnings"
bikeshed -f spec $< $@
else
@ echo "Building $@"
bikeshed --die-on=warning spec $< $@
endif
else
@ echo "Building $@ remotely"
@ (HTTP_STATUS=$$(curl https://www.w3.org/publications/spec-generator/ \
--output $@ \
--write-out "%{http_code}" \
--header "Accept: text/plain, text/html" \
-F type=bikeshed-spec \
-F die-on=warning \
-F file=@$<) && \
[[ "$$HTTP_STATUS" -eq "200" ]]) || ( \
echo ""; cat $@; echo ""; \
rm -f index.html; \
exit 22 \
);
endif
all: $(DST)
@ echo "All done"
remote: all
ci:
mkdir -p out
make remote
mv $(DST) out