modernc.org/99c@v1.0.1-0.20181109153923-a9e8197063d9/Makefile (about) 1 # Copyright 2017 The 99c 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=*.c --include=*.h --include=*.yy --exclude-dir=lib/ 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 find -name \*.c -or -name \*.h | xargs -n1 indent -linux -l -1 36 find -name \*.c~ -or -name \*.h~ | xargs rm 37 gofmt -l -s -w . 38 go test -i 39 go test 40 go install -tags virtual.profile ./99prof 41 go install -tags virtual.strace ./99strace 42 go install -tags virtual.trace ./99trace 43 go install ./ ./99dump ./99nm ./99run 44 45 internalError: 46 egrep -ho '"internal error.*"' *.go | sort | cat -n 47 48 later: 49 @grep -n $(grep) LATER * || true 50 @grep -n $(grep) MAYBE * || true 51 52 mem: clean 53 go test -run @ -bench . -memprofile mem.out -memprofilerate 1 -timeout 24h 54 go tool pprof -lines -web -alloc_space *.test mem.out 55 56 nuke: clean 57 go clean -i 58 59 todo: 60 @grep -nr $(grep) ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* * | grep -v $(ngrep) || true 61 @grep -nr $(grep) TODO * | grep -v $(ngrep) || true 62 @grep -nr $(grep) BUG * | grep -v $(ngrep) || true 63 @grep -nr $(grep) [^[:alpha:]]println * | grep -v $(ngrep) || true