gtsocial-umbx

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

Makefile (2339B)


      1 # Copyright 2017 The Memory 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 	maligned || true
     16 	unconvert -apply
     17 	staticcheck | grep -v 'lexer\.go' || true
     18 	grep -n 'FAIL\|PASS' log
     19 	date
     20 
     21 clean:
     22 	go clean
     23 	rm -f *~ *.test *.out
     24 
     25 cover:
     26 	t=$(shell tempfile) ; go test -coverprofile $$t && go tool cover -html $$t && unlink $$t
     27 
     28 cpu: clean
     29 	go test -run @ -bench . -cpuprofile cpu.out
     30 	go tool pprof -lines *.test cpu.out
     31 
     32 edit:
     33 	@ 1>/dev/null 2>/dev/null gvim -p Makefile *.go &
     34 
     35 editor:
     36 	gofmt -l -s -w *.go
     37 	GOOS=darwin GOARCH=amd64 go build
     38 	GOOS=darwin GOARCH=arm64 go build
     39 	GOOS=freebsd GOARCH=386 go build
     40 	GOOS=freebsd GOARCH=amd64 go build
     41 	GOOS=freebsd GOARCH=arm go build
     42 	GOOS=freebsd GOARCH=arm64 go build
     43 	GOOS=illumos GOARCH=amd64 go build
     44 	GOOS=linux GOARCH=386 go build
     45 	GOOS=linux GOARCH=amd64 go build
     46 	GOOS=linux GOARCH=arm go build
     47 	GOOS=linux GOARCH=arm64 go build
     48 	GOOS=linux GOARCH=mips go build
     49 	GOOS=linux GOARCH=mips64le go build
     50 	GOOS=linux GOARCH=mipsle go build
     51 	GOOS=linux GOARCH=riscv64 go build
     52 	GOOS=linux GOARCH=s390x go build
     53 	GOOS=netbsd GOARCH=386 go build
     54 	GOOS=netbsd GOARCH=amd64 go build
     55 	GOOS=netbsd GOARCH=arm go build
     56 	GOOS=openbsd GOARCH=386 go build
     57 	GOOS=openbsd GOARCH=amd64 go build
     58 	GOOS=openbsd GOARCH=arm64 go build
     59 	GOOS=windows GOARCH=386 go build
     60 	GOOS=windows GOARCH=amd64 go build
     61 
     62 internalError:
     63 	egrep -ho '"internal error.*"' *.go | sort | cat -n
     64 
     65 later:
     66 	@grep -n $(grep) LATER * || true
     67 	@grep -n $(grep) MAYBE * || true
     68 
     69 mem: clean
     70 	go test -run @ -bench . -memprofile mem.out -memprofilerate 1 -timeout 24h
     71 	go tool pprof -lines -web -alloc_space *.test mem.out
     72 
     73 nuke: clean
     74 	go clean -i
     75 
     76 todo:
     77 	@grep -nr $(grep) ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* * | grep -v $(ngrep) || true
     78 	@grep -nr $(grep) TODO * | grep -v $(ngrep) || true
     79 	@grep -nr $(grep) BUG * | grep -v $(ngrep) || true
     80 	@grep -nr $(grep) [^[:alpha:]]println * | grep -v $(ngrep) || true