forked from WICG/attribution-reporting-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
37 lines (28 loc) · 1022 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
32
33
34
35
36
37
SHELL = /bin/bash
OUT_DIR ?= out
.PHONY: all clean validator
all: $(OUT_DIR)/index.html validator
$(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 \
);
validator: $(OUT_DIR)/validate-headers.html $(OUT_DIR)/validate-headers.js
$(OUT_DIR)/validate-headers.html: ts/src/header-validator/index.html $(OUT_DIR)
@ cp $< $@
$(OUT_DIR)/validate-headers.js: ts/dist/header-validator/main.js $(OUT_DIR)
@ cp $< $@
$(OUT_DIR):
@ mkdir -p $@
ts/dist/header-validator/main.js: ts/package.json ts/tsconfig.json ts/webpack.config.js ts/src/*.ts
@ npm ci --prefix ./ts
@ npm run pack --prefix ./ts
clean:
@ rm -rf $(OUT_DIR)