1
0

Makefile 890 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. rm -rf ./assets/frps/statik
  13. rm -rf ./assets/frpc/statik
  14. go generate ./assets/...
  15. fmt:
  16. go fmt ./...
  17. frps:
  18. env CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" -o bin/frps ./cmd/frps
  19. frpc:
  20. env CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" -o bin/frpc ./cmd/frpc
  21. test: gotest
  22. gotest:
  23. go test -v --cover ./assets/...
  24. go test -v --cover ./cmd/...
  25. go test -v --cover ./client/...
  26. go test -v --cover ./server/...
  27. go test -v --cover ./pkg/...
  28. ci:
  29. go test -count=1 -p=1 -v ./tests/...
  30. e2e:
  31. ./hack/run-e2e.sh
  32. alltest: gotest ci e2e
  33. clean:
  34. rm -f ./bin/frpc
  35. rm -f ./bin/frps