-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
34 lines (24 loc) · 843 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
VERSION = 18
DOC = "draft-ietf-regext-epp-ttl-$(VERSION)"
XML = "$(DOC).xml"
all: html
lint: clean
@echo "Running lint check..."
@xmllint --noout draft.xml.in
test: lint
@echo "Testing example XML files..."
@find examples -name '*.xml' -print \( -exec xmllint --noout --schema xsd/epp.xsd {} \; -or -quit \)
xml: test
@echo "Compiling XML file..."
@find examples -name '*.xml' -exec cp -fv {} {}.txt \;
@find examples -name '*-command.xml.txt' -exec sed -i "" "s/^/C: /g" {} \;
@find examples -name '*-response.xml.txt' -exec sed -i "" "s/^/S: /g" {} \;
@xmllint --xinclude "draft.xml.in" > "$(XML)"
@xmlstarlet edit --inplace --update '//rfc/@docName' --value "$(DOC)" "$(XML)"
html: xml
@echo "Generating HTML file..."
@xml2rfc --html "$(XML)"
clean:
@echo "Cleaning up..."
@rm -fv examples/*.txt
@rm -fv *txt *html