-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
80 lines (59 loc) · 1.8 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
# Original makefile from https://github.com/martinthomson/i-d-template
# Edited by wkumari to remove a bunch of the extra stuff I'll never use.
# Then more by tale to suit workflow of other drafts
# The following tools are used by this file.
# All are assumed to be on the path, but you can override these
# in the environment, or command line.
# Mandatory:
# https://pypi.python.org/pypi/xml2rfc
xml2rfc ?= xml2rfc
# If you are using markdown files:
# https://github.com/cabo/kramdown-rfc2629
kramdown-rfc2629 ?= kramdown-rfc2629
# If you are using outline files:
# https://github.com/Juniper/libslax/tree/master/doc/oxtradoc
oxtradoc ?= oxtradoc.in
# For sanity checkout your draft:
# https://tools.ietf.org/tools/idnits/
idnits ?= idnits
# For generating PDF:
# https://www.gnu.org/software/enscript/
enscript ?= enscript
# http://www.ghostscript.com/
ps2pdf ?= ps2pdf
## Targets
.PHONY: latest txt html pdf submit diff clean
latest: txt html
txt: draft-irtf-cfrg-vrf.txt
html: draft-irtf-cfrg-vrf.html
idnits: draft-irtf-cfrg-vrf.txt
$(idnits) draft-irtf-cfrg-vrf.txt
clean:
-rm -f draft-irtf-cfrg-vrf.txt.{txt,html,pdf} index.html
-rm -f *.diff.html
commit: latest
@echo "Committing and pushing to github. Run 'make tag' to add and push a tag."
read -p "Commit message: " msg; \
git commit -a -m "$$msg";
@git push
tag:
@echo "Current tags:"
git tag
@echo
@read -p "Tag message (e.g: Version-00): " tag; \
git tag -a $$tag -m $$tag
@git push --tags
## Recipes
.INTERMEDIATE: $(draft).raw.txt
%.xml: %.md
$(kramdown-rfc2629) $< > $@
%.xml: %.org
$(oxtradoc) -m outline-to-xml -n "$@" $< > $@
%.txt: %.xml
$(xml2rfc) $< -o $@ --text
%.raw.txt: %.xml
$(xml2rfc) $< -o $@ --raw
%.html: %.xml
$(xml2rfc) $< -o $@ --html
%.pdf: %.txt
$(enscript) --margins 76::76: -G -q -p - $^ | $(ps2pdf) - $@