-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (29 loc) · 1.16 KB
/
Makefile
File metadata and controls
43 lines (29 loc) · 1.16 KB
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
.PHONY: all build extract_symbols lint linter-version test check-copyrights licenses check-licenses docker-image profiler-in-docker
VERSION ?= v0.0.0
VERSION_LD_FLAGS := -X github.com/DataDog/dd-otel-host-profiler/version.version=$(VERSION)
GO_FLAGS := -ldflags="${VERSION_LD_FLAGS} -extldflags=-static" -tags osusergo,netgo,debugtracer
all: build
build:
go build $(GO_FLAGS)
GOLANGCI_LINT_VERSION = "v2.6.1"
GO = $(shell go env GOROOT)/bin/go
lint:
$(GO) run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) version
$(GO) run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) run
linter-version:
@echo $(GOLANGCI_LINT_VERSION)
test:
go test -v -race ./...
check-copyrights:
$(GO) run tools/checkcopyright.go
licenses:
tools/make-licenses.sh
check-licenses:
tools/check-licenses.sh
docker-image:
docker build -t dd-otel-host-profiler -f docker/dev/Dockerfile .
profiler-in-docker: docker-image
docker run -v "$$PWD":/app -it --rm --user $(shell id -u):$(shell id -g) dd-otel-host-profiler \
bash -c "cd /app && make VERSION=$(VERSION)"
extract_symbols:
go build $(GO_FLAGS) ./tools/extract_symbols