blob: 25eb3fcafb4cf9ae202a02f1a64bf369178063a5 [file] [log] [blame]
Joey Armstrong73d35792022-11-25 08:46:46 -05001# -*- makefile -*-
2# -----------------------------------------------------------------------
3# Copyright 2017-2022 Open Networking Foundation (ONF) and the ONF Contributors
Matteo Scandolo4747d292019-08-05 11:50:18 -07004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Joey Armstrong73d35792022-11-25 08:46:46 -050016# -----------------------------------------------------------------------
Matteo Scandolo4747d292019-08-05 11:50:18 -070017
Joey Armstrong73d35792022-11-25 08:46:46 -050018.DEFAULT_GOAL := help
19MAKECMDGOALS ?= help
20
21TOP ?= .
22MAKEDIR ?= $(TOP)/makefiles
23
24##--------------------##
25##---] INCLUDES [---##
26##--------------------##
27help-targets := help-all help HELP
28$(if $(filter $(help-targets),$(MAKECMDGOALS))\
29 ,$(eval include $(MAKEDIR)/help.mk))
30
31##-------------------##
32##---] GLOBALS [---##
33##-------------------##
34SHELL = bash -e -o pipefail
35VERSION ?= $(shell cat ./VERSION)
Matteo Scandolo84f7d482019-08-08 19:00:47 -070036DIFF ?= $(git diff --shortstat 2> /dev/null | tail -n1)
Zdravko Bozakov2da76342019-10-21 09:47:35 +020037GIT_STATUS ?= $(shell [ -z "$DIFF" ] && echo "Dirty" || echo "Clean")
Matteo Scandolo4747d292019-08-05 11:50:18 -070038
Joey Armstrong73d35792022-11-25 08:46:46 -050039## Docker related -- are these ${shell vars} or $(make macros) ?
Matteo Scandolo4747d292019-08-05 11:50:18 -070040DOCKER_TAG ?= ${VERSION}
Andrea Campanellac5b106c2022-01-19 19:06:46 +010041DOCKER_REPOSITORY ?=
42DOCKER_REGISTRY ?=
43DOCKER_RUN_ARGS ?=
Andrea Campanellad683d162020-10-13 16:40:27 +020044DOCKER_PORTS ?= -p 50070:50070 -p 50060:50060 -p 50071:50071 -p 50072:50072 -p 50073:50073 -p 50074:50074 -p 50075:50075
Andrea Campanella64dffd52019-12-17 17:29:57 -080045TYPE ?= minimal
Zdravko Bozakov2da76342019-10-21 09:47:35 +020046
Kent Hagerman60d62302020-03-10 17:02:36 -040047# tool containers
Matteo Scandolo34a9ea32020-11-19 17:40:49 -080048VOLTHA_TOOLS_VERSION ?= 2.3.1
Zdravko Bozakov2da76342019-10-21 09:47:35 +020049
Kent Hagerman60d62302020-03-10 17:02:36 -040050GO = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app $(shell test -t 0 && echo "-it") -v gocache:/.cache -v gocache-${VOLTHA_TOOLS_VERSION}:/go/pkg voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-golang go
Joey Armstrong73d35792022-11-25 08:46:46 -050051GO_SH = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app $(shell test -t 0 && echo "-it") -v gocache:/.cache -v gocache-${VOLTHA_TOOLS_VERSION}:/go/pkg voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-golang sh -c '# fix-editor-colorization-quote(')
Kent Hagerman60d62302020-03-10 17:02:36 -040052GO_JUNIT_REPORT = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app -i voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-go-junit-report go-junit-report
Matteo Scandolo34a9ea32020-11-19 17:40:49 -080053GOCOVER_COBERTURA = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app/src/github.com/opencord/bbsim -i voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-gocover-cobertura gocover-cobertura
Matteo Scandolo90d08f62020-10-29 12:06:55 -070054GOLANGCI_LINT = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app $(shell test -t 0 && echo "-it") -v gocache:/.cache -v gocache-${VOLTHA_TOOLS_VERSION}:/go/pkg voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-golangci-lint golangci-lint
Kent Hagerman60d62302020-03-10 17:02:36 -040055HADOLINT = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app $(shell test -t 0 && echo "-it") voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-hadolint hadolint
56PROTOC = docker run --rm --user $$(id -u):$$(id -g) -v ${CURDIR}:/app $(shell test -t 0 && echo "-it") -v gocache-${VOLTHA_TOOLS_VERSION}:/go/pkg voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}-protoc protoc
57
Joey Armstrong73d35792022-11-25 08:46:46 -050058## use local vars to shorten paths
59bbsim-tag = ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}bbsim:${DOCKER_TAG}
60
Matteo Scandolo4747d292019-08-05 11:50:18 -070061# Public targets
Matteo Scandolo4747d292019-08-05 11:50:18 -070062all: help
63
hkouser24361d42020-12-14 19:21:47 +053064protos: api/bbsim/bbsim.pb.go api/bbsim/bbsim.pb.gw.go api/legacy/bbsim.pb.go api/legacy/bbsim.pb.gw.go api/bbsim/bbsim_dmi.pb.go # @HELP Build proto files
Matteo Scandolo01d41ce2019-10-28 15:42:47 -070065
Matteo Scandolo6866b8c2019-10-28 16:15:24 -070066.PHONY: build
Kent Hagerman60d62302020-03-10 17:02:36 -040067build: protos build-bbsim build-bbsimctl build-bbr
68
69## lint and unit tests
70
71lint-dockerfile:
72 @echo "Running Dockerfile lint check..."
73 @${HADOLINT} $$(find ./build -name "Dockerfile*")
74 @echo "Dockerfile lint check OK"
75
76lint-mod:
77 @echo "Running dependency check..."
78 @${GO} mod verify
79 @echo "Dependency check OK. Running vendor check..."
80 @git status > /dev/null
81 @git diff-index --quiet HEAD -- go.mod go.sum vendor || (echo "ERROR: Staged or modified files must be committed before running this test" && git status -- go.mod go.sum vendor && exit 1)
82 @[[ `git ls-files --exclude-standard --others go.mod go.sum vendor` == "" ]] || (echo "ERROR: Untracked files must be cleaned up before running this test" && git status -- go.mod go.sum vendor && exit 1)
83 ${GO} mod tidy
84 ${GO} mod vendor
85 @git status > /dev/null
86 @git diff-index --quiet HEAD -- go.mod go.sum vendor || (echo "ERROR: Modified files detected after running go mod tidy / go mod vendor" && git status -- go.mod go.sum vendor && git checkout -- go.mod go.sum vendor && exit 1)
87 @[[ `git ls-files --exclude-standard --others go.mod go.sum vendor` == "" ]] || (echo "ERROR: Untracked files detected after running go mod tidy / go mod vendor" && git status -- go.mod go.sum vendor && git checkout -- go.mod go.sum vendor && exit 1)
88 @echo "Vendor check OK."
89
90lint: lint-mod lint-dockerfile
91
Matteo Scandolo90d08f62020-10-29 12:06:55 -070092sca:
Joey Armstrong73d35792022-11-25 08:46:46 -050093 @$(RM) -r ./sca-report
Kent Hagerman60d62302020-03-10 17:02:36 -040094 @mkdir -p ./sca-report
95 @echo "Running static code analysis..."
Matteo Scandolo96f89192021-03-12 13:17:26 -080096 @${GOLANGCI_LINT} run -vv --deadline=6m --out-format junit-xml ./... | tee ./sca-report/sca-report.xml
Kent Hagerman60d62302020-03-10 17:02:36 -040097 @echo ""
98 @echo "Static code analysis OK"
Matteo Scandolo4747d292019-08-05 11:50:18 -070099
Matteo Scandolo0e9fabf2020-09-30 17:19:27 -0700100test: docs-lint test-unit test-bbr
Matteo Scandolo569e7172019-12-20 11:51:51 -0800101
Matteo Scandolocedde462021-03-09 17:37:16 -0800102test-unit: clean local-omci-lib-go # @HELP Execute unit tests
Matteo Scandolo90d08f62020-10-29 12:06:55 -0700103 @echo "Running unit tests..."
Kent Hagerman60d62302020-03-10 17:02:36 -0400104 @mkdir -p ./tests/results
Matteo Scandolo4b077aa2021-02-16 17:33:37 -0800105 @${GO} test -mod=vendor -bench=. -v -coverprofile ./tests/results/go-test-coverage.out -covermode count ./... 2>&1 | tee ./tests/results/go-test-results.out ;\
Kent Hagerman60d62302020-03-10 17:02:36 -0400106 RETURN=$$? ;\
107 ${GO_JUNIT_REPORT} < ./tests/results/go-test-results.out > ./tests/results/go-test-results.xml ;\
108 ${GOCOVER_COBERTURA} < ./tests/results/go-test-coverage.out > ./tests/results/go-test-coverage.xml ;\
109 exit $$RETURN
Matteo Scandolo4747d292019-08-05 11:50:18 -0700110
Kent Hagerman60d62302020-03-10 17:02:36 -0400111test-bbr: release-bbr docker-build # @HELP Validate that BBSim and BBR are working together
Joey Armstrong73d35792022-11-25 08:46:46 -0500112 DOCKER_RUN_ARGS="-pon 2 -onu 2" $(MAKE) docker-run
Matteo Scandolo569e7172019-12-20 11:51:51 -0800113 sleep 5
Matteo Scandoloc11074d2020-09-14 14:59:24 -0700114 ./$(RELEASE_DIR)/$(RELEASE_BBR_NAME)-linux-amd64 -pon 2 -onu 2 -logfile tmp.logs
Joey Armstrong73d35792022-11-25 08:46:46 -0500115 docker $(RM) -f bbsim
Matteo Scandolo569e7172019-12-20 11:51:51 -0800116
Kent Hagerman60d62302020-03-10 17:02:36 -0400117mod-update: # @HELP Download the dependencies to the vendor folder
118 ${GO} mod tidy
119 ${GO} mod vendor
Matteo Scandolo38305492019-10-11 11:36:00 -0700120
Matteo Scandolocedde462021-03-09 17:37:16 -0800121docker-build: local-omci-lib-go local-protos# @HELP Build the BBSim docker container (contains BBSimCtl too)
Kent Hagerman60d62302020-03-10 17:02:36 -0400122 docker build \
Joey Armstrong73d35792022-11-25 08:46:46 -0500123 -t "$(bbsim-tag)" \
Kent Hagerman60d62302020-03-10 17:02:36 -0400124 -f build/package/Dockerfile .
Matteo Scandolo4747d292019-08-05 11:50:18 -0700125
Matteo Scandolo01d41ce2019-10-28 15:42:47 -0700126docker-push: # @HELP Push the docker container to a registry
Joey Armstrong73d35792022-11-25 08:46:46 -0500127 docker push "$(bbsim-tag)"
Andrea Campanella64dffd52019-12-17 17:29:57 -0800128docker-kind-load:
129 @if [ "`kind get clusters | grep voltha-$(TYPE)`" = '' ]; then echo "no voltha-$(TYPE) cluster found" && exit 1; fi
Joey Armstrong73d35792022-11-25 08:46:46 -0500130 kind load docker-image "$(bbsim-tag)" --name=voltha-$(TYPE) --nodes $(shell kubectl get nodes --template='{{range .items}}{{.metadata.name}},{{end}}' | sed 's/,$$//')
131
132## -----------------------------------------------------------------------
133## docker-run
134## -----------------------------------------------------------------------
135docker-run-cmd = docker run
136docker-run-cmd += ${DOCKER_PORTS}
137docker-run-cmd += --privileged
138docker-run-cmd += --rm
139docker-run-cmd += --name bbsim
140docker-run-cmd += "$(bbsim-tag)" /app/bbsim
141docker-run-cmd += ${DOCKER_RUN_ARGS}
Andrea Campanella64dffd52019-12-17 17:29:57 -0800142
Matteo Scandoloe383d5d2019-10-25 14:47:27 -0700143docker-run: # @HELP Runs the container locally (available options: DOCKER_RUN_ARGS="-pon 2 -onu 2" make docker-run)
Joey Armstrong73d35792022-11-25 08:46:46 -0500144 docker ps
145 $(docker-run-cmd) --detach
Matteo Scandolo4b3fc7e2019-09-17 16:49:54 -0700146
Matteo Scandoloe383d5d2019-10-25 14:47:27 -0700147docker-run-dev: # @HELP Runs the container locally (intended for development purposes, not in detached mode)
Joey Armstrong73d35792022-11-25 08:46:46 -0500148 $(docker-run-cmd)
Matteo Scandoloe383d5d2019-10-25 14:47:27 -0700149
Joey Armstrong73d35792022-11-25 08:46:46 -0500150## -----------------------------------------------------------------------
151## docker-run
152## -----------------------------------------------------------------------
Zack Williams4b0ef4d2019-12-18 14:25:20 -0700153.PHONY: docs docs-lint
Zdravko Bozakov2da76342019-10-21 09:47:35 +0200154docs: swagger # @HELP Generate docs and opens them in the browser
Joey Armstrong73d35792022-11-25 08:46:46 -0500155 $(MAKE) -C docs html
Zdravko Bozakov2da76342019-10-21 09:47:35 +0200156 @echo -e "\nBBSim documentation generated in file://${PWD}/docs/build/html/index.html"
Matteo Scandolo40e067f2019-10-16 16:59:41 -0700157
Zack Williams4b0ef4d2019-12-18 14:25:20 -0700158docs-lint:
Joey Armstrong73d35792022-11-25 08:46:46 -0500159 $(MAKE) -C docs lint
Zack Williams4b0ef4d2019-12-18 14:25:20 -0700160
Matteo Scandolo8dea3992019-10-22 10:54:25 -0700161# Release related items
162# Generates binaries in $RELEASE_DIR with name $RELEASE_NAME-$RELEASE_OS_ARCH
163# Inspired by: https://github.com/kubernetes/minikube/releases
164RELEASE_DIR ?= release
165RELEASE_OS_ARCH ?= linux-amd64 linux-arm64 windows-amd64 darwin-amd64
166
Kent Hagerman60d62302020-03-10 17:02:36 -0400167RELEASE_BBR_NAME ?= bbr
168RELEASE_BBSIM_NAME ?= bbsim
169RELEASE_BBSIMCTL_NAME ?= bbsimctl
Matteo Scandolo8dea3992019-10-22 10:54:25 -0700170
Matteo Scandolo90d08f62020-10-29 12:06:55 -0700171release-bbr:
Kent Hagerman60d62302020-03-10 17:02:36 -0400172 @echo "$(RELEASE_BBR_NAME)-linux-amd64"
Matteo Scandolo90d08f62020-10-29 12:06:55 -0700173 @${GO} build -mod vendor \
Kent Hagerman60d62302020-03-10 17:02:36 -0400174 -ldflags "-w -X main.buildTime=$(shell date +%Y/%m/%d-%H:%M:%S) \
175 -X main.commitHash=$(shell git log --pretty=format:%H -n 1) \
176 -X main.gitStatus=${GIT_STATUS} \
177 -X main.version=${VERSION}" \
178 -o "$(RELEASE_DIR)/$(RELEASE_BBR_NAME)-linux-amd64" ./cmd/bbr
Matteo Scandolo8dea3992019-10-22 10:54:25 -0700179
Matteo Scandolo90d08f62020-10-29 12:06:55 -0700180release-bbsim:
Kent Hagerman60d62302020-03-10 17:02:36 -0400181 @echo "$(RELEASE_BBSIM_NAME)-linux-amd64"
Matteo Scandolo90d08f62020-10-29 12:06:55 -0700182 @${GO} build -mod vendor \
Kent Hagerman60d62302020-03-10 17:02:36 -0400183 -ldflags "-w -X main.buildTime=$(shell date +%Y/%m/%d-%H:%M:%S) \
184 -X main.commitHash=$(shell git log --pretty=format:%H -n 1) \
185 -X main.gitStatus=${GIT_STATUS} \
186 -X main.version=${VERSION}" \
187 -o "$(RELEASE_DIR)/$(RELEASE_BBSIM_NAME)-linux-amd64" ./cmd/bbsim
Matteo Scandolo8dea3992019-10-22 10:54:25 -0700188
Kent Hagerman60d62302020-03-10 17:02:36 -0400189release-bbsimctl:
190 @${GO_SH} set -eo pipefail; \
191 for os_arch in ${RELEASE_OS_ARCH}; do \
192 echo "$(RELEASE_BBSIMCTL_NAME)-$$os_arch"; \
193 GOOS="$${os_arch%-*}" GOARCH="$${os_arch#*-}" go build -mod vendor \
194 -ldflags "-w -X github.com/opencord/bbsim/internal/bbsimctl/config.BuildTime=$(shell date +%Y/%m/%d-%H:%M:%S) \
195 -X github.com/opencord/bbsim/internal/bbsimctl/config.CommitHash=$(shell git log --pretty=format:%H -n 1) \
196 -X github.com/opencord/bbsim/internal/bbsimctl/config.GitStatus=${GIT_STATUS} \
197 -X github.com/opencord/bbsim/internal/bbsimctl/config.Version=${VERSION}" \
198 -o "$(RELEASE_DIR)/$(RELEASE_BBSIMCTL_NAME)-$$os_arch" ./cmd/bbsimctl; \
Joey Armstrong73d35792022-11-25 08:46:46 -0500199 done'# fix-editor-colorization-quote(')
Kent Hagerman60d62302020-03-10 17:02:36 -0400200
201.PHONY: release release-bbr release-bbsim release-bbsimctl
202release: release-bbr release-bbsim release-bbsimctl # @HELP Creates release ready bynaries for BBSimctl and BBR artifacts
Matteo Scandolo8dea3992019-10-22 10:54:25 -0700203
Joey Armstrong73d35792022-11-25 08:46:46 -0500204swagger-deps += docs/swagger/bbsim/bbsim.swagger.json
205swagger-deps += docs/swagger/leagacy/bbsim.swagger.json
206.PHONY: $(swagger-deps)
207swagger: $(swagger-deps) # @HELP Generate swagger documentation for BBSim API
Matteo Scandolo4747d292019-08-05 11:50:18 -0700208
Joey Armstrong73d35792022-11-25 08:46:46 -0500209## -----------------------------------------------------------------------
Matteo Scandoloca08fc72019-12-04 14:17:39 -0800210## Local Development Helpers
Joey Armstrong73d35792022-11-25 08:46:46 -0500211## -----------------------------------------------------------------------
Matteo Scandolocedde462021-03-09 17:37:16 -0800212local-omci-lib-go:
213ifdef LOCAL_OMCI_LIB_GO
214 mkdir -p vendor/github.com/opencord/omci-lib-go
215 cp -r ${LOCAL_OMCI_LIB_GO}/* vendor/github.com/opencord/omci-lib-go
Matteo Scandoloca08fc72019-12-04 14:17:39 -0800216endif
Matteo Scandolo4747d292019-08-05 11:50:18 -0700217
Matteo Scandolo4f4ac792020-10-01 16:33:21 -0700218local-protos: ## Copies a local version of the voltha-protos dependency into the vendor directory
219ifdef LOCAL_PROTOS
Joey Armstrong73d35792022-11-25 08:46:46 -0500220 $(RM) -r vendor/github.com/opencord/voltha-protos/v5/go
David K. Bainbridgec415efe2021-08-19 13:05:21 +0000221 mkdir -p vendor/github.com/opencord/voltha-protos/v5/go
222 cp -r ${LOCAL_PROTOS}/go/* vendor/github.com/opencord/voltha-protos/v5/go
Joey Armstrong73d35792022-11-25 08:46:46 -0500223 $(RM) -r vendor/github.com/opencord/voltha-protos/v5/go/vendor
Matteo Scandolo4f4ac792020-10-01 16:33:21 -0700224endif
225
Matteo Scandolo4747d292019-08-05 11:50:18 -0700226# Internals
Matteo Scandolo8dea3992019-10-22 10:54:25 -0700227
Matteo Scandolo3de9de02019-11-14 13:40:03 -0800228clean:
Joey Armstrong73d35792022-11-25 08:46:46 -0500229 @$(RM) -f bbsim
230 @$(RM) -f bbsimctl
231 @$(RM) -f bbr
232 @$(RM) -r tools/bin
233 @$(RM) -r release/*
Matteo Scandolo3de9de02019-11-14 13:40:03 -0800234
Matteo Scandolocedde462021-03-09 17:37:16 -0800235build-bbr: local-omci-lib-go local-protos
Kent Hagerman60d62302020-03-10 17:02:36 -0400236 @go build -mod vendor \
237 -ldflags "-w -X main.buildTime=$(shell date +%Y/%m/%d-%H:%M:%S) \
238 -X main.commitHash=$(shell git log --pretty=format:%H -n 1) \
239 -X main.gitStatus=${GIT_STATUS} \
240 -X main.version=${VERSION}" \
241 ./cmd/bbr
Matteo Scandolo40e067f2019-10-16 16:59:41 -0700242
Matteo Scandolo8df63df2019-09-12 10:34:32 -0700243build-bbsim:
Kent Hagerman60d62302020-03-10 17:02:36 -0400244 @go build -mod vendor \
245 -ldflags "-w -X main.buildTime=$(shell date +%Y/%m/%d-%H:%M:%S) \
246 -X main.commitHash=$(shell git log --pretty=format:%H -n 1) \
247 -X main.gitStatus=${GIT_STATUS} \
248 -X main.version=${VERSION}" \
249 ./cmd/bbsim
Matteo Scandolo8df63df2019-09-12 10:34:32 -0700250
251build-bbsimctl:
Kent Hagerman60d62302020-03-10 17:02:36 -0400252 @go build -mod vendor \
253 -ldflags "-w -X github.com/opencord/bbsim/internal/bbsimctl/config.BuildTime=$(shell date +%Y/%m/%d-%H:%M:%S) \
254 -X github.com/opencord/bbsim/internal/bbsimctl/config.CommitHash=$(shell git log --pretty=format:%H -n 1) \
255 -X github.com/opencord/bbsim/internal/bbsimctl/config.GitStatus=${GIT_STATUS} \
256 -X github.com/opencord/bbsim/internal/bbsimctl/config.Version=${VERSION}" \
257 ./cmd/bbsimctl
Matteo Scandolo4747d292019-08-05 11:50:18 -0700258
Kent Hagerman60d62302020-03-10 17:02:36 -0400259setup_tools:
260 @echo "Downloading dependencies..."
David K. Bainbridgec415efe2021-08-19 13:05:21 +0000261 @${GO} mod download github.com/grpc-ecosystem/grpc-gateway github.com/opencord/voltha-protos/v5
Kent Hagerman60d62302020-03-10 17:02:36 -0400262 @echo "Dependencies downloaded OK"
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700263
David K. Bainbridgec415efe2021-08-19 13:05:21 +0000264VOLTHA_PROTOS ?= $(shell ${GO} list -f '{{ .Dir }}' -m github.com/opencord/voltha-protos/v5)
Kent Hagerman60d62302020-03-10 17:02:36 -0400265GOOGLEAPI ?= $(shell ${GO} list -f '{{ .Dir }}' -m github.com/grpc-ecosystem/grpc-gateway)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700266
Joey Armstrong73d35792022-11-25 08:46:46 -0500267.PHONY: api/openolt/openolt.pb.go api/bbsim/bbsim.pb.go api/bbsim/bbsim.pb.gw.go api/legacy/bbsim.pb.go api/legacy/bbsim.pb.gw.go
Kent Hagerman60d62302020-03-10 17:02:36 -0400268api/openolt/openolt.pb.go: api/openolt/openolt.proto setup_tools
269 @echo $@
270 @${PROTOC} -I. \
271 -I${GOOGLEAPI}/third_party/googleapis \
amit.ghoshee17c002021-06-10 12:14:38 +0200272 --go_out=plugins=grpc:./ --go_opt=paths=source_relative \
Kent Hagerman60d62302020-03-10 17:02:36 -0400273 $<
Zdravko Bozakov2da76342019-10-21 09:47:35 +0200274
hkouser24361d42020-12-14 19:21:47 +0530275api/bbsim/bbsim_dmi.pb.go: api/bbsim/bbsim_dmi.proto setup_tools
276 @echo $@
277 @${PROTOC} -I. \
278 -I${GOOGLEAPI}/third_party/googleapis \
amit.ghoshee17c002021-06-10 12:14:38 +0200279 --go_out=plugins=grpc:./ --go_opt=paths=source_relative \
hkouser24361d42020-12-14 19:21:47 +0530280 $<
281
Kent Hagerman60d62302020-03-10 17:02:36 -0400282api/bbsim/bbsim.pb.go api/bbsim/bbsim.pb.gw.go: api/bbsim/bbsim.proto api/bbsim/bbsim.yaml setup_tools
283 @echo $@
284 @${PROTOC} -I. \
285 -I${GOOGLEAPI}/third_party/googleapis \
286 -I${VOLTHA_PROTOS}/protos/ \
amit.ghoshee17c002021-06-10 12:14:38 +0200287 --go_out=plugins=grpc:./ --go_opt=paths=source_relative \
288 --grpc-gateway_out=logtostderr=true,paths=source_relative,grpc_api_configuration=api/bbsim/bbsim.yaml,allow_delete_body=true:./ \
Kent Hagerman60d62302020-03-10 17:02:36 -0400289 $<
Zdravko Bozakov2da76342019-10-21 09:47:35 +0200290
Kent Hagerman60d62302020-03-10 17:02:36 -0400291api/legacy/bbsim.pb.go api/legacy/bbsim.pb.gw.go: api/legacy/bbsim.proto setup_tools
292 @echo $@
293 @${PROTOC} -I. \
294 -I${GOOGLEAPI}/third_party/googleapis/ \
295 -I${GOOGLEAPI}/ \
296 -I${VOLTHA_PROTOS}/protos/ \
297 --go_out=plugins=grpc:./ \
amit.ghoshee17c002021-06-10 12:14:38 +0200298 --grpc-gateway_out=logtostderr=true,paths=source_relative,allow_delete_body=true:./ \
Kent Hagerman60d62302020-03-10 17:02:36 -0400299 $<
300
301docs/swagger/bbsim/bbsim.swagger.json: api/bbsim/bbsim.yaml setup_tools
302 @echo $@
303 @${PROTOC} -I ./api \
304 -I${GOOGLEAPI}/ \
305 -I${VOLTHA_PROTOS}/protos/ \
Zack Williamsd2907e62020-04-03 10:23:02 -0700306 --swagger_out=logtostderr=true,allow_delete_body=true,disable_default_errors=true,grpc_api_configuration=$<:docs/swagger/ \
Kent Hagerman60d62302020-03-10 17:02:36 -0400307 api/bbsim/bbsim.proto
308
309docs/swagger/leagacy/bbsim.swagger.json: api/legacy/bbsim.proto setup_tools
310 @echo $@
311 @${PROTOC} -I ./api \
312 -I${GOOGLEAPI}/ \
313 -I${VOLTHA_PROTOS}/protos/ \
Zack Williamsd2907e62020-04-03 10:23:02 -0700314 --swagger_out=logtostderr=true,allow_delete_body=true,disable_default_errors=true:docs/swagger/ \
Kent Hagerman60d62302020-03-10 17:02:36 -0400315 $<
Joey Armstrong73d35792022-11-25 08:46:46 -0500316
317# [EOF]