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" |
| 17 | |
| 18 | .PHONY: dep test clean docker |
| 19 | |
| 20 | bbsim: $(BBSIM_DEPS) openolt/openolt.pb.go dep |
| 21 | go build -i -v -o $@ |
| 22 | |
| 23 | dep: openolt/openolt.pb.go |
| 24 | @go get -v -d ./... |
| 25 | |
| 26 | openolt/openolt.pb.go: openolt.proto |
| 27 | @protoc -I . \ |
| 28 | -I${GOPATH}/src \ |
| 29 | -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ |
| 30 | --go_out=plugins=grpc:openolt \ |
| 31 | $< |
| 32 | |
| 33 | test: |
| 34 | @go test -v ./... |
| 35 | @go test -v ./... -cover |
| 36 | |
| 37 | clean: |
| 38 | @rm bbsim openolt/openolt.pb.go |
| 39 | |
| 40 | docker: |
| 41 | @docker build -t voltha/voltha-bbsim:${DOCKERTAG} . |
| 42 | |