forked from faucetsdn/faucet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (42 loc) · 1.55 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Copyright 2015 Open Networking Foundation (http://www.opennetworking.org/
# Use is subject to License terms
fileinfo := Ryu Faucet Developers Makefile
author := Shivaram Mysore ([email protected])
## Dependent programs
PYTHON = python
PYREVERSE = pyreverse
YAPF = yapf
PYLINT = pylint
RM := rm
MKDIR := mkdir -p
MV := mv
PROJECT_NAME = ryu_faucet
## Directories
DIST_DIR = dist
SRC_DIR = src
all: clobber sdist uml
uml:
$(MKDIR) $(DIST_DIR)/doc
$(PYREVERSE) -ASmn -o png -p $(PROJECT_NAME) $(SRC_DIR)/ryu_faucet/org/onfsdn/faucet/*py
$(MV) classes*png $(DIST_DIR)/doc
$(MV) packages*png $(DIST_DIR)/doc
sdist:
@echo Building Python package installable via "pip"
$(MKDIR) $(DIST_DIR)
$(PYTHON) setup.py sdist
codefmt:
@echo Run below command manually to inline replace current code with newly formatted code per “pep8” guidelines
@echo $(YAPF) --style pep8 -i \*py
codeerrors:
@echo Finding errors in code now ...
$(PYLINT) $(SRC_DIR)/ryu_faucet/org/onfsdn/faucet/*py > $(DIST_DIR)/error_report.out
@echo Code error report available at $(DIST_DIR)/error_report.out
## list target source: http://stackoverflow.com/questions/4219255/how-do-you-get-the-list-of-targets-in-a-makefile
.PHONY: list
list:
@echo List of all targets in this Makefile:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
clobber:
@echo Removing $(DIST_DIR)
$(RM) -rf $(DIST_DIR)
$(RM) -rf ryu_faucet.egg-info