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