1
0

Makefile 890 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. vet:
  17. go vet ./...
  18. frps:
  19. env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o bin/frps ./cmd/frps
  20. frpc:
  21. env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o bin/frpc ./cmd/frpc
  22. test: gotest
  23. gotest:
  24. go test -v --cover ./assets/...
  25. go test -v --cover ./cmd/...
  26. go test -v --cover ./client/...
  27. go test -v --cover ./server/...
  28. go test -v --cover ./pkg/...
  29. e2e:
  30. ./hack/run-e2e.sh
  31. e2e-trace:
  32. DEBUG=true LOG_LEVEL=trace ./hack/run-e2e.sh
  33. alltest: vet gotest e2e
  34. clean:
  35. rm -f ./bin/frpc
  36. rm -f ./bin/frps