VOL-2463 : Enable and disable pon/NNI port
This patch has dependency on https://gerrit.opencord.org/#/c/17105/

Change-Id: I9b63fcf332204d282f4cc3a2056a73a03df6b507
diff --git a/Makefile b/Makefile
index b317b84..a9dbffb 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@
 	@echo "check        - runs targets that should be run before a commit"
 	@echo "clean        - remove temporary and generated files"
 
-internal/pkg/commands/voltha_v1_pb.go: assets/protosets/voltha_v1.pb
+internal/pkg/commands/%_pb.go: assets/protosets/%.pb
 	@echo "/*" > $@
 	@echo " * Copyright 2019-present Open Networking Foundation" >> $@
 	@echo " *" >> $@
@@ -30,35 +30,12 @@
 	@echo " */" >> $@
 	@echo "package commands" >> $@
 	@echo "" >> $@
-	@echo "var V1Descriptor = []byte{" >> $@
-	hexdump -ve '1/1 "0x%02x,"' assets/protosets/voltha_v1.pb | fold -w 60 -s >> $@
+	@echo "var $(shell echo $(subst .pb,,$(subst assets/protosets/voltha_,,$<)) |tr '[:lower:]' '[:upper:]')Descriptor = []byte{" >> $@
+	hexdump -ve '1/1 "0x%02x,"' $< | fold -w 60 -s >> $@
 	@echo "}" >> $@
 	@go fmt $@
 
-internal/pkg/commands/voltha_v2_pb.go: assets/protosets/voltha_v2.pb
-	@echo "/*" > $@
-	@echo " * Copyright 2019-present Open Networking Foundation" >> $@
-	@echo " *" >> $@
-	@echo " * Licensed under the Apache License, Version 2.0 (the "License");" >> $@
-	@echo " * you may not use this file except in compliance with the License." >> $@
-	@echo " * You may obtain a copy of the License at" >> $@
-	@echo " *" >> $@
-	@echo " * http://www.apache.org/licenses/LICENSE-2.0" >> $@
-	@echo " *" >> $@
-	@echo " * Unless required by applicable law or agreed to in writing, software" >> $@
-	@echo " * distributed under the License is distributed on an "AS IS" BASIS," >> $@
-	@echo " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied." >> $@
-	@echo " * See the License for the specific language governing permissions and" >> $@
-	@echo " * limitations under the License." >> $@
-	@echo " */" >> $@
-	@echo "package commands" >> $@
-	@echo "" >> $@
-	@echo "var V2Descriptor = []byte{" >> $@
-	hexdump -ve '1/1 "0x%02x,"' assets/protosets/voltha_v2.pb | fold -w 60 -s >> $@
-	@echo "}" >> $@
-	@go fmt $@
-
-encode-protosets: internal/pkg/commands/voltha_v1_pb.go internal/pkg/commands/voltha_v2_pb.go
+encode-protosets: internal/pkg/commands/voltha_v1_pb.go internal/pkg/commands/voltha_v2_pb.go internal/pkg/commands/voltha_v3_pb.go
 
 SHELL=bash -e -o pipefail