forked from w3c/webappsec-csp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (29 loc) · 908 Bytes
/
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
id_base = ..
xml2rfc ?= xml2rfc
kramdown-rfc2629 ?= kramdown-rfc2629
idnits ?= idnits
title = west-webappsec-csp-reg
latest = $(shell (ls draft-${title}-*.txt || echo "draft-${title}-00.txt") | sort | tail -1)
version = $(shell basename ${latest} .txt | 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: $(target).html $(target).txt
clean:
rm -f $(target).html $(target).txt
next:
cp $(target).txt $(next).txt
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 $< $@
%.txt: %.xml
$(xml2rfc) $< $@
update:
cp $(id_base)/Tools/skel/Makefile .