2024-11-02 23:56:56 -05:00
|
|
|
# You must use the current google protoc-gen-go
|
2024-10-22 23:35:52 -05:00
|
|
|
#
|
|
|
|
# cd ~/go/src/google.golang.org/protobuf/cmd/protoc-gen-go
|
|
|
|
# go install
|
|
|
|
|
2024-11-02 23:56:56 -05:00
|
|
|
check-for-protoc-gen-go:
|
2024-11-18 05:32:37 -06:00
|
|
|
@if [ -f "/usr/bin/protoc-gen-go" ]; then \
|
2024-11-02 23:56:56 -05:00
|
|
|
echo "the protoc-gen-go package is old in debian sid right now"; \
|
|
|
|
echo "for now, remove it"; \
|
2024-11-18 05:32:37 -06:00
|
|
|
echo "and install protoc-gen-go-wit from mirrors.wit.com"; \
|
2024-11-02 23:56:56 -05:00
|
|
|
fi
|
|
|
|
make all
|
2024-10-22 23:35:52 -05:00
|
|
|
|
2024-11-01 00:58:12 -05:00
|
|
|
all: droplet.pb.go hypervisor.pb.go event.pb.go experiments.pb.go
|
2024-10-24 16:57:50 -05:00
|
|
|
make -C example
|
2024-10-21 17:53:36 -05:00
|
|
|
|
2024-10-22 23:35:52 -05:00
|
|
|
vet: lint
|
2024-10-21 17:53:36 -05:00
|
|
|
GO111MODULE=off go vet
|
|
|
|
|
|
|
|
lint:
|
2024-10-22 23:35:52 -05:00
|
|
|
-buf lint droplet.proto
|
2024-10-21 17:53:36 -05:00
|
|
|
|
|
|
|
# autofixes your import headers in your golang files
|
|
|
|
goimports:
|
|
|
|
goimports -w *.go
|
2024-10-24 16:57:50 -05:00
|
|
|
make -C example goimports
|
2024-10-18 20:58:15 -05:00
|
|
|
|
|
|
|
redomod:
|
|
|
|
rm -f go.*
|
|
|
|
GO111MODULE= go mod init
|
|
|
|
GO111MODULE= go mod tidy
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.pb.go
|
2024-10-21 19:24:16 -05:00
|
|
|
-rm -f go.*
|
2024-10-24 16:57:50 -05:00
|
|
|
make -C example clean
|
2024-10-18 20:58:15 -05:00
|
|
|
|
|
|
|
droplet.pb.go: droplet.proto
|
2024-10-21 18:28:59 -05:00
|
|
|
# protoc --go_out=. droplet.proto
|
|
|
|
# This is switched over to use the new protoc-gen-go from google.golang.org/protobuf/cmd/protoc-gen-go
|
|
|
|
# the debian one (2024/10/21) seems to be the older/original one from github.com/golang/protobuf/protoc-gen-go
|
|
|
|
cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/virtbuf \
|
|
|
|
--go_opt=Mdroplet.proto=go.wit.com/lib/protobuf/virtbuf \
|
|
|
|
droplet.proto
|
|
|
|
|
2024-10-22 03:26:02 -05:00
|
|
|
hypervisor.pb.go: hypervisor.proto
|
|
|
|
cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/virtbuf \
|
|
|
|
--go_opt=Mhypervisor.proto=go.wit.com/lib/protobuf/virtbuf \
|
|
|
|
hypervisor.proto
|
|
|
|
|
2024-10-26 06:01:19 -05:00
|
|
|
event.pb.go: event.proto
|
2024-10-22 23:35:52 -05:00
|
|
|
cd ~/go/src && protoc --go_out=. \
|
|
|
|
--proto_path=go.wit.com/lib/protobuf/virtbuf \
|
2024-10-26 06:01:19 -05:00
|
|
|
--go_opt=Mevent.proto=go.wit.com/lib/protobuf/virtbuf \
|
|
|
|
event.proto
|
2024-10-22 23:35:52 -05:00
|
|
|
|
2024-10-24 17:52:46 -05:00
|
|
|
experiments.pb.go: experiments.proto
|
2024-10-24 17:50:50 -05:00
|
|
|
cd ~/go/src && protoc --go_out=. \
|
|
|
|
--proto_path=go.wit.com/lib/protobuf/virtbuf \
|
2024-10-24 17:52:46 -05:00
|
|
|
--go_opt=Mexperiments.proto=go.wit.com/lib/protobuf/virtbuf \
|
|
|
|
experiments.proto
|
2024-10-24 17:50:50 -05:00
|
|
|
|
2024-10-18 20:58:15 -05:00
|
|
|
deps:
|
|
|
|
apt install golang-goprotobuf-dev
|
|
|
|
apt install protobuf-compiler
|
|
|
|
|
|
|
|
push:
|
|
|
|
git pull
|
|
|
|
git add --all
|
|
|
|
git commit -a -s
|
|
|
|
git push
|