-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (40 loc) · 2.09 KB
/
Copy pathMakefile
File metadata and controls
51 lines (40 loc) · 2.09 KB
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
VERSION := 21
VERSION_UPDATE1 := 00
STATUS := draft-
OUTPUT := $(STATUS)ietf-cellar-ebml-$(VERSION)
OUTPUT_UPDATE1 := draft-ietf-cellar-ebml-update1-$(VERSION_UPDATE1)
XML2RFC_CALL := xml2rfc
MMARK_CALL := mmark
-include runtimes.mak
XML2RFC := $(XML2RFC_CALL) --v3
MMARK := $(MMARK_CALL)
all: $(OUTPUT).html $(OUTPUT).txt $(OUTPUT).xml $(OUTPUT_UPDATE1).html $(OUTPUT_UPDATE1).txt $(OUTPUT_UPDATE1).xml
$(info RFC rendering has been tested with mmark version 2.2.8 and xml2rfc 2.46.0, please ensure these are installed and recent enough.)
$(OUTPUT).md: specification.markdown rfc_frontmatter.markdown rfc_backmatter.markdown EBMLSchema8794.xsd ebml_schema_example.xml
cat rfc_frontmatter.markdown $< rfc_backmatter.markdown | sed "s/@BUILD_DATE@/$(shell date +'%F')/" > $(OUTPUT).md
$(OUTPUT_UPDATE1).md: update1/update1_frontmatter.markdown update1/update1.markdown update1/update1_backmatter.markdown EBMLSchema.xsd
cat update1/update1_frontmatter.markdown update1/update1.markdown update1/update1_backmatter.markdown | sed -e "s/@BUILD_DATE@/$(shell date +'%F')/" \
-e "s/@BUILD_VERSION@/$(OUTPUT_UPDATE1)/" > $@
%.xml: %.md
$(MMARK) $< > $@
sed -i -e 's/<sourcecode type="xsd">/<sourcecode type="xml">/' $@
rfc8794.xml: $(OUTPUT).xml
sed -e 's/<?xml version="1.0" encoding="utf-8"?>/<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">/' \
-e "s/docName=\"8794\"/docName=\"$(OUTPUT)\" sortRefs=\"true\"/" \
-e "s@\"http://www.w3.org/2001/XInclude\"@\"http://www.w3.org/2001/XInclude\" tocInclude=\"true\" symRefs=\"true\"@" \
-e 's@<organization></organization>@@' \
-e 's@<street></street>@@' \
-e 's@<li>@<li><t>@' \
-e 's@</li>@</t>\n</li>@' \
-e 's@BCP 14@BCP\ 14@' \
-e 's@<dd><t>@<dd>@' \
-e 's@<date></date>@@' \
-e 's@<back>@<back>\n<displayreference target="I-D.ietf-cellar-matroska" to="Matroska"/>@' \
$< > $@
%.html: %.xml
$(XML2RFC) --html $< -o $@
%.txt: %.xml
$(XML2RFC) $< -o $@
clean:
rm -f $(OUTPUT).txt $(OUTPUT).html $(OUTPUT).md $(OUTPUT).xml
rm -f $(OUTPUT_UPDATE1).txt $(OUTPUT_UPDATE1).html $(OUTPUT_UPDATE1).md $(OUTPUT_UPDATE1).xml