Update and rename MantenerFIFO to MantenerFIFO.md
[vsorcdistro/.git] / mininet / Makefile
1 MININET = mininet/*.py
2 TEST = mininet/test/*.py
3 EXAMPLES = mininet/examples/*.py
4 MN = bin/mn
5 PYTHON ?= python
6 PYMN = $(PYTHON) -B bin/mn
7 BIN = $(MN)
8 PYSRC = $(MININET) $(TEST) $(EXAMPLES) $(BIN)
9 MNEXEC = mnexec
10 MANPAGES = mn.1 mnexec.1
11 P8IGN = E251,E201,E302,E202,E126,E127,E203,E226
12 PREFIX ?= /usr
13 BINDIR ?= $(PREFIX)/bin
14 MANDIR ?= $(PREFIX)/share/man/man1
15 DOCDIRS = doc/html doc/latex
16 PDF = doc/latex/refman.pdf
17
18 CFLAGS += -Wall -Wextra
19
20 all: codecheck test
21
22 clean:
23         rm -rf build dist *.egg-info *.pyc $(MNEXEC) $(MANPAGES) $(DOCDIRS)
24
25 codecheck: $(PYSRC)
26         -echo "Running code check"
27         util/versioncheck.py
28         pyflakes $(PYSRC)
29         pylint --rcfile=.pylint $(PYSRC)
30 #       Exclude miniedit from pep8 checking for now
31         pep8 --repeat --ignore=$(P8IGN) `ls $(PYSRC) | grep -v miniedit.py`
32
33 errcheck: $(PYSRC)
34         -echo "Running check for errors only"
35         pyflakes $(PYSRC)
36         pylint -E --rcfile=.pylint $(PYSRC)
37
38 test: $(MININET) $(TEST)
39         -echo "Running tests"
40         mininet/test/test_nets.py
41         mininet/test/test_hifi.py
42
43 slowtest: $(MININET)
44         -echo "Running slower tests (walkthrough, examples)"
45         mininet/test/test_walkthrough.py -v
46         mininet/examples/test/runner.py -v
47
48 mnexec: mnexec.c $(MN) mininet/net.py
49         cc $(CFLAGS) $(LDFLAGS) -DVERSION=\"`PYTHONPATH=. $(PYMN) --version`\" $< -o $@
50
51 install-mnexec: $(MNEXEC)
52         install -D $(MNEXEC) $(BINDIR)/$(MNEXEC)
53
54 install-manpages: $(MANPAGES)
55         install -D -t $(MANDIR) $(MANPAGES)
56
57 install: install-mnexec install-manpages
58         $(PYTHON) setup.py install
59
60 develop: $(MNEXEC) $(MANPAGES)
61 #       Perhaps we should link these as well
62         install $(MNEXEC) $(BINDIR)
63         install $(MANPAGES) $(MANDIR)
64         $(PYTHON) setup.py develop
65
66 man: $(MANPAGES)
67
68 mn.1: $(MN)
69         PYTHONPATH=. help2man -N -n "create a Mininet network." \
70         --no-discard-stderr "$(PYMN)" -o $@
71
72 mnexec.1: mnexec
73         help2man -N -n "execution utility for Mininet." \
74         -h "-h" -v "-v" --no-discard-stderr ./$< -o $@
75
76 .PHONY: doc
77
78 doc: man
79         doxygen doc/doxygen.cfg
80         make -C doc/latex