Makefile 1.4 KB

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