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