-
Notifications
You must be signed in to change notification settings - Fork 32
/
Makefile.fluffy
51 lines (35 loc) · 1.03 KB
/
Makefile.fluffy
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
xml2rfc ?= xml2rfc -v
kramdown-rfc2629 ?= kramdown-rfc2629
idnits ?= idnits
draft := draft-ietf-rtcweb-jsep
current_ver := $(shell git tag | grep "$(draft)" | tail -1 | sed -e"s/.*-//")
ifeq "${current_ver}" ""
next_ver ?= 00
else
next_ver ?= $(shell printf "%.2d" $$((1$(current_ver)-99)))
endif
next := $(draft)-$(next_ver)
.PHONY: latest submit clean
latest: $(draft).txt $(draft).html
submit: $(next).txt
idnits: $(next).txt
$(idnits) $<
diff: $(draft).diff.html
clean:
-rm -f $(draft).txt $(draft).raw $(draft).old.raw $(draft).html $(draft).diff.html
-rm -f $(next).txt $(next).raw $(next).html
-rm -f $(draft)-[0-9][0-9].xml
$(next).xml: $(draft).xml
sed -e"s/$(basename $<)-latest/$(basename $@)/" $< > $@
#%.xml: %.md
# $(kramdown-rfc2629) $< > $@
%.txt: %.xml
$(xml2rfc) $< --text --out $@
%.raw: %.xml
$(xml2rfc) $< --raw --out $@
%.html: %.xml
$(xml2rfc) $< --html --out $@
$(draft).diff.html: $(draft).old.raw $(draft).raw
htmlwdiff $^ > $@
upload: $(draft).html $(draft).txt
python upload-draft.py $(draft).html