Makefile 838 B

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