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