blob: c0c53f2eda2ca95bb5e5b2d34edf3a8c122ff2f6 [file] [log] [blame]
carlosmscabralf40ecd12013-02-01 18:15:58 -02001MININET = mininet/*.py
2TEST = mininet/test/*.py
3EXAMPLES = examples/*.py
4MN = bin/mn
carlosmscabral9ab2f8d2013-02-04 12:28:14 -02005BIN = $(MN)
carlosmscabralf40ecd12013-02-01 18:15:58 -02006PYSRC = $(MININET) $(TEST) $(EXAMPLES) $(BIN)
7MNEXEC = mnexec
8MANPAGES = mn.1 mnexec.1
9P8IGN = E251,E201,E302,E202
10BINDIR = /usr/bin
11MANDIR = /usr/share/man/man1
12DOCDIRS = doc/html doc/latex
13PDF = doc/latex/refman.pdf
14
15all: codecheck test
16
17clean:
18 rm -rf build dist *.egg-info *.pyc $(MNEXEC) $(MANPAGES) $(DOCDIRS)
19
20codecheck: $(PYSRC)
21 -echo "Running code check"
22 util/versioncheck.py
23 pyflakes $(PYSRC)
24 pylint --rcfile=.pylint $(PYSRC)
25 pep8 --repeat --ignore=$(P8IGN) $(PYSRC)
26
27errcheck: $(PYSRC)
28 -echo "Running check for errors only"
29 pyflakes $(PYSRC)
30 pylint -E --rcfile=.pylint $(PYSRC)
31
32test: $(MININET) $(TEST)
33 -echo "Running tests"
34 mininet/test/test_nets.py
35 mininet/test/test_hifi.py
36
37mnexec: mnexec.c $(MN) mininet/net.py
38 cc $(CFLAGS) $(LDFLAGS) -DVERSION=\"`PYTHONPATH=. $(MN) --version`\" $< -o $@
39
40install: $(MNEXEC) $(MANPAGES)
41 install $(MNEXEC) $(BINDIR)
42 install $(MANPAGES) $(MANDIR)
43 python setup.py install
44
45develop: $(MNEXEC) $(MANPAGES)
46 # Perhaps we should link these as well
47 install $(MNEXEC) $(BINDIR)
48 install $(MANPAGES) $(MANDIR)
49 python setup.py develop
50
51man: $(MANPAGES)
52
53mn.1: $(MN)
54 PYTHONPATH=. help2man -N -n "create a Mininet network." \
55 --no-discard-stderr $< -o $@
56
57mnexec.1: mnexec
58 help2man -N -n "execution utility for Mininet." \
59 -h "-h" -v "-v" --no-discard-stderr ./$< -o $@
60
61.PHONY: doc
62
63doc: man
64 doxygen doc/doxygen.cfg
65 make -C doc/latex