forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·90 lines (72 loc) · 2.52 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Calling the post-processor with file-upload. Assumes the username
# and password are in ~/.curl-w3.org (user = USER:PASS)
#
# To set a date other than today, use: make date=YYYY-MM-DD
#
# "cdate" is an alias for "date": "make cdate=YYYY-MM-DD" works, too.
#
# To set the status, modify one of the "this version" URLs:
# http://www.w3.org/TR/[YEAR]/CR-[SHORTNAME]-[CDATE]/
# Or set that URL to [VERSION] and call Make as: make status=CR
#
#
# Possible other options to add to the curl command below:
# -F ids=on
# -F omitdchtml=on
# e.g., like this: make opts="-F ids=on -F omitdchtml=on"
date ?=
status ?= ED
group ?= CSS
opts ?=
target ?= Overview
markup ?= html
cdate ?= $(date)
# %.html: %.src.html
# @echo "Calling post-processor to generate $@..."
# @curl -K ~/.curl-w3.org -s -S -F output=html -F file=@$< \
# -F group=$(group) -F method=file -F date=$(cdate) -F status=$(status) \
# $(opts) -o $@ https://www.w3.org/Style/Group/process.cgi
# %.err: %.src.html
# @echo "Calling post-processor to check $<..."
# @curl -K ~/.curl-w3.org -s -S -F output=err -F file=@$< \
# -F group=$(group) -F method=file -F date=$(cdate) -F status=$(status) \
# $(opts) -o $@ https://www.w3.org/Style/Group/process.cgi
%.html: %.bs
@echo "- Calling Bikeshed to generate $@..."
@curl -o $@ -s -L -F file=@$< -F md-date=$(cdate) -F md-status=$(status) \
-F output=html -F paragraph=$(markup) $(opts) http://api.csswg.org/bikeshed/
%.err: %.bs
@echo "- Calling Bikeshed to check $<..."
@rm -f $@
@touch $@
@curl -o $@ -s -L -F file=@$< -F md-date=$(cdate) -F md-status=$(status) \
-F output=err -F paragraph=$(markup) $(opts) http://api.csswg.org/bikeshed/
@sed -i 's/\\033\[[0-9;]*m//g' $@
# For Dispositions of Comments in css3-background:
%.html: %.txt; awk -f issues-txt-to-html.awk $< >$@
# Rule to create PNG from FIG
%.png: %.fig; fig2dev -L png -m 0.8 -S 4 $< $@
# Rule to create EPS from FIG
%.eps: %.fig; fig2dev -m 0.8 -L eps -F -c $< $@
# Rule to create PNG from EPS
%.png: %.eps; convert -density 96x96 $< $@
all: check $(target).html
# egrep will exit with a zero exit code if there is anything left
check: $(target).err
@cat $<
@echo
@if egrep -qv '^(Warning:|\(Processed in .* seconds\)|No errors)' $< &&\
! egrep -q '[^A-Z]* Successfully generated' $<;\
then false; else true; fi
# A handy shortcut:
commit: update all
hg commit -m 'Generated. Do not edit!' $(target).html || true
hg push
update:
hg pull
hg update
clean:
rm -f $(target).html $(target).err
.PHONY: check commit update clean
.DELETE_ON_ERROR:
.PRECIOUS: %.png