Makefile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Copyright 2014 The sortutil Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style
  3. # license that can be found in the LICENSE file.
  4. .PHONY: all bench clean cover cpu editor internalError later mem nuke todo edit devbench
  5. grep=--include=*.go --include=*.l --include=*.y --include=*.yy --include=*.qbe --include=*.ssa
  6. ngrep='internalError\|TODOOK\|lexer\.go\|parser\.go\|ast.go\|trigraphs\.go\|.*_string\.go\|stringer\.go\|testdata\/gcc'
  7. all:
  8. date
  9. go version 2>&1 | tee log
  10. ./unconvert.sh
  11. gofmt -l -s -w *.go
  12. go test -i
  13. go test 2>&1 | tee -a log
  14. go install -v ./...
  15. GOOS=linux GOARCH=arm go build
  16. GOOS=linux GOARCH=386 go build
  17. GOOS=linux GOARCH=amd64 go build
  18. GOOS=windows GOARCH=386 go build
  19. GOOS=windows GOARCH=amd64 go build
  20. go vet 2>&1 | grep -v $(ngrep) || true
  21. golint 2>&1 | grep -v $(ngrep) || true
  22. make todo
  23. misspell *.go
  24. staticcheck | grep -v 'lexer\.go\|parser\.go' || true
  25. maligned || true
  26. pcregrep -nM 'FAIL|false|<nil>|:\n}' ast_test.go || true
  27. grep -n 'FAIL\|PASS' log
  28. go version
  29. date 2>&1 | tee -a log
  30. devbench:
  31. date 2>&1 | tee log-devbench
  32. go test -timeout 24h -dev -run @ -bench . 2>&1 | tee -a log-devbench
  33. grep -n 'FAIL\|SKIP' log-devbench || true
  34. bench:
  35. date 2>&1 | tee log-bench
  36. go test -timeout 24h -v -run '^[^E]' -bench . 2>&1 | tee -a log-bench
  37. grep -n 'FAIL\|SKIP' log-bench || true
  38. clean:
  39. go clean
  40. rm -f *~ *.test *.out
  41. cover:
  42. t=$(shell mktemp) ; go test -coverprofile $$t && go tool cover -html $$t && unlink $$t
  43. cpu: clean
  44. go test -run @ -bench . -cpuprofile cpu.out
  45. go tool pprof -lines *.test cpu.out
  46. edit:
  47. touch log
  48. gvim -p Makefile go.mod builder.json *.go &
  49. editor:
  50. gofmt -l -s -w *.go
  51. go test -i
  52. go test -short 2>&1 | tee log
  53. go install
  54. later:
  55. @grep -n $(grep) LATER * || true
  56. @grep -n $(grep) MAYBE * || true
  57. mem: clean
  58. go test -v -run ParserCS -memprofile mem.out -timeout 24h
  59. go tool pprof -lines -web -alloc_space *.test mem.out
  60. nuke: clean
  61. go clean -i
  62. todo:
  63. @grep -nr $(grep) ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* * | grep -v $(ngrep) || true
  64. @grep -nr $(grep) 'TODO\|panic' * | grep -v $(ngrep) || true
  65. @grep -nr $(grep) BUG * | grep -v $(ngrep) || true
  66. @grep -nr $(grep) [^[:alpha:]]println * | grep -v $(ngrep) || true
  67. @grep -nir $(grep) 'work.*progress' || true