Makefile 868 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. export PATH := $(GOPATH)/bin:$(PATH)
  2. export GOPATH := $(shell pwd)/Godeps/_workspace:$(GOPATH)
  3. all: build
  4. build: fmt frps frpc build_test
  5. build_test: echo_server http_server
  6. fmt:
  7. go fmt ./src/...
  8. @go fmt ./test/echo_server.go
  9. @go fmt ./test/http_server.go
  10. @go fmt ./test/func_test.go
  11. frps:
  12. go build -o bin/frps ./src/cmd/frps
  13. cp -rf ./assets ./bin
  14. frpc:
  15. go build -o bin/frpc ./src/cmd/frpc
  16. echo_server:
  17. go build -o test/bin/echo_server ./test/echo_server.go
  18. http_server:
  19. go build -o test/bin/http_server ./test/http_server.go
  20. test: gotest
  21. gotest:
  22. go test -v ./src/...
  23. alltest:
  24. cd ./test && ./run_test.sh && cd -
  25. go test -v ./src/...
  26. go test -v ./test/func_test.go
  27. cd ./test && ./clean_test.sh && cd -
  28. clean:
  29. rm -f ./bin/frpc
  30. rm -f ./bin/frps
  31. rm -f ./test/bin/echo_server
  32. rm -f ./test/bin/http_server
  33. cd ./test && ./clean_test.sh && cd -