forked from WICG/attribution-reporting-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (24 loc) · 829 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
SHELL = /bin/bash
OUT_DIR ?= out
.PHONY: all clean validator
all: $(OUT_DIR)/index.html $(OUT_DIR)/validate-headers.html $(OUT_DIR)/validate-json.mjs
$(OUT_DIR)/index.html: index.bs $(OUT_DIR)
@ (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 $@; \
exit 22 \
);
$(OUT_DIR)/validate-headers.html: validate-headers.html $(OUT_DIR)
@ cp $< $@
$(OUT_DIR)/validate-json.mjs: header-validator/validate-json.js $(OUT_DIR)
@ cp $< $@
$(OUT_DIR):
@ mkdir -p $@
clean:
@ rm -rf $(OUT_DIR)