Statistics
| Branch: | Tag: | Revision:

mininet / Makefile @ 2e3258d2

History | View | Annotate | Download (1.79 KB)

1
MININET = mininet/*.py
2
TEST = mininet/test/*.py
3
EXAMPLES = mininet/examples/*.py
4
MN = bin/mn
5
PYMN = python -B bin/mn
6
BIN = $(MN)
7
PYSRC = $(MININET) $(TEST) $(EXAMPLES) $(BIN)
8
MNEXEC = mnexec
9
MANPAGES = mn.1 mnexec.1
10
P8IGN = E251,E201,E302,E202,E126,E127,E203,E226
11
BINDIR = /usr/bin
12
MANDIR = /usr/share/man/man1
13
DOCDIRS = doc/html doc/latex
14
PDF = doc/latex/refman.pdf
15

    
16
CFLAGS += -Wall -Wextra
17

    
18
all: codecheck test
19

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

    
23
deb: 
24
	debuild -i -us -uc -b
25

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

    
34
errcheck: $(PYSRC)
35
	-echo "Running check for errors only"
36
	pyflakes $(PYSRC)
37
	pylint -E --rcfile=.pylint $(PYSRC)
38

    
39
test: $(MININET) $(TEST)
40
	-echo "Running tests"
41
	mininet/test/test_nets.py
42
	mininet/test/test_hifi.py
43

    
44
slowtest: $(MININET)
45
	-echo "Running slower tests (walkthrough, examples)"
46
	mininet/test/test_walkthrough.py -v
47
	mininet/examples/test/runner.py -v
48

    
49
mnexec: mnexec.c $(MN) mininet/net.py
50
	cc $(CFLAGS) $(LDFLAGS) -DVERSION=\"`PYTHONPATH=. $(PYMN) --version`\" $< -o $@
51

    
52
install: $(MNEXEC) $(MANPAGES)
53
	install $(MNEXEC) $(BINDIR)
54
	install $(MANPAGES) $(MANDIR)
55
	python setup.py install
56

    
57
develop: $(MNEXEC) $(MANPAGES)
58
# 	Perhaps we should link these as well
59
	install $(MNEXEC) $(BINDIR)
60
	install $(MANPAGES) $(MANDIR)
61
	python setup.py develop
62

    
63
man: $(MANPAGES)
64

    
65
mn.1: $(MN)
66
	PYTHONPATH=. help2man -N -n "create a Mininet network." \
67
	--no-discard-stderr "$(PYMN)" -o $@
68

    
69
mnexec.1: mnexec
70
	help2man -N -n "execution utility for Mininet." \
71
	-h "-h" -v "-v" --no-discard-stderr ./$< -o $@
72

    
73
.PHONY: doc
74

    
75
doc: man
76
	doxygen doc/doxygen.cfg
77
	make -C doc/latex