Statistics
| Branch: | Tag: | Revision:

mininet / Makefile @ beeea4b2

History | View | Annotate | Download (1.73 KB)

1
MININET = mininet/*.py
2
TEST = mininet/test/*.py
3
EXAMPLES = mininet/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,E126,E127,E203,E226
10
BINDIR = /usr/bin
11
MANDIR = /usr/share/man/man1
12
DOCDIRS = doc/html doc/latex
13
PDF = doc/latex/refman.pdf
14

    
15
CFLAGS += -Wall -Wextra
16

    
17
all: codecheck test
18

    
19
clean:
20
	rm -rf build dist *.egg-info *.pyc $(MNEXEC) $(MANPAGES) $(DOCDIRS)
21

    
22
codecheck: $(PYSRC)
23
	-echo "Running code check"
24
	util/versioncheck.py
25
	pyflakes $(PYSRC)
26
	pylint --rcfile=.pylint $(PYSRC)
27
#	Exclude miniedit from pep8 checking for now
28
	pep8 --repeat --ignore=$(P8IGN) `ls $(PYSRC) | grep -v miniedit.py`
29

    
30
errcheck: $(PYSRC)
31
	-echo "Running check for errors only"
32
	pyflakes $(PYSRC)
33
	pylint -E --rcfile=.pylint $(PYSRC)
34

    
35
test: $(MININET) $(TEST)
36
	-echo "Running tests"
37
	mininet/test/test_nets.py
38
	mininet/test/test_hifi.py
39

    
40
slowtest: $(MININET)
41
	-echo "Running slower tests (walkthrough, examples)"
42
	mininet/test/test_walkthrough.py -v
43
	mininet/examples/test/runner.py -v
44

    
45
mnexec: mnexec.c $(MN) mininet/net.py
46
	cc $(CFLAGS) $(LDFLAGS) -DVERSION=\"`PYTHONPATH=. $(MN) --version`\" $< -o $@
47

    
48
install: $(MNEXEC) $(MANPAGES)
49
	install $(MNEXEC) $(BINDIR)
50
	install $(MANPAGES) $(MANDIR)
51
	python setup.py install
52

    
53
develop: $(MNEXEC) $(MANPAGES)
54
# 	Perhaps we should link these as well
55
	install $(MNEXEC) $(BINDIR)
56
	install $(MANPAGES) $(MANDIR)
57
	python setup.py develop
58

    
59
man: $(MANPAGES)
60

    
61
mn.1: $(MN)
62
	PYTHONPATH=. help2man -N -n "create a Mininet network." \
63
	--no-discard-stderr $< -o $@
64

    
65
mnexec.1: mnexec
66
	help2man -N -n "execution utility for Mininet." \
67
	-h "-h" -v "-v" --no-discard-stderr ./$< -o $@
68

    
69
.PHONY: doc
70

    
71
doc: man
72
	doxygen doc/doxygen.cfg
73
	make -C doc/latex