Statistics
| Branch: | Tag: | Revision:

mininet / Makefile @ cdbbb5b7

History | View | Annotate | Download (1.76 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
codecheck: $(PYSRC)
24
	-echo "Running code check"
25
	util/versioncheck.py
26
	pyflakes $(PYSRC)
27
	pylint --rcfile=.pylint $(PYSRC)
28
#	Exclude miniedit from pep8 checking for now
29
	pep8 --repeat --ignore=$(P8IGN) `ls $(PYSRC) | grep -v miniedit.py`
30

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

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

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

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

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

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

    
60
man: $(MANPAGES)
61

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

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

    
70
.PHONY: doc
71

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