-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (29 loc) · 1.04 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
.PHONY: all build extract_symbols
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
all: build
build:
go build $(GO_FLAGS)
GOLANGCI_LINT_VERSION = "v1.61.0"
GO = $(shell go env GOROOT)/bin/go
lint:
$(GO) run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) version
$(GO) run github.com/golangci/golangci-lint/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 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