source: code/trunk/vendor/modernc.org/ccgo/v3/lib/Makefile@ 822

Last change on this file since 822 was 822, checked in by yakumo.izuru, 22 months ago

Prefer immortal.run over runit and rc.d, use vendored modules
for convenience.

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

File size: 4.2 KB
Line 
1# Copyright 2019 The CCGO 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
7grep=--include=*.go
8ngrep='TODOOK\|internalError\|testdata'
9testlog=testdata/testlog-$(shell echo $$GOOS)-$(shell echo $$GOARCH)-on-$(shell go env GOOS)-$(shell go env GOARCH)
10
11all:
12 LC_ALL=C make all_log 2>&1 | tee log
13
14all_log:
15 date
16 go version
17 uname -a
18 ./unconvert.sh
19 gofmt -l -s -w *.go
20 GOOS=darwin GOARCH=amd64 go build -o /dev/null
21 GOOS=linux GOARCH=386 go build -o /dev/null
22 GOOS=linux GOARCH=amd64 go build -o /dev/null
23 GOOS=linux GOARCH=arm go build -o /dev/null
24 GOOS=windows GOARCH=386 go build -o /dev/null
25 GOOS=windows GOARCH=amd64 go build -o /dev/null
26 go vet 2>&1 | grep -v $(ngrep) || true
27 golint 2>&1 | grep -v $(ngrep) || true
28 make todo
29 misspell *.go
30 staticcheck | grep -v 'lexer\.go' || true
31 maligned || true
32 grep -n 'files.*, ok' log
33 @grep -n --color=never 'FAIL\|PASS' log
34 @grep -n --color=always 'FAIL' log
35 grep -n --color=always 'nil pointer' log
36 grep -c 'exit status 1' log || true
37 grep -c 'exit status 2' log || true
38 LC_ALL=C date 2>&1 | tee -a log
39
40test:
41 LC_ALL=C make test_log 2>&1 | tee $(testlog)
42 grep -ni --color=always fail $(testlog) || true
43
44test_log:
45 go version
46 uname -a
47 go test -v -timeout 24h
48 date | tee -a $(testlog)
49
50test_linux_amd64:
51 GOOS=linux GOARCH=amd64 make test
52
53test_linux_386:
54 GOOS=linux GOARCH=386 make test
55
56test_linux_arm:
57 GOOS=linux GOARCH=arm make test
58
59test_linux_arm64:
60 GOOS=linux GOARCH=arm64 make test
61
62test_windows_386:
63 go version | tee %TEMP%\testlog-windows-386
64 go test -v -timeout 24h | tee -a %TEMP%\testlog-windows-386
65 date /T | tee -a %TEMP%\testlog-windows-386
66 time /T | tee -a %TEMP%\testlog-windows-386
67
68test_windows_amd64:
69 go version | tee %TEMP%\testlog-windows-amd64
70 go test -v -timeout 24h | tee -a %TEMP%\testlog-windows-amd64
71 date /T | tee -a %TEMP%\testlog-windows-amd64
72 time /T | tee -a %TEMP%\testlog-windows-amd64
73
74build_all_targets:
75 GOOS=darwin GOARCH=amd64 go test -c -o /dev/null
76 GOOS=darwin GOARCH=arm64 go test -c -o /dev/null
77 GOOS=freebsd GOARCH=386 go test -c -o /dev/null
78 GOOS=freebsd GOARCH=amd64 go test -c -o /dev/null
79 GOOS=freebsd GOARCH=arm go test -c -o /dev/null
80 GOOS=linux GOARCH=386 go test -c -o /dev/null
81 GOOS=linux GOARCH=amd64 go test -c -o /dev/null
82 GOOS=linux GOARCH=arm go test -c -o /dev/null
83 GOOS=linux GOARCH=arm64 go test -c -o /dev/null
84 GOOS=linux GOARCH=riscv64 go test -c -o /dev/null
85 GOOS=linux GOARCH=s390x go test -c -o /dev/null
86 GOOS=netbsd GOARCH=amd64 go test -c -o /dev/null
87 #TODO GOOS=netbsd GOARCH=arm go test -c -o /dev/null
88 GOOS=openbsd GOARCH=amd64 go test -c -o /dev/null
89 GOOS=openbsd GOARCH=arm64 go test -c -o /dev/null
90 GOOS=windows GOARCH=386 go test -c -o /dev/null
91 GOOS=windows GOARCH=amd64 go test -c -o /dev/null
92 GOOS=windows GOARCH=arm64 go test -c -o /dev/null
93
94devbench:
95 date 2>&1 | tee log-devbench
96 go test -timeout 24h -dev -run @ -bench . 2>&1 | tee -a log-devbench
97 grep -n 'FAIL\|SKIP' log-devbench || true
98
99bench:
100 date 2>&1 | tee log-bench
101 go test -timeout 24h -v -run '^[^E]' -bench . 2>&1 | tee -a log-bench
102 grep -n 'FAIL\|SKIP' log-bench || true
103
104clean:
105 go clean
106 rm -f *~ *.test *.out
107
108cover:
109 t=$(shell mktemp) ; go test -coverprofile $$t && go tool cover -html $$t && unlink $$t
110
111cpu: clean
112 go test -run @ -bench . -cpuprofile cpu.out
113 go tool pprof -lines *.test cpu.out
114
115edit:
116 @touch log
117 @if [ -f "Session.vim" ]; then gvim -S & else gvim -p Makefile *.go & fi
118
119
120editor:
121 gofmt -l -s -w *.go
122 go build -v -o $(GOPATH)/bin/ccgo3 modernc.org/ccgo/v3
123 go test -c -o /dev/null
124
125later:
126 @grep -n $(grep) LATER * || true
127 @grep -n $(grep) MAYBE * || true
128
129mem: clean
130 go test -run Mem -mem -memprofile mem.out -timeout 24h
131 go tool pprof -lines -web -alloc_space *.test mem.out
132
133nuke: clean
134 go clean -i
135
136todo:
137 @grep -nr $(grep) ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* * | grep -v $(ngrep) || true
138 @grep -nr $(grep) 'TODO\|panic' * | grep -v $(ngrep) || true
139 @grep -nr $(grep) BUG * | grep -v $(ngrep) || true
140 @grep -nr $(grep) [^[:alpha:]]println * | grep -v $(ngrep) || true
141 @grep -nir $(grep) 'work.*progress' || true
Note: See TracBrowser for help on using the repository browser.