forked from go-delve/delve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (41 loc) · 1.5 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
.DEFAULT_GOAL=test
BPF_OBJ := pkg/proc/internal/ebpf/trace_probe/trace.o
BPF_SRC := $(shell find . -type f -name '*.bpf.*')
GO_SRC := $(shell find . -type f -not -path './_fixtures/*' -not -path './vendor/*' -not -path './_scripts/*' -not -path './localtests/*' -name '*.go')
check-cert:
@go run _scripts/make.go check-cert
build: $(GO_SRC)
@go run _scripts/make.go build
docker-image-build:
@docker build -t ebpf-builder:latest -f ./pkg/proc/internal/ebpf/trace_probe/Dockerfile ./pkg/proc/internal/ebpf/
docker-ebpf-obj-build: docker-image-build
@docker run -it --rm \
-v $(abspath .):/delve \
ebpf-builder:latest
$(BPF_OBJ): $(BPF_SRC)
clang \
-I /usr/include \
-I /usr/src/kernels/$(uname -r)/tools/lib \
-I /usr/src/kernels/$(uname -r)/tools/bpf/resolve_btfids/libbpf \
-g -O2 \
-c \
-target bpf \
-o $(BPF_OBJ) \
pkg/proc/internal/ebpf/trace_probe/trace.bpf.c
build-bpf: $(BPF_OBJ) $(GO_SRC)
@env CGO_LDFLAGS="/usr/lib/libbpf.a" go run _scripts/make.go build --tags=ebpf
install: $(GO_SRC)
@go run _scripts/make.go install
uninstall:
@go run _scripts/make.go uninstall
test: vet
@go run _scripts/make.go test
vet:
@go vet $$(go list ./... | grep -v native)
test-proc-run:
@go run _scripts/make.go test -s proc -r $(RUN)
test-integration-run:
@go run _scripts/make.go test -s service/test -r $(RUN)
vendor:
@go run _scripts/make.go vendor
.PHONY: vendor test-integration-run test-proc-run test check-cert install build vet build-bpf uninstall docker-image-build docker-ebpf-obj-build