chore: add protobuf

This commit is contained in:
xuu
2025-03-07 17:26:55 -07:00
parent 7ff278e0cf
commit 41aa46ce83
10 changed files with 1758 additions and 3 deletions

View File

@@ -1,10 +1,21 @@
all: avro flatbuffers protobuf
avro: twt-avro/gen.go
twt-avro/gen.go: lextwt.avro
go tool avro gen -pkg twt_avro -encoders lextwt.avro > twt-avro/gen.go
flatbuffers: twt-fbs/gen.go
twt-fbs/gen.go: lextwt.fbs
flatbuffers: twt-fbs/lextwt
twt-fbs/lextwt: lextwt.fbs
flatc -o twt-fbs --go lextwt.fbs
.ALL: avro flatbuffers
protobuf: twt-pb/lextwt.pb.go
twt-pb/lextwt.pb.go: lextwt.proto
protoc --proto_path=. \
--plugin=bin/protoc-gen-go \
--go_opt=paths=source_relative \
--go_opt="Mlextwt.proto=go.sour.is/lextwt-encoding/twt-pb;twt_pb" \
--go_out=twt-pb \
lextwt.proto
.PHONY: avro protobuf flatbuffers