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