-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
39 lines (32 loc) · 1.19 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
default: test
test:
go test ./...
lint:
golangci-lint run
bench:
go test ./... -run=NONE -bench=. -benchmem
GOPROTO_PACKAGE=github.com/bsm/zetasketch/internal/zetasketch
# proto task fetches and compiles zetasketch protobuf.
#
# To install protoc-gen-go:
# go install google.golang.org/protobuf/cmd/protoc-gen-go@v1
#
# Protos are explicitly fetched because ALL of them are required
# before any `protoc` calls (roughly - they require each other).
proto: internal/zetasketch/hllplus-unique.proto internal/zetasketch/aggregator.proto internal/zetasketch/unique-stats.proto
@mkdir -p $(dir $@)
protoc \
-I=internal/protobuf \
-I=internal/zetasketch \
--go_out=internal/zetasketch \
--go_opt=paths=source_relative \
--go_opt=Mhllplus-unique.proto=$(GOPROTO_PACKAGE) \
--go_opt=Maggregator.proto=$(GOPROTO_PACKAGE) \
--go_opt=Munique-stats.proto=$(GOPROTO_PACKAGE) \
$^
internal/zetasketch/%.proto:
@mkdir -p $(dir $@)
curl -so $@ https://raw.githubusercontent.com/google/zetasketch/master/proto/$*.proto
internal/protobuf/google/protobuf/descriptor.proto:
@mkdir -p $(dir $@)
curl -so $@ https://raw.githubusercontent.com/protocolbuffers/protobuf/master/src/google/protobuf/descriptor.proto