aboutsummaryrefslogtreecommitdiff
path: root/rpkid/Makefile
blob: 541ed433ff3ac17f2d7c96946609ef85c5e55311 (plain) (blame)
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
97
98
99
100
101
102
103
104
105
106
107
108
109
# $Id$

all: rpki/relaxng.py myrpki.rng

rpki/relaxng.py: ../scripts/make-relaxng.py left-right-schema.rng up-down-schema.rng publication-schema.rng
	python ../scripts/make-relaxng.py >$@.tmp
	mv $@.tmp $@

left-right-schema.rng: left-right-schema.rnc
	trang left-right-schema.rnc left-right-schema.rng

up-down-schema.rng: up-down-schema.rnc
	trang up-down-schema.rnc up-down-schema.rng

publication-schema.rng: publication-schema.rnc
	trang publication-schema.rnc publication-schema.rng

myrpki.rng: myrpki.rnc
	trang myrpki.rnc myrpki.rng

clean:
	find . -type f -name '*.pyc' -delete
	cd tests; $(MAKE) $@

install:
	@true

dont-run-trang:
	touch *.rng

relaxng: left-right-schema.rng up-down-schema.rng publication-schema.rng
	cd tests; $(MAKE) protocol-samples
	xmllint --noout --relaxng  left-right-schema.rng  tests/left-right-protocol-samples/*.xml
	xmllint --noout --relaxng     up-down-schema.rng     tests/up-down-protocol-samples/*.xml
	xmllint --noout --relaxng publication-schema.rng tests/publication-protocol-samples/*.xml

unit-tests: all
	PWD=`pwd`; for i in rpki/*.py; do echo "[$$i]"; PYTHONPATH=$$PWD python $$i; done

all-tests:: unit-tests

all-tests:: relaxng

test all-tests parse-test profile yamltest::
	cd tests; $(MAKE) $@


irbe_cli.usage: irbe_cli.py
	python irbe_cli.py --help | sed 's/^/      /' >$@

tags:
	find . -type f \( -name '*.py' -o -name '*.sql' -o -name '*.rnc' \) ! -name relaxng.py | etags -

lint:
	pylint --rcfile ../scripts/pylint.rc rpki/[a-z]*.py irbe_cli.py irdbd.py pubd.py rootd.py rpkid.py tests/smoketest.py tests/testpoke.py ../myrpki/myrpki.py ../myrpki/yamltest.py

# Documentation

doc/irdbd.dot: irdbd.sql
	sh ../scripts/graphviz-sql.sh $? >$@

doc/pubd.dot: pubd.sql
	sh ../scripts/graphviz-sql.sh $? >$@

doc/rpkid.dot: rpkid.sql
	sh ../scripts/graphviz-sql.sh $? >$@

.SUFFIXES: .dot .png .pdf .eps

.dot.pdf:
	dot -Tps2 $? | ps2pdf - $@

.dot.eps:
	dot -o $@ -Teps $?

.dot.png:
	dot -o $@ -Tpng $?

TEXT_DOCS = Installation Configuration Left-Right Publication MySQL-Setup MyRPKI

dot: doc/irdbd.dot doc/pubd.dot doc/rpkid.dot

eps: doc/irdbd.eps doc/pubd.eps doc/rpkid.eps doc/rpkid-bpki.eps doc/pubd-bpki.eps

png: doc/irdbd.png doc/pubd.png doc/rpkid.png doc/rpkid-bpki.png doc/pubd-bpki.png

docclean:
	rm -rf doc/html doc/latex doc/xml

html: dot eps png
	TZ='' doxygen

tgz: html
	cd doc && tar -cf - html | gzip -9 >manual.tar.gz

text: html
	for i in ${TEXT_DOCS}; do \
		xsltproc --html doc/tweak-doc.xsl doc/html/$$i.html | \
		html2text -rcfile doc/html2textrc -nobs -ascii | \
		awk -f doc/tweak-doc.awk >doc/$$i; \
	done 2>&1 | \
	awk -f doc/suppress-html-parse-errors.awk 1>&2

pdf: doc/irdbd.pdf doc/pubd.pdf doc/rpkid.pdf doc/rpkid-bpki.pdf doc/pubd-bpki.pdf

pdf: html
	cd doc/latex && TZ='' ${MAKE} && ln -f refman.pdf ../manual.pdf

docs: dot eps png html text tgz pdf