forked from open-telemetry/opentelemetry-go-instrumentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
25 lines (20 loc) · 732 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
# Obtain an absolute path to the directory of the Makefile.
# Assume the Makefile is in the root of the repository.
REPODIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
# Build the list of include directories to compile the bpf program
BPF_INCLUDE += -I${REPODIR}/include/libbpf
BPF_INCLUDE+= -I${REPODIR}/include
.PHONY: generate
generate: export CFLAGS := $(BPF_INCLUDE)
generate:
go mod tidy
go generate ./...
.PHONY: build
build: generate
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o otel-go-instrumentation cli/main.go
.PHONY: docker-build
docker-build:
docker build -t $(IMG) .
.PHONY: offsets
offsets:
cd offsets-tracker; OFFSETS_OUTPUT_FILE="../pkg/inject/offset_results.json" go run main.go