1
0

Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. export PATH := $(PATH):`go env GOPATH`/bin
  2. export GO111MODULE=on
  3. LDFLAGS := -s -w
  4. all: env fmt build
  5. build: frps frpc
  6. env:
  7. @go version
  8. # compile assets into binary file
  9. file:
  10. rm -rf ./assets/frps/static/*
  11. rm -rf ./assets/frpc/static/*
  12. cp -rf ./web/frps/dist/* ./assets/frps/static
  13. cp -rf ./web/frpc/dist/* ./assets/frpc/static
  14. fmt:
  15. go fmt ./...
  16. fmt-more:
  17. gofumpt -l -w .
  18. gci:
  19. gci write -s standard -s default -s "prefix(github.com/fatedier/frp/)" ./
  20. vet:
  21. go vet ./...
  22. frps:
  23. env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -tags frps -o bin/frps ./cmd/frps
  24. frpc:
  25. env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -tags frpc -o bin/frpc ./cmd/frpc
  26. test: gotest
  27. gotest:
  28. go test -v --cover ./assets/...
  29. go test -v --cover ./cmd/...
  30. go test -v --cover ./client/...
  31. go test -v --cover ./server/...
  32. go test -v --cover ./pkg/...
  33. e2e:
  34. ./hack/run-e2e.sh
  35. e2e-trace:
  36. DEBUG=true LOG_LEVEL=trace ./hack/run-e2e.sh
  37. e2e-compatibility-last-frpc:
  38. if [ ! -d "./lastversion" ]; then \
  39. TARGET_DIRNAME=lastversion ./hack/download.sh; \
  40. fi
  41. FRPC_PATH="`pwd`/lastversion/frpc" ./hack/run-e2e.sh
  42. rm -r ./lastversion
  43. e2e-compatibility-last-frps:
  44. if [ ! -d "./lastversion" ]; then \
  45. TARGET_DIRNAME=lastversion ./hack/download.sh; \
  46. fi
  47. FRPS_PATH="`pwd`/lastversion/frps" ./hack/run-e2e.sh
  48. rm -r ./lastversion
  49. alltest: vet gotest e2e
  50. clean:
  51. rm -f ./bin/frpc
  52. rm -f ./bin/frps
  53. rm -rf ./lastversion