Debian Codegraph @

Makefile

raw
1 # Copyright 2024 The Libc 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 build_all_targets check clean download edit editor generate dev membrk-test test work xtest short-test xlibc libc-test surface vet
6
7 SHELL=/bin/bash -o pipefail
8
9 DIR = /tmp/libc
10 TAR = musl-7ada6dde6f9dc6a2836c3d92c2f762d35fd229e0.tar.gz
11 URL = https://git.musl-libc.org/cgit/musl/snapshot/$(TAR)
12
13 all: editor
14 golint 2>&1
15 staticcheck 2>&1
16
17 build_all_targets: vet
18 ./build_all_targets.sh
19 echo done
20
21 clean:
22 rm -f log-* cpu.test mem.test *.out
23 git clean -fd
24 find testdata/nsz.repo.hu/ -name \*.go -delete
25 make -C testdata/nsz.repo.hu/libc-test/ cleanall
26 go clean
27
28 check:
29 staticcheck 2>&1 | grep -v U1000
30
31 download:
32 @if [ ! -f $(TAR) ]; then wget $(URL) ; fi
33
34 edit:
35 @if [ -f "Session.vim" ]; then gvim -S & else gvim -p Makefile go.mod builder.json & fi
36
37 editor:
38 # gofmt -l -s -w *.go
39 go test -c -o /dev/null
40 go build -o /dev/null -v generator*.go
41 go vet 2>&1 | grep -n 'asm_' || true
42
43 generate: download
44 mkdir -p $(DIR) || true
45 rm -rf $(DIR)/*
46 GO_GENERATE_DIR=$(DIR) go run generator*.go
47 go build -v
48 go test -v -short -count=1 ./...
49 git status
50
51 dev: download
52 mkdir -p $(DIR) || true
53 rm -rf $(DIR)/*
54 echo -n > /tmp/ccgo.log
55 GO_GENERATE_DIR=$(DIR) GO_GENERATE_DEV=1 go run -tags=ccgo.dmesg,ccgo.assert generator*.go
56 go build -v
57 go test -v -short -count=1 ./...
58 git status
59
60 membrk-test:
61 echo -n > /tmp/ccgo.log
62 touch log-test
63 cp log-test log-test0
64 go test -v -timeout 24h -count=1 -tags=libc.membrk 2>&1 | tee log-test
65 grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
66
67 test:
68 go test -v -timeout 24h -count=1
69
70 short-test:
71 echo -n > /tmp/ccgo.log
72 touch log-test
73 cp log-test log-test0
74 go test -v -timeout 24h -count=1 -short 2>&1 | tee log-test
75 grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
76
77 xlibc:
78 echo -n > /tmp/ccgo.log
79 touch log-test
80 cp log-test log-test0
81 go test -v -timeout 24h -count=1 -tags=ccgo.dmesg,ccgo.assert 2>&1 -run TestLibc | tee log-test
82 grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
83
84 xpthread:
85 echo -n > /tmp/ccgo.log
86 touch log-test
87 cp log-test log-test0
88 go test -v -timeout 24h -count=1 2>&1 -run TestLibc -re pthread | tee log-test
89 grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
90
91 libc-test:
92 echo -n > /tmp/ccgo.log
93 touch log-test
94 cp log-test log-test0
95 go test -v -timeout 24h -count=1 2>&1 -run TestLibc | tee log-test
96 # grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
97 grep -o 'undefined: \<.*\>' log-test | sort -u
98
99 xtest:
100 echo -n > /tmp/ccgo.log
101 touch log-test
102 cp log-test log-test0
103 go test -v -timeout 24h -count=1 -tags=ccgo.dmesg,ccgo.assert 2>&1 | tee log-test
104 grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
105
106 work:
107 rm -f go.work*
108 go work init
109 go work use .
110 go work use ../ccgo/v4
111 go work use ../ccgo/v3
112 go work use ../cc/v4
113
114 surface:
115 surface > surface.new
116 surface surface.old surface.new > log-todo-surface || true
117
118 vet:
119 go vet 2>&1 | grep abi0 | grep -v 'misuse' || true