-
Notifications
You must be signed in to change notification settings - Fork 68
/
Makefile
29 lines (22 loc) · 963 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
26
27
28
29
.PHONY: all crossbuild build build-debug snap
all: crossbuild
crossbuild:
DOCKER_CLI_EXPERIMENTAL="enabled" docker run \
--rm \
--privileged \
-v "/var/run/docker.sock:/var/run/docker.sock" \
-v "$(PWD):/__w/parca-agent/parca-agent" \
-v "$(GOPATH)/pkg/mod":/go/pkg/mod \
-w "/__w/parca-agent/parca-agent" \
docker.io/goreleaser/goreleaser-cross:v1.22.4 \
release --snapshot --clean --skip=publish --verbose
build:
go build -o parca-agent -buildvcs=false -ldflags="-extldflags=-static" -tags osusergo,netgo
build-debug:
go build -o parca-agent-debug -buildvcs=false -ldflags="-extldflags=-static" -tags osusergo,netgo -gcflags "all=-N -l"
snap: crossbuild
cp ./dist/metadata.json snap/local/metadata.json
cp ./dist/linux-amd64_linux_amd64_v1/parca-agent snap/local/parca-agent
snapcraft pack --verbose --build-for amd64
cp ./dist/linux-arm64_linux_arm64/parca-agent snap/local/parca-agent
snapcraft pack --verbose --build-for arm64