modernc.org/xrender@v1.0.9/Makefile (about) 1 # Copyright 2021 The Xrender-Go 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 bench clean cover cpu editor internalError later mem nuke todo edit devbench 6 7 grep=--include=*.go 8 ngrep='TODOOK\|internalError\|testdata\|scanner.go\|parser.go\|ast.go\|assets.go\|TODO-' 9 10 11 all: 12 @LC_ALL=C date 13 @go version 2>&1 | tee log 14 @gofmt -l -s -w *.go 15 @go install -v ./... 16 @go test -i 17 @go test 2>&1 -timeout 1h | tee -a log 18 @go vet 2>&1 | grep -v $(ngrep) || true 19 @golint 2>&1 | grep -v $(ngrep) || true 20 @make todo 21 @misspell *.go 22 @staticcheck | grep -v 'scanner\.go' || true 23 @maligned || true 24 @grep -n --color=always 'FAIL\|PASS' log 25 LC_ALL=C date 2>&1 | tee -a log 26 27 generate: 28 go generate 2>&1 | tee log-generate 29 go build -v ./... 2>&1 | tee -a log-generate 30 31 build_all_targets: 32 GOOS=darwin GOARCH=arm64 go build -v ./... 33 GOOS=darwin GOARCH=arm64 go test -c -o /dev/null 34 GOOS=linux GOARCH=386 go build -v ./... 35 GOOS=linux GOARCH=386 go test -c -o /dev/null 36 GOOS=linux GOARCH=amd64 go build -v ./... 37 GOOS=linux GOARCH=amd64 go test -c -o /dev/null 38 GOOS=linux GOARCH=arm go build -v ./... 39 GOOS=linux GOARCH=arm go test -c -o /dev/null 40 GOOS=linux GOARCH=arm64 go build -v ./... 41 GOOS=linux GOARCH=arm64 go test -c -o /dev/null 42 43 darwin_arm64: 44 @echo "Should be executed only on linux/arm64." 45 make generate 46 47 linux_amd64: 48 @echo "Should be executed only on linux/amd64." 49 make generate 50 51 linux_386: 52 @echo "Should be executed only on linux/386." 53 make generate 54 55 linux_arm: 56 @echo "Should be executed only on linux/arm." 57 make generate 58 59 linux_arm64: 60 @echo "Should be executed only on linux/arm64." 61 make generate 62 63 bench: 64 date 2>&1 | tee log-bench 65 go test -timeout 24h -v -run '^[^E]' -bench . 2>&1 | tee -a log-bench 66 grep -n 'FAIL\|SKIP' log-bench || true 67 68 clean: 69 go clean 70 rm -f *~ *.test *.out 71 72 cover: 73 t=$(shell mktemp) ; go test -coverprofile $$t && go tool cover -html $$t && unlink $$t 74 75 cpu: clean 76 go test -run @ -bench . -cpuprofile cpu.out 77 go tool pprof -lines *.test cpu.out 78 79 edit: 80 @touch log 81 @if [ -f "Session.vim" ]; then gvim -S & else gvim -p Makefile *.go & fi 82 83 editor: 84 gofmt -l -s -w *.go 85 nilness . 86 go install -v ./... 2>&1 | tee log-install 87 go build -o /dev/null generator.go 88 @gofmt -l -s -w . 89 90 later: 91 @grep -n $(grep) LATER * || true 92 @grep -n $(grep) MAYBE * || true 93 94 mem: clean 95 go test -run @ -dev -bench . -memprofile mem.out -timeout 24h 96 go tool pprof -lines -web -alloc_space *.test mem.out 97 98 nuke: clean 99 go clean -i 100 101 todo: 102 @grep -nr $(grep) ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* * | grep -v $(ngrep) || true 103 @grep -nrw $(grep) 'TODO\|panic' * | grep -v $(ngrep) || true 104 @grep -nr $(grep) BUG * | grep -v $(ngrep) || true 105 @grep -nr $(grep) [^[:alpha:]]println * | grep -v $(ngrep) || true 106 @grep -nir $(grep) 'work.*progress' || true