Makefile 862 B

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