Makefile 885 B

12345678910111213141516171819202122232425262728293031323334
  1. BUILD_DATE = $(shell date +%F_%T_%Z_%a)
  2. TAG=$(shell git describe --tags --abbrev=0)
  3. GO_VERS = $(shell go version | sed -e 's/ /_/g'| cut -b 12-)
  4. build:
  5. clear
  6. go fmt ./...
  7. go build -ldflags "-w -s -X main.GoVersion=$(GO_VERS) -X main.Version=${TAG} -X main.Date=${BUILD_DATE}" -o ./bin/gostore ./cmd/gostore/main.go
  8. strip -s ./bin/gostore
  9. upx -f ./bin/gostore
  10. dev.run:
  11. clear
  12. rm -rf ./bin_dev
  13. mkdir -p ./bin_dev
  14. cp -rf ./static ./bin_dev
  15. go fmt ./...
  16. go build -race -o ./bin_dev/gostore_dev ./cmd/gostore/main.go
  17. ./dev.sh
  18. mod:
  19. clear
  20. go get -u ./...
  21. go mod tidy -compat=1.21
  22. go mod vendor
  23. go fmt ./...
  24. test.run:
  25. clear
  26. go fmt ./...
  27. go test -vet=all -race -timeout 30s -coverprofile cover.out ./...
  28. go tool cover -func=cover.out
  29. lint:
  30. clear
  31. go fmt ./...
  32. golangci-lint run ./cmd/serv_old/...
  33. golangci-lint run ./cmd/client_pwa/...
  34. golangci-lint run ./internal/...