Statistics
| Branch: | Tag: | Revision:

mininet / Makefile @ db45b7c6

History | View | Annotate | Download (1.57 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
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
PLFMT = --msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}'
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 $(PLFMT) --rcfile=.pylint $(PYSRC)
28
	pep8 --repeat --ignore=$(P8IGN) $(PYSRC)
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
mnexec: mnexec.c $(MN) mininet/net.py
41
	cc $(CFLAGS) $(LDFLAGS) -DVERSION=\"`PYTHONPATH=. $(MN) --version`\" $< -o $@
42

    
43
install: $(MNEXEC) $(MANPAGES)
44
	install $(MNEXEC) $(BINDIR)
45
	install $(MANPAGES) $(MANDIR)
46
	python setup.py install
47

    
48
develop: $(MNEXEC) $(MANPAGES)
49
	# Perhaps we should link these as well
50
	install $(MNEXEC) $(BINDIR)
51
	install $(MANPAGES) $(MANDIR)
52
	python setup.py develop
53

    
54
man: $(MANPAGES)
55

    
56
mn.1: $(MN)
57
	PYTHONPATH=. help2man -N -n "create a Mininet network." \
58
	--no-discard-stderr $< -o $@
59

    
60
mnexec.1: mnexec
61
	help2man -N -n "execution utility for Mininet." \
62
	-h "-h" -v "-v" --no-discard-stderr ./$< -o $@
63

    
64
.PHONY: doc
65

    
66
doc: man
67
	doxygen doc/doxygen.cfg
68
	make -C doc/latex