Makefile 912 B

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