[VOL-5254] - Baseline build prior to release tag/branch

Makefile
--------
  o Copy in mod-update target logic from repo:onf-make.
  o Support for FIX_LOCAL_PERMS=1 repairing docker inspired problems.

go.mod
go.sum
vendor/github.com/opencord/voltha-lib-go/v7/LICENSE
vendor/github.com/opencord/voltha-lib-go/v7/pkg/config/common.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/config/configmanager.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/config/logcontroller.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/config/logfeaturescontroller.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/db/backend.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/db/common.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/db/kvstore/client.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/db/kvstore/common.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/db/kvstore/etcdclient.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/db/kvstore/etcdpool.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/db/kvstore/kvutils.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/db/kvstore/redisclient.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/log/common.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/log/log.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/log/utils.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/probe/common.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/probe/probe.go
vendor/github.com/opencord/voltha-lib-go/v7/pkg/version/version.go
--------------------------------------------------------------------------
  o Update voltha-protos to version 5.4.11
  o Update voltha-lib-go to verison 7.5.2
  o make mod-update LOCAL_FIX_PERMS=1 to update dependencies.
  o Steps documented on docs.votlha.org, merge/deply still pending:
    https://docs.voltha.org/howto/release/tasks/go_mod_update.html#release-task-golang-mod-update

Change-Id: If8bb8a4f8bcfaa9cd451f5cab960bb0488378198
diff --git a/Makefile b/Makefile
index becd004..929588d 100644
--- a/Makefile
+++ b/Makefile
@@ -111,6 +111,39 @@
 	docker push ${ADAPTER_IMAGENAME}:${DOCKER_TAG}-rd
 endif
 
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+.PHONY: mod-update
+mod-update: go-version mod-tidy mod-vendor
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+.PHONY: go-version
+go-version :
+	$(call banner-enter,Target $@)
+	${GO} version
+	$(call banner-leave,Target $@)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+.PHONY: mod-tidy
+mod-tidy :
+	$(call banner-enter,Target $@)
+	${GO} mod tidy
+	$(call banner-leave,Target $@)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+.PHONY: mod-vendor
+mod-vendor : mod-tidy
+mod-vendor :
+	$(call banner-enter,Target $@)
+	$(if $(LOCAL_FIX_PERMS),chmod o+w $(CURDIR))
+	${GO} mod vendor
+	$(if $(LOCAL_FIX_PERMS),chmod o-w $(CURDIR))
+	$(call banner-leave,Target $@)
+
 ## lint and unit tests
 
 lint-dockerfile: ## Perform static analysis on Dockerfile
@@ -119,21 +152,28 @@
 	@echo "Dockerfile lint check OK"
 
 lint-mod: ## Verify the Go dependencies
+	$(call banner-entry,Target $@)
 	@echo "Running dependency check..."
 	@${GO} mod verify
 	@echo "Dependency check OK. Running vendor check..."
 	@git status > /dev/null
 	@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)
 	@[[ `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)
-	${GO} mod tidy
-	${GO} mod vendor
+
+	$(HIDE)$(MAKE) --no-print-directory mod-update
+
 	@git status > /dev/null
 	@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)
 	@[[ `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)
 	@echo "Vendor check OK."
+	$(call banner-leave,Target $@)
 
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
 lint: lint-mod lint-dockerfile ## Run all lint targets
 
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
 test: local-lib-go ## Run unit tests
 	@mkdir -p ./tests/results
 	@${GO} test -mod=vendor -v -coverprofile ./tests/results/go-test-coverage.out -covermode count ./... 2>&1 | tee ./tests/results/go-test-results.out ;\
@@ -156,10 +196,6 @@
 distclean: clean ## Removes any local filesystem artifacts generated by a build or test run
 	rm -rf ${VENVDIR}
 
-mod-update: ## Update go mod files
-	${GO} mod tidy
-	${GO} mod vendor
-
 # For each makefile target, add ## <description> on the target line and it will be listed by 'make help'
 help: ## Print help for each Makefile target
 	@echo "Usage: make [<target>]"
@@ -167,3 +203,4 @@
 	@echo
 	@grep '^[[:alpha:]_-]*:.* ##' $(MAKEFILE_LIST) \
 		| sort | awk 'BEGIN {FS=":.* ## "}; {printf "%-25s : %s\n", $$1, $$2};'
+	@printf '  %-33.33s %s\n' 'mod-update' 'Update go.mod files (vendor and tidy)'