Zack Williams | 86f8720 | 2018-10-05 10:36:32 -0700 | [diff] [blame] | 1 | # Copyright 2018-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | BBSIM_DEPS = $(wildcard ./*.go) |
| 16 | DOCKERTAG ?= "latest" |
Matteo Scandolo | 88e9189 | 2018-11-06 16:29:19 -0800 | [diff] [blame^] | 17 | REGISTRY ?= "" |
Zack Williams | 86f8720 | 2018-10-05 10:36:32 -0700 | [diff] [blame] | 18 | |
| 19 | .PHONY: dep test clean docker |
| 20 | |
Keita NISHIMOTO | 3b8b9c0 | 2018-10-09 09:40:01 +0900 | [diff] [blame] | 21 | bbsim: protos/openolt.pb.go dep |
Zack Williams | 86f8720 | 2018-10-05 10:36:32 -0700 | [diff] [blame] | 22 | go build -i -v -o $@ |
| 23 | |
Keita NISHIMOTO | 3b8b9c0 | 2018-10-09 09:40:01 +0900 | [diff] [blame] | 24 | dep: protos/openolt.pb.go |
Keita NISHIMOTO | ca4da5f | 2018-10-15 22:48:52 +0900 | [diff] [blame] | 25 | go get -v -d ./... |
Zack Williams | 86f8720 | 2018-10-05 10:36:32 -0700 | [diff] [blame] | 26 | |
Keita NISHIMOTO | 3b8b9c0 | 2018-10-09 09:40:01 +0900 | [diff] [blame] | 27 | protos/openolt.pb.go: openolt.proto |
Zack Williams | 86f8720 | 2018-10-05 10:36:32 -0700 | [diff] [blame] | 28 | @protoc -I . \ |
| 29 | -I${GOPATH}/src \ |
| 30 | -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ |
Keita NISHIMOTO | 3b8b9c0 | 2018-10-09 09:40:01 +0900 | [diff] [blame] | 31 | --go_out=plugins=grpc:protos/ \ |
Keita NISHIMOTO | ca4da5f | 2018-10-15 22:48:52 +0900 | [diff] [blame] | 32 | $< |
Zack Williams | 86f8720 | 2018-10-05 10:36:32 -0700 | [diff] [blame] | 33 | |
| 34 | test: |
Keita NISHIMOTO | ca4da5f | 2018-10-15 22:48:52 +0900 | [diff] [blame] | 35 | go test -v ./... |
| 36 | go test -v ./... -cover |
| 37 | |
| 38 | fmt: |
| 39 | go fmt ./... |
| 40 | |
| 41 | vet: |
| 42 | go vet ./... |
| 43 | |
| 44 | lint: |
| 45 | gometalinter --vendor --exclude ../../golang.org --skip protos --sort path --sort line ./... |
Zack Williams | 86f8720 | 2018-10-05 10:36:32 -0700 | [diff] [blame] | 46 | |
| 47 | clean: |
Keita NISHIMOTO | ca4da5f | 2018-10-15 22:48:52 +0900 | [diff] [blame] | 48 | rm -f bbsim openolt/openolt.pb.go |
Zack Williams | 86f8720 | 2018-10-05 10:36:32 -0700 | [diff] [blame] | 49 | |
| 50 | docker: |
Matteo Scandolo | 88e9189 | 2018-11-06 16:29:19 -0800 | [diff] [blame^] | 51 | docker build -t ${REGISTRY}voltha/voltha-bbsim:${DOCKERTAG} . |