Makefile 954 B

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