modernc.org/memory@v1.8.0/Makefile (about)

     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 build_all_targets
     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  
    38  build_all_targets:
    39  	GOOS=darwin GOARCH=amd64 go build
    40  	GOOS=darwin GOARCH=arm64 go build
    41  	GOOS=freebsd GOARCH=386 go build
    42  	GOOS=freebsd GOARCH=amd64 go build
    43  	GOOS=freebsd GOARCH=arm go build
    44  	GOOS=freebsd GOARCH=arm64 go build
    45  	GOOS=illumos GOARCH=amd64 go build
    46  	GOOS=linux GOARCH=386 go build
    47  	GOOS=linux GOARCH=amd64 go build
    48  	GOOS=linux GOARCH=arm go build
    49  	GOOS=linux GOARCH=arm64 go build
    50  	GOOS=linux GOARCH=loong64 go build
    51  	GOOS=linux GOARCH=mips go build
    52  	GOOS=linux GOARCH=mips64le go build
    53  	GOOS=linux GOARCH=mipsle go build
    54  	GOOS=linux GOARCH=riscv64 go build
    55  	GOOS=linux GOARCH=s390x go build
    56  	GOOS=netbsd GOARCH=386 go build
    57  	GOOS=netbsd GOARCH=amd64 go build
    58  	GOOS=netbsd GOARCH=arm go build
    59  	GOOS=openbsd GOARCH=386 go build
    60  	GOOS=openbsd GOARCH=amd64 go build
    61  	GOOS=openbsd GOARCH=arm64 go build
    62  	GOOS=windows GOARCH=386 go build
    63  	GOOS=windows GOARCH=amd64 go build
    64  
    65  internalError:
    66  	egrep -ho '"internal error.*"' *.go | sort | cat -n
    67  
    68  later:
    69  	@grep -n $(grep) LATER * || true
    70  	@grep -n $(grep) MAYBE * || true
    71  
    72  mem: clean
    73  	go test -run @ -bench . -memprofile mem.out -memprofilerate 1 -timeout 24h
    74  	go tool pprof -lines -web -alloc_space *.test mem.out
    75  
    76  nuke: clean
    77  	go clean -i
    78  
    79  todo:
    80  	@grep -nr $(grep) ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* * | grep -v $(ngrep) || true
    81  	@grep -nr $(grep) TODO * | grep -v $(ngrep) || true
    82  	@grep -nr $(grep) BUG * | grep -v $(ngrep) || true
    83  	@grep -nr $(grep) [^[:alpha:]]println * | grep -v $(ngrep) || true