Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .PHONY: help default clean bench test
  2. default: bench test
  3. clean:
  4. rm -rf ./objs
  5. #########################################################################################################
  6. # SRS benchmark tool for SRS, janus, GB28181.
  7. ./objs/.format.bench.txt: *.go janus/*.go ./objs/.format.srs.txt ./objs/.format.gb28181.txt
  8. gofmt -w *.go janus
  9. mkdir -p objs && echo "done" > ./objs/.format.bench.txt
  10. bench: ./objs/srs_bench
  11. ./objs/srs_bench: ./objs/.format.bench.txt *.go janus/*.go srs/*.go vnet/*.go gb28181/*.go Makefile
  12. go build -mod=vendor -o objs/srs_bench .
  13. #########################################################################################################
  14. # For all regression tests.
  15. test: ./objs/srs_test ./objs/srs_gb28181_test ./objs/srs_blackbox_test
  16. #########################################################################################################
  17. # For SRS regression test.
  18. ./objs/.format.srs.txt: srs/*.go vnet/*.go
  19. gofmt -w srs vnet
  20. mkdir -p objs && echo "done" > ./objs/.format.srs.txt
  21. ./objs/srs_test: ./objs/.format.srs.txt *.go srs/*.go vnet/*.go Makefile
  22. go test ./srs -mod=vendor -c -o ./objs/srs_test
  23. #########################################################################################################
  24. # For gb28181 test.
  25. ./objs/.format.gb28181.txt: gb28181/*.go
  26. gofmt -w gb28181
  27. mkdir -p objs && echo "done" > ./objs/.format.gb28181.txt
  28. ./objs/srs_gb28181_test: ./objs/.format.gb28181.txt *.go gb28181/*.go Makefile
  29. go test ./gb28181 -mod=vendor -c -o ./objs/srs_gb28181_test
  30. #########################################################################################################
  31. # For blackbox test.
  32. ./objs/.format.blackbox.txt: blackbox/*.go
  33. gofmt -w blackbox
  34. mkdir -p objs && echo "done" > ./objs/.format.blackbox.txt
  35. ./objs/srs_blackbox_test: ./objs/.format.blackbox.txt *.go blackbox/*.go Makefile
  36. go test ./blackbox -mod=vendor -c -o ./objs/srs_blackbox_test
  37. #########################################################################################################
  38. # Help menu.
  39. help:
  40. @echo "Usage: make [default|bench|test|clean]"
  41. @echo " default The default entry for make is bench+test"
  42. @echo " bench Make the bench to ./objs/srs_bench"
  43. @echo " test Make the test tool to ./objs/srs_test and ./objs/srs_gb28181_test ./objs/srs_blackbox_test"
  44. @echo " clean Remove all tools at ./objs"