Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. .PHONY: default server client deps fmt clean all release-all assets client-assets server-assets contributors
  2. export GOPATH:=$(shell pwd)
  3. BUILDTAGS=debug
  4. default: all
  5. deps: assets
  6. go get -tags '$(BUILDTAGS)' -d -v ngrok/...
  7. server: deps
  8. go install -gcflags "-N -l" -tags '$(BUILDTAGS)' ngrok/main/ngrokd
  9. fmt:
  10. go fmt ngrok/...
  11. client: deps
  12. go install -gcflags "-N -l" -tags '$(BUILDTAGS)' ngrok/main/ngrok
  13. assets: client-assets server-assets
  14. client-assets:
  15. go get github.com/jteeuwen/go-bindata
  16. GOOS="" GOARCH="" go install github.com/jteeuwen/go-bindata/go-bindata
  17. bin/go-bindata -nomemcopy -pkg=assets -tags=$(BUILDTAGS) \
  18. -debug=$(if $(findstring debug,$(BUILDTAGS)),true,false) \
  19. -o=src/ngrok/client/assets/assets_$(BUILDTAGS).go \
  20. assets/client/...
  21. server-assets:
  22. go get github.com/jteeuwen/go-bindata
  23. GOOS="" GOARCH="" go install github.com/jteeuwen/go-bindata/go-bindata
  24. bin/go-bindata -nomemcopy -pkg=assets -tags=$(BUILDTAGS) \
  25. -debug=$(if $(findstring debug,$(BUILDTAGS)),true,false) \
  26. -o=src/ngrok/server/assets/assets_$(BUILDTAGS).go \
  27. assets/server/...
  28. release-all: BUILDTAGS=release
  29. release-all: all
  30. all: fmt client server
  31. clean:
  32. go clean -i -r ngrok/...
  33. rm -rf src/ngrok/client/assets/ src/ngrok/server/assets/
  34. contributors:
  35. echo "Contributors to ngrok, both large and small:\n" > CONTRIBUTORS
  36. git log --raw | grep "^Author: " | sort | uniq | cut -d ' ' -f2- | sed 's/^/- /' | cut -d '<' -f1 >> CONTRIBUTORS