Makefile (1548B)
1 # Copyright (c) 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 5 .PHONY: all clean cover cpu editor internalError later mem nuke todo edit 6 7 grep=--include=*.go --include=*.l --include=*.y --include=*.yy 8 ngrep='TODOOK\|parser\.go\|scanner\.go\|.*_string\.go' 9 10 all: editor 11 go vet 2>&1 | grep -v $(ngrep) || true 12 golint 2>&1 | grep -v $(ngrep) || true 13 make todo 14 unused . || true 15 misspell *.go 16 gosimple || true 17 maligned || true 18 unconvert -apply 19 20 clean: 21 go clean 22 rm -f *~ *.test *.out 23 24 cover: 25 t=$(shell tempfile) ; go test -coverprofile $$t && go tool cover -html $$t && unlink $$t 26 27 cpu: clean 28 go test -run @ -bench . -cpuprofile cpu.out 29 go tool pprof -lines *.test cpu.out 30 31 edit: 32 @ 1>/dev/null 2>/dev/null gvim -p Makefile *.go 33 34 editor: 35 unconvert -apply || true 36 gofmt -l -s -w *.go 37 go test -i 38 go test 2>&1 | tee log 39 go install 40 41 internalError: 42 egrep -ho '"internal error.*"' *.go | sort | cat -n 43 44 later: 45 @grep -n $(grep) LATER * || true 46 @grep -n $(grep) MAYBE * || true 47 48 mem: clean 49 go test -run @ -bench . -memprofile mem.out -memprofilerate 1 -timeout 24h 50 go tool pprof -lines -web -alloc_space *.test mem.out 51 52 nuke: clean 53 go clean -i 54 55 todo: 56 @grep -nr $(grep) ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* * | grep -v $(ngrep) || true 57 @grep -nr $(grep) TODO * | grep -v $(ngrep) || true 58 @grep -nr $(grep) BUG * | grep -v $(ngrep) || true 59 @grep -nr $(grep) [^[:alpha:]]println * | grep -v $(ngrep) || true