Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 -tags '$(BUILDTAGS)' ngrok/main/ngrokd
  9. fmt:
  10. go fmt ngrok/...
  11. client: deps
  12. go install -tags '$(BUILDTAGS)' ngrok/main/ngrok
  13. assets: client-assets server-assets
  14. bin/go-bindata:
  15. GOOS="" GOARCH="" go get github.com/jteeuwen/go-bindata/go-bindata
  16. client-assets: bin/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: bin/go-bindata
  22. bin/go-bindata -nomemcopy -pkg=assets -tags=$(BUILDTAGS) \
  23. -debug=$(if $(findstring debug,$(BUILDTAGS)),true,false) \
  24. -o=src/ngrok/server/assets/assets_$(BUILDTAGS).go \
  25. assets/server/...
  26. release-client: BUILDTAGS=release
  27. release-client: client
  28. release-server: BUILDTAGS=release
  29. release-server: server
  30. release-all: fmt release-client release-server
  31. all: fmt client server
  32. clean:
  33. go clean -i -r ngrok/...
  34. rm -rf src/ngrok/client/assets/ src/ngrok/server/assets/
  35. contributors:
  36. echo "Contributors to ngrok, both large and small:\n" > CONTRIBUTORS
  37. git log --raw | grep "^Author: " | sort | uniq | cut -d ' ' -f2- | sed 's/^/- /' | cut -d '<' -f1 >> CONTRIBUTORS