Makefile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. compile: daemon-compile-x64-lin
  2. daemon-compile-armhf:
  3. GOARCH=arm GOARM=6 go build -o OliveTin.armhf github.com/jamesread/OliveTin/cmd/OliveTin
  4. daemon-compile-x64-lin:
  5. GOOS=linux go build -o OliveTin github.com/jamesread/OliveTin/cmd/OliveTin
  6. daemon-compile-x64-win:
  7. GOOS=windows GOARCH=amd64 go build -o OliveTin.exe github.com/jamesread/OliveTin/cmd/OliveTin
  8. daemon-compile: daemon-compile-armhf daemon-compile-x64-lin daemon-compile-x64-win
  9. daemon-codestyle:
  10. go fmt ./...
  11. go vet ./...
  12. gocyclo -over 4 cmd internal
  13. gocritic check ./...
  14. daemon-unittests:
  15. mkdir -p reports
  16. go test ./... -coverprofile reports/unittests.out
  17. go tool cover -html=reports/unittests.out -o reports/unittests.html
  18. githooks:
  19. cp -v .githooks/* .git/hooks/
  20. go-tools:
  21. go install "github.com/bufbuild/buf/cmd/buf"
  22. go install "github.com/fzipp/gocyclo/cmd/gocyclo"
  23. go install "github.com/go-critic/go-critic/cmd/gocritic"
  24. go install "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway"
  25. go install "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2"
  26. go install "google.golang.org/grpc/cmd/protoc-gen-go-grpc"
  27. go install "google.golang.org/protobuf/cmd/protoc-gen-go"
  28. grpc: githooks go-tools
  29. buf generate
  30. podman-image:
  31. buildah bud -t olivetin
  32. podman-container:
  33. podman kill olivetin
  34. podman rm olivetin
  35. podman create --name olivetin -p 1337:1337 -v /etc/OliveTin/:/config:ro olivetin
  36. podman start olivetin
  37. devrun: compile
  38. killall OliveTin || true
  39. ./OliveTin &
  40. devcontainer: compile podman-image podman-container
  41. webui-codestyle:
  42. cd webui && npm install
  43. cd webui && ./node_modules/.bin/eslint main.js js/*
  44. cd webui && ./node_modules/.bin/stylelint style.css
  45. clean:
  46. rm -rf dist OliveTin OliveTin.armhf OliveTin.exe reports gen
  47. .PHONY: grpc