blob: 651ea0b5f81f313d045e100857512064dfd79b9d [file] [log] [blame]
Joey Armstrong73d35792022-11-25 08:46:46 -05001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstrong2c039362024-02-04 18:51:52 -05003# Copyright 2017-2024 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 Armstrong36c9bcd2023-04-05 19:05:56 -040018$(if $(DEBUG),$(warning ENTER))
19
Joey Armstrong73d35792022-11-25 08:46:46 -050020.DEFAULT_GOAL := help
21MAKECMDGOALS ?= help
22
Joey Armstrong96bcf1b2023-06-27 14:49:40 -040023##-------------------##
24##---] GLOBALS [---##
25##-------------------##
26TOP ?=$(strip \
27 $(dir \
28 $(abspath $(lastword $(MAKEFILE_LIST)))\
29 )\
30)
Joey Armstrong73d35792022-11-25 08:46:46 -050031
32##--------------------##
33##---] INCLUDES [---##
34##--------------------##
Joey Armstrong96bcf1b2023-06-27 14:49:40 -040035include $(TOP)/config.mk
36include $(TOP)/makefiles/include.mk
37include $(ONF_MAKEDIR)/release/include.mk
Joey Armstrong36c9bcd2023-04-05 19:05:56 -040038
39##--------------------##
40##---] INCLUDES [---##
41##--------------------##
Joey Armstrong73d35792022-11-25 08:46:46 -050042help-targets := help-all help HELP
43$(if $(filter $(help-targets),$(MAKECMDGOALS))\
44 ,$(eval include $(MAKEDIR)/help.mk))
45
46##-------------------##
47##---] GLOBALS [---##
48##-------------------##
Joey Armstrong73d35792022-11-25 08:46:46 -050049VERSION ?= $(shell cat ./VERSION)
Matteo Scandolo84f7d482019-08-08 19:00:47 -070050DIFF ?= $(git diff --shortstat 2> /dev/null | tail -n1)
Zdravko Bozakov2da76342019-10-21 09:47:35 +020051GIT_STATUS ?= $(shell [ -z "$DIFF" ] && echo "Dirty" || echo "Clean")
Matteo Scandolo4747d292019-08-05 11:50:18 -070052
Joey Armstrong36c9bcd2023-04-05 19:05:56 -040053include $(MAKEDIR)/tools.mk # Command macros for DOCKER_*, GO_*
Kent Hagerman60d62302020-03-10 17:02:36 -040054
Joey Armstrong73d35792022-11-25 08:46:46 -050055## use local vars to shorten paths
56bbsim-tag = ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}bbsim:${DOCKER_TAG}
57
Joey Armstrong5c610772023-01-23 16:03:32 -050058## -----------------------------------------------------------------------
59## -----------------------------------------------------------------------
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
Joey Armstrong36c9bcd2023-04-05 19:05:56 -040066## -----------------------------------------------------------------------
67## Intent: Build tools for use on localhost
68## -----------------------------------------------------------------------
69build-target-deps += build-bbsim
70build-target-deps += build-bbsimctl
71build-target-deps += build-bbr
72
73.PHONY: build $(build-target-deps)
74build: protos $(build-target-deps)
75
76## -----------------------------------------------------------------------
77## Intent: Cross-compile binaries for release
78## -----------------------------------------------------------------------
79release-target-deps += release-bbr
80release-target-deps += release-bbsim
81release-target-deps += release-bbsimctl
82
83.PHONY: release $(release-target-deps)
84release: $(release-target-deps)
Kent Hagerman60d62302020-03-10 17:02:36 -040085
86## lint and unit tests
87
Joey Armstrong36c9bcd2023-04-05 19:05:56 -040088## -----------------------------------------------------------------------
89## -----------------------------------------------------------------------
Kent Hagerman60d62302020-03-10 17:02:36 -040090lint-dockerfile:
91 @echo "Running Dockerfile lint check..."
92 @${HADOLINT} $$(find ./build -name "Dockerfile*")
93 @echo "Dockerfile lint check OK"
94
Joey Armstrong36c9bcd2023-04-05 19:05:56 -040095## -----------------------------------------------------------------------
96## -----------------------------------------------------------------------
Kent Hagerman60d62302020-03-10 17:02:36 -040097lint-mod:
Joey Armstrong96bcf1b2023-06-27 14:49:40 -040098 $(call banner-enter,Target $@)
Kent Hagerman60d62302020-03-10 17:02:36 -040099 @echo "Running dependency check..."
100 @${GO} mod verify
101 @echo "Dependency check OK. Running vendor check..."
102 @git status > /dev/null
103 @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)
104 @[[ `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)
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400105
106 $(HIDE)$(MAKE) --no-print-directory mod-update
107
Kent Hagerman60d62302020-03-10 17:02:36 -0400108 @git status > /dev/null
109 @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)
110 @[[ `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)
111 @echo "Vendor check OK."
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400112 $(call banner-enter,Target $@)
Kent Hagerman60d62302020-03-10 17:02:36 -0400113
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400114## -----------------------------------------------------------------------
115## -----------------------------------------------------------------------
Kent Hagerman60d62302020-03-10 17:02:36 -0400116lint: lint-mod lint-dockerfile
117
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400118## -----------------------------------------------------------------------
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400119## Intent: Generate a static code analysis report
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400120## -----------------------------------------------------------------------
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400121sca-report-dir := ./sca-report
122sca-report-xml := $(sca-report-dir)/sca-report.xml
Matteo Scandolo90d08f62020-10-29 12:06:55 -0700123sca:
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400124 $(call begin-enter,Target $@)
125 @$(RM) -r $(sca-report-dir)
126 @mkdir -p $(sca-report-dir)
Kent Hagerman60d62302020-03-10 17:02:36 -0400127 @echo "Running static code analysis..."
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400128 @${GOLANGCI_LINT} run -vv --deadline=6m --out-format junit-xml ./... \
129 | tee ./sca-report/sca-report.xml
Kent Hagerman60d62302020-03-10 17:02:36 -0400130 @echo ""
131 @echo "Static code analysis OK"
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400132 $(call begin-leave,Target $@)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700133
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400134## -----------------------------------------------------------------------
135## -----------------------------------------------------------------------
Matteo Scandolo0e9fabf2020-09-30 17:19:27 -0700136test: docs-lint test-unit test-bbr
Matteo Scandolo569e7172019-12-20 11:51:51 -0800137
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400138## -----------------------------------------------------------------------
139## -----------------------------------------------------------------------
Joey Armstrongf99712c2023-06-01 17:04:38 -0400140coverage-out := ./tests/results/go-test-coverage.out
141coverage-xml := ./tests/results/go-test-coverage.xml
142
143results-out := ./tests/results/go-test-results.out
144results-xml := ./tests/results/go-test-results.xml
145
Matteo Scandolocedde462021-03-09 17:37:16 -0800146test-unit: clean local-omci-lib-go # @HELP Execute unit tests
Joey Armstrong84b5bb92023-06-15 17:08:45 -0400147
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400148 $(call banner-enter,Target $@)
Joey Armstrong84b5bb92023-06-15 17:08:45 -0400149
150 @mkdir -p $(dir $(results-out))
Joey Armstrong84b5bb92023-06-15 17:08:45 -0400151
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400152 $(call banner,Running unit tests...)
153
154 $(if $(LOCAL_FIX_PERMS),\
155 chmod o+w $(dir $(results-out) $(results-out)))
Joey Armstrong84b5bb92023-06-15 17:08:45 -0400156 set -euo pipefail \
157 && ${GO} test -mod=vendor -bench=. -v \
Joey Armstrongf99712c2023-06-01 17:04:38 -0400158 -coverprofile $(coverage-out) \
159 -covermode count ./... \
Joey Armstrong84b5bb92023-06-15 17:08:45 -0400160 2>&1 | tee "$(results-out)"
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400161 $(if $(LOCAL_FIX_PERMS),\
162 chmod o-w $(dir $(results-out) $(results-out)))
Joey Armstrong84b5bb92023-06-15 17:08:45 -0400163
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400164 $(call banner,Coverage report: junit)
165 $(if $(LOCAL_FIX_PERMS),\
166 chmod o+w $(dir $(results-xml) $(results-xml)))
Joey Armstrong84b5bb92023-06-15 17:08:45 -0400167 ${GO_JUNIT_REPORT} < $(results-out) > $(results-xml)
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400168 $(if $(LOCAL_FIX_PERMS),\
169 chmod o-w $(dir $(results-xml) $(results-xml)))
Joey Armstrong84b5bb92023-06-15 17:08:45 -0400170
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400171 $(call banner,Coverage report: Cobertura)
172 $(if $(LOCAL_FIX_PERMS),\
173 chmod o+w $(dir $(results-xml) $(coverage-xml)))
Joey Armstrong84b5bb92023-06-15 17:08:45 -0400174 ${GOCOVER_COBERTURA} < $(coverage-out) > $(coverage-xml)
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400175 $(if $(LOCAL_FIX_PERMS),\
176 chmod o-w $(dir $(results-xml) $(coverage-xml)))
177
178 $(call banner,Coverage report directory perms:)
Joey Armstrong84b5bb92023-06-15 17:08:45 -0400179
180 @echo
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400181 @/bin/ls -ld tests tests/results
Joey Armstrong84b5bb92023-06-15 17:08:45 -0400182
183 @echo
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400184 @find $(dir $(results-out)) -print0 | xargs -0 ls -l
185 # chown -R $$(id -u):$$(id -g) $(dir $(results-xml)
186
187 $(call banner,Locally modified files: git status)
Joey Armstrong84b5bb92023-06-15 17:08:45 -0400188 git status
189
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400190 $(call banner-leave,Target $@)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700191
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400192## -----------------------------------------------------------------------
193## -----------------------------------------------------------------------
Kent Hagerman60d62302020-03-10 17:02:36 -0400194test-bbr: release-bbr docker-build # @HELP Validate that BBSim and BBR are working together
Joey Armstrong73d35792022-11-25 08:46:46 -0500195 DOCKER_RUN_ARGS="-pon 2 -onu 2" $(MAKE) docker-run
Matteo Scandolo569e7172019-12-20 11:51:51 -0800196 sleep 5
Matteo Scandoloc11074d2020-09-14 14:59:24 -0700197 ./$(RELEASE_DIR)/$(RELEASE_BBR_NAME)-linux-amd64 -pon 2 -onu 2 -logfile tmp.logs
Joey Armstrong73d35792022-11-25 08:46:46 -0500198 docker $(RM) -f bbsim
Matteo Scandolo569e7172019-12-20 11:51:51 -0800199
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400200## -----------------------------------------------------------------------
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400201## -----------------------------------------------------------------------
Matteo Scandolocedde462021-03-09 17:37:16 -0800202docker-build: local-omci-lib-go local-protos# @HELP Build the BBSim docker container (contains BBSimCtl too)
Kent Hagerman60d62302020-03-10 17:02:36 -0400203 docker build \
Joey Armstrong73d35792022-11-25 08:46:46 -0500204 -t "$(bbsim-tag)" \
Kent Hagerman60d62302020-03-10 17:02:36 -0400205 -f build/package/Dockerfile .
Matteo Scandolo4747d292019-08-05 11:50:18 -0700206
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400207## -----------------------------------------------------------------------
208## -----------------------------------------------------------------------
Matteo Scandolo01d41ce2019-10-28 15:42:47 -0700209docker-push: # @HELP Push the docker container to a registry
Joey Armstrong73d35792022-11-25 08:46:46 -0500210 docker push "$(bbsim-tag)"
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400211
212## -----------------------------------------------------------------------
213## -----------------------------------------------------------------------
Andrea Campanella64dffd52019-12-17 17:29:57 -0800214docker-kind-load:
215 @if [ "`kind get clusters | grep voltha-$(TYPE)`" = '' ]; then echo "no voltha-$(TYPE) cluster found" && exit 1; fi
Joey Armstrong73d35792022-11-25 08:46:46 -0500216 kind load docker-image "$(bbsim-tag)" --name=voltha-$(TYPE) --nodes $(shell kubectl get nodes --template='{{range .items}}{{.metadata.name}},{{end}}' | sed 's/,$$//')
217
218## -----------------------------------------------------------------------
219## docker-run
220## -----------------------------------------------------------------------
Joey Armstrong72558cb2022-11-30 06:35:52 -0500221
222# % docker run --detach unless dev-mode
223is-docker-run := $(filter-out %-dev,$(MAKECMDGOALS))
224is-docker-run := $(findstring docker-run,$(is-docker-run))
225
Joey Armstrong73d35792022-11-25 08:46:46 -0500226docker-run-cmd = docker run
Joey Armstrong72558cb2022-11-30 06:35:52 -0500227$(if $(is-docker-run),$(eval docker-run-cmd += --detach))
Joey Armstrong73d35792022-11-25 08:46:46 -0500228docker-run-cmd += ${DOCKER_PORTS}
229docker-run-cmd += --privileged
230docker-run-cmd += --rm
231docker-run-cmd += --name bbsim
232docker-run-cmd += "$(bbsim-tag)" /app/bbsim
233docker-run-cmd += ${DOCKER_RUN_ARGS}
Andrea Campanella64dffd52019-12-17 17:29:57 -0800234
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400235## -----------------------------------------------------------------------
236## -----------------------------------------------------------------------
Matteo Scandoloe383d5d2019-10-25 14:47:27 -0700237docker-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 -0500238 docker ps
Joey Armstrong72558cb2022-11-30 06:35:52 -0500239 $(docker-run-cmd)
Matteo Scandolo4b3fc7e2019-09-17 16:49:54 -0700240
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400241## -----------------------------------------------------------------------
242## -----------------------------------------------------------------------
Matteo Scandoloe383d5d2019-10-25 14:47:27 -0700243docker-run-dev: # @HELP Runs the container locally (intended for development purposes, not in detached mode)
Joey Armstrong73d35792022-11-25 08:46:46 -0500244 $(docker-run-cmd)
Matteo Scandoloe383d5d2019-10-25 14:47:27 -0700245
Joey Armstrong73d35792022-11-25 08:46:46 -0500246## -----------------------------------------------------------------------
247## docker-run
248## -----------------------------------------------------------------------
Zack Williams4b0ef4d2019-12-18 14:25:20 -0700249.PHONY: docs docs-lint
Zdravko Bozakov2da76342019-10-21 09:47:35 +0200250docs: swagger # @HELP Generate docs and opens them in the browser
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400251
252 $(call begin-enter,Target $@)
253 -$(MAKE) -C docs html
254 $(call begin-leave,Target $@)
255
Zdravko Bozakov2da76342019-10-21 09:47:35 +0200256 @echo -e "\nBBSim documentation generated in file://${PWD}/docs/build/html/index.html"
Matteo Scandolo40e067f2019-10-16 16:59:41 -0700257
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400258## -----------------------------------------------------------------------
259## -----------------------------------------------------------------------
Zack Williams4b0ef4d2019-12-18 14:25:20 -0700260docs-lint:
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400261 $(MAKE) -C docs lint-doc8
Zack Williams4b0ef4d2019-12-18 14:25:20 -0700262
Joey Armstrong5c610772023-01-23 16:03:32 -0500263## -----------------------------------------------------------------------
264## -----------------------------------------------------------------------
Joey Armstrong73d35792022-11-25 08:46:46 -0500265swagger-deps += docs/swagger/bbsim/bbsim.swagger.json
266swagger-deps += docs/swagger/leagacy/bbsim.swagger.json
267.PHONY: $(swagger-deps)
268swagger: $(swagger-deps) # @HELP Generate swagger documentation for BBSim API
Matteo Scandolo4747d292019-08-05 11:50:18 -0700269
Joey Armstrong73d35792022-11-25 08:46:46 -0500270## -----------------------------------------------------------------------
Matteo Scandoloca08fc72019-12-04 14:17:39 -0800271## Local Development Helpers
Joey Armstrong73d35792022-11-25 08:46:46 -0500272## -----------------------------------------------------------------------
Matteo Scandolocedde462021-03-09 17:37:16 -0800273local-omci-lib-go:
274ifdef LOCAL_OMCI_LIB_GO
275 mkdir -p vendor/github.com/opencord/omci-lib-go
276 cp -r ${LOCAL_OMCI_LIB_GO}/* vendor/github.com/opencord/omci-lib-go
Matteo Scandoloca08fc72019-12-04 14:17:39 -0800277endif
Matteo Scandolo4747d292019-08-05 11:50:18 -0700278
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400279## -----------------------------------------------------------------------
280## -----------------------------------------------------------------------
Matteo Scandolo4f4ac792020-10-01 16:33:21 -0700281local-protos: ## Copies a local version of the voltha-protos dependency into the vendor directory
282ifdef LOCAL_PROTOS
Joey Armstrong73d35792022-11-25 08:46:46 -0500283 $(RM) -r vendor/github.com/opencord/voltha-protos/v5/go
David K. Bainbridgec415efe2021-08-19 13:05:21 +0000284 mkdir -p vendor/github.com/opencord/voltha-protos/v5/go
285 cp -r ${LOCAL_PROTOS}/go/* vendor/github.com/opencord/voltha-protos/v5/go
Joey Armstrong73d35792022-11-25 08:46:46 -0500286 $(RM) -r vendor/github.com/opencord/voltha-protos/v5/go/vendor
Matteo Scandolo4f4ac792020-10-01 16:33:21 -0700287endif
288
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400289## -----------------------------------------------------------------------
290## -----------------------------------------------------------------------
291clean ::
Joey Armstrong73d35792022-11-25 08:46:46 -0500292 @$(RM) -f bbsim
293 @$(RM) -f bbsimctl
294 @$(RM) -f bbr
295 @$(RM) -r tools/bin
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400296 @$(RM) -r release
Matteo Scandolo3de9de02019-11-14 13:40:03 -0800297
Joey Armstrongf99712c2023-06-01 17:04:38 -0400298 @$(RM) $(coverage-out)
299 @$(RM) $(coverage-xml)
300
301 @$(RM) $(results-out)
302 @$(RM) $(results-xml)
303
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400304 @$(RM) $(sca-report-xml)
305
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400306sterile :: clean
Matteo Scandolo40e067f2019-10-16 16:59:41 -0700307
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400308## -----------------------------------------------------------------------
309## -----------------------------------------------------------------------
Kent Hagerman60d62302020-03-10 17:02:36 -0400310setup_tools:
311 @echo "Downloading dependencies..."
David K. Bainbridgec415efe2021-08-19 13:05:21 +0000312 @${GO} mod download github.com/grpc-ecosystem/grpc-gateway github.com/opencord/voltha-protos/v5
Kent Hagerman60d62302020-03-10 17:02:36 -0400313 @echo "Dependencies downloaded OK"
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700314
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400315## -----------------------------------------------------------------------
316## -----------------------------------------------------------------------
David K. Bainbridgec415efe2021-08-19 13:05:21 +0000317VOLTHA_PROTOS ?= $(shell ${GO} list -f '{{ .Dir }}' -m github.com/opencord/voltha-protos/v5)
Kent Hagerman60d62302020-03-10 17:02:36 -0400318GOOGLEAPI ?= $(shell ${GO} list -f '{{ .Dir }}' -m github.com/grpc-ecosystem/grpc-gateway)
Matteo Scandolo4747d292019-08-05 11:50:18 -0700319
Joey Armstrong73d35792022-11-25 08:46:46 -0500320.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 -0400321api/openolt/openolt.pb.go: api/openolt/openolt.proto setup_tools
322 @echo $@
323 @${PROTOC} -I. \
324 -I${GOOGLEAPI}/third_party/googleapis \
amit.ghoshee17c002021-06-10 12:14:38 +0200325 --go_out=plugins=grpc:./ --go_opt=paths=source_relative \
Kent Hagerman60d62302020-03-10 17:02:36 -0400326 $<
Zdravko Bozakov2da76342019-10-21 09:47:35 +0200327
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400328## -----------------------------------------------------------------------
329## -----------------------------------------------------------------------
hkouser24361d42020-12-14 19:21:47 +0530330api/bbsim/bbsim_dmi.pb.go: api/bbsim/bbsim_dmi.proto setup_tools
331 @echo $@
332 @${PROTOC} -I. \
333 -I${GOOGLEAPI}/third_party/googleapis \
amit.ghoshee17c002021-06-10 12:14:38 +0200334 --go_out=plugins=grpc:./ --go_opt=paths=source_relative \
hkouser24361d42020-12-14 19:21:47 +0530335 $<
336
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400337## -----------------------------------------------------------------------
338## -----------------------------------------------------------------------
Kent Hagerman60d62302020-03-10 17:02:36 -0400339api/bbsim/bbsim.pb.go api/bbsim/bbsim.pb.gw.go: api/bbsim/bbsim.proto api/bbsim/bbsim.yaml setup_tools
340 @echo $@
341 @${PROTOC} -I. \
342 -I${GOOGLEAPI}/third_party/googleapis \
343 -I${VOLTHA_PROTOS}/protos/ \
amit.ghoshee17c002021-06-10 12:14:38 +0200344 --go_out=plugins=grpc:./ --go_opt=paths=source_relative \
345 --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 -0400346 $<
Zdravko Bozakov2da76342019-10-21 09:47:35 +0200347
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400348## -----------------------------------------------------------------------
349## -----------------------------------------------------------------------
Kent Hagerman60d62302020-03-10 17:02:36 -0400350api/legacy/bbsim.pb.go api/legacy/bbsim.pb.gw.go: api/legacy/bbsim.proto setup_tools
351 @echo $@
352 @${PROTOC} -I. \
353 -I${GOOGLEAPI}/third_party/googleapis/ \
354 -I${GOOGLEAPI}/ \
355 -I${VOLTHA_PROTOS}/protos/ \
356 --go_out=plugins=grpc:./ \
amit.ghoshee17c002021-06-10 12:14:38 +0200357 --grpc-gateway_out=logtostderr=true,paths=source_relative,allow_delete_body=true:./ \
Kent Hagerman60d62302020-03-10 17:02:36 -0400358 $<
359
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400360## -----------------------------------------------------------------------
361## -----------------------------------------------------------------------
Kent Hagerman60d62302020-03-10 17:02:36 -0400362docs/swagger/bbsim/bbsim.swagger.json: api/bbsim/bbsim.yaml setup_tools
363 @echo $@
364 @${PROTOC} -I ./api \
365 -I${GOOGLEAPI}/ \
366 -I${VOLTHA_PROTOS}/protos/ \
Zack Williamsd2907e62020-04-03 10:23:02 -0700367 --swagger_out=logtostderr=true,allow_delete_body=true,disable_default_errors=true,grpc_api_configuration=$<:docs/swagger/ \
Kent Hagerman60d62302020-03-10 17:02:36 -0400368 api/bbsim/bbsim.proto
369
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400370## -----------------------------------------------------------------------
371## -----------------------------------------------------------------------
Kent Hagerman60d62302020-03-10 17:02:36 -0400372docs/swagger/leagacy/bbsim.swagger.json: api/legacy/bbsim.proto setup_tools
373 @echo $@
374 @${PROTOC} -I ./api \
375 -I${GOOGLEAPI}/ \
376 -I${VOLTHA_PROTOS}/protos/ \
Zack Williamsd2907e62020-04-03 10:23:02 -0700377 --swagger_out=logtostderr=true,allow_delete_body=true,disable_default_errors=true:docs/swagger/ \
Kent Hagerman60d62302020-03-10 17:02:36 -0400378 $<
Joey Armstrong73d35792022-11-25 08:46:46 -0500379
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400380## -----------------------------------------------------------------------
Joey Armstrong96bcf1b2023-06-27 14:49:40 -0400381## Intent:
382## -----------------------------------------------------------------------
383clean ::
384 $(RM) -r "docs/$(venv-name)"
385
386## -----------------------------------------------------------------------
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400387## Intent: Helper target used to exercise release script changes
388## -----------------------------------------------------------------------
Joey Armstrong2c850cc2023-04-17 16:30:00 -0400389include $(MAKEDIR)/release/onf-publish.mk
Joey Armstrong36c9bcd2023-04-05 19:05:56 -0400390
391$(if $(DEBUG),$(warning LEAVE))
392
Joey Armstrong2c039362024-02-04 18:51:52 -0500393# [EOF] x 2