forked from enosi-rl/gtrace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (37 loc) · 974 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.PHONY: gtrace
gtrace:
go build -o gtrace ./cmd/gtrace
.PHONY: examples
examples: gtrace
PATH=$(PWD):$(PATH) go generate ./examples/...
go build -o pinger ./examples/pinger
go build -o buildtags ./examples/buildtags
.PHONY: test
test: gtrace
find ./test -name '*_gtrace*' -delete
for os in linux darwin windows; do \
echo "--------"; \
echo "running: GOOS=$$os go generate ./test"; \
echo "--------"; \
PATH=$(PWD):$(PATH) GOOS=$$os go generate ./test; \
if [[ $$? -ne 0 ]]; then \
exit 1;\
fi; \
done; \
for os in linux darwin; do \
for arch in amd64 arm64; do \
echo "--------"; \
echo "running: GOOS=$$os GOARCH=$$arch go generate ./test"; \
echo "--------"; \
PATH=$(PWD):$(PATH) GOOS=$$os GOARCH=$$arch go generate ./test; \
if [[ $$? -ne 0 ]]; then \
exit 1;\
fi; \
done; \
done
go test -v ./test
clean:
rm -f gtrace
rm -f pinger
find ./test -name '*_gtrace*' -delete
find ./examples -name '*_gtrace*' -delete