Makefile 851 B

123456789101112131415161718192021222324252627282930
  1. VERSION="1.0.1"
  2. default: debug
  3. debug:
  4. go vet ./...
  5. go build -mod vendor -o ./fave
  6. build: clean
  7. @-mkdir ./bin
  8. @cd ./bin
  9. @cd ..
  10. CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod vendor -a -o ./bin/fave.linux-amd64 -ldflags='-X main.Version=$(VERSION) -extldflags "-static"'
  11. CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -mod vendor -a -o ./bin/fave.darwin-amd64 -ldflags='-X main.Version=$(VERSION) -extldflags "-static"'
  12. CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -mod vendor -a -o ./bin/fave.windows-amd64.exe -ldflags='-X main.Version=$(VERSION) -extldflags "-static"'
  13. cd ./bin && find . -name 'fave*' | xargs -I{} tar czf {}.tar.gz {}
  14. cd ./bin && shasum -a 256 * > sha256sum.txt
  15. cat ./bin/sha256sum.txt
  16. clean:
  17. @-rm -r ./bin
  18. test:
  19. go test ./...
  20. run:
  21. @./fave -host 0.0.0.0 -port 8080 -dir ./hosts
  22. update:
  23. go mod vendor