Makefile 817 B

12345678910111213141516171819202122232425262728
  1. .PHONY: build format test install coverage coverage-html
  2. YOSAICTL = yosaictl
  3. YOSAID = yosaid
  4. YOSAISERVER = yosai-server
  5. build:
  6. go build -o ./build/linux/$(YOSAICTL)/$(YOSAICTL) ./cmd/$(YOSAICTL)/$(YOSAICTL).go && \
  7. go build -o ./build/linux/$(YOSAID)/$(YOSAID) ./cmd/$(YOSAID)/$(YOSAID).go && \
  8. go build -o ./build/linux/${YOSAISERVER}/$(YOSAISERVER) ./cmd/$(YOSAISERVER)/$(YOSAISERVER).go
  9. format:
  10. go fmt ./...
  11. install:
  12. sudo mv ./build/linux/$(YOSAICTL)/$(YOSAICTL) /usr/local/bin && sudo chmod u+x /usr/local/bin/$(YOSAICTL) && \
  13. sudo mv ./build/linux/$(YOSAID)/$(YOSAID) /usr/local/bin && sudo chmod u+x /usr/local/bin/$(YOSAID)
  14. test:
  15. go test -v ./...
  16. coverage:
  17. go test -v ./... -cover
  18. coverage-html:
  19. go test -v ./... -coverprofile=coverage.out
  20. go tool cover -html=coverage.out -o coverage.html