-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
96 lines (77 loc) · 3.37 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
VERSION=$(shell ./getver ${DRAFT}.xml )
YANGDATE=2018-02-14
DRAFT=dtbootstrap-anima-keyinfra
VRDATE=yang/ietf-voucher-request@${YANGDATE}.yang
MUDDATE=yang/ietf-mud-brski-masaurl-extension@${YANGDATE}.yang
EXTRA_FILES+=ietf-voucher-request-tree.txt
EXTRA_FILES+=${VRDATE} ${MUDDATE}
EXTRA_FILES+=time-sequence-diagram.txt
EXTRA_FILES+=component-diagram.txt
EXAMPLE1=00-D0-E5-F2-00-02
EXTRA_FILES+=examples/jrc_prime256v1.txt
EXTRA_FILES+=examples/jrc_prime256v1.crt
EXTRA_FILES+=examples/jrc_prime256v1.key
EXTRA_FILES+=examples/vr_${EXAMPLE1}.b64
EXTRA_FILES+=examples/vr_${EXAMPLE1}.asn1.txt
EXTRA_FILES+=examples/vr_${EXAMPLE1}.json
EXTRA_FILES+=examples/parboiled_vr_${EXAMPLE1}.b64
EXTRA_FILES+=examples/parboiled_vr_${EXAMPLE1}.asn1.txt
EXTRA_FILES+=examples/parboiled_vr_${EXAMPLE1}.json
EXTRA_FILES+=examples/voucher_${EXAMPLE1}.b64
EXTRA_FILES+=examples/voucher_${EXAMPLE1}.asn1.txt
EXTRA_FILES+=examples/voucher_${EXAMPLE1}.json
EXTRA_FILES+=examples/idevid_${EXAMPLE1}.crt
EXTRA_FILES+=examples/idevid_${EXAMPLE1}.txt
EXTRA_FILES+=examples/idevid_${EXAMPLE1}.asn1.txt
EXTRA_FILES+=examples/idevid_${EXAMPLE1}.key
${DRAFT}-${VERSION}.txt: ${DRAFT}.txt ${DRAFT}.html
cp ${DRAFT}.txt ${DRAFT}-${VERSION}.txt
: git add ${DRAFT}-${VERSION}.txt ${DRAFT}.txt
cp ${DRAFT}.html ${DRAFT}-${VERSION}.html
@echo Consider a \'git add\' of html version
ietf-voucher-request-tree.txt: ${VRDATE}
pyang --path=../voucher -f tree --tree-print-groupings ${VRDATE} > ietf-voucher-request-tree.txt
${VRDATE}: ietf-voucher-request.yang
sed -e"s/YYYY-MM-DD/${YANGDATE}/" ietf-voucher-request.yang > ${VRDATE}
${MUDDATE}: ietf-mud-brski-masaurl-extension.yang
sed -e"s/YYYY-MM-DD/${YANGDATE}/" ietf-mud-brski-masaurl-extension.yang > ${MUDDATE}
examples/%.txt: examples/%.crt
openssl x509 -noout -text -in $? | fold -w 60 >$@
examples/%.asn1.txt: examples/%.b64
base64 --decode <$? | openssl asn1parse -inform der | fold -w 60 >$@
examples/%.asn1.txt: examples/%.crt
openssl asn1parse -in $? | fold -w 60 >$@
examples/%.json: examples/%.b64
base64 --decode <$? | openssl cms -verify -inform der -nosigs -noverify | fold -w 60 >$@
ALL-${DRAFT}.xml: ${DRAFT}.xml ${EXTRA_FILES}
cat ${DRAFT}.xml | ./insert-figures > ALL-${DRAFT}.xml
xml2rfc --v2v3 ALL-${DRAFT}.xml
cp ALL-${DRAFT}.xml ALL-${DRAFT}.v2.xml
mv ALL-${DRAFT}.v2v3.xml ALL-${DRAFT}.xml
%.txt: ALL-%.xml
./validate-json >.json-errors || cat .json-errors
@echo PROCESSING: $(subst ALL-,,$@)
unset DISPLAY; XML_LIBRARY=$(XML_LIBRARY):./src xml2rfc ${NETWORK} --text -o $(subst ALL-,,$@) $?
%.html: ALL-%.xml
unset DISPLAY; XML_LIBRARY=$(XML_LIBRARY):./src xml2rfc ${NETWORK} --html -o $(subst ALL-,,$@) $?
submit: ALL-${DRAFT}.xml
curl -S -F "user=${IETFUSER}" -F "xml=@ALL-${DRAFT}.xml" https://datatracker.ietf.org/api/submit
clean:
-rm -f ${DRAFT}-${VERSION}.xml ${DRAFT}-${VERSION}.txt
-rm -f ALL-${DRAFT}-${VERSION}.xml
-rm -f ALL-${DRAFT}.xml
-rm -f *~
-rm -f ietf-voucher-request@*.yang
validate: ${VRDATE}
pyang --ietf --strict --max-line-length=70 -p ../voucher ${VRDATE}
pyang --canonical -p ../voucher/ ${VRDATE}
-yanglint -p ../voucher/ ${VRDATE}
echo "Testing ex-file-voucher-request.json..."
-yanglint -p ../../voucher/ -s ${VRDATE} refs/ex-file-voucher-request.json
.PRECIOUS: ${DRAFT}-${VERSION}.xml
.PRECIOUS: ${VRDATE}
.PRECIOUS: ALL-${DRAFT}.xml
.PRECIOUS: DATE-${DRAFT}.xml
version:
echo Version: ${VERSION}