makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. .DEFAULT_GOAL := everything
  2. V="v1.0.$(shell date +%Y%m%d%H%M%S)"
  3. dependencies:
  4. @echo Downloading Dependencies
  5. @go get ./...
  6. build: dependencies
  7. @echo Compiling Apps
  8. @echo --- golti $(V)
  9. @go build -o golti -ldflags="-s -w -X git.riomhaire.com/gremlin/golti13platform/infrastructure/application/cmd.version=$(V) -X git.riomhaire.com/gremlin/golti13platform/infrastructure/application/cmd.builtBy=$(USERNAME) " git.riomhaire.com/gremlin/golti13platform/infrastructure/application
  10. @upx golti
  11. @cp golti ${GOPATH}/bin
  12. @echo Done Compiling Apps
  13. build-arm: dependencies
  14. @echo Compiling Apps
  15. @echo --- golti arm version
  16. @GOOS=linux GOARCH=arm GOARM=5 go build -o golti-arm -ldflags="-s -w -X git.riomhaire.com/gremlin/golti13platform/infrastructure/application/cmd.version=$(V) -X git.riomhaire.com/gremlin/golti13platform/infrastructure/application/cmd.builtBy=$(USERNAME) " git.riomhaire.com/gremlin/golti13platform/infrastructure/application
  17. @upx -9 golti-arm
  18. @echo Done Compiling Apps
  19. test:
  20. @echo Running Unit Tests
  21. @go test ./...
  22. profile:
  23. @echo Profiling Code
  24. @go get -u github.com/haya14busa/goverage
  25. @goverage -v -coverprofile=coverage.out ./...
  26. @go tool cover -html=coverage.out -o coverage.html
  27. @rm coverage.out
  28. clean:
  29. @echo Cleaning
  30. @go clean
  31. @rm -f golti
  32. @rm -f golti-arm
  33. @rm -f coverage*.html
  34. @find . -name "debug.test" -exec rm -f {} \;
  35. everything: clean build test
  36. @echo Done