gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

Makefile (1481B)


      1 # Copyright (c) 2016 The mathutil 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 	misspell *.go
     15 	unconvert || true
     16 	maligned || true
     17 	staticcheck || true
     18 
     19 clean:
     20 	go clean
     21 	rm -f *~ *.test *.out
     22 
     23 cover:
     24 	t=$(shell tempfile) ; go test -coverprofile $$t && go tool cover -html $$t && unlink $$t
     25 
     26 cpu: clean
     27 	go test -run @ -bench . -cpuprofile cpu.out
     28 	go tool pprof -lines *.test cpu.out
     29 
     30 edit:
     31 	@ 1>/dev/null 2>/dev/null gvim -p Makefile *.go &
     32 
     33 editor:
     34 	gofmt -l -s -w *.go
     35 	go test
     36 	go build
     37 
     38 internalError:
     39 	egrep -ho '"internal error.*"' *.go | sort | cat -n
     40 
     41 later:
     42 	@grep -n $(grep) LATER * || true
     43 	@grep -n $(grep) MAYBE * || true
     44 
     45 mem: clean
     46 	go test -run @ -bench . -memprofile mem.out -memprofilerate 1 -timeout 24h
     47 	go tool pprof -lines -web -alloc_space *.test mem.out
     48 
     49 nuke: clean
     50 	go clean -i
     51 
     52 todo:
     53 	@grep -nr $(grep) ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* * | grep -v $(ngrep) || true
     54 	@grep -nr $(grep) TODO * | grep -v $(ngrep) || true
     55 	@grep -nr $(grep) BUG * | grep -v $(ngrep) || true
     56 	@grep -nr $(grep) [^[:alpha:]]println * | grep -v $(ngrep) || true