Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # Copyright 2022 The OpenZipkin Authors
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. .DEFAULT_GOAL := test
  15. .PHONY: test
  16. test:
  17. # MallocNanoZone env var avoids problems in macOS Monterey: golang/go#49138
  18. MallocNanoZone=0 go test -v -race -cover ./...
  19. .PHONY: bench
  20. bench:
  21. go test -v -run - -bench . -benchmem ./...
  22. .PHONY: protoc
  23. protoc:
  24. protoc --go_out=module=github.com/openzipkin/zipkin-go:. proto/zipkin_proto3/zipkin.proto
  25. protoc --go_out=module=github.com/openzipkin/zipkin-go:. proto/testing/*.proto
  26. protoc --go-grpc_out=module=github.com/openzipkin/zipkin-go:. proto/testing/*.proto
  27. .PHONY: lint
  28. lint:
  29. # Ignore grep's exit code since no match returns 1.
  30. echo 'linting...' ; golint ./...
  31. .PHONY: vet
  32. vet:
  33. go vet ./...
  34. .PHONY: all
  35. all: vet lint test bench
  36. .PHONY: example