| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
.PHONY: all clean cover cpu editor internalError later mem nuke todo |
| 6 |
|
| 7 |
grep=--include=*.go --include=*.l --include=*.y |
| 8 |
|
| 9 |
all: editor |
| 10 |
go vet || true |
| 11 |
golint || true |
| 12 |
make todo |
| 13 |
|
| 14 |
clean: |
| 15 |
go clean |
| 16 |
rm -f *~ cpu.test mem.test |
| 17 |
|
| 18 |
cover: |
| 19 |
t=$(shell tempfile) ; go test -coverprofile $$t && go tool cover -html $$t && unlink $$t |
| 20 |
|
| 21 |
cpu: |
| 22 |
go test -c -o cpu.test |
| 23 |
./cpu.test -noerr -test.cpuprofile cpu.out |
| 24 |
go tool pprof --lines cpu.test cpu.out |
| 25 |
|
| 26 |
editor: |
| 27 |
gofmt -l -s -w *.go |
| 28 |
go test |
| 29 |
go install |
| 30 |
|
| 31 |
internalError: |
| 32 |
egrep -ho '"internal error.*"' *.go | sort | cat -n |
| 33 |
|
| 34 |
later: |
| 35 |
@grep -n $(grep) LATER * || true |
| 36 |
@grep -n $(grep) MAYBE * || true |
| 37 |
|
| 38 |
mem: |
| 39 |
go test -c -o mem.test |
| 40 |
./mem.test -test.bench . -test.memprofile mem.out |
| 41 |
go tool pprof --lines --web --alloc_space mem.test mem.out |
| 42 |
|
| 43 |
nuke: clean |
| 44 |
go clean -i |
| 45 |
|
| 46 |
todo: |
| 47 |
@grep -nr $(grep) ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* * || true |
| 48 |
@grep -nr $(grep) TODO * || true |
| 49 |
@grep -nr $(grep) BUG * || true |
| 50 |
@grep -nr $(grep) [^[:alpha:]]println * || true |