Makefile 761 B

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