Makefile 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
  2. # SPDX-License-Identifier: MIT
  3. VERSION := $(shell git describe --tags | sed -e 's/^v//g' | awk -F "-" '{print $$1}')
  4. ITERATION := $(shell git describe --tags --long | awk -F "-" '{print $$2}')
  5. GO_VERSION=$(shell gobuild -v)
  6. GO := $(or $(GOROOT),/usr/lib/go)/bin/go
  7. PROCS := $(shell nproc)
  8. cores:
  9. @echo "cores: $(PROCS)"
  10. bench:
  11. go test -bench .
  12. bench-record:
  13. $(GO) test -bench . > "benchmarks/stun-go-$(GO_VERSION).txt"
  14. lint:
  15. @golangci-lint run ./...
  16. @echo "ok"
  17. escape:
  18. @echo "Not escapes, except autogenerated:"
  19. @go build -gcflags '-m -l' 2>&1 \
  20. | grep -v "<autogenerated>" \
  21. | grep escapes
  22. format:
  23. goimports -w .
  24. bench-compare:
  25. go test -bench . > bench.go-16
  26. go-tip test -bench . > bench.go-tip
  27. @benchcmp bench.go-16 bench.go-tip
  28. install:
  29. go get gortc.io/api
  30. go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
  31. test-integration:
  32. @cd e2e && bash ./test.sh
  33. prepush: test lint test-integration
  34. check-api:
  35. @cd api && bash ./check.sh
  36. test:
  37. @./go.test.sh
  38. clean: