2015-05-15 20:20:40 +00:00
|
|
|
.DEFAULT_GOAL=test
|
2015-12-13 21:51:11 +00:00
|
|
|
|
2021-07-31 15:16:26 +00:00
|
|
|
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')
|
|
|
|
|
2015-08-08 19:30:43 +00:00
|
|
|
check-cert:
|
2020-03-28 18:18:55 +00:00
|
|
|
@go run _scripts/make.go check-cert
|
2015-08-03 14:34:39 +00:00
|
|
|
|
2021-07-31 15:16:26 +00:00
|
|
|
build: $(GO_SRC)
|
2020-03-28 18:18:55 +00:00
|
|
|
@go run _scripts/make.go build
|
2015-03-01 03:07:08 +00:00
|
|
|
|
2021-07-31 15:16:26 +00:00
|
|
|
$(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/lib64/libbpf.a" go run _scripts/make.go build --tags=ebpf
|
|
|
|
|
|
|
|
install: $(GO_SRC)
|
2020-03-28 18:18:55 +00:00
|
|
|
@go run _scripts/make.go install
|
2015-03-01 03:07:08 +00:00
|
|
|
|
2019-09-13 03:40:26 +00:00
|
|
|
uninstall:
|
2020-03-28 18:18:55 +00:00
|
|
|
@go run _scripts/make.go uninstall
|
2019-09-13 03:40:26 +00:00
|
|
|
|
2020-03-18 16:25:32 +00:00
|
|
|
test: vet
|
2020-03-28 18:18:55 +00:00
|
|
|
@go run _scripts/make.go test
|
2015-05-15 20:30:34 +00:00
|
|
|
|
2020-03-18 16:25:32 +00:00
|
|
|
vet:
|
2020-03-28 18:18:55 +00:00
|
|
|
@go vet $$(go list ./... | grep -v native)
|
2020-03-18 16:25:32 +00:00
|
|
|
|
2015-06-12 19:49:23 +00:00
|
|
|
test-proc-run:
|
2020-03-28 18:18:55 +00:00
|
|
|
@go run _scripts/make.go test -s proc -r $(RUN)
|
2015-05-15 20:30:34 +00:00
|
|
|
|
|
|
|
test-integration-run:
|
2020-03-28 18:18:55 +00:00
|
|
|
@go run _scripts/make.go test -s service/test -r $(RUN)
|
2017-05-26 18:43:19 +00:00
|
|
|
|
2018-05-28 18:28:39 +00:00
|
|
|
vendor:
|
2020-03-28 18:18:55 +00:00
|
|
|
@go run _scripts/make.go vendor
|
2017-05-26 18:43:19 +00:00
|
|
|
|
2021-07-31 15:16:26 +00:00
|
|
|
.PHONY: vendor test-integration-run test-proc-run test check-cert install build vet build-bpf uninstall
|