1
0

Makefile 981 B

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