forked from opennetworkinglab/onos-p4-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (44 loc) · 1.46 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
55
56
57
ONOS_VERSION = 2.1.0
ONOS_MD5 = 6ca21242cf837a726cfbcc637107026b
ONOS_URL = http://repo1.maven.org/maven2/org/onosproject/onos-releases/$(ONOS_VERSION)/onos-$(ONOS_VERSION).tar.gz
ONOS_TAR_PATH = ~/onos.tar.gz
APP_OAR = app/target/srv6-tutorial-1.0-SNAPSHOT.oar
p4:
cd p4src && make build
onos-run:
$(info ************ STARTING ONOS ************)
cd ~ && ./start_onos.sh
onos-cli:
onos
topo:
$(info ************ STARTING MININET TOPOLOGY ************)
sudo -E python mininet/topo.py --onos-ip ${OCI}
netcfg:
$(info ************ PUSHING NETCFG TO ONOS ************)
onos-netcfg ${OCI} netcfg.json
app-build: p4
$(info ************ BUILDING ONOS APP ************)
cd app && mvn clean package
$(APP_OAR):
$(error Missing app binary, run 'make app-build' first)
app-reload: $(APP_OAR)
$(info ************ RELOADING ONOS APP ************)
onos-app ${OCI} reinstall! app/target/srv6-tutorial-1.0-SNAPSHOT.oar
test-all:
$(info ************ RUNNING ALL PTF TESTS ************)
cd ptf && make all
reset:
-cd ~ && ./kill_onos.sh
-cd p4src && make clean
-cd ptf && make clean
-sudo rm -rf app/target
-sudo mn -c
-sudo rm -rf /tmp/bmv2-*
$(ONOS_TAR_PATH):
touch $(ONOS_TAR_PATH)
LOCAL_ONOS_MD5 = $(shell md5sum $(ONOS_TAR_PATH) | awk '{print $$1}')
onos-version-check: $(ONOS_TAR_PATH)
@if [ $(LOCAL_ONOS_MD5) = $(ONOS_MD5) ]; then echo "ONOS is already up to date"; exit 1; fi
onos-upgrade: onos-version-check
-rm -f $(ONOS_TAR_PATH)
curl $(ONOS_URL) -o $(ONOS_TAR_PATH)