-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
49 lines (39 loc) · 1.11 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
xml2rfc ?= xml2rfc
kramdown-rfc2629 ?= kramdown-rfc2629
idnits ?= idnits
title = inadarei-api-health-check
latest = $(shell (ls draft-${title}-*.xml || echo "draft-${title}-00.xml") | sort | tail -1)
version = $(shell basename ${latest} .xml | awk -F- '{print $$NF}')
target = draft-$(title)-$(version)
prev = draft-$(title)-$(shell printf "%.2d" `echo ${version}-1 | bc`)
next = draft-$(title)-$(shell printf "%.2d" `echo ${version}+1 | bc`)
.PHONY: latest clean next diff idnits update
latest:
$(kramdown-rfc2629) draft.md > $(target).xml
$(xml2rfc) $(target).xml --text --html
cp $(target).html index.html
cp $(target).txt index.txt
#latest: $(target).html $(target).txt index.html index.txt
clean:
rm -f $(target).html $(target).txt
next:
cp $(target).xml $(next).xml
sed -i '' -e"s/$(target)/$(next)/" draft.md
diff:
rfcdiff $(prev).txt $(target).txt
idnits: $(target).txt
$(idnits) $<
# %.xml: draft.md
# $(kramdown-rfc2629) $< > $@
#
# %.html: %.xml
# $(xml2rfc) --html --text $<
#
# %.txt: %.xml
# $(xml2rfc) $<
#
# index.html: $(target).html
# cp $< $@
#
# index.txt: $(target).txt
# cp $< $@