VOL-2169 Add LOCAL_LIB_GO and update README

Change-Id: I904605e8178c5fe0e3053717062f4c61b8a47745
diff --git a/Makefile b/Makefile
index 3ccf82b..dc15d72 100644
--- a/Makefile
+++ b/Makefile
@@ -57,7 +57,7 @@
 	--build-arg LOCAL_PYVOLTHA=${LOCAL_PYVOLTHA} \
 	--build-arg LOCAL_PROTOS=${LOCAL_PROTOS}
 
-.PHONY: simulated_olt simulated_onu local-protosa
+.PHONY: simulated_olt simulated_onu local-protos local-lib-go
 
 # This should to be the first and default target in this Makefile
 help:
@@ -74,14 +74,26 @@
 	@echo "lint-sanity          : Verify that 'go vet' doesn't report any issues"
 	@echo "lint-mod             : Verify the integrity of the 'mod' files"
 	@echo "lint                 : Shorthand for lint-style & lint-sanity"
+	@echo "local-lib-go         : Copies a local version of the VOTLHA dependencies into the vendor directory"
+	@echo "local-protos         : Copies a local verison of the VOLTHA protos into the vendor directory"
 	@echo "test                 : Generate reports for all go tests"
 	@echo
 
 ## Local Development Helpers
 local-protos:
 ifdef LOCAL_PROTOS
+	rm -rf vendor/github.com/opencord/voltha-protos/go
 	mkdir -p vendor/github.com/opencord/voltha-protos/go
-	cp -r ${GOPATH}/src/github.com/opencord/voltha-protos/go/* vendor/github.com/opencord/voltha-protos/go
+	cp -r ${LOCAL_PROTOS}/go/* vendor/github.com/opencord/voltha-protos/go
+	rm -rf vendor/github.com/opencord/voltha-protos/go/vendor
+endif
+
+## Local Development Helpers
+local-lib-go:
+ifdef LOCAL_LIB_GO
+	rm -rf vendor/github.com/opencord/voltha-lib-go
+	mkdir -p vendor/github.com/opencord/voltha-lib-go/v2/pkg
+	cp -r ${LOCAL_LIB_GO}/pkg/* vendor/github.com/opencord/voltha-lib-go/v2/pkg/
 endif
 
 ## Docker targets
@@ -90,7 +102,7 @@
 
 docker-build: simulated_olt
 
-simulated_olt: local-protos
+simulated_olt: local-protos local-lib-go
 	docker build $(DOCKER_BUILD_ARGS) -t ${SIMULATEDOLT_IMAGENAME}:${DOCKER_TAG} -t ${SIMULATEDOLT_IMAGENAME}:latest -f docker/Dockerfile.simulated_olt .
 
 docker-push:
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..b59aa1f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,29 @@
+# How to Build the Golang based Simulated OLT Adapter
+
+## Working with Go Dependencies
+This project uses Go Modules https://github.com/golang/go/wiki/Modules to manage
+dependencies. As a local best pratice this project also vendors the dependencies.
+If you need to update dependencies please follow the Go Modules best practices
+and also perform the following steps before committing a patch:
+```bash
+go mod tidy
+go mod verify
+go mod vendor
+```
+
+## Building with a Local Copy of `voltha-protos` or `voltha-lib-go`
+If you want to build/test using a local copy or `voltha-protos` or `voltha-lib-go`
+this can be accomplished by using the environment variables `LOCAL_PROTOS` and
+`LOCAL_LIB_GO`. These environment variables should be set to the filesystem
+path where the local source is located, e.g.
+
+```bash
+LOCAL\_PROTOS=$HOME/src/voltha-protos
+LOCAL\_LIB\_GO=$HOME/src/voltha-lib-go
+```
+
+When these environment variables are set the vendored versions of these packages
+will be removed from the `vendor` directory and replaced by coping the files from
+the specified locations to the `vendor` directory. *NOTE:* _this means that
+the files in the `vendor` directory are no longer what is in the `git` repository
+and it will take manual `git` intervention to put the original files back._