Makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. export PATH := $(GOPATH)/bin:$(PATH)
  2. export GO15VENDOREXPERIMENT := 1
  3. all: fmt build
  4. build: frps frpc build_test
  5. build_test: echo_server http_server
  6. # compile assets into binary file
  7. assets:
  8. go get -d github.com/rakyll/statik
  9. @go install github.com/rakyll/statik
  10. @rm -rf ./assets/statik
  11. go generate ./assets/...
  12. fmt:
  13. @go fmt ./assets/...
  14. @go fmt ./cmd/...
  15. @go fmt ./client/...
  16. @go fmt ./server/...
  17. @go fmt ./models/...
  18. @go fmt ./utils/...
  19. @go fmt ./test/echo_server.go
  20. @go fmt ./test/http_server.go
  21. @go fmt ./test/func_test.go
  22. frps:
  23. go build -o bin/frps ./cmd/frps
  24. @cp -rf ./assets/static ./bin
  25. frpc:
  26. go build -o bin/frpc ./cmd/frpc
  27. echo_server:
  28. go build -o test/bin/echo_server ./test/echo_server.go
  29. http_server:
  30. go build -o test/bin/http_server ./test/http_server.go
  31. test: gotest
  32. gotest:
  33. go test -v ./...
  34. alltest:
  35. cd ./test && ./run_test.sh && cd -
  36. go test -v ./src/...
  37. go test -v ./test/func_test.go
  38. cd ./test && ./clean_test.sh && cd -
  39. clean:
  40. rm -f ./bin/frpc
  41. rm -f ./bin/frps
  42. rm -f ./test/bin/echo_server
  43. rm -f ./test/bin/http_server
  44. cd ./test && ./clean_test.sh && cd -
  45. save:
  46. godep save ./src/...